Commit 01b4ae38 authored by Jiadong Zhu's avatar Jiadong Zhu Committed by Alex Deucher

drm/amdgpu/mes: implement amdgpu_mes_reset_hw_queue_mmio

The reset_queue api could be used from kfd or kgd.

v2: add use_mmio parameter for mes_reset_legacy_queue.
Acked-by: default avatarVitaly Prosyak <vitaly.prosyak@amd.com>
Signed-off-by: default avatarJiadong Zhu <Jiadong.Zhu@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 8b2429a1
...@@ -826,6 +826,24 @@ int amdgpu_mes_reset_hw_queue(struct amdgpu_device *adev, int queue_id) ...@@ -826,6 +826,24 @@ int amdgpu_mes_reset_hw_queue(struct amdgpu_device *adev, int queue_id)
return 0; return 0;
} }
int amdgpu_mes_reset_hw_queue_mmio(struct amdgpu_device *adev, int queue_type,
int me_id, int pipe_id, int queue_id, int vmid)
{
struct mes_reset_queue_input queue_input;
int r;
queue_input.use_mmio = true;
queue_input.me_id = me_id;
queue_input.pipe_id = pipe_id;
queue_input.queue_id = queue_id;
queue_input.vmid = vmid;
r = adev->mes.funcs->reset_hw_queue(&adev->mes, &queue_input);
if (r)
DRM_ERROR("failed to reset hardware queue by mmio, queue id = %d\n",
queue_id);
return r;
}
int amdgpu_mes_map_legacy_queue(struct amdgpu_device *adev, int amdgpu_mes_map_legacy_queue(struct amdgpu_device *adev,
struct amdgpu_ring *ring) struct amdgpu_ring *ring)
{ {
...@@ -883,11 +901,13 @@ int amdgpu_mes_reset_legacy_queue(struct amdgpu_device *adev, ...@@ -883,11 +901,13 @@ int amdgpu_mes_reset_legacy_queue(struct amdgpu_device *adev,
queue_input.queue_type = ring->funcs->type; queue_input.queue_type = ring->funcs->type;
queue_input.doorbell_offset = ring->doorbell_index; queue_input.doorbell_offset = ring->doorbell_index;
queue_input.me_id = ring->me;
queue_input.pipe_id = ring->pipe; queue_input.pipe_id = ring->pipe;
queue_input.queue_id = ring->queue; queue_input.queue_id = ring->queue;
queue_input.mqd_addr = amdgpu_bo_gpu_offset(ring->mqd_obj); queue_input.mqd_addr = amdgpu_bo_gpu_offset(ring->mqd_obj);
queue_input.wptr_addr = ring->wptr_gpu_addr; queue_input.wptr_addr = ring->wptr_gpu_addr;
queue_input.vmid = vmid; queue_input.vmid = vmid;
queue_input.use_mmio = use_mmio;
r = adev->mes.funcs->reset_legacy_queue(&adev->mes, &queue_input); r = adev->mes.funcs->reset_legacy_queue(&adev->mes, &queue_input);
if (r) if (r)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment