[Intel-gfx] [PATCH] intel/gtt: unmap pages after rewriting GTT table.

Dave Airlie airlied at gmail.com
Tue Jan 11 02:17:16 CET 2011


This fixes a regression caused by the GTT rework that
450f2b3d51025a1749b694ee13f0e4e23ed58750 is part off.

On my ILK laptop with DMAR enabled I was seeing the occasional
DMAR warning.

The ordering in the previous code was to rewrite the GTT table
before unampping the pages and that makes sense to me.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 drivers/char/agp/intel-gtt.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index 29ac6d4..bc8f759 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -1058,15 +1058,14 @@ static int intel_fake_agp_remove_entries(struct agp_memory *mem,
 		return -EINVAL;
 	}
 
-	if (USE_PCI_DMA_API && INTEL_GTT_GEN > 2)
-		intel_agp_unmap_memory(mem);
-
 	for (i = pg_start; i < (mem->page_count + pg_start); i++) {
 		intel_private.driver->write_entry(intel_private.scratch_page_dma,
 						  i, 0);
 	}
 	readl(intel_private.gtt+i-1);
 
+	if (USE_PCI_DMA_API && INTEL_GTT_GEN > 2)
+		intel_agp_unmap_memory(mem);
 	return 0;
 }
 
-- 
1.7.3.2




More information about the Intel-gfx mailing list