drm/vmwgfx: Make sure we unpin no longer needed buffers
authorZack Rusin <zackr@vmware.com>
Thu, 14 Jan 2021 23:38:16 +0000 (18:38 -0500)
committerZack Rusin <zackr@vmware.com>
Wed, 20 Jan 2021 22:04:56 +0000 (17:04 -0500)
commitd1a73c641afd2617bd80bce8b71a096fc5b74b7e
tree34d59fa7650a368c7ab9ce962704e01f720aee22
parentca230ab18791f418faac19d00f3c35e2dbc25dfe
drm/vmwgfx: Make sure we unpin no longer needed buffers

We were not correctly unpinning no longer needed buffers. In particular
vmw_buffer_object, which is internally often pinned on creation wasn't
unpinned on destruction and none of the internal MOB buffers were
unpinned before being put back. Technically this existed for a
long time but commit 57fcd550eb15 ("drm/ttm: Warn on pinning without
holding a reference") introduced a WARN_ON which was filling up the
kernel logs rather quickly.

Quite frankly internal usage of vmw_buffer_object and in general
pinning needs to be refactored in vmwgfx but for now this makes
it work.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Fixes: 57fcd550eb15 ("drm/ttm: Warn on pinning without holding a reference")
Link: https://patchwork.freedesktop.org/patch/414984/?series=86052&rev=1
Cc: Huang Rui <ray.huang@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Christian Koenig <christian.koenig@amd.com>
Cc: dri-devel@lists.freedesktop.org
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
drivers/gpu/drm/vmwgfx/vmwgfx_mob.c