From 2af4b637d8a2da72a42ca8288dcab90fb1e2346c Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Thu, 28 Apr 2016 19:45:22 +0200 Subject: gallium/radeon: split out code for discarding DCC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Alex Deucher Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeon/r600_texture.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/gallium/drivers/radeon') diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c index 94597fc55cf..3e71da23f10 100644 --- a/src/gallium/drivers/radeon/r600_texture.c +++ b/src/gallium/drivers/radeon/r600_texture.c @@ -293,6 +293,17 @@ static void r600_texture_discard_cmask(struct r600_common_screen *rscreen, p_atomic_inc(&rscreen->compressed_colortex_counter); } +static void r600_texture_discard_dcc(struct r600_common_screen *rscreen, + struct r600_texture *rtex) +{ + /* Disable DCC. */ + rtex->dcc_offset = 0; + rtex->cb_color_info &= ~VI_S_028C70_DCC_ENABLE(1); + + /* Notify all contexts about the change. */ + r600_dirty_all_framebuffer_states(rscreen); +} + void r600_texture_disable_dcc(struct r600_common_screen *rscreen, struct r600_texture *rtex) { @@ -308,12 +319,7 @@ void r600_texture_disable_dcc(struct r600_common_screen *rscreen, rctx->b.flush(&rctx->b, NULL, 0); pipe_mutex_unlock(rscreen->aux_context_lock); - /* Disable DCC. */ - rtex->dcc_offset = 0; - rtex->cb_color_info &= ~VI_S_028C70_DCC_ENABLE(1); - - /* Notify all contexts about the change. */ - r600_dirty_all_framebuffer_states(rscreen); + r600_texture_discard_dcc(rscreen, rtex); } static boolean r600_texture_get_handle(struct pipe_screen* screen, -- cgit v1.2.3