[Mesa-stable] [PATCH v2 2/6] i965/miptree: Add an aux_disabled parameter to render_aux_usage
Jason Ekstrand
jason at jlekstrand.net
Wed Jan 24 20:37:20 UTC 2018
Only one of the callers of intel_miptree_render_aux_usage actually took
brw->draw_aux_buffer_disabled into account. This was causing us to
ignore draw_aux_buffer_disabled for the intel_miptree_prepare_render.
This isn't a problem because the draw_aux_buffer_disabled entry was set
during texture preparation and we already did the resolve at that time.
However, this also meant that the aux_usage we were passing to
brw_cache_flush_for_render and brw_render_cache_add_bo was wrong so our
automatic cache flushing around aux_usage changes wasn't happening.
This was causing GPU hangs in Oxenfree.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104711
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104411
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104383
Fixes: ea0d2e98ecb369ab84e78c84709c0930ea8c293a
Cc: mesa-stable at lists.freedesktop.org
Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
---
src/mesa/drivers/dri/i965/brw_blorp.c | 6 ++++--
src/mesa/drivers/dri/i965/brw_draw.c | 6 ++++--
src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 4 ++--
src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 6 +++++-
src/mesa/drivers/dri/i965/intel_mipmap_tree.h | 3 ++-
5 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c
index 76f2ae6..82d9de1 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.c
+++ b/src/mesa/drivers/dri/i965/brw_blorp.c
@@ -320,7 +320,8 @@ brw_blorp_blit_miptrees(struct brw_context *brw,
enum isl_format dst_isl_format =
brw_blorp_to_isl_format(brw, dst_format, true);
enum isl_aux_usage dst_aux_usage =
- intel_miptree_render_aux_usage(brw, dst_mt, dst_isl_format, false);
+ intel_miptree_render_aux_usage(brw, dst_mt, dst_isl_format,
+ false, false);
const bool dst_clear_supported = dst_aux_usage != ISL_AUX_USAGE_NONE;
intel_miptree_prepare_access(brw, dst_mt, dst_level, 1, dst_layer, 1,
dst_aux_usage, dst_clear_supported);
@@ -1267,7 +1268,8 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
irb->mt, irb->mt_level, irb->mt_layer, num_layers);
enum isl_aux_usage aux_usage =
- intel_miptree_render_aux_usage(brw, irb->mt, isl_format, false);
+ intel_miptree_render_aux_usage(brw, irb->mt, isl_format,
+ false, false);
intel_miptree_prepare_render(brw, irb->mt, level, irb->mt_layer,
num_layers, aux_usage);
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index 3492a25..2606360 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -549,7 +549,8 @@ brw_predraw_resolve_framebuffer(struct brw_context *brw)
bool blend_enabled = ctx->Color.BlendEnabled & (1 << i);
enum isl_aux_usage aux_usage =
intel_miptree_render_aux_usage(brw, irb->mt, isl_format,
- blend_enabled);
+ blend_enabled,
+ brw->draw_aux_buffer_disabled[i]);
intel_miptree_prepare_render(brw, irb->mt, irb->mt_level,
irb->mt_layer, irb->layer_count,
@@ -625,7 +626,8 @@ brw_postdraw_set_buffers_need_resolve(struct brw_context *brw)
bool blend_enabled = ctx->Color.BlendEnabled & (1 << i);
enum isl_aux_usage aux_usage =
intel_miptree_render_aux_usage(brw, irb->mt, isl_format,
- blend_enabled);
+ blend_enabled,
+ brw->draw_aux_buffer_disabled[i]);
brw_render_cache_add_bo(brw, irb->mt->bo, isl_format, aux_usage);
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index 38af6bc..fd2ee36 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -230,9 +230,9 @@ gen6_update_renderbuffer_surface(struct brw_context *brw,
enum isl_format isl_format = brw->mesa_to_isl_render_format[rb_format];
enum isl_aux_usage aux_usage =
- brw->draw_aux_buffer_disabled[unit] ? ISL_AUX_USAGE_NONE :
intel_miptree_render_aux_usage(brw, mt, isl_format,
- ctx->Color.BlendEnabled & (1 << unit));
+ ctx->Color.BlendEnabled & (1 << unit),
+ brw->draw_aux_buffer_disabled[unit]);
struct isl_view view = {
.format = isl_format,
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 38287c4..c8081ee 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -2682,10 +2682,14 @@ enum isl_aux_usage
intel_miptree_render_aux_usage(struct brw_context *brw,
struct intel_mipmap_tree *mt,
enum isl_format render_format,
- bool blend_enabled)
+ bool blend_enabled,
+ bool draw_aux_disabled)
{
struct gen_device_info *devinfo = &brw->screen->devinfo;
+ if (draw_aux_disabled)
+ return ISL_AUX_USAGE_NONE;
+
switch (mt->aux_usage) {
case ISL_AUX_USAGE_MCS:
assert(mt->mcs_buf);
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
index 17dcdbc..6135af1 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
@@ -652,7 +652,8 @@ enum isl_aux_usage
intel_miptree_render_aux_usage(struct brw_context *brw,
struct intel_mipmap_tree *mt,
enum isl_format render_format,
- bool blend_enabled);
+ bool blend_enabled,
+ bool draw_aux_disabled);
void
intel_miptree_prepare_render(struct brw_context *brw,
struct intel_mipmap_tree *mt, uint32_t level,
--
2.5.0.400.gff86faf
More information about the mesa-stable
mailing list