drm/vmwgfx: Unpin the screen object backup buffer when not used
authorThomas Hellstrom <thellstrom@vmware.com>
Thu, 22 Mar 2018 09:35:18 +0000 (10:35 +0100)
committerThomas Hellstrom <thellstrom@vmware.com>
Thu, 22 Mar 2018 11:08:24 +0000 (12:08 +0100)
commit20fb5a635a0c8478ac98f15cfafc2ea83df29565
tree21801e5254a8e7ee292d8e25e541415fadb0b134
parent89dc15b76fd3b57d0b7d3bd3556bd6fa514e0257
drm/vmwgfx: Unpin the screen object backup buffer when not used

We were relying on the pinned screen object backup buffer to be destroyed
when not used. But if we hold a copy of the atomic state, like when
hibernating, the backup buffer might not be destroyed since it's
refcounted by the atomic state. This causes us to hibernate with a
buffer pinned in VRAM.

Fix this by only having the buffer pinned when it is actually used by a
screen object.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c