From e928676b69bf9cafce1c0304dd473c926b9f2854 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 17 Jan 2020 13:38:52 -0600 Subject: [PATCH] iris: Consolodate URB emit Now that we don't have to carry a URB state emit function for BLORP we can roll some stuff together and drop a genX helper. Cc: "20.0" mesa-stable@lists.freedesktop.org Reviewed-by: Kenneth Graunke Part-of: --- src/gallium/drivers/iris/iris_context.h | 3 -- src/gallium/drivers/iris/iris_genx_protos.h | 4 -- src/gallium/drivers/iris/iris_state.c | 44 +++++++-------------- 3 files changed, 15 insertions(+), 36 deletions(-) diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h index b5c3f78da28..ca1faae5f1d 100644 --- a/src/gallium/drivers/iris/iris_context.h +++ b/src/gallium/drivers/iris/iris_context.h @@ -670,9 +670,6 @@ struct iris_context { /** Is a GS or TES outputting points or lines? */ bool output_topology_is_points_or_lines; - /* 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_genx_protos.h b/src/gallium/drivers/iris/iris_genx_protos.h index 6e9a7ba5f8e..6d59f936e37 100644 --- a/src/gallium/drivers/iris/iris_genx_protos.h +++ b/src/gallium/drivers/iris/iris_genx_protos.h @@ -29,10 +29,6 @@ /* iris_state.c */ void genX(init_state)(struct iris_context *ice); -void genX(emit_urb_setup)(struct iris_context *ice, - struct iris_batch *batch, - const unsigned size[4], - bool tess_present, bool gs_present); void genX(emit_hashing_mode)(struct iris_context *ice, struct iris_batch *batch, unsigned width, unsigned height, diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 2593bf45b2a..f5bcc681ab1 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -5381,9 +5381,21 @@ iris_upload_dirty_render_state(struct iris_context *ice, assert(size[i] != 0); } - genX(emit_urb_setup)(ice, batch, size, - ice->shaders.prog[MESA_SHADER_TESS_EVAL] != NULL, - ice->shaders.prog[MESA_SHADER_GEOMETRY] != NULL); + unsigned entries[4], start[4]; + gen_get_urb_config(&batch->screen->devinfo, + batch->screen->l3_config_3d, + ice->shaders.prog[MESA_SHADER_TESS_EVAL] != NULL, + ice->shaders.prog[MESA_SHADER_GEOMETRY] != NULL, + size, entries, start); + + for (int i = MESA_SHADER_VERTEX; i <= MESA_SHADER_GEOMETRY; i++) { + iris_emit_cmd(batch, GENX(3DSTATE_URB_VS), urb) { + urb._3DCommandSubOpcode += i; + urb.VSURBStartingAddress = start[i]; + urb.VSURBEntryAllocationSize = size[i] - 1; + urb.VSNumberofURBEntries = entries[i]; + } + } } if (dirty & IRIS_DIRTY_BLEND_STATE) { @@ -7218,32 +7230,6 @@ iris_emit_raw_pipe_control(struct iris_batch *batch, } } -void -genX(emit_urb_setup)(struct iris_context *ice, - struct iris_batch *batch, - const unsigned size[4], - bool tess_present, bool gs_present) -{ - const struct gen_device_info *devinfo = &batch->screen->devinfo; - unsigned entries[4]; - unsigned start[4]; - - ice->shaders.last_vs_entry_size = size[MESA_SHADER_VERTEX]; - - gen_get_urb_config(devinfo, batch->screen->l3_config_3d, - tess_present, gs_present, - size, entries, start); - - for (int i = MESA_SHADER_VERTEX; i <= MESA_SHADER_GEOMETRY; i++) { - iris_emit_cmd(batch, GENX(3DSTATE_URB_VS), urb) { - urb._3DCommandSubOpcode += i; - urb.VSURBStartingAddress = start[i]; - urb.VSURBEntryAllocationSize = size[i] - 1; - urb.VSNumberofURBEntries = entries[i]; - } - } -} - #if GEN_GEN == 9 /** * Preemption on Gen9 has to be enabled or disabled in various cases. -- 2.30.2