diff options
author | Jack Xiao <Jack.Xiao@amd.com> | 2019-05-06 16:40:48 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-06-21 18:59:29 -0500 |
commit | 2c195b6cac59e2d60b75ac20379a7a48f5185c2c (patch) | |
tree | f9246924d555bb0918099b07b852390bb331da68 /drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | |
parent | e17a512a18c1f1dece8c3d4f9685c581052d3191 (diff) |
drm/amdgpu/gfx10: remove unnecessary waiting on gfx inactive
The following KIQ ring test could guarantee the previous unmap
has been done.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index 80b100caf628..b7b761f7e34e 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c @@ -3541,9 +3541,8 @@ static int gfx_v10_0_hw_init(void *handle) static int gfx_v10_0_kiq_disable_kgq(struct amdgpu_device *adev) { struct amdgpu_kiq *kiq = &adev->gfx.kiq; - struct amdgpu_ring *ring, *kiq_ring = &kiq->ring; - struct v10_gfx_mqd *mqd; - int r, i, j; + struct amdgpu_ring *kiq_ring = &kiq->ring; + int i; if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues) return -EINVAL; @@ -3552,33 +3551,9 @@ static int gfx_v10_0_kiq_disable_kgq(struct amdgpu_device *adev) adev->gfx.num_gfx_rings)) return -ENOMEM; - for (i = 0; i < adev->gfx.num_gfx_rings; i++) { - ring = &adev->gfx.gfx_ring[i]; - - r = amdgpu_bo_reserve(ring->mqd_obj, false); - if (unlikely(r != 0)) - return r; - - r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr); - if (!r) { - kiq->pmf->kiq_unmap_queues(kiq_ring, ring, - PREEMPT_QUEUES, 0, 0); - mqd = ring->mqd_ptr; - - for (j = 0; j < adev->usec_timeout; j++) { - if (!mqd->cp_gfx_hqd_active) - break; - udelay(1); - } - - if (j == adev->usec_timeout) - DRM_ERROR("failed to wait for gfx inactive\n"); - - amdgpu_bo_kunmap(ring->mqd_obj); - ring->mqd_ptr = NULL; - } - amdgpu_bo_unreserve(ring->mqd_obj); - } + for (i = 0; i < adev->gfx.num_gfx_rings; i++) + kiq->pmf->kiq_unmap_queues(kiq_ring, &adev->gfx.gfx_ring[i], + PREEMPT_QUEUES, 0, 0); return amdgpu_ring_test_ring(kiq_ring); } |