iris: Track last VS URB entry size
authorSagar Ghuge <sagar.ghuge@intel.com>
Thu, 7 Mar 2019 01:05:23 +0000 (17:05 -0800)
committerSagar Ghuge <sagar.ghuge@intel.com>
Fri, 8 Mar 2019 18:01:39 +0000 (10:01 -0800)
Return immediately if last VS URB entry size is good enough for BLORP
operation

v2: Fix comments (Caio)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Suggested-by: Kenneth Graunke<kenneth@whitecape.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/gallium/drivers/iris/iris_blorp.c
src/gallium/drivers/iris/iris_context.h
src/gallium/drivers/iris/iris_state.c

index cd6d74960cb2772258127c6eacb00571c31a9c23..a3df22c0a40ec3eb15e9734de2c93f5980c3cdc1 100644 (file)
@@ -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;
 }
index d4f88f2a907910e08983f9330868db8ae647f7ff..8f91d28446fdb9f2444766cedc31dbb4f89ab341 100644 (file)
@@ -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.
        *
index c6dc065dc3b958ab274f99932fc77bf3d79c3de8..469d149dfba424214be2a8f0aef84fa08d99e147 100644 (file)
@@ -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,