Compare commits
20 Commits
Author | SHA1 | Date |
---|---|---|
Lyude | b72aa83670 | |
Dave Airlie | 4e283e4f9e | |
Dave Airlie | 20431644c6 | |
Dave Airlie | f6bfa3f73e | |
Hans de Goede | 956bc1d0e3 | |
Dave Airlie | c53f6ecbd3 | |
Hans de Goede | 823bbd2280 | |
Hans de Goede | e00118db05 | |
Hans de Goede | d27513d070 | |
Kalev Lember | 99164bf932 | |
Kalev Lember | 7eb9118390 | |
Dave Airlie | e9ab3825d5 | |
Hans de Goede | ab7cedf46f | |
Peter Robinson | 001b730a94 | |
Igor Gnatenko | def8a86451 | |
Dave Airlie | 9b664a4970 | |
Adam Jackson | 758fa20491 | |
Adam Jackson | cc3a6bcd48 | |
Adam Jackson | 082a187a5c | |
Peter Robinson | 6651ada7db |
|
@ -0,0 +1,140 @@
|
|||
From 095803a37aa67361fc68604e81f858f31ae59b1b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= <marek.olsak@amd.com>
|
||||
Date: Thu, 2 Jun 2016 23:36:43 +0200
|
||||
Subject: [PATCH] gallium/radeon: add support for sharing textures with DCC
|
||||
between processes
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
v2: use a function for calculating WORD1 of bo metadata
|
||||
|
||||
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
|
||||
---
|
||||
src/gallium/drivers/radeon/r600_pipe_common.h | 4 +++
|
||||
src/gallium/drivers/radeon/r600_texture.c | 16 +++++++++---
|
||||
src/gallium/drivers/radeonsi/si_state.c | 35 ++++++++++++++++++++++++++-
|
||||
3 files changed, 51 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h
|
||||
index 2d60da4..fd658b6 100644
|
||||
--- a/src/gallium/drivers/radeon/r600_pipe_common.h
|
||||
+++ b/src/gallium/drivers/radeon/r600_pipe_common.h
|
||||
@@ -379,6 +379,10 @@ struct r600_common_screen {
|
||||
void (*query_opaque_metadata)(struct r600_common_screen *rscreen,
|
||||
struct r600_texture *rtex,
|
||||
struct radeon_bo_metadata *md);
|
||||
+
|
||||
+ void (*apply_opaque_metadata)(struct r600_common_screen *rscreen,
|
||||
+ struct r600_texture *rtex,
|
||||
+ struct radeon_bo_metadata *md);
|
||||
};
|
||||
|
||||
/* This encapsulates a state or an operation which can emitted into the GPU
|
||||
diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
|
||||
index 0f5c08f..920cc21 100644
|
||||
--- a/src/gallium/drivers/radeon/r600_texture.c
|
||||
+++ b/src/gallium/drivers/radeon/r600_texture.c
|
||||
@@ -1035,8 +1035,12 @@ r600_texture_create_object(struct pipe_screen *screen,
|
||||
}
|
||||
}
|
||||
|
||||
- if (!buf && rtex->surface.dcc_size &&
|
||||
- !(rscreen->debug_flags & DBG_NO_DCC)) {
|
||||
+ /* Shared textures must always set up DCC here.
|
||||
+ * If it's not present, it will be disabled by
|
||||
+ * apply_opaque_metadata later.
|
||||
+ */
|
||||
+ if (rtex->surface.dcc_size &&
|
||||
+ (buf || !(rscreen->debug_flags & DBG_NO_DCC))) {
|
||||
/* Reserve space for the DCC buffer. */
|
||||
rtex->dcc_offset = align64(rtex->size, rtex->surface.dcc_alignment);
|
||||
rtex->size = rtex->dcc_offset + rtex->surface.dcc_size;
|
||||
@@ -1063,7 +1067,9 @@ r600_texture_create_object(struct pipe_screen *screen,
|
||||
rtex->cmask.offset, rtex->cmask.size,
|
||||
0xCCCCCCCC, R600_COHERENCY_NONE);
|
||||
}
|
||||
- if (rtex->dcc_offset) {
|
||||
+
|
||||
+ /* Initialize DCC only if the texture is not being imported. */
|
||||
+ if (!buf && rtex->dcc_offset) {
|
||||
r600_screen_clear_buffer(rscreen, &rtex->resource.b.b,
|
||||
rtex->dcc_offset,
|
||||
rtex->surface.dcc_size,
|
||||
@@ -1229,6 +1235,10 @@ static struct pipe_resource *r600_texture_from_handle(struct pipe_screen *screen
|
||||
|
||||
rtex->resource.is_shared = true;
|
||||
rtex->resource.external_usage = usage;
|
||||
+
|
||||
+ if (rscreen->apply_opaque_metadata)
|
||||
+ rscreen->apply_opaque_metadata(rscreen, rtex, &metadata);
|
||||
+
|
||||
return &rtex->resource.b.b;
|
||||
}
|
||||
|
||||
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
|
||||
index 14520ca..e506ec9 100644
|
||||
--- a/src/gallium/drivers/radeonsi/si_state.c
|
||||
+++ b/src/gallium/drivers/radeonsi/si_state.c
|
||||
@@ -3398,6 +3398,11 @@ void si_init_state_functions(struct si_context *sctx)
|
||||
si_init_config(sctx);
|
||||
}
|
||||
|
||||
+static uint32_t si_get_bo_metadata_word1(struct r600_common_screen *rscreen)
|
||||
+{
|
||||
+ return (ATI_VENDOR_ID << 16) | rscreen->info.pci_id;
|
||||
+}
|
||||
+
|
||||
static void si_query_opaque_metadata(struct r600_common_screen *rscreen,
|
||||
struct r600_texture *rtex,
|
||||
struct radeon_bo_metadata *md)
|
||||
@@ -3432,7 +3437,7 @@ static void si_query_opaque_metadata(struct r600_common_screen *rscreen,
|
||||
md->metadata[0] = 1; /* metadata image format version 1 */
|
||||
|
||||
/* TILE_MODE_INDEX is ambiguous without a PCI ID. */
|
||||
- md->metadata[1] = (ATI_VENDOR_ID << 16) | rscreen->info.pci_id;
|
||||
+ md->metadata[1] = si_get_bo_metadata_word1(rscreen);
|
||||
|
||||
si_make_texture_descriptor(sscreen, rtex, true,
|
||||
res->target, res->format,
|
||||
@@ -3459,9 +3464,37 @@ static void si_query_opaque_metadata(struct r600_common_screen *rscreen,
|
||||
md->size_metadata = (11 + res->last_level) * 4;
|
||||
}
|
||||
|
||||
+static void si_apply_opaque_metadata(struct r600_common_screen *rscreen,
|
||||
+ struct r600_texture *rtex,
|
||||
+ struct radeon_bo_metadata *md)
|
||||
+{
|
||||
+ uint32_t *desc = &md->metadata[2];
|
||||
+
|
||||
+ if (rscreen->chip_class < VI)
|
||||
+ return;
|
||||
+
|
||||
+ /* Return if DCC is enabled. The texture should be set up with it
|
||||
+ * already.
|
||||
+ */
|
||||
+ if (md->size_metadata >= 11 * 4 &&
|
||||
+ md->metadata[0] != 0 &&
|
||||
+ md->metadata[1] == si_get_bo_metadata_word1(rscreen) &&
|
||||
+ G_008F28_COMPRESSION_EN(desc[6])) {
|
||||
+ assert(rtex->dcc_offset == ((uint64_t)desc[7] << 8));
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* Disable DCC. These are always set by texture_from_handle and must
|
||||
+ * be cleared here.
|
||||
+ */
|
||||
+ rtex->dcc_offset = 0;
|
||||
+ rtex->cb_color_info &= ~VI_S_028C70_DCC_ENABLE(1);
|
||||
+}
|
||||
+
|
||||
void si_init_screen_state_functions(struct si_screen *sscreen)
|
||||
{
|
||||
sscreen->b.query_opaque_metadata = si_query_opaque_metadata;
|
||||
+ sscreen->b.apply_opaque_metadata = si_apply_opaque_metadata;
|
||||
}
|
||||
|
||||
static void
|
||||
--
|
||||
2.9.3
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
From d77692b73964b2dc81937a1d6ba2e927e1d548cc Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Mon, 6 Feb 2017 12:13:17 +0100
|
||||
Subject: [PATCH] glx/glvnd: Fix GLXdispatchIndex sorting
|
||||
|
||||
Commit 8bca8d89ef3b ("glx/glvnd: Fix dispatch function names and indices")
|
||||
fixed the sorting of the array initializers in g_glxglvnddispatchfuncs.c
|
||||
because FindGLXFunction's binary search needs these to be sorted
|
||||
alphabetically.
|
||||
|
||||
That commit also mostly fixed the sorting of the DI_foo defines in
|
||||
g_glxglvnddispatchindices.h, which is what actually matters as the
|
||||
arrays are initialized using "[DI_foo] = glXfoo," but a small error
|
||||
crept in which at least causes glXGetVisualFromFBConfigSGIX to not
|
||||
resolve, breaking games such as "The Binding of Isaac: Rebirth" and
|
||||
"Crypt of the NecroDancer" from Steam not working and possible causes
|
||||
other problems too.
|
||||
|
||||
This commit fixes the last of the sorting errors, fixing these mentioned
|
||||
games not working.
|
||||
|
||||
Fixes: 8bca8d89ef3b ("glx/glvnd: Fix dispatch function names and indices")
|
||||
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
|
||||
Cc: "17.0" <mesa-stable@lists.freedesktop.org>
|
||||
Cc: Adam Jackson <ajax@redhat.com>
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
src/glx/g_glxglvnddispatchindices.h | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/glx/g_glxglvnddispatchindices.h b/src/glx/g_glxglvnddispatchindices.h
|
||||
index 0891654..05a2c8c 100644
|
||||
--- a/src/glx/g_glxglvnddispatchindices.h
|
||||
+++ b/src/glx/g_glxglvnddispatchindices.h
|
||||
@@ -46,14 +46,14 @@ typedef enum __GLXdispatchIndex {
|
||||
DI_GetMscRateOML,
|
||||
// GetProcAddress implemented by libglvnd
|
||||
// GetProcAddressARB implemented by libglvnd
|
||||
+ DI_GetScreenDriver,
|
||||
// GetSelectedEvent implemented by libglvnd
|
||||
DI_GetSelectedEventSGIX,
|
||||
+ DI_GetSwapIntervalMESA,
|
||||
+ DI_GetSyncValuesOML,
|
||||
DI_GetVideoSyncSGI,
|
||||
// GetVisualFromFBConfig implemented by libglvnd
|
||||
DI_GetVisualFromFBConfigSGIX,
|
||||
- DI_GetScreenDriver,
|
||||
- DI_GetSwapIntervalMESA,
|
||||
- DI_GetSyncValuesOML,
|
||||
// ImportContextEXT implemented by libglvnd
|
||||
// IsDirect implemented by libglvnd
|
||||
DI_JoinSwapGroupSGIX,
|
||||
@@ -81,9 +81,9 @@ typedef enum __GLXdispatchIndex {
|
||||
DI_SwapIntervalMESA,
|
||||
DI_SwapIntervalSGI,
|
||||
// UseXFont implemented by libglvnd
|
||||
- // WaitGL implemented by libglvnd
|
||||
DI_WaitForMscOML,
|
||||
DI_WaitForSbcOML,
|
||||
+ // WaitGL implemented by libglvnd
|
||||
DI_WaitVideoSyncSGI,
|
||||
// WaitX implemented by libglvnd
|
||||
DI_LAST_INDEX
|
||||
--
|
||||
2.9.3
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
From 14a5478a27ccd58855d49d227b0762287fd2cbc2 Mon Sep 17 00:00:00 2001
|
||||
From: Lyude <lyude@redhat.com>
|
||||
Date: Fri, 2 Jun 2017 20:27:07 -0400
|
||||
Subject: [PATCH] nvc0: Disable BGRA8 images on Fermi
|
||||
|
||||
For unknown reasons, using BGRA8 images on Fermi results in breaking
|
||||
reads from PBOs, such that they always return 0x0. Discovered this
|
||||
through a glamor bug, and confirmed it does indeed break a good number
|
||||
of piglit tests such as spec/arb_pixel_buffer_object/pbo-read-argb8888
|
||||
|
||||
Until we have a proper fix, just disable this functionality on Fermi.
|
||||
|
||||
Signed-off-by: Lyude <lyude@redhat.com>
|
||||
---
|
||||
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 19 ++++++++++++++-----
|
||||
1 file changed, 14 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
|
||||
index c636926..f6c5c72 100644
|
||||
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
|
||||
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
|
||||
@@ -87,11 +87,20 @@ nvc0_screen_is_format_supported(struct pipe_screen *pscreen,
|
||||
bindings &= ~(PIPE_BIND_LINEAR |
|
||||
PIPE_BIND_SHARED);
|
||||
|
||||
- if (bindings & PIPE_BIND_SHADER_IMAGE && sample_count > 1 &&
|
||||
- nouveau_screen(pscreen)->class_3d >= GM107_3D_CLASS) {
|
||||
- /* MS images are currently unsupported on Maxwell because they have to
|
||||
- * be handled explicitly. */
|
||||
- return false;
|
||||
+ if (bindings & PIPE_BIND_SHADER_IMAGE) {
|
||||
+ if (sample_count > 1 &&
|
||||
+ nouveau_screen(pscreen)->class_3d >= GM107_3D_CLASS) {
|
||||
+ /* MS images are currently unsupported on Maxwell because they have to
|
||||
+ * be handled explicitly. */
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ if (format == PIPE_FORMAT_B8G8R8A8_UNORM &&
|
||||
+ nouveau_screen(pscreen)->class_3d < NVE4_3D_CLASS) {
|
||||
+ /* This should work on Fermi, but for currently unknown reasons it
|
||||
+ * does not and results in breaking reads from pbos. */
|
||||
+ return false;
|
||||
+ }
|
||||
}
|
||||
|
||||
return (( nvc0_format_table[format].usage |
|
||||
--
|
||||
2.9.4
|
||||
|
78
mesa.spec
78
mesa.spec
|
@ -59,8 +59,8 @@
|
|||
|
||||
Name: mesa
|
||||
Summary: Mesa graphics libraries
|
||||
Version: 17.0.2
|
||||
Release: 1%{?rctag:.%{rctag}}%{?dist}
|
||||
Version: 17.0.5
|
||||
Release: 3%{?rctag:.%{rctag}}%{?dist}
|
||||
|
||||
License: MIT
|
||||
URL: http://www.mesa3d.org
|
||||
|
@ -71,6 +71,7 @@ Source2: vl_mpeg12_decoder.c
|
|||
# Source4 contains email correspondence clarifying the license terms.
|
||||
# Fedora opts to ignore the optional part of clause 2 and treat that code as 2 clause BSD.
|
||||
Source3: Mesa-MLAA-License-Clarification-Email.txt
|
||||
|
||||
# Update eglext.h to 20161230 version, drop this once upstream has this version
|
||||
# or newer
|
||||
Source4: eglext.h
|
||||
|
@ -90,6 +91,8 @@ Patch14: 0001-Fix-linkage-against-shared-glapi.patch
|
|||
Patch15: 0001-glapi-Link-with-glapi-when-built-shared.patch
|
||||
# submitted upstream
|
||||
Patch16: 0001-glxglvnddispatch-Add-missing-dispatch-for-GetDriverC.patch
|
||||
# fix XWayland on fermi with nouveau
|
||||
Patch17: 0001-nvc0-Disable-BGRA8-images-on-Fermi.patch
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gcc-c++
|
||||
|
@ -691,41 +694,39 @@ popd
|
|||
%endif
|
||||
|
||||
%changelog
|
||||
* Mon Mar 20 2017 Peter Robinson <pbrobinson@fedoraproject.org> 17.0.2-1
|
||||
- Update to 17.0.2
|
||||
* Tue Jun 06 2017 Lyude Paul <lyude@redhat.com> - 17.0.5-3
|
||||
- add fix for rhbz#1411447
|
||||
|
||||
* Mon Mar 20 2017 Hans de Goede <hdegoede@redhat.com> - 17.0.1-3
|
||||
* Wed May 03 2017 Dave Airlie <airlied@redhat.com> - 17.0.5-2
|
||||
- enable radv
|
||||
|
||||
* Tue May 02 2017 Dave Airlie <airlied@redhat.com> - 17.0.5-1
|
||||
- Update to 17.0.5
|
||||
|
||||
* Mon Mar 20 2017 Hans de Goede <hdegoede@redhat.com> - 13.0.4-3
|
||||
- Fix glXGetDriverConfig not working with glvnd (rhbz#1429894)
|
||||
- Fix indirect rendering, add libGLX_indirect.so.0 symlink (rhbz#1427174)
|
||||
|
||||
* Tue Mar 14 2017 Peter Robinson <pbrobinson@fedoraproject.org> 17.0.1-2
|
||||
- Rebuild for aarch64 llvmpipe fix (rhbz 1429050)
|
||||
* Mon Mar 06 2017 Dave Airlie <airlied@redhat.com> - 13.0.4-2
|
||||
- rebuild for llvm 3.9
|
||||
|
||||
* Sun Mar 05 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 17.0.1-1
|
||||
- Update to 17.0.1
|
||||
|
||||
* Mon Feb 13 2017 Peter Robinson <pbrobinson@fedoraproject.org> 17.0.0-1
|
||||
- 17.0.0 GA
|
||||
|
||||
* Mon Feb 6 2017 Peter Robinson <pbrobinson@fedoraproject.org> 17.0.0-0.6.rc3
|
||||
- Update to 17.0.0-rc3
|
||||
|
||||
* Mon Feb 6 2017 Hans de Goede <hdegoede@redhat.com> - 17.0.0-0.5.rc2
|
||||
* Mon Feb 6 2017 Hans de Goede <hdegoede@redhat.com> - 13.0.4-1
|
||||
- New upstream bugfix release 13.0.4
|
||||
- Fix GLX_SGIX_fbconfig extension dispatching with glvnd, this fixes games such
|
||||
as "The Binding of Isaac: Rebirth" and "Crypt of the NecroDancer" from Steam
|
||||
|
||||
* Thu Feb 2 2017 Hans de Goede <hdegoede@redhat.com> - 17.0.0-0.4.rc2
|
||||
* Thu Feb 2 2017 Hans de Goede <hdegoede@redhat.com> - 13.0.3-7
|
||||
- Update eglext.h to 20161230 version this brings in some new defines needed
|
||||
by some apps / libraries
|
||||
|
||||
* Sat Jan 28 2017 Peter Robinson <pbrobinson@fedoraproject.org> 17.0.0-0.3.rc2
|
||||
- Update to 17.0.0-rc2
|
||||
* Mon Jan 30 2017 Kalev Lember <klember@redhat.com> - 13.0.3-6
|
||||
- Add back libglvnd support again
|
||||
|
||||
* Sat Jan 21 2017 Peter Robinson <pbrobinson@fedoraproject.org> 17.0.0-0.2.rc1
|
||||
- Enable etnaviv gallium driver
|
||||
* Mon Jan 30 2017 Kalev Lember <klember@redhat.com> - 13.0.3-5
|
||||
- Temporarily revert libglvnd support
|
||||
|
||||
* Fri Jan 20 2017 Igor Gnatenko <ignatenko@redhat.com> - 17.0.0-0.rc1
|
||||
- Update to 17.0.0-rc1
|
||||
* Tue Jan 24 2017 Dave Airlie <airlied@redhat.com< - 13.0.3-4
|
||||
- Fix llvm 3.8 radeonsi tess bug (#1413888)
|
||||
|
||||
* Tue Jan 17 2017 Hans de Goede <hdegoede@redhat.com> - 13.0.3-3
|
||||
- Enable libglvnd support (rhbz#1413579)
|
||||
|
@ -739,30 +740,17 @@ popd
|
|||
* Mon Dec 12 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 13.0.2-2
|
||||
- Use nettle for sha1
|
||||
|
||||
* Tue Nov 29 2016 Peter Robinson <pbrobinson@fedoraproject.org> 13.0.2-1
|
||||
- 13.0.2 GA
|
||||
* Mon Dec 05 2016 Dave Airlie <airlied@redhat.com> - 13.0.2-1
|
||||
- 13.0.2 - enable intel vulkan support
|
||||
|
||||
* Tue Nov 15 2016 Peter Robinson <pbrobinson@fedoraproject.org> 13.0.1-1
|
||||
- 13.0.1 GA
|
||||
* Wed Nov 30 2016 Adam Jackson <ajax@redhat.com> - 12.0.4-2
|
||||
- Backport a texture corruption fix for radeon
|
||||
|
||||
* Wed Nov 2 2016 Peter Robinson <pbrobinson@fedoraproject.org> 13.0.0-3
|
||||
- Don't ship duplicate vulkan devel headers
|
||||
* Tue Nov 29 2016 Adam Jackson <ajax@redhat.com> - 12.0.4-1
|
||||
- 12.0.4
|
||||
|
||||
* Wed Nov 2 2016 Peter Robinson <pbrobinson@fedoraproject.org> 13.0.0-2
|
||||
- Add options for enabling vulkan components
|
||||
- Enable intel/radeon vulkan drivers
|
||||
|
||||
* Wed Nov 2 2016 Peter Robinson <pbrobinson@fedoraproject.org> 13.0.0-1
|
||||
- 13.0.0 GA
|
||||
|
||||
* Tue Nov 01 2016 Dave Airlie <airlied@redhat.com> - 13.0.0-0.3.rc2
|
||||
- rebuild for llvm 3.9
|
||||
|
||||
* Mon Oct 24 2016 Peter Robinson <pbrobinson@fedoraproject.org> 13.0.0-0.2.rc2
|
||||
- 13.0.0-rc2
|
||||
|
||||
* Thu Oct 20 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 13.0.0-0.1.rc1
|
||||
- 13.0.0-rc1
|
||||
* Sat Oct 22 2016 Peter Robinson <pbrobinson@fedoraproject.org> 12.0.3-3
|
||||
- Add patch to improve performance in some Raspberry Pi use cases
|
||||
|
||||
* Tue Oct 11 2016 Hans de Goede <hdegoede@redhat.com> - 12.0.3-2
|
||||
- Add 2 patches from upstream to fix DRI3 vaapi crashes (rhbz1309446, fdo71759)
|
||||
|
|
|
@ -0,0 +1,304 @@
|
|||
/*
|
||||
* Mesa 3-D graphics library
|
||||
*
|
||||
* Copyright 2016 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* Mesa OpenGL inter-driver interoperability interface designed for but not
|
||||
* limited to OpenCL.
|
||||
*
|
||||
* This is a driver-agnostic, backward-compatible interface. The structures
|
||||
* are only allowed to grow. They can never shrink and their members can
|
||||
* never be removed, renamed, or redefined.
|
||||
*
|
||||
* The interface doesn't return a lot of static texture parameters like
|
||||
* width, height, etc. It mainly returns mutable buffer and texture view
|
||||
* parameters that can't be part of the texture allocation (because they are
|
||||
* mutable). If drivers want to return more data or want to return static
|
||||
* allocation parameters, they can do it in one of these two ways:
|
||||
* - attaching the data to the DMABUF handle in a driver-specific way
|
||||
* - passing the data via "out_driver_data" in the "in" structure.
|
||||
*
|
||||
* Mesa is expected to do a lot of error checking on behalf of OpenCL, such
|
||||
* as checking the target, miplevel, and texture completeness.
|
||||
*
|
||||
* OpenCL, on the other hand, needs to check if the display+context combo
|
||||
* is compatible with the OpenCL driver by querying the device information.
|
||||
* It also needs to check if the texture internal format and channel ordering
|
||||
* (returned in a driver-specific way) is supported by OpenCL, among other
|
||||
* things.
|
||||
*/
|
||||
|
||||
#ifndef MESA_GLINTEROP_H
|
||||
#define MESA_GLINTEROP_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Forward declarations to avoid inclusion of GL/glx.h */
|
||||
struct _XDisplay;
|
||||
struct __GLXcontextRec;
|
||||
|
||||
/* Forward declarations to avoid inclusion of EGL/egl.h */
|
||||
typedef void *EGLDisplay;
|
||||
typedef void *EGLContext;
|
||||
|
||||
/** Returned error codes. */
|
||||
enum {
|
||||
MESA_GLINTEROP_SUCCESS = 0,
|
||||
MESA_GLINTEROP_OUT_OF_RESOURCES,
|
||||
MESA_GLINTEROP_OUT_OF_HOST_MEMORY,
|
||||
MESA_GLINTEROP_INVALID_OPERATION,
|
||||
MESA_GLINTEROP_INVALID_VERSION,
|
||||
MESA_GLINTEROP_INVALID_DISPLAY,
|
||||
MESA_GLINTEROP_INVALID_CONTEXT,
|
||||
MESA_GLINTEROP_INVALID_TARGET,
|
||||
MESA_GLINTEROP_INVALID_OBJECT,
|
||||
MESA_GLINTEROP_INVALID_MIP_LEVEL,
|
||||
MESA_GLINTEROP_UNSUPPORTED
|
||||
};
|
||||
|
||||
/** Access flags. */
|
||||
enum {
|
||||
MESA_GLINTEROP_ACCESS_READ_WRITE = 0,
|
||||
MESA_GLINTEROP_ACCESS_READ_ONLY,
|
||||
MESA_GLINTEROP_ACCESS_WRITE_ONLY
|
||||
};
|
||||
|
||||
#define MESA_GLINTEROP_DEVICE_INFO_VERSION 1
|
||||
|
||||
/**
|
||||
* Device information returned by Mesa.
|
||||
*/
|
||||
struct mesa_glinterop_device_info {
|
||||
/* The caller should set this to the version of the struct they support */
|
||||
/* The callee will overwrite it if it supports a lower version.
|
||||
*
|
||||
* The caller should check the value and access up-to the version supported
|
||||
* by the the callee.
|
||||
*/
|
||||
/* NOTE: Do not use the MESA_GLINTEROP_DEVICE_INFO_VERSION macro */
|
||||
uint32_t version;
|
||||
|
||||
/* PCI location */
|
||||
uint32_t pci_segment_group;
|
||||
uint32_t pci_bus;
|
||||
uint32_t pci_device;
|
||||
uint32_t pci_function;
|
||||
|
||||
/* Device identification */
|
||||
uint32_t vendor_id;
|
||||
uint32_t device_id;
|
||||
|
||||
/* Structure version 1 ends here. */
|
||||
};
|
||||
|
||||
#define MESA_GLINTEROP_EXPORT_IN_VERSION 1
|
||||
|
||||
/**
|
||||
* Input parameters to Mesa interop export functions.
|
||||
*/
|
||||
struct mesa_glinterop_export_in {
|
||||
/* The caller should set this to the version of the struct they support */
|
||||
/* The callee will overwrite it if it supports a lower version.
|
||||
*
|
||||
* The caller should check the value and access up-to the version supported
|
||||
* by the the callee.
|
||||
*/
|
||||
/* NOTE: Do not use the MESA_GLINTEROP_EXPORT_IN_VERSION macro */
|
||||
uint32_t version;
|
||||
|
||||
/* One of the following:
|
||||
* - GL_TEXTURE_BUFFER
|
||||
* - GL_TEXTURE_1D
|
||||
* - GL_TEXTURE_2D
|
||||
* - GL_TEXTURE_3D
|
||||
* - GL_TEXTURE_RECTANGLE
|
||||
* - GL_TEXTURE_1D_ARRAY
|
||||
* - GL_TEXTURE_2D_ARRAY
|
||||
* - GL_TEXTURE_CUBE_MAP_ARRAY
|
||||
* - GL_TEXTURE_CUBE_MAP
|
||||
* - GL_TEXTURE_CUBE_MAP_POSITIVE_X
|
||||
* - GL_TEXTURE_CUBE_MAP_NEGATIVE_X
|
||||
* - GL_TEXTURE_CUBE_MAP_POSITIVE_Y
|
||||
* - GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
|
||||
* - GL_TEXTURE_CUBE_MAP_POSITIVE_Z
|
||||
* - GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
|
||||
* - GL_TEXTURE_2D_MULTISAMPLE
|
||||
* - GL_TEXTURE_2D_MULTISAMPLE_ARRAY
|
||||
* - GL_TEXTURE_EXTERNAL_OES
|
||||
* - GL_RENDERBUFFER
|
||||
* - GL_ARRAY_BUFFER
|
||||
*/
|
||||
unsigned target;
|
||||
|
||||
/* If target is GL_ARRAY_BUFFER, it's a buffer object.
|
||||
* If target is GL_RENDERBUFFER, it's a renderbuffer object.
|
||||
* If target is GL_TEXTURE_*, it's a texture object.
|
||||
*/
|
||||
unsigned obj;
|
||||
|
||||
/* Mipmap level. Ignored for non-texture objects. */
|
||||
unsigned miplevel;
|
||||
|
||||
/* One of MESA_GLINTEROP_ACCESS_* flags. This describes how the exported
|
||||
* object is going to be used.
|
||||
*/
|
||||
uint32_t access;
|
||||
|
||||
/* Size of memory pointed to by out_driver_data. */
|
||||
uint32_t out_driver_data_size;
|
||||
|
||||
/* If the caller wants to query driver-specific data about the OpenGL
|
||||
* object, this should point to the memory where that data will be stored.
|
||||
* This is expected to be a temporary staging memory. The pointer is not
|
||||
* allowed to be saved for later use by Mesa.
|
||||
*/
|
||||
void *out_driver_data;
|
||||
/* Structure version 1 ends here. */
|
||||
};
|
||||
|
||||
#define MESA_GLINTEROP_EXPORT_OUT_VERSION 1
|
||||
|
||||
/**
|
||||
* Outputs of Mesa interop export functions.
|
||||
*/
|
||||
struct mesa_glinterop_export_out {
|
||||
/* The caller should set this to the version of the struct they support */
|
||||
/* The callee will overwrite it if it supports a lower version.
|
||||
*
|
||||
* The caller should check the value and access up-to the version supported
|
||||
* by the the callee.
|
||||
*/
|
||||
/* NOTE: Do not use the MESA_GLINTEROP_EXPORT_OUT_VERSION macro */
|
||||
uint32_t version;
|
||||
|
||||
/* The DMABUF handle. It must be closed by the caller using the POSIX
|
||||
* close() function when it's not needed anymore. Mesa is not responsible
|
||||
* for closing the handle.
|
||||
*
|
||||
* Not closing the handle by the caller will lead to a resource leak,
|
||||
* will prevent releasing the GPU buffer, and may prevent creating new
|
||||
* DMABUF handles within the process.
|
||||
*/
|
||||
int dmabuf_fd;
|
||||
|
||||
/* The mutable OpenGL internal format specified by glTextureView or
|
||||
* glTexBuffer. If the object is not one of those, the original internal
|
||||
* format specified by glTexStorage, glTexImage, or glRenderbufferStorage
|
||||
* will be returned.
|
||||
*/
|
||||
unsigned internal_format;
|
||||
|
||||
/* Buffer offset and size for GL_ARRAY_BUFFER and GL_TEXTURE_BUFFER.
|
||||
* This allows interop with suballocations (a buffer allocated within
|
||||
* a larger buffer).
|
||||
*
|
||||
* Parameters specified by glTexBufferRange for GL_TEXTURE_BUFFER are
|
||||
* applied to these and can shrink the range further.
|
||||
*/
|
||||
ptrdiff_t buf_offset;
|
||||
ptrdiff_t buf_size;
|
||||
|
||||
/* Parameters specified by glTextureView. If the object is not a texture
|
||||
* view, default parameters covering the whole texture will be returned.
|
||||
*/
|
||||
unsigned view_minlevel;
|
||||
unsigned view_numlevels;
|
||||
unsigned view_minlayer;
|
||||
unsigned view_numlayers;
|
||||
|
||||
/* The number of bytes written to out_driver_data. */
|
||||
uint32_t out_driver_data_written;
|
||||
/* Structure version 1 ends here. */
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Query device information.
|
||||
*
|
||||
* \param dpy GLX display
|
||||
* \param context GLX context
|
||||
* \param out where to return the information
|
||||
*
|
||||
* \return MESA_GLINTEROP_SUCCESS or MESA_GLINTEROP_* != 0 on error
|
||||
*/
|
||||
int
|
||||
MesaGLInteropGLXQueryDeviceInfo(struct _XDisplay *dpy, struct __GLXcontextRec *context,
|
||||
struct mesa_glinterop_device_info *out);
|
||||
|
||||
|
||||
/**
|
||||
* Same as MesaGLInteropGLXQueryDeviceInfo except that it accepts EGLDisplay
|
||||
* and EGLContext.
|
||||
*/
|
||||
int
|
||||
MesaGLInteropEGLQueryDeviceInfo(EGLDisplay dpy, EGLContext context,
|
||||
struct mesa_glinterop_device_info *out);
|
||||
|
||||
|
||||
/**
|
||||
* Create and return a DMABUF handle corresponding to the given OpenGL
|
||||
* object, and return other parameters about the OpenGL object.
|
||||
*
|
||||
* \param dpy GLX display
|
||||
* \param context GLX context
|
||||
* \param in input parameters
|
||||
* \param out return values
|
||||
*
|
||||
* \return MESA_GLINTEROP_SUCCESS or MESA_GLINTEROP_* != 0 on error
|
||||
*/
|
||||
int
|
||||
MesaGLInteropGLXExportObject(struct _XDisplay *dpy, struct __GLXcontextRec *context,
|
||||
struct mesa_glinterop_export_in *in,
|
||||
struct mesa_glinterop_export_out *out);
|
||||
|
||||
|
||||
/**
|
||||
* Same as MesaGLInteropGLXExportObject except that it accepts
|
||||
* EGLDisplay and EGLContext.
|
||||
*/
|
||||
int
|
||||
MesaGLInteropEGLExportObject(EGLDisplay dpy, EGLContext context,
|
||||
struct mesa_glinterop_export_in *in,
|
||||
struct mesa_glinterop_export_out *out);
|
||||
|
||||
|
||||
typedef int (PFNMESAGLINTEROPGLXQUERYDEVICEINFOPROC)(struct _XDisplay *dpy, struct __GLXcontextRec *context,
|
||||
struct mesa_glinterop_device_info *out);
|
||||
typedef int (PFNMESAGLINTEROPEGLQUERYDEVICEINFOPROC)(EGLDisplay dpy, EGLContext context,
|
||||
struct mesa_glinterop_device_info *out);
|
||||
typedef int (PFNMESAGLINTEROPGLXEXPORTOBJECTPROC)(struct _XDisplay *dpy, struct __GLXcontextRec *context,
|
||||
struct mesa_glinterop_export_in *in,
|
||||
struct mesa_glinterop_export_out *out);
|
||||
typedef int (PFNMESAGLINTEROPEGLEXPORTOBJECTPROC)(EGLDisplay dpy, EGLContext context,
|
||||
struct mesa_glinterop_export_in *in,
|
||||
struct mesa_glinterop_export_out *out);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MESA_GLINTEROP_H */
|
2
sources
2
sources
|
@ -1 +1 @@
|
|||
SHA512 (mesa-17.0.2.tar.xz) = df0cb47d01dee16d1d72e0a5fd9d49ab412294761ca647cbb6b411e16892b8be503d87911591339d4630d16b7c948897bfa4321b2c5a8a4219fa58b347015471
|
||||
SHA512 (mesa-17.0.5.tar.xz) = 942fa62c9098bcd030856cd622696eae418f292addb912e1d558cf27d396f25c3f2000dae97a12d1ff233f1ea157497259442082005035bb27b9bafb2cfc33c3
|
||||
|
|
|
@ -0,0 +1,85 @@
|
|||
From 99d790538de2e7d7d489a8638b13c5aa069c27c3 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Anholt <eric@anholt.net>
|
||||
Date: Thu, 13 Oct 2016 12:37:59 -0700
|
||||
Subject: vc4: Avoid loading from the texture during non-utile-aligned
|
||||
glTexImage().
|
||||
|
||||
Previously, the plan was "if the width/height we have to load/store isn't
|
||||
the size the user is planning on writing, then we need to load the old
|
||||
contents out beforehand to prevent writing back undefined".
|
||||
|
||||
However, when we're doing glTexImage() we often end up aligning the
|
||||
width/height into the padding of the texture, and we don't actually
|
||||
need to read out that padding.
|
||||
|
||||
Improves x11perf -aatrapezoid100 performance from ~460/sec to
|
||||
~700/sec.
|
||||
|
||||
diff --git a/src/gallium/drivers/vc4/vc4_resource.c b/src/gallium/drivers/vc4/vc4_resource.c
|
||||
index 4168079..704cd71 100644
|
||||
--- a/src/gallium/drivers/vc4/vc4_resource.c
|
||||
+++ b/src/gallium/drivers/vc4/vc4_resource.c
|
||||
@@ -284,26 +284,48 @@ vc4_resource_transfer_map(struct pipe_context *pctx,
|
||||
return NULL;
|
||||
|
||||
/* We need to align the box to utile boundaries, since that's
|
||||
- * what load/store operate on.
|
||||
+ * what load/store operates on. This may cause us to need to
|
||||
+ * read out the original contents in that border area. Right
|
||||
+ * now we just read out the entire contents, including the
|
||||
+ * middle area that will just get overwritten.
|
||||
*/
|
||||
- uint32_t orig_width = ptrans->box.width;
|
||||
- uint32_t orig_height = ptrans->box.height;
|
||||
uint32_t box_start_x = ptrans->box.x & (utile_w - 1);
|
||||
uint32_t box_start_y = ptrans->box.y & (utile_h - 1);
|
||||
- ptrans->box.width += box_start_x;
|
||||
- ptrans->box.x -= box_start_x;
|
||||
- ptrans->box.height += box_start_y;
|
||||
- ptrans->box.y -= box_start_y;
|
||||
- ptrans->box.width = align(ptrans->box.width, utile_w);
|
||||
- ptrans->box.height = align(ptrans->box.height, utile_h);
|
||||
+ bool needs_load = (usage & PIPE_TRANSFER_READ) != 0;
|
||||
+
|
||||
+ if (box_start_x) {
|
||||
+ ptrans->box.width += box_start_x;
|
||||
+ ptrans->box.x -= box_start_x;
|
||||
+ needs_load = true;
|
||||
+ }
|
||||
+ if (box_start_y) {
|
||||
+ ptrans->box.height += box_start_y;
|
||||
+ ptrans->box.y -= box_start_y;
|
||||
+ needs_load = true;
|
||||
+ }
|
||||
+ if (ptrans->box.width & (utile_w - 1)) {
|
||||
+ /* We only need to force a load if our border region
|
||||
+ * we're extending into is actually part of the
|
||||
+ * texture.
|
||||
+ */
|
||||
+ uint32_t slice_width = u_minify(prsc->width0, level);
|
||||
+ if (ptrans->box.x + ptrans->box.width != slice_width)
|
||||
+ needs_load = true;
|
||||
+ ptrans->box.width = align(ptrans->box.width, utile_w);
|
||||
+ }
|
||||
+ if (ptrans->box.height & (utile_h - 1)) {
|
||||
+ uint32_t slice_height = u_minify(prsc->height0, level);
|
||||
+ if (ptrans->box.y + ptrans->box.height != slice_height)
|
||||
+ needs_load = true;
|
||||
+ ptrans->box.height = align(ptrans->box.height, utile_h);
|
||||
+ }
|
||||
|
||||
ptrans->stride = ptrans->box.width * rsc->cpp;
|
||||
ptrans->layer_stride = ptrans->stride * ptrans->box.height;
|
||||
|
||||
trans->map = malloc(ptrans->layer_stride * ptrans->box.depth);
|
||||
- if (usage & PIPE_TRANSFER_READ ||
|
||||
- ptrans->box.width != orig_width ||
|
||||
- ptrans->box.height != orig_height) {
|
||||
+
|
||||
+ if (needs_load) {
|
||||
vc4_load_tiled_image(trans->map, ptrans->stride,
|
||||
buf + slice->offset +
|
||||
ptrans->box.z * rsc->cube_map_stride,
|
||||
--
|
||||
cgit v0.10.2
|
||||
|
Loading…
Reference in New Issue