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.
Unified · Split
| @@ -353,7 +353,8 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, · 352 unmodified lines | ||
| 353 | 353 | * Don't move nonexistent data. Clear destination instead. |
| 354 | 354 | */ |
| 355 | 355 | if (old_iomap == NULL && |
| 356 | − (ttm == NULL || ttm->state == tt_unpopulated)) { | |
| 356 | + (ttm == NULL || (ttm->state == tt_unpopulated && | |
| 357 | + !(ttm->page_flags & TTM_PAGE_FLAG_SWAPPED)))) { | |
| 357 | 358 | memset_io(new_iomap, 0, new_mem->num_pages*PAGE_SIZE); |
| 358 | 359 | goto out2; |
| 359 | 360 | } |