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>
This commit is contained in:
Thomas Hellstrom 2013-12-21 22:23:02 +01:00 коммит произвёл Dave Airlie
Родитель 488574dbc4
Коммит 2e6d8b469b
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -353,7 +353,8 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
* Don't move nonexistent data. Clear destination instead. * Don't move nonexistent data. Clear destination instead.
*/ */
if (old_iomap == NULL && 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); memset_io(new_iomap, 0, new_mem->num_pages*PAGE_SIZE);
goto out2; goto out2;
} }