Remove queue after reset flag is required to remove a queue that has
been successfully reset to clean up the MES' internal state.

Signed-off-by: Jonathan Kim <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h       | 1 +
 drivers/gpu/drm/amd/amdgpu/mes_v11_0.c        | 1 +
 drivers/gpu/drm/amd/amdgpu/mes_v12_0.c        | 1 +
 drivers/gpu/drm/amd/include/mes_v11_api_def.h | 3 ++-
 drivers/gpu/drm/amd/include/mes_v12_api_def.h | 3 ++-
 5 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h
index 97c137c90f97..9c27a68cb82f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h
@@ -239,6 +239,7 @@ struct mes_add_queue_input {
 struct mes_remove_queue_input {
        uint32_t        doorbell_offset;
        uint64_t        gang_context_addr;
+       bool            remove_queue_after_reset;
 };
 
 struct mes_map_legacy_queue_input {
diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c 
b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
index da575bb1377f..d2a34b4d1797 100644
--- a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
@@ -378,6 +378,7 @@ static int mes_v11_0_remove_hw_queue(struct amdgpu_mes *mes,
 
        mes_remove_queue_pkt.doorbell_offset = input->doorbell_offset;
        mes_remove_queue_pkt.gang_context_addr = input->gang_context_addr;
+       mes_remove_queue_pkt.remove_queue_after_reset = 
input->remove_queue_after_reset;
 
        return mes_v11_0_submit_pkt_and_poll_completion(mes,
                        &mes_remove_queue_pkt, sizeof(mes_remove_queue_pkt),
diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c 
b/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
index 79dd2261ad04..0d580d1b5794 100644
--- a/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
@@ -365,6 +365,7 @@ static int mes_v12_0_remove_hw_queue(struct amdgpu_mes *mes,
 
        mes_remove_queue_pkt.doorbell_offset = input->doorbell_offset;
        mes_remove_queue_pkt.gang_context_addr = input->gang_context_addr;
+       mes_remove_queue_pkt.remove_queue_after_reset = 
input->remove_queue_after_reset;
 
        return mes_v12_0_submit_pkt_and_poll_completion(mes,
                        AMDGPU_MES_SCHED_PIPE,
diff --git a/drivers/gpu/drm/amd/include/mes_v11_api_def.h 
b/drivers/gpu/drm/amd/include/mes_v11_api_def.h
index ab1cfc92dbeb..f9629d42ada2 100644
--- a/drivers/gpu/drm/amd/include/mes_v11_api_def.h
+++ b/drivers/gpu/drm/amd/include/mes_v11_api_def.h
@@ -345,7 +345,8 @@ union MESAPI__REMOVE_QUEUE {
                        uint32_t unmap_kiq_utility_queue  : 1;
                        uint32_t preempt_legacy_gfx_queue : 1;
                        uint32_t unmap_legacy_queue       : 1;
-                       uint32_t reserved                 : 28;
+                       uint32_t remove_queue_after_reset : 1;
+                       uint32_t reserved                 : 27;
                };
                struct MES_API_STATUS       api_status;
 
diff --git a/drivers/gpu/drm/amd/include/mes_v12_api_def.h 
b/drivers/gpu/drm/amd/include/mes_v12_api_def.h
index 69611c7e30e3..2f12cba4eb66 100644
--- a/drivers/gpu/drm/amd/include/mes_v12_api_def.h
+++ b/drivers/gpu/drm/amd/include/mes_v12_api_def.h
@@ -399,7 +399,8 @@ union MESAPI__REMOVE_QUEUE {
                        uint32_t unmap_kiq_utility_queue  : 1;
                        uint32_t preempt_legacy_gfx_queue : 1;
                        uint32_t unmap_legacy_queue       : 1;
-                       uint32_t reserved                 : 28;
+                       uint32_t remove_queue_after_reset : 1;
+                       uint32_t reserved                 : 27;
                };
                struct MES_API_STATUS           api_status;
 
-- 
2.34.1

Reply via email to