summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2021-03-22 20:04:11 +0300
committerZack Rusin <zackr@vmware.com>2021-04-14 23:41:31 +0300
commit2ef4fb92363c44e8a6f93fd0877b6a7dee6f874d (patch)
treec0b3475babab37484f784507a2d5fb163b53e169 /drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c
parent68ce556bd1643498080af310d4544f46f3c4f3df (diff)
downloadlinux-2ef4fb92363c44e8a6f93fd0877b6a7dee6f874d.tar.xz
drm/vmwgfx: Make sure bo's are unpinned before putting them back
During cotable resize we pin the backup buffer to make sure the trylock doesn't fail. We were never unpinning the backup buffer resulting in every subsequent cotable resize trying to release a pinned bo. After we copy the old backup to the new we can release the pin. Mob's are always pinned so we just have to make sure we unpin them before releasing them. Reviewed-by: Thomas Hellström (Intel) <thomas_os@shipmail.org> Fixes: d1a73c641afd ("drm/vmwgfx: Make sure we unpin no longer needed buffers") Link: https://patchwork.freedesktop.org/patch/msgid/20210413205938.788366-1-zackr@vmware.com Signed-off-by: Zack Rusin <zackr@vmware.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c
index ba658fa9cf6c..183571c387b7 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c
@@ -481,11 +481,15 @@ static int vmw_cotable_resize(struct vmw_resource *res, size_t new_size)
vmw_bo_unreference(&old_buf);
res->id = vcotbl->type;
+ /* Release the pin acquired in vmw_bo_init */
+ ttm_bo_unpin(bo);
+
return 0;
out_map_new:
ttm_bo_kunmap(&old_map);
out_wait:
+ ttm_bo_unpin(bo);
ttm_bo_unreserve(bo);
vmw_bo_unreference(&buf);