From 9d05822cb8b5d3fd066c64722b76b3507a7fd24f Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 17 Jan 2020 13:30:48 -0600 Subject: [PATCH] i965: Re-emit l3 state before BLORP executes If BLORP is the first thing to execute, we may not have set the L3$ config yet. That's not normally a problem but we're about to add code to BLORP which will look at brw_context::l3::config and we'd like that to be initialized. It's also just good practice. Cc: "20.0" mesa-stable@lists.freedesktop.org Reviewed-by: Jordan Justen Reviewed-by: Kenneth Graunke Part-of: --- src/mesa/drivers/dri/i965/brw_context.h | 3 +++ src/mesa/drivers/dri/i965/gen7_l3_state.c | 6 +++--- src/mesa/drivers/dri/i965/genX_blorp_exec.c | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 17639bf5995..f44a392d79c 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -1504,6 +1504,9 @@ gen6_set_sample_maps(struct gl_context *ctx); /* gen8_multisample_state.c */ void gen8_emit_3dstate_sample_pattern(struct brw_context *brw); +/* gen7_l3_state.c */ +void brw_emit_l3_state(struct brw_context *brw); + /* gen7_urb.c */ void gen7_emit_push_constant_state(struct brw_context *brw, unsigned vs_size, diff --git a/src/mesa/drivers/dri/i965/gen7_l3_state.c b/src/mesa/drivers/dri/i965/gen7_l3_state.c index feed3fab283..8536709e587 100644 --- a/src/mesa/drivers/dri/i965/gen7_l3_state.c +++ b/src/mesa/drivers/dri/i965/gen7_l3_state.c @@ -212,8 +212,8 @@ update_urb_size(struct brw_context *brw, const struct gen_l3_config *cfg) } } -static void -emit_l3_state(struct brw_context *brw) +void +brw_emit_l3_state(struct brw_context *brw) { const struct gen_l3_weights w = get_pipeline_state_l3_weights(brw); const float dw = gen_diff_l3_weights(w, gen_get_l3_config_weights(brw->l3.config)); @@ -261,7 +261,7 @@ const struct brw_tracked_state gen7_l3_state = { BRW_NEW_TES_PROG_DATA | BRW_NEW_VS_PROG_DATA, }, - .emit = emit_l3_state + .emit = brw_emit_l3_state }; /** diff --git a/src/mesa/drivers/dri/i965/genX_blorp_exec.c b/src/mesa/drivers/dri/i965/genX_blorp_exec.c index 476849bdea6..8769602547e 100644 --- a/src/mesa/drivers/dri/i965/genX_blorp_exec.c +++ b/src/mesa/drivers/dri/i965/genX_blorp_exec.c @@ -317,6 +317,7 @@ genX(blorp_exec)(struct blorp_batch *batch, brw_cache_flush_for_depth(brw, params->stencil.addr.buffer); brw_select_pipeline(brw, BRW_RENDER_PIPELINE); + brw_emit_l3_state(brw); retry: intel_batchbuffer_require_space(brw, 1400); -- 2.30.2