Skip to content

Commit 18ee4ce

Browse files
Jack Xiaoalexdeucher
authored andcommitted
drm/amdgpu: add mes unmap legacy queue routine
For mes kiq has been taken over by mes sched, drv can't directly use mes kiq to unmap queues. drv has to use mes sched api to unmap legacy queue. Signed-off-by: Jack Xiao <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 14ab292 commit 18ee4ce

File tree

7 files changed

+526
-151
lines changed

7 files changed

+526
-151
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ int amdgpu_gfx_mqd_sw_init(struct amdgpu_device *adev,
367367

368368
/* create MQD for KIQ */
369369
ring = &adev->gfx.kiq.ring;
370-
if (!ring->mqd_obj) {
370+
if (!adev->enable_mes_kiq && !ring->mqd_obj) {
371371
/* originaly the KIQ MQD is put in GTT domain, but for SRIOV VRAM domain is a must
372372
* otherwise hypervisor trigger SAVE_VF fail after driver unloaded which mean MQD
373373
* deallocated and gart_unbind, to strict diverage we decide to use VRAM domain for
@@ -464,7 +464,7 @@ int amdgpu_gfx_disable_kcq(struct amdgpu_device *adev)
464464
{
465465
struct amdgpu_kiq *kiq = &adev->gfx.kiq;
466466
struct amdgpu_ring *kiq_ring = &kiq->ring;
467-
int i, r;
467+
int i, r = 0;
468468

469469
if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues)
470470
return -EINVAL;
@@ -479,7 +479,9 @@ int amdgpu_gfx_disable_kcq(struct amdgpu_device *adev)
479479
for (i = 0; i < adev->gfx.num_compute_rings; i++)
480480
kiq->pmf->kiq_unmap_queues(kiq_ring, &adev->gfx.compute_ring[i],
481481
RESET_QUEUES, 0, 0);
482-
r = amdgpu_ring_test_helper(kiq_ring);
482+
483+
if (adev->gfx.kiq.ring.sched.ready)
484+
r = amdgpu_ring_test_helper(kiq_ring);
483485
spin_unlock(&adev->gfx.kiq.ring_lock);
484486

485487
return r;

0 commit comments

Comments
 (0)