diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2019-05-21 13:08:30 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-05-22 12:43:29 +0200 |
commit | cb1f8814bbfcc2d0d7c499530e3d878ba04e4af2 (patch) | |
tree | cd684ec8fd8d9a94b0180a5b464a1a946c3dcd2d /drivers/gpu/drm/mgag200 | |
parent | 81da87f63a1edebcf8cbb811d387e353d9f89c7a (diff) | |
download | linux-cb1f8814bbfcc2d0d7c499530e3d878ba04e4af2.tar.gz linux-cb1f8814bbfcc2d0d7c499530e3d878ba04e4af2.tar.bz2 linux-cb1f8814bbfcc2d0d7c499530e3d878ba04e4af2.zip |
drm: Rename reserve/unreserve to lock/unlock in GEM VRAM helpers
To align with the rest of DRM terminology, the GEM VRAM helpers now use
lock and unlock in places where reserve and unreserve where used before.
All callers have been adapted.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20190521110831.20200-3-tzimmermann@suse.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/mgag200')
-rw-r--r-- | drivers/gpu/drm/mgag200/mgag200_cursor.c | 40 | ||||
-rw-r--r-- | drivers/gpu/drm/mgag200/mgag200_fb.c | 11 |
2 files changed, 25 insertions, 26 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_cursor.c b/drivers/gpu/drm/mgag200/mgag200_cursor.c index 1c4fc85315a0..06a8c076cb33 100644 --- a/drivers/gpu/drm/mgag200/mgag200_cursor.c +++ b/drivers/gpu/drm/mgag200/mgag200_cursor.c @@ -23,9 +23,9 @@ static void mga_hide_cursor(struct mga_device *mdev) WREG8(MGA_CURPOSXL, 0); WREG8(MGA_CURPOSXH, 0); if (mdev->cursor.pixels_1->pin_count) - drm_gem_vram_unpin_reserved(mdev->cursor.pixels_1); + drm_gem_vram_unpin_locked(mdev->cursor.pixels_1); if (mdev->cursor.pixels_2->pin_count) - drm_gem_vram_unpin_reserved(mdev->cursor.pixels_2); + drm_gem_vram_unpin_locked(mdev->cursor.pixels_2); } int mga_crtc_cursor_set(struct drm_crtc *crtc, @@ -80,53 +80,53 @@ int mga_crtc_cursor_set(struct drm_crtc *crtc, if (!obj) return -ENOENT; - ret = drm_gem_vram_reserve(pixels_1, true); + ret = drm_gem_vram_lock(pixels_1, true); if (ret) { WREG8(MGA_CURPOSXL, 0); WREG8(MGA_CURPOSXH, 0); goto out_unref; } - ret = drm_gem_vram_reserve(pixels_2, true); + ret = drm_gem_vram_lock(pixels_2, true); if (ret) { WREG8(MGA_CURPOSXL, 0); WREG8(MGA_CURPOSXH, 0); - drm_gem_vram_unreserve(pixels_1); - goto out_unreserve1; + drm_gem_vram_unlock(pixels_1); + goto out_unlock1; } /* Move cursor buffers into VRAM if they aren't already */ if (!pixels_1->pin_count) { - ret = drm_gem_vram_pin_reserved(pixels_1, - DRM_GEM_VRAM_PL_FLAG_VRAM); + ret = drm_gem_vram_pin_locked(pixels_1, + DRM_GEM_VRAM_PL_FLAG_VRAM); if (ret) goto out1; gpu_addr = drm_gem_vram_offset(pixels_1); if (gpu_addr < 0) { - drm_gem_vram_unpin_reserved(pixels_1); + drm_gem_vram_unpin_locked(pixels_1); goto out1; } mdev->cursor.pixels_1_gpu_addr = gpu_addr; } if (!pixels_2->pin_count) { - ret = drm_gem_vram_pin_reserved(pixels_2, - DRM_GEM_VRAM_PL_FLAG_VRAM); + ret = drm_gem_vram_pin_locked(pixels_2, + DRM_GEM_VRAM_PL_FLAG_VRAM); if (ret) { - drm_gem_vram_unpin_reserved(pixels_1); + drm_gem_vram_unpin_locked(pixels_1); goto out1; } gpu_addr = drm_gem_vram_offset(pixels_2); if (gpu_addr < 0) { - drm_gem_vram_unpin_reserved(pixels_1); - drm_gem_vram_unpin_reserved(pixels_2); + drm_gem_vram_unpin_locked(pixels_1); + drm_gem_vram_unpin_locked(pixels_2); goto out1; } mdev->cursor.pixels_2_gpu_addr = gpu_addr; } gbo = drm_gem_vram_of_gem(obj); - ret = drm_gem_vram_reserve(gbo, true); + ret = drm_gem_vram_lock(gbo, true); if (ret) { - dev_err(&dev->pdev->dev, "failed to reserve user bo\n"); + dev_err(&dev->pdev->dev, "failed to lock user bo\n"); goto out1; } src = drm_gem_vram_kmap(gbo, true, NULL); @@ -250,13 +250,13 @@ int mga_crtc_cursor_set(struct drm_crtc *crtc, out3: drm_gem_vram_kunmap(gbo); out2: - drm_gem_vram_unreserve(gbo); + drm_gem_vram_unlock(gbo); out1: if (ret) mga_hide_cursor(mdev); - drm_gem_vram_unreserve(pixels_1); -out_unreserve1: - drm_gem_vram_unreserve(pixels_2); + drm_gem_vram_unlock(pixels_1); +out_unlock1: + drm_gem_vram_unlock(pixels_2); out_unref: drm_gem_object_put_unlocked(obj); diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c b/drivers/gpu/drm/mgag200/mgag200_fb.c index 87217bdce9f8..97c575a9a86f 100644 --- a/drivers/gpu/drm/mgag200/mgag200_fb.c +++ b/drivers/gpu/drm/mgag200/mgag200_fb.c @@ -36,13 +36,12 @@ static void mga_dirty_update(struct mga_fbdev *mfbdev, obj = mfbdev->mfb.obj; gbo = drm_gem_vram_of_gem(obj); - /* - * try and reserve the BO, if we fail with busy - * then the BO is being moved and we should - * store up the damage until later. + /* Try to lock the BO. If we fail with -EBUSY then + * the BO is being moved and we should store up the + * damage until later. */ if (drm_can_sleep()) - ret = drm_gem_vram_reserve(gbo, true); + ret = drm_gem_vram_lock(gbo, true); if (ret) { if (ret != -EBUSY) return; @@ -101,7 +100,7 @@ static void mga_dirty_update(struct mga_fbdev *mfbdev, drm_gem_vram_kunmap(gbo); out: - drm_gem_vram_unreserve(gbo); + drm_gem_vram_unlock(gbo); } static void mga_fillrect(struct fb_info *info, |