Mesa (master): radeonsi/gfx9: fix importing shared textures with DCC

Marek Olšák mareko at kemper.freedesktop.org
Thu Nov 30 17:47:25 UTC 2017


Module: Mesa
Branch: master
Commit: ed4780383cae61e051b3d3d120649222da49feae
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ed4780383cae61e051b3d3d120649222da49feae

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Thu Nov 30 02:16:29 2017 +0100

radeonsi/gfx9: fix importing shared textures with DCC

VI has 11 dwords at least. GFX9 has 10 dwords.

Cc: 17.2 17.3 <mesa-stable at lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

---

 src/gallium/drivers/radeon/r600_texture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
index 1a0503bec6..86a2e1b9a5 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -646,7 +646,7 @@ static void si_apply_opaque_metadata(struct si_screen *sscreen,
 	/* Return if DCC is enabled. The texture should be set up with it
 	 * already.
 	 */
-	if (md->size_metadata >= 11 * 4 &&
+	if (md->size_metadata >= 10 * 4 && /* at least 2(header) + 8(desc) dwords */
 	    md->metadata[0] != 0 &&
 	    md->metadata[1] == si_get_bo_metadata_word1(sscreen) &&
 	    G_008F28_COMPRESSION_EN(desc[6])) {




More information about the mesa-commit mailing list