Mesa (master): gallium/radeon: don't disable DCC because of SDMA

Marek Olšák mareko at kemper.freedesktop.org
Tue Jun 7 22:23:49 UTC 2016


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Sun Jun  5 15:45:30 2016 +0200

gallium/radeon: don't disable DCC because of SDMA

We want to keep DCC enabled to save bandwidth. It was a bad idea to disable
it here.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

---

 src/gallium/drivers/radeon/r600_texture.c | 23 +++--------------------
 1 file changed, 3 insertions(+), 20 deletions(-)

diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
index b276417..27b464f 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -32,8 +32,6 @@
 #include <errno.h>
 #include <inttypes.h>
 
-static bool r600_texture_discard_dcc(struct r600_common_screen *rscreen,
-				     struct r600_texture *rtex);
 static void r600_texture_discard_cmask(struct r600_common_screen *rscreen,
 				       struct r600_texture *rtex);
 static unsigned r600_choose_tiling(struct r600_common_screen *rscreen,
@@ -69,27 +67,12 @@ bool r600_prepare_for_dma_blit(struct r600_common_context *rctx,
 
 	/* DCC as:
 	 *   src: Use the 3D path. DCC decompression is expensive.
-	 *   dst: If overwriting the whole texture, discard DCC and use SDMA.
-	 *        Otherwise, use the 3D path.
+	 *   dst: Use the 3D path to compress the pixels with DCC.
 	 */
-	if (rsrc->dcc_offset && rsrc->surface.level[src_level].dcc_enabled)
+	if ((rsrc->dcc_offset && rsrc->surface.level[src_level].dcc_enabled) ||
+	    (rdst->dcc_offset && rdst->surface.level[dst_level].dcc_enabled))
 		return false;
 
-	if (rdst->dcc_offset && rdst->surface.level[dst_level].dcc_enabled) {
-		/* We can't discard DCC if the texture has been exported.
-		 * We can only discard DCC for the entire texture.
-		 */
-		if (rdst->resource.is_shared ||
-		    rdst->resource.b.b.last_level > 0 ||
-		    !util_texrange_covers_whole_level(&rdst->resource.b.b, dst_level,
-						      dstx, dsty, dstz, src_box->width,
-						      src_box->height, src_box->depth))
-			return false;
-
-		if (!r600_texture_discard_dcc(rctx->screen, rdst))
-			return false;
-	}
-
 	/* CMASK as:
 	 *   src: Both texture and SDMA paths need decompression. Use SDMA.
 	 *   dst: If overwriting the whole texture, discard CMASK and use




More information about the mesa-commit mailing list