Skip to contentSkip to conversation

drm/ttm: Don't clear page metadata of imported sg pages

PATCH In review Thomas Hellstrom 2 participants 2 messages Feb 5, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/ttm: Don't clear page metadata of imported sg pages

These page pointers shouldn't be visible to TTM in the first place, but until we fix that up, don't clear the page metadata because that will upset the exporter.

---
 drivers/gpu/drm/ttm/ttm_tt.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/ttm/ttm_tt.c +3 -0
index 9af9908..75f3190 100644
@@ -380,6 +380,9 @@ static void ttm_tt_clear_mapping(struct ttm_tt *ttm)
 	pgoff_t i;
 	struct page **page = ttm->pages;
 
+	if (ttm->page_flags & TTM_PAGE_FLAG_SG)
+		return;
+
 	for (i = 0; i < ttm->num_pages; ++i) {
 		(*page)->mapping = NULL;
 		(*page++)->index = 0;
Signature · 1 line
1.7.10.4
Reviewed-by on v1 1/1
#1 lore raw

----- Ursprungligt meddelande -----

Quoted 9 lines

These page pointers shouldn't be visible to TTM in the first place, but until we fix that up, don't clear the page metadata because that will upset the exporter.

---
 drivers/gpu/drm/ttm/ttm_tt.c |    3 +++
 1 file changed, 3 insertions(+)
Quoted 18 lines
drivers/gpu/drm/ttm/ttm_tt.c +3 -1
index 9af9908..75f3190 100644
@@ -380,6 +380,9 @@ static void ttm_tt_clear_mapping(struct ttm_tt *ttm)
 	pgoff_t i;
 	struct page **page = ttm->pages;
 
+	if (ttm->page_flags & TTM_PAGE_FLAG_SG)
+		return;
+
 	for (i = 0; i < ttm->num_pages; ++i) {
 		(*page)->mapping = NULL;
 		(*page++)->index = 0;
--

1.7.10.4