From 5d24682aaeb7cf15655483a8a55f306975677996 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Fri, 10 Feb 2023 14:28:41 -0800 Subject: [PATCH] iris: Drop iris_cache_flush_for_render Before dropping this function, handle the two callers of this function: * The call in iris_blorp.c is redundant. The required cache flushes are already handled by the callers of blorp functions. Delete this. * The call in iris_resolve.c is still providing a benefit because it calls iris_emit_buffer_barrier_for internally. Inline the needed barrier. Cc: 23.0 Reviewed-by: Kenneth Graunke Part-of: --- src/gallium/drivers/iris/iris_blorp.c | 10 ---------- src/gallium/drivers/iris/iris_context.h | 3 --- src/gallium/drivers/iris/iris_resolve.c | 12 ++---------- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/gallium/drivers/iris/iris_blorp.c b/src/gallium/drivers/iris/iris_blorp.c index 4cfcad00561..33c2acf1734 100644 --- a/src/gallium/drivers/iris/iris_blorp.c +++ b/src/gallium/drivers/iris/iris_blorp.c @@ -304,16 +304,6 @@ iris_blorp_exec_render(struct blorp_batch *blorp_batch, !(blorp_batch->flags & BLORP_BATCH_NO_EMIT_DEPTH_STENCIL)) genX(emit_depth_state_workarounds)(ice, batch, ¶ms->depth.surf); - /* Flush the render cache in cases where the same surface is used with - * different aux modes, which can lead to GPU hangs. Invalidation of - * sampler caches and flushing of any caches which had previously written - * the source surfaces should already have been handled by the caller. - */ - if (params->dst.enabled) { - iris_cache_flush_for_render(batch, params->dst.addr.buffer, - params->dst.aux_usage); - } - iris_require_command_space(batch, 1400); #if GFX_VER == 8 diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h index 4947c8a0e81..28a222db15c 100644 --- a/src/gallium/drivers/iris/iris_context.h +++ b/src/gallium/drivers/iris/iris_context.h @@ -1099,9 +1099,6 @@ void iris_predraw_flush_buffers(struct iris_context *ice, void iris_postdraw_update_resolve_tracking(struct iris_context *ice); void iris_postdraw_update_image_resolve_tracking(struct iris_context *ice, gl_shader_stage stage); -void iris_cache_flush_for_render(struct iris_batch *batch, - struct iris_bo *bo, - enum isl_aux_usage aux_usage); int iris_get_driver_query_info(struct pipe_screen *pscreen, unsigned index, struct pipe_driver_query_info *info); int iris_get_driver_query_group_info(struct pipe_screen *pscreen, diff --git a/src/gallium/drivers/iris/iris_resolve.c b/src/gallium/drivers/iris/iris_resolve.c index d965f8fb12b..3078ad4eb2c 100644 --- a/src/gallium/drivers/iris/iris_resolve.c +++ b/src/gallium/drivers/iris/iris_resolve.c @@ -266,7 +266,8 @@ iris_predraw_resolve_framebuffer(struct iris_context *ice, surf->view.array_len, aux_usage); - iris_cache_flush_for_render(batch, res->bo, aux_usage); + iris_emit_buffer_barrier_for(batch, res->bo, + IRIS_DOMAIN_RENDER_WRITE); } } } @@ -422,15 +423,6 @@ flush_previous_aux_mode(struct iris_batch *batch, } } -void -iris_cache_flush_for_render(struct iris_batch *batch, - struct iris_bo *bo, - enum isl_aux_usage aux_usage) -{ - iris_emit_buffer_barrier_for(batch, bo, IRIS_DOMAIN_RENDER_WRITE); - flush_previous_aux_mode(batch, bo, aux_usage); -} - static void flush_ubos(struct iris_batch *batch, struct iris_shader_state *shs)