Add a modify flag and user_wptr to struct amdgpu_mqd_prop. When set,
init_mqd patches the MQD in place: keep the context-saved rptr and use
user_wptr as the wptr. KFD already patches the MQD in place for the same
disable/re-enable sequence.

v3: use an mqd_prop modify flag consumed by init_mqd instead of a
    separate per-IP update_mqd callback, per review.

Signed-off-by: Jesse Zhang <[email protected]>
Suggested-by: Alexander Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h
index 63670b41c26c..df4aae01b285 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h
@@ -494,6 +494,9 @@ struct amdgpu_mqd_prop {
        uint64_t ctx_save_area_addr;
        uint32_t ctx_save_area_size;
        uint32_t ctl_stack_size;
+       /* queue MODIFY: keep the context-saved rptr, use user_wptr as the wptr 
*/
+       bool modify;
+       u64 user_wptr;
 };
 
 struct amdgpu_mqd {
-- 
2.49.0

Reply via email to