diff options
| author | Rex Zhu <[email protected]> | 2018-08-22 05:45:25 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2019-06-21 02:21:06 +0000 |
| commit | ba0c13b7747ba0157603414366bbe5a00a2f32cd (patch) | |
| tree | 4335a082dc9eeff01de757dcf95baf9f42572eef /drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | |
| parent | drm/amdgpu: Add struct kiq_pm4_funcs into kiq struct (diff) | |
| download | kernel-ba0c13b7747ba0157603414366bbe5a00a2f32cd.tar.gz kernel-ba0c13b7747ba0157603414366bbe5a00a2f32cd.zip | |
drm/amdgpu: Add common gfx func Disable kcq via kiq
so can be shared with gfx8 and gfx9
Reviewed-by: Alex Deucher <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Rex Zhu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c index 15e9f120ff84..ad159e06cfb2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c @@ -431,6 +431,25 @@ void amdgpu_gfx_mqd_sw_fini(struct amdgpu_device *adev) &ring->mqd_ptr); } +int amdgpu_gfx_disable_kcq(struct amdgpu_device *adev) +{ + struct amdgpu_kiq *kiq = &adev->gfx.kiq; + struct amdgpu_ring *kiq_ring = &kiq->ring; + int i; + + if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues) + return -EINVAL; + + if (amdgpu_ring_alloc(kiq_ring, kiq->pmf->unmap_queues_size * + adev->gfx.num_compute_rings)) + return -ENOMEM; + + for (i = 0; i < adev->gfx.num_compute_rings; i++) + kiq->pmf->kiq_unmap_queues(kiq_ring, &adev->gfx.compute_ring[i], true); + + return amdgpu_ring_test_ring(kiq_ring); +} + /* amdgpu_gfx_off_ctrl - Handle gfx off feature enable/disable * * @adev: amdgpu_device pointer |
