summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/bochs/bochs_mm.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-01-11 06:37:48 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-01-14 08:39:14 +0100
commit0bcdda5e35d717a394d8496f4d4181ddd82d0c12 (patch)
tree3f4128ee01c2cec25db6823b6e9dedba27357322 /drivers/gpu/drm/bochs/bochs_mm.c
parentdde8fb5555a5987775a0388bf976510a302f1b11 (diff)
downloadlinux-0bcdda5e35d717a394d8496f4d4181ddd82d0c12.tar.bz2
drm/bochs: move ttm_bo_(un)reserve calls into bochs_bo_{pin, unpin}
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20190111053752.4004-13-kraxel@redhat.com
Diffstat (limited to 'drivers/gpu/drm/bochs/bochs_mm.c')
-rw-r--r--drivers/gpu/drm/bochs/bochs_mm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c
index 5a0e092847ab..fcbf35456d4e 100644
--- a/drivers/gpu/drm/bochs/bochs_mm.c
+++ b/drivers/gpu/drm/bochs/bochs_mm.c
@@ -223,7 +223,11 @@ int bochs_bo_pin(struct bochs_bo *bo, u32 pl_flag)
bochs_ttm_placement(bo, pl_flag);
for (i = 0; i < bo->placement.num_placement; i++)
bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
+ ret = ttm_bo_reserve(&bo->bo, true, false, NULL);
+ if (ret)
+ return ret;
ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx);
+ ttm_bo_unreserve(&bo->bo);
if (ret)
return ret;
@@ -247,7 +251,11 @@ int bochs_bo_unpin(struct bochs_bo *bo)
for (i = 0; i < bo->placement.num_placement; i++)
bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT;
+ ret = ttm_bo_reserve(&bo->bo, true, false, NULL);
+ if (ret)
+ return ret;
ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx);
+ ttm_bo_unreserve(&bo->bo);
if (ret)
return ret;