From: Sagar Ghuge Date: Thu, 7 Mar 2019 01:05:23 +0000 (-0800) Subject: iris: Track last VS URB entry size X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bca28deb46235cae3079dba29c5a62cf2168e4b3;p=mesa.git iris: Track last VS URB entry size Return immediately if last VS URB entry size is good enough for BLORP operation v2: Fix comments (Caio) Signed-off-by: Sagar Ghuge Suggested-by: Kenneth Graunke Reviewed-by: Caio Marcelo de Oliveira Filho Reviewed-by: Kenneth Graunke --- diff --git a/src/gallium/drivers/iris/iris_blorp.c b/src/gallium/drivers/iris/iris_blorp.c index cd6d74960cb..a3df22c0a40 100644 --- a/src/gallium/drivers/iris/iris_blorp.c +++ b/src/gallium/drivers/iris/iris_blorp.c @@ -249,6 +249,12 @@ blorp_emit_urb_config(struct blorp_batch *blorp_batch, unsigned size[4] = { vs_entry_size, 1, 1, 1 }; + /* If last VS URB size is good enough for what the BLORP operation needed, + * then we can skip reconfiguration + */ + if (ice->shaders.last_vs_entry_size >= vs_entry_size) + return; + genX(emit_urb_setup)(ice, batch, size, false, false); ice->state.dirty |= IRIS_DIRTY_URB; } diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h index d4f88f2a907..8f91d28446f 100644 --- a/src/gallium/drivers/iris/iris_context.h +++ b/src/gallium/drivers/iris/iris_context.h @@ -502,6 +502,9 @@ struct iris_context { unsigned urb_size; + /* Track last VS URB entry size */ + unsigned last_vs_entry_size; + /** * Scratch buffers for various sizes and stages. * diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index c6dc065dc3b..469d149dfba 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -5866,6 +5866,8 @@ genX(emit_urb_setup)(struct iris_context *ice, unsigned entries[4]; unsigned start[4]; + ice->shaders.last_vs_entry_size = size[MESA_SHADER_VERTEX]; + gen_get_urb_config(devinfo, 1024 * push_size_kB, 1024 * ice->shaders.urb_size, tess_present, gs_present,