All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/ttm: Set CPU caching mode to cached for BOs being swapped out
@ 2015-11-05  8:08 Michel Dänzer
  2015-11-05  8:47 ` Thomas Hellstrom
  0 siblings, 1 reply; 5+ messages in thread
From: Michel Dänzer @ 2015-11-05  8:08 UTC (permalink / raw)
  To: dri-devel

From: Michel Dänzer <michel.daenzer@amd.com>

I ran into the BUG_ON in ttm_tt_swapout, presumably the BO being swapped
out was using a write-combined CPU mapping.

Instead of BUGging out, just set the caching mode to what's needed.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 drivers/gpu/drm/ttm/ttm_tt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index 4e19d0f..c2794eb 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -334,7 +334,8 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistent_swap_storage)
 	int ret = -ENOMEM;
 
 	BUG_ON(ttm->state != tt_unbound && ttm->state != tt_unpopulated);
-	BUG_ON(ttm->caching_state != tt_cached);
+
+	ttm_tt_set_caching(ttm, tt_cached);
 
 	if (!persistent_swap_storage) {
 		swap_storage = shmem_file_setup("ttm swap",
-- 
2.6.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-11-09  9:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-05  8:08 [PATCH] drm/ttm: Set CPU caching mode to cached for BOs being swapped out Michel Dänzer
2015-11-05  8:47 ` Thomas Hellstrom
2015-11-06  2:33   ` Michel Dänzer
2015-11-06 13:02     ` Thomas Hellstrom
2015-11-09  9:16       ` Michel Dänzer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.