From e21cca78ea9c146a52fef060f8b581ed8cecb5f8 Mon Sep 17 00:00:00 2001 From: Rohan Garg Date: Tue, 11 Oct 2022 17:20:04 +0200 Subject: [PATCH] anv,blorp,iris: Set PreferredSLMAllocationSize on gfx125+ MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Rohan Garg Reviewed-by: Lionel Landwerlin Reviewed-by: Tapani Pälli Part-of: --- src/gallium/drivers/iris/iris_state.c | 1 + src/intel/blorp/blorp_genX_exec.h | 1 + src/intel/common/intel_genX_state.h | 10 ++++++++++ src/intel/vulkan/genX_cmd_buffer.c | 2 ++ src/intel/vulkan/genX_pipeline.c | 4 ++++ 5 files changed, 18 insertions(+) diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 46b2895..3daa691 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -7620,6 +7620,7 @@ iris_upload_compute_walker(struct iris_context *ice, .NumberofThreadsinGPGPUThreadGroup = dispatch.threads, .SharedLocalMemorySize = encode_slm_size(GFX_VER, prog_data->total_shared), + .PreferredSLMAllocationSize = preferred_slm_allocation_size(devinfo), .NumberOfBarriers = cs_prog_data->uses_barrier, .SamplerStatePointer = shs->sampler_table.offset, .SamplerCount = encode_sampler_count(shader), diff --git a/src/intel/blorp/blorp_genX_exec.h b/src/intel/blorp/blorp_genX_exec.h index 3119d2b..60f95c7 100644 --- a/src/intel/blorp/blorp_genX_exec.h +++ b/src/intel/blorp/blorp_genX_exec.h @@ -2187,6 +2187,7 @@ blorp_exec_compute(struct blorp_batch *batch, const struct blorp_params *params) .NumberofThreadsinGPGPUThreadGroup = dispatch.threads, .SharedLocalMemorySize = encode_slm_size(GFX_VER, prog_data->total_shared), + .PreferredSLMAllocationSize = preferred_slm_allocation_size(devinfo), .NumberOfBarriers = cs_prog_data->uses_barrier, }; } diff --git a/src/intel/common/intel_genX_state.h b/src/intel/common/intel_genX_state.h index 69ccbd6..6b9e121 100644 --- a/src/intel/common/intel_genX_state.h +++ b/src/intel/common/intel_genX_state.h @@ -126,6 +126,16 @@ intel_set_ps_dispatch_state(struct GENX(3DSTATE_PS) *ps, #endif +#if GFX_VERx10 >= 125 + +UNUSED static int +preferred_slm_allocation_size(const struct intel_device_info *devinfo) +{ + return 0; +} + +#endif + #ifdef __cplusplus } #endif diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 4514b96..8dd3d09 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -35,6 +35,7 @@ #include "genxml/genX_rt_pack.h" #include "common/intel_guardband.h" #include "compiler/brw_prim.h" +#include "common/intel_genX_state.h" #include "ds/intel_tracepoints.h" @@ -5717,6 +5718,7 @@ emit_compute_walker(struct anv_cmd_buffer *cmd_buffer, .NumberofThreadsinGPGPUThreadGroup = dispatch.threads, .SharedLocalMemorySize = encode_slm_size(GFX_VER, prog_data->base.total_shared), + .PreferredSLMAllocationSize = preferred_slm_allocation_size(devinfo), .NumberOfBarriers = prog_data->uses_barrier, }; } diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c index 1cfbdf3..6b0302a 100644 --- a/src/intel/vulkan/genX_pipeline.c +++ b/src/intel/vulkan/genX_pipeline.c @@ -1724,6 +1724,8 @@ emit_task_state(struct anv_graphics_pipeline *pipeline) task.NumberofBarriers = task_prog_data->base.uses_barrier; task.SharedLocalMemorySize = encode_slm_size(GFX_VER, task_prog_data->base.base.total_shared); + task.PreferredSLMAllocationSize = + preferred_slm_allocation_size(devinfo); /* * 3DSTATE_TASK_SHADER_DATA.InlineData[0:1] will be used for an address @@ -1800,6 +1802,8 @@ emit_mesh_state(struct anv_graphics_pipeline *pipeline) mesh.NumberofBarriers = mesh_prog_data->base.uses_barrier; mesh.SharedLocalMemorySize = encode_slm_size(GFX_VER, mesh_prog_data->base.base.total_shared); + mesh.PreferredSLMAllocationSize = + preferred_slm_allocation_size(devinfo); /* * 3DSTATE_MESH_SHADER_DATA.InlineData[0:1] will be used for an address -- 2.7.4