[Mesa-dev] [PATCH v2 2/7] radeonsi: Disable operations that do not work with DCC.

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Sun Oct 11 08:38:02 PDT 2015


Signed-off-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
---
 src/gallium/drivers/radeon/r600_texture.c | 5 +++++
 src/gallium/drivers/radeonsi/cik_sdma.c   | 3 ++-
 src/gallium/drivers/radeonsi/si_blit.c    | 3 ++-
 src/gallium/drivers/radeonsi/si_dma.c     | 3 ++-
 4 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
index fffb9ef..c2a692c 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -1290,6 +1290,11 @@ void evergreen_do_fast_color_clear(struct r600_common_context *rctx,
 			continue;
 		}
 
+		/* CMASK clear does not work for DCC compressed textures */
+		if (tex->surface.dcc_enabled) {
+			continue;
+		}
+
 		/* ensure CMASK is enabled */
 		r600_texture_alloc_cmask_separate(rctx->screen, tex);
 		if (tex->cmask.size == 0) {
diff --git a/src/gallium/drivers/radeonsi/cik_sdma.c b/src/gallium/drivers/radeonsi/cik_sdma.c
index 6454b8c..25fd09a 100644
--- a/src/gallium/drivers/radeonsi/cik_sdma.c
+++ b/src/gallium/drivers/radeonsi/cik_sdma.c
@@ -242,7 +242,8 @@ void cik_sdma_copy(struct pipe_context *ctx,
 
 	if (src->format != dst->format ||
 	    rdst->surface.nsamples > 1 || rsrc->surface.nsamples > 1 ||
-	    (rdst->dirty_level_mask | rdst->stencil_dirty_level_mask) & (1 << dst_level)) {
+	    (rdst->dirty_level_mask | rdst->stencil_dirty_level_mask) & (1 << dst_level) ||
+	    rdst->surface.dcc_enabled || rsrc->surface.dcc_enabled) {
 		goto fallback;
 	}
 
diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
index d5c5db3..120ec7f 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -675,7 +675,8 @@ static bool do_hardware_msaa_resolve(struct pipe_context *ctx,
 	    info->src.box.depth == 1 &&
 	    dst->surface.level[info->dst.level].mode >= RADEON_SURF_MODE_1D &&
 	    !(dst->surface.flags & RADEON_SURF_SCANOUT) &&
-	    (!dst->cmask.size || !dst->dirty_level_mask) /* dst cannot be fast-cleared */) {
+	    (!dst->cmask.size || !dst->dirty_level_mask) && /* dst cannot be fast-cleared */
+	    !dst->surface.dcc_enabled) {
 		si_blitter_begin(ctx, SI_COLOR_RESOLVE |
 				 (info->render_condition_enable ? 0 : SI_DISABLE_RENDER_COND));
 		util_blitter_custom_resolve_color(sctx->blitter,
diff --git a/src/gallium/drivers/radeonsi/si_dma.c b/src/gallium/drivers/radeonsi/si_dma.c
index 31b0b41..73c026c 100644
--- a/src/gallium/drivers/radeonsi/si_dma.c
+++ b/src/gallium/drivers/radeonsi/si_dma.c
@@ -248,7 +248,8 @@ void si_dma_copy(struct pipe_context *ctx,
 	if (src->format != dst->format || src_box->depth > 1 ||
 	    (rdst->dirty_level_mask | rdst->stencil_dirty_level_mask) & (1 << dst_level) ||
 	    rdst->cmask.size || rdst->fmask.size ||
-	    rsrc->cmask.size || rsrc->fmask.size) {
+	    rsrc->cmask.size || rsrc->fmask.size ||
+	    rdst->surface.dcc_enabled || rsrc->surface.dcc_enabled) {
 		goto fallback;
 	}
 
-- 
2.5.3



More information about the mesa-dev mailing list