diff options
| author | Alex Deucher <alexander.deucher@amd.com> | 2017-03-27 16:54:06 -0400 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2017-03-29 23:55:15 -0400 |
| commit | e1d53aa880e359f94bb1141cc836ddbbc0080162 (patch) | |
| tree | 0ce4b65678e5735ed56a143c2ac12d2ecb4569f6 | |
| parent | e935c2116ecee327511a4fbde55a8ad211725280 (diff) | |
drm/amdgpu/gfx9: reserve mqd objects before mapping them
It's required.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index 7f6326fa6e2c..861b1eccd714 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c @@ -2186,30 +2186,40 @@ static int gfx_v9_0_kiq_resume(struct amdgpu_device *adev) gfx_v9_0_cp_compute_enable(adev, true); ring = &adev->gfx.kiq.ring; - if (!amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr)) { + + r = amdgpu_bo_reserve(ring->mqd_obj, false); + if (unlikely(r != 0)) + goto done; + + r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr); + if (!r) { r = gfx_v9_0_kiq_init_queue(ring, ring->mqd_ptr, ring->mqd_gpu_addr); amdgpu_bo_kunmap(ring->mqd_obj); ring->mqd_ptr = NULL; - if (r) - return r; - } else { - return r; } + amdgpu_bo_unreserve(ring->mqd_obj); + if (r) + goto done; for (i = 0; i < adev->gfx.num_compute_rings; i++) { ring = &adev->gfx.compute_ring[i]; - if (!amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr)) { + + r = amdgpu_bo_reserve(ring->mqd_obj, false); + if (unlikely(r != 0)) + goto done; + r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr); + if (!r) { r = gfx_v9_0_kiq_init_queue(ring, ring->mqd_ptr, ring->mqd_gpu_addr); amdgpu_bo_kunmap(ring->mqd_obj); ring->mqd_ptr = NULL; - if (r) - return r; - } else { - return r; } + amdgpu_bo_unreserve(ring->mqd_obj); + if (r) + goto done; } - return 0; +done: + return r; } static int gfx_v9_0_cp_resume(struct amdgpu_device *adev) |
