diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2019-02-13 11:10:39 -0800 |
---|---|---|
committer | Jordan Justen <jordan.l.justen@intel.com> | 2020-06-23 11:08:14 -0700 |
commit | f03d4b1d6c08a20306e6d7d609d77c7decd5d087 (patch) | |
tree | 4f0dc987484af292331f7b28529fb4bf05310d10 | |
parent | d05b7c6c9710e2d3562fa6317d8ee132d92c27ef (diff) |
iris/compute: Split out iris_load_indirect_locationcs-emit-refactor
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5571>
-rw-r--r-- | src/gallium/drivers/iris/iris_state.c | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index c5698cf39a5..ead1302e152 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -6571,6 +6571,33 @@ iris_upload_render_state(struct iris_context *ice, } static void +iris_load_indirect_location(struct iris_context *ice, + struct iris_batch *batch, + const struct pipe_grid_info *grid) +{ +#define GPGPU_DISPATCHDIMX 0x2500 +#define GPGPU_DISPATCHDIMY 0x2504 +#define GPGPU_DISPATCHDIMZ 0x2508 + + assert(grid->indirect); + + struct iris_state_ref *grid_size = &ice->state.grid_size; + struct iris_bo *bo = iris_resource_bo(grid_size->res); + iris_emit_cmd(batch, GENX(MI_LOAD_REGISTER_MEM), lrm) { + lrm.RegisterAddress = GPGPU_DISPATCHDIMX; + lrm.MemoryAddress = ro_bo(bo, grid_size->offset + 0); + } + iris_emit_cmd(batch, GENX(MI_LOAD_REGISTER_MEM), lrm) { + lrm.RegisterAddress = GPGPU_DISPATCHDIMY; + lrm.MemoryAddress = ro_bo(bo, grid_size->offset + 4); + } + iris_emit_cmd(batch, GENX(MI_LOAD_REGISTER_MEM), lrm) { + lrm.RegisterAddress = GPGPU_DISPATCHDIMZ; + lrm.MemoryAddress = ro_bo(bo, grid_size->offset + 8); + } +} + +static void iris_upload_gpgpu_walker(struct iris_context *ice, struct iris_batch *batch, const struct pipe_grid_info *grid) @@ -6679,26 +6706,8 @@ iris_upload_gpgpu_walker(struct iris_context *ice, } } -#define GPGPU_DISPATCHDIMX 0x2500 -#define GPGPU_DISPATCHDIMY 0x2504 -#define GPGPU_DISPATCHDIMZ 0x2508 - - if (grid->indirect) { - struct iris_state_ref *grid_size = &ice->state.grid_size; - struct iris_bo *bo = iris_resource_bo(grid_size->res); - iris_emit_cmd(batch, GENX(MI_LOAD_REGISTER_MEM), lrm) { - lrm.RegisterAddress = GPGPU_DISPATCHDIMX; - lrm.MemoryAddress = ro_bo(bo, grid_size->offset + 0); - } - iris_emit_cmd(batch, GENX(MI_LOAD_REGISTER_MEM), lrm) { - lrm.RegisterAddress = GPGPU_DISPATCHDIMY; - lrm.MemoryAddress = ro_bo(bo, grid_size->offset + 4); - } - iris_emit_cmd(batch, GENX(MI_LOAD_REGISTER_MEM), lrm) { - lrm.RegisterAddress = GPGPU_DISPATCHDIMZ; - lrm.MemoryAddress = ro_bo(bo, grid_size->offset + 8); - } - } + if (grid->indirect) + iris_load_indirect_location(ice, batch, grid); const uint32_t right_mask = brw_cs_right_mask(group_size, simd_size); |