aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2017-07-27 11:43:00 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-08-15 14:45:57 -0400
commit078af1a3e9d7b47f3e37ea25640023cf2e8b4d51 (patch)
treed89ebe9b58fa2e8e141ab36b6e6ef8afb781d7f6 /drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
parenta4a02777892c16d98bbcc2ea2add47950bfbf9e0 (diff)
drm/amdgpu: use amdgpu_bo_free_kernel more often
Saves us even more loc. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c37
1 files changed, 3 insertions, 34 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
index faf8d28303e0..d228f5a99044 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
@@ -2217,40 +2217,9 @@ static void gfx_v6_0_ring_emit_vm_flush(struct amdgpu_ring *ring,
2217 2217
2218static void gfx_v6_0_rlc_fini(struct amdgpu_device *adev) 2218static void gfx_v6_0_rlc_fini(struct amdgpu_device *adev)
2219{ 2219{
2220 int r; 2220 amdgpu_bo_free_kernel(&adev->gfx.rlc.save_restore_obj, NULL, NULL);
2221 2221 amdgpu_bo_free_kernel(&adev->gfx.rlc.clear_state_obj, NULL, NULL);
2222 if (adev->gfx.rlc.save_restore_obj) { 2222 amdgpu_bo_free_kernel(&adev->gfx.rlc.cp_table_obj, NULL, NULL);
2223 r = amdgpu_bo_reserve(adev->gfx.rlc.save_restore_obj, true);
2224 if (unlikely(r != 0))
2225 dev_warn(adev->dev, "(%d) reserve RLC sr bo failed\n", r);
2226 amdgpu_bo_unpin(adev->gfx.rlc.save_restore_obj);
2227 amdgpu_bo_unreserve(adev->gfx.rlc.save_restore_obj);
2228
2229 amdgpu_bo_unref(&adev->gfx.rlc.save_restore_obj);
2230 adev->gfx.rlc.save_restore_obj = NULL;
2231 }
2232
2233 if (adev->gfx.rlc.clear_state_obj) {
2234 r = amdgpu_bo_reserve(adev->gfx.rlc.clear_state_obj, true);
2235 if (unlikely(r != 0))
2236 dev_warn(adev->dev, "(%d) reserve RLC c bo failed\n", r);
2237 amdgpu_bo_unpin(adev->gfx.rlc.clear_state_obj);
2238 amdgpu_bo_unreserve(adev->gfx.rlc.clear_state_obj);
2239
2240 amdgpu_bo_unref(&adev->gfx.rlc.clear_state_obj);
2241 adev->gfx.rlc.clear_state_obj = NULL;
2242 }
2243
2244 if (adev->gfx.rlc.cp_table_obj) {
2245 r = amdgpu_bo_reserve(adev->gfx.rlc.cp_table_obj, true);
2246 if (unlikely(r != 0))
2247 dev_warn(adev->dev, "(%d) reserve RLC cp table bo failed\n", r);
2248 amdgpu_bo_unpin(adev->gfx.rlc.cp_table_obj);
2249 amdgpu_bo_unreserve(adev->gfx.rlc.cp_table_obj);
2250
2251 amdgpu_bo_unref(&adev->gfx.rlc.cp_table_obj);
2252 adev->gfx.rlc.cp_table_obj = NULL;
2253 }
2254} 2223}
2255 2224
2256static int gfx_v6_0_rlc_init(struct amdgpu_device *adev) 2225static int gfx_v6_0_rlc_init(struct amdgpu_device *adev)