[Mesa-dev] [PATCH 05/23] radeonsi: clean up si_do_fast_color_clear parameters

Marek Olšák maraeo at gmail.com
Tue Nov 28 21:38:33 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/drivers/radeonsi/si_clear.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_clear.c b/src/gallium/drivers/radeonsi/si_clear.c
index d99947f..29e63c7 100644
--- a/src/gallium/drivers/radeonsi/si_clear.c
+++ b/src/gallium/drivers/radeonsi/si_clear.c
@@ -335,25 +335,24 @@ static void si_set_optimal_micro_tile_mode(struct si_screen *sscreen,
 			return;
 		}
 	}
 
 	rtex->surface.micro_tile_mode = rtex->last_msaa_resolve_target_micro_mode;
 
 	p_atomic_inc(&sscreen->b.dirty_tex_counter);
 }
 
 static void si_do_fast_color_clear(struct si_context *sctx,
-				   struct pipe_framebuffer_state *fb,
-				   struct r600_atom *fb_state,
-				   unsigned *buffers, ubyte *dirty_cbufs,
+				   unsigned *buffers,
 				   const union pipe_color_union *color)
 {
+	struct pipe_framebuffer_state *fb = &sctx->framebuffer.state;
 	int i;
 
 	/* This function is broken in BE, so just disable this path for now */
 #ifdef PIPE_ARCH_BIG_ENDIAN
 	return;
 #endif
 
 	if (sctx->b.render_cond)
 		return;
 
@@ -488,42 +487,38 @@ static void si_do_fast_color_clear(struct si_context *sctx,
 
 			if (need_compressed_update)
 				p_atomic_inc(&sctx->screen->b.compressed_colortex_counter);
 		}
 
 		/* We can change the micro tile mode before a full clear. */
 		si_set_optimal_micro_tile_mode(sctx->screen, tex);
 
 		si_set_clear_color(tex, fb->cbufs[i]->format, color);
 
-		if (dirty_cbufs)
-			*dirty_cbufs |= 1 << i;
-		sctx->b.set_atom_dirty(&sctx->b, fb_state, true);
+		sctx->framebuffer.dirty_cbufs |= 1 << i;
+		si_mark_atom_dirty(sctx, &sctx->framebuffer.atom);
 		*buffers &= ~clear_bit;
 	}
 }
 
 static void si_clear(struct pipe_context *ctx, unsigned buffers,
 		     const union pipe_color_union *color,
 		     double depth, unsigned stencil)
 {
 	struct si_context *sctx = (struct si_context *)ctx;
 	struct pipe_framebuffer_state *fb = &sctx->framebuffer.state;
 	struct pipe_surface *zsbuf = fb->zsbuf;
 	struct r600_texture *zstex =
 		zsbuf ? (struct r600_texture*)zsbuf->texture : NULL;
 
 	if (buffers & PIPE_CLEAR_COLOR) {
-		si_do_fast_color_clear(sctx, fb,
-				       &sctx->framebuffer.atom, &buffers,
-				       &sctx->framebuffer.dirty_cbufs,
-				       color);
+		si_do_fast_color_clear(sctx, &buffers, color);
 		if (!buffers)
 			return; /* all buffers have been fast cleared */
 	}
 
 	if (buffers & PIPE_CLEAR_COLOR) {
 		int i;
 
 		/* These buffers cannot use fast clear, make sure to disable expansion. */
 		for (i = 0; i < fb->nr_cbufs; i++) {
 			struct r600_texture *tex;
-- 
2.7.4



More information about the mesa-dev mailing list