]> git.hungrycats.org Git - linux/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 06:17:31 +0000 (08:17 +0200)
commit6a2360b2d0ac3b3dc4c6e1d9a2e613d41d61e1ce
tree4235018c5fa39076dea26554b35136f62c2b283b
parent17512079fe0b94dbe42f2ae44bfeb93d8b9aba5d
drm/vmwgfx: Unpin the screen object backup buffer when not used

[ Upstream commit 20fb5a635a0c8478ac98f15cfafc2ea83df29565 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c