Commit 9977e5b4 authored by Thomas Zimmermann's avatar Thomas Zimmermann Committed by Gerd Hoffmann

drm: Assert that BO is locked in drm_gem_vram_{pin, unpin}_locked()

We may not call drm_gem_vram_{pin,unpin}_locked() with an unlocked
BO. Now test for this.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20190521110831.20200-4-tzimmermann@suse.deSigned-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent cb1f8814
......@@ -284,6 +284,8 @@ int drm_gem_vram_pin_locked(struct drm_gem_vram_object *gbo,
int i, ret;
struct ttm_operation_ctx ctx = { false, false };
lockdep_assert_held(&gbo->bo.resv->lock.base);
if (gbo->pin_count) {
++gbo->pin_count;
return 0;
......@@ -361,6 +363,8 @@ int drm_gem_vram_unpin_locked(struct drm_gem_vram_object *gbo)
int i, ret;
struct ttm_operation_ctx ctx = { false, false };
lockdep_assert_held(&gbo->bo.resv->lock.base);
if (WARN_ON_ONCE(!gbo->pin_count))
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment