Commit 954e0a72 authored by Jack Xiao's avatar Jack Xiao Committed by Alex Deucher

drm/amdgpu/gfx10: add mes queue fence handling

From IH ring buffer, look up the coresponding kernel queue and process.
Signed-off-by: default avatarJack Xiao <Jack.Xiao@amd.com>
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 207e8bbe
...@@ -9188,31 +9188,51 @@ static int gfx_v10_0_eop_irq(struct amdgpu_device *adev, ...@@ -9188,31 +9188,51 @@ static int gfx_v10_0_eop_irq(struct amdgpu_device *adev,
int i; int i;
u8 me_id, pipe_id, queue_id; u8 me_id, pipe_id, queue_id;
struct amdgpu_ring *ring; struct amdgpu_ring *ring;
uint32_t mes_queue_id = entry->src_data[0];
DRM_DEBUG("IH: CP EOP\n"); DRM_DEBUG("IH: CP EOP\n");
me_id = (entry->ring_id & 0x0c) >> 2;
pipe_id = (entry->ring_id & 0x03) >> 0;
queue_id = (entry->ring_id & 0x70) >> 4;
switch (me_id) { if (adev->enable_mes && (mes_queue_id & AMDGPU_FENCE_MES_QUEUE_FLAG)) {
case 0: struct amdgpu_mes_queue *queue;
if (pipe_id == 0)
amdgpu_fence_process(&adev->gfx.gfx_ring[0]); mes_queue_id &= AMDGPU_FENCE_MES_QUEUE_ID_MASK;
else
amdgpu_fence_process(&adev->gfx.gfx_ring[1]); spin_lock(&adev->mes.queue_id_lock);
break; queue = idr_find(&adev->mes.queue_id_idr, mes_queue_id);
case 1: if (queue) {
case 2: DRM_DEBUG("process mes queue id = %d\n", mes_queue_id);
for (i = 0; i < adev->gfx.num_compute_rings; i++) { amdgpu_fence_process(queue->ring);
ring = &adev->gfx.compute_ring[i]; }
/* Per-queue interrupt is supported for MEC starting from VI. spin_unlock(&adev->mes.queue_id_lock);
* The interrupt can only be enabled/disabled per pipe instead of per queue. } else {
*/ me_id = (entry->ring_id & 0x0c) >> 2;
if ((ring->me == me_id) && (ring->pipe == pipe_id) && (ring->queue == queue_id)) pipe_id = (entry->ring_id & 0x03) >> 0;
amdgpu_fence_process(ring); queue_id = (entry->ring_id & 0x70) >> 4;
switch (me_id) {
case 0:
if (pipe_id == 0)
amdgpu_fence_process(&adev->gfx.gfx_ring[0]);
else
amdgpu_fence_process(&adev->gfx.gfx_ring[1]);
break;
case 1:
case 2:
for (i = 0; i < adev->gfx.num_compute_rings; i++) {
ring = &adev->gfx.compute_ring[i];
/* Per-queue interrupt is supported for MEC starting from VI.
* The interrupt can only be enabled/disabled per pipe instead
* of per queue.
*/
if ((ring->me == me_id) &&
(ring->pipe == pipe_id) &&
(ring->queue == queue_id))
amdgpu_fence_process(ring);
}
break;
} }
break;
} }
return 0; return 0;
} }
......
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