Skip to content

Commit e9d951a

Browse files
ChristianKoenigAMDalexdeucher
authored andcommitted
drm/amdgpu: take a BO reference in the display code
No need for the GEM reference here. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 6d99905 commit e9d951a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static void amdgpu_unpin_work_func(struct work_struct *__work)
109109
} else
110110
DRM_ERROR("failed to reserve buffer after flip\n");
111111

112-
drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base);
112+
amdgpu_bo_unref(&work->old_rbo);
113113
kfree(work->shared);
114114
kfree(work);
115115
}
@@ -148,8 +148,8 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc,
148148
obj = old_amdgpu_fb->obj;
149149

150150
/* take a reference to the old object */
151-
drm_gem_object_reference(obj);
152151
work->old_rbo = gem_to_amdgpu_bo(obj);
152+
amdgpu_bo_ref(work->old_rbo);
153153

154154
new_amdgpu_fb = to_amdgpu_framebuffer(fb);
155155
obj = new_amdgpu_fb->obj;
@@ -222,7 +222,7 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc,
222222
amdgpu_bo_unreserve(new_rbo);
223223

224224
cleanup:
225-
drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base);
225+
amdgpu_bo_unref(&work->old_rbo);
226226
fence_put(work->excl);
227227
for (i = 0; i < work->shared_count; ++i)
228228
fence_put(work->shared[i]);

0 commit comments

Comments
 (0)