summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorThomas Hellstrom2013-12-21 22:23:02 +0100
committerDave Airlie2013-12-23 01:33:07 +0100
commit2e6d8b469b8000b4aa9b95dfcebd89eafae3e8cf (patch)
tree5613851f2728a14177a9e48c26e07837ebec3bcb /drivers/gpu
parentgpu: fix qxl missing crc32_le (diff)
downloadkernel-qcow2-linux-2e6d8b469b8000b4aa9b95dfcebd89eafae3e8cf.tar.gz
kernel-qcow2-linux-2e6d8b469b8000b4aa9b95dfcebd89eafae3e8cf.tar.xz
kernel-qcow2-linux-2e6d8b469b8000b4aa9b95dfcebd89eafae3e8cf.zip
drm/ttm: Fix swapin regression
Commit "drm/ttm: Don't move non-existing data" didn't take the swapped-out corner case into account. This patch corrects that. Fixes blank screen after attempted suspend / hibernate on vmwgfx. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo_util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 15b86a94949d..406152152315 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -353,7 +353,8 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
* Don't move nonexistent data. Clear destination instead.
*/
if (old_iomap == NULL &&
- (ttm == NULL || ttm->state == tt_unpopulated)) {
+ (ttm == NULL || (ttm->state == tt_unpopulated &&
+ !(ttm->page_flags & TTM_PAGE_FLAG_SWAPPED)))) {
memset_io(new_iomap, 0, new_mem->num_pages*PAGE_SIZE);
goto out2;
}