From: Jack Xiao <[email protected]>

mqd_stride_size is used to calculate the next mqd offset
for cooperative dispatch.

Signed-off-by: Jack Xiao <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h    | 1 +
 drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index de8fb746daf17..91a9236d19d7d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -774,6 +774,7 @@ struct amdgpu_mqd_prop {
        uint64_t eop_gpu_addr;
        uint32_t hqd_pipe_priority;
        uint32_t hqd_queue_priority;
+       uint32_t mqd_stride_size;
        bool allow_tunneling;
        bool hqd_active;
        uint64_t shadow_addr;
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
index 6a4ecded103aa..0e57c367d9819 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
@@ -2217,6 +2217,9 @@ static int gfx_v12_1_compute_mqd_init(struct 
amdgpu_device *adev, void *m,
        mqd->cp_hqd_pipe_priority = prop->hqd_pipe_priority;
        mqd->cp_hqd_queue_priority = prop->hqd_queue_priority;
 
+       mqd->cp_mqd_stride_size = prop->mqd_stride_size ? prop->mqd_stride_size 
:
+               sizeof(struct v12_1_compute_mqd);
+
        mqd->cp_hqd_active = prop->hqd_active;
 
        return 0;
-- 
2.52.0

Reply via email to