Mesa (master): anv: Emit CFE_STATE for gen12-hp

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 13 21:27:40 UTC 2021


Module: Mesa
Branch: master
Commit: 435b272241e0edf3081e5819372f9fa955518544
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=435b272241e0edf3081e5819372f9fa955518544

Author: Jordan Justen <jordan.l.justen at intel.com>
Date:   Wed Nov 14 11:04:15 2018 -0800

anv: Emit CFE_STATE for gen12-hp

Rework:
 * make scratch TODO. (Jason)
 * emit_compute_cs_state => emit_compute_state. (Jason)

Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8342>

---

 src/intel/vulkan/genX_pipeline.c | 35 ++++++++++++++++++++++++++++++++---
 1 file changed, 32 insertions(+), 3 deletions(-)

diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c
index 205e8677f19..404d80ae225 100644
--- a/src/intel/vulkan/genX_pipeline.c
+++ b/src/intel/vulkan/genX_pipeline.c
@@ -2340,9 +2340,36 @@ genX(graphics_pipeline_create)(
    return pipeline->base.batch.status;
 }
 
+#if GEN_GEN > 12 || GEN_IS_GEN12HP
+
+static void
+emit_compute_state(struct anv_compute_pipeline *pipeline,
+                   const struct anv_device *device)
+{
+   const struct brw_cs_prog_data *cs_prog_data = get_cs_prog_data(pipeline);
+   anv_pipeline_setup_l3_config(&pipeline->base, cs_prog_data->base.total_shared > 0);
+
+   const struct anv_cs_parameters cs_params = anv_cs_parameters(pipeline);
+   pipeline->cs_right_mask = brw_cs_right_mask(cs_params.group_size, cs_params.simd_size);
+
+   const uint32_t subslices = MAX2(device->physical->subslice_total, 1);
+
+   const struct anv_shader_bin *cs_bin = pipeline->cs;
+   const struct gen_device_info *devinfo = &device->info;
+
+   anv_batch_emit(&pipeline->base.batch, GENX(CFE_STATE), cfe) {
+      cfe.MaximumNumberofThreads =
+         devinfo->max_cs_threads * subslices - 1;
+      /* TODO: Enable gen12-hp scratch support*/
+      assert(get_scratch_space(cs_bin) == 0);
+   }
+}
+
+#else /* #if GEN_GEN > 12 || GEN_IS_GEN12HP */
+
 static void
-emit_media_cs_state(struct anv_compute_pipeline *pipeline,
-                    const struct anv_device *device)
+emit_compute_state(struct anv_compute_pipeline *pipeline,
+                   const struct anv_device *device)
 {
    const struct brw_cs_prog_data *cs_prog_data = get_cs_prog_data(pipeline);
 
@@ -2447,6 +2474,8 @@ emit_media_cs_state(struct anv_compute_pipeline *pipeline,
                                         &desc);
 }
 
+#endif /* #if GEN_GEN > 12 || GEN_IS_GEN12HP */
+
 static VkResult
 compute_pipeline_create(
     VkDevice                                    _device,
@@ -2496,7 +2525,7 @@ compute_pipeline_create(
       return result;
    }
 
-   emit_media_cs_state(pipeline, device);
+   emit_compute_state(pipeline, device);
 
    *pPipeline = anv_pipeline_to_handle(&pipeline->base);
 



More information about the mesa-commit mailing list