aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2018-08-22 01:45:25 -0400
committerAlex Deucher <alexander.deucher@amd.com>2019-06-20 22:21:06 -0400
commitba0c13b7747ba0157603414366bbe5a00a2f32cd (patch)
tree4335a082dc9eeff01de757dcf95baf9f42572eef
parentbc4a6f71355f8abda43b379a5c86735f1de57e58 (diff)
drm/amdgpu: Add common gfx func Disable kcq via kiq
so can be shared with gfx8 and gfx9 Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c19
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h1
2 files changed, 20 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)
431 &ring->mqd_ptr); 431 &ring->mqd_ptr);
432} 432}
433 433
434int amdgpu_gfx_disable_kcq(struct amdgpu_device *adev)
435{
436 struct amdgpu_kiq *kiq = &adev->gfx.kiq;
437 struct amdgpu_ring *kiq_ring = &kiq->ring;
438 int i;
439
440 if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues)
441 return -EINVAL;
442
443 if (amdgpu_ring_alloc(kiq_ring, kiq->pmf->unmap_queues_size *
444 adev->gfx.num_compute_rings))
445 return -ENOMEM;
446
447 for (i = 0; i < adev->gfx.num_compute_rings; i++)
448 kiq->pmf->kiq_unmap_queues(kiq_ring, &adev->gfx.compute_ring[i], true);
449
450 return amdgpu_ring_test_ring(kiq_ring);
451}
452
434/* amdgpu_gfx_off_ctrl - Handle gfx off feature enable/disable 453/* amdgpu_gfx_off_ctrl - Handle gfx off feature enable/disable
435 * 454 *
436 * @adev: amdgpu_device pointer 455 * @adev: amdgpu_device pointer
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
index 14d6f01db27b..b22421f2b6fe 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
@@ -353,6 +353,7 @@ int amdgpu_gfx_kiq_init(struct amdgpu_device *adev,
353int amdgpu_gfx_mqd_sw_init(struct amdgpu_device *adev, 353int amdgpu_gfx_mqd_sw_init(struct amdgpu_device *adev,
354 unsigned mqd_size); 354 unsigned mqd_size);
355void amdgpu_gfx_mqd_sw_fini(struct amdgpu_device *adev); 355void amdgpu_gfx_mqd_sw_fini(struct amdgpu_device *adev);
356int amdgpu_gfx_disable_kcq(struct amdgpu_device *adev);
356 357
357void amdgpu_gfx_compute_queue_acquire(struct amdgpu_device *adev); 358void amdgpu_gfx_compute_queue_acquire(struct amdgpu_device *adev);
358void amdgpu_gfx_graphics_queue_acquire(struct amdgpu_device *adev); 359void amdgpu_gfx_graphics_queue_acquire(struct amdgpu_device *adev);