From e0b8b0ee043b5e1f4283aac28ee3df7b7513abe5 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 4 Mar 2010 12:24:01 +0000 Subject: [PATCH] agp/intel: Disable/enable GTT to enforce TLB flush on i8xx Fixes: Bug 26345 - [i845G] CPU/GPU incoherency http://bugs.freedesktop.org/show_bug.cgi?id=26345 Signed-off-by: Chris Wilson --- drivers/char/agp/intel-agp.c | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index 0c2edeb..1c836b0 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c @@ -1485,6 +1485,14 @@ static void intel_tlbflush(struct agp_memory *mem) pci_write_config_dword(agp_bridge->dev, INTEL_AGPCTRL, 0x2280); } +static void intel_830_tlbflush(struct agp_memory *mem) +{ + writel(agp_bridge->gatt_bus_addr, intel_private.registers+I810_PGETBL_CTL); + readl(intel_private.registers+I810_PGETBL_CTL); /* PCI Posting. */ + + writel(agp_bridge->gatt_bus_addr|I810_PGETBL_ENABLED, intel_private.registers+I810_PGETBL_CTL); + readl(intel_private.registers+I810_PGETBL_CTL); /* PCI Posting. */ +} static void intel_8xx_tlbflush(struct agp_memory *mem) { @@ -2005,7 +2013,7 @@ static const struct agp_bridge_driver intel_830mp_driver = { .configure = intel_830mp_configure, .fetch_size = intel_8xx_fetch_size, .cleanup = intel_8xx_cleanup, - .tlb_flush = intel_8xx_tlbflush, + .tlb_flush = intel_830_tlbflush, .mask_memory = agp_generic_mask_memory, .masks = intel_generic_masks, .agp_enable = agp_generic_enable, @@ -2031,7 +2039,7 @@ static const struct agp_bridge_driver intel_840_driver = { .configure = intel_840_configure, .fetch_size = intel_8xx_fetch_size, .cleanup = intel_8xx_cleanup, - .tlb_flush = intel_8xx_tlbflush, + .tlb_flush = intel_830_tlbflush, .mask_memory = agp_generic_mask_memory, .masks = intel_generic_masks, .agp_enable = agp_generic_enable, @@ -2057,7 +2065,7 @@ static const struct agp_bridge_driver intel_845_driver = { .configure = intel_845_configure, .fetch_size = intel_8xx_fetch_size, .cleanup = intel_8xx_cleanup, - .tlb_flush = intel_8xx_tlbflush, + .tlb_flush = intel_830_tlbflush, .mask_memory = agp_generic_mask_memory, .masks = intel_generic_masks, .agp_enable = agp_generic_enable, @@ -2084,7 +2092,7 @@ static const struct agp_bridge_driver intel_850_driver = { .configure = intel_850_configure, .fetch_size = intel_8xx_fetch_size, .cleanup = intel_8xx_cleanup, - .tlb_flush = intel_8xx_tlbflush, + .tlb_flush = intel_830_tlbflush, .mask_memory = agp_generic_mask_memory, .masks = intel_generic_masks, .agp_enable = agp_generic_enable, @@ -2110,7 +2118,7 @@ static const struct agp_bridge_driver intel_860_driver = { .configure = intel_860_configure, .fetch_size = intel_8xx_fetch_size, .cleanup = intel_8xx_cleanup, - .tlb_flush = intel_8xx_tlbflush, + .tlb_flush = intel_830_tlbflush, .mask_memory = agp_generic_mask_memory, .masks = intel_generic_masks, .agp_enable = agp_generic_enable, -- 1.7.0