aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-10-28 08:54:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-10-28 08:54:23 -0400
commit37be944a0270402f9cda291a930b0286f6dc92f5 (patch)
tree6a91a9eb86450f4a18a8871f04a1ef810e7b55d6 /drivers/char/agp
parentca836a25435ef1b9914840ed0a310c9b6ac261d1 (diff)
parent1717c0e23f411147490c7a3312b894f0ea9a5fb1 (diff)
Merge branch 'drm-core-next' of git://people.freedesktop.org/~airlied/linux
* 'drm-core-next' of git://people.freedesktop.org/~airlied/linux: (290 commits) Revert "drm/ttm: add a way to bo_wait for either the last read or last write" Revert "drm/radeon/kms: add a new gem_wait ioctl with read/write flags" vmwgfx: Don't pass unused arguments to do_dirty functions vmwgfx: Emulate depth 32 framebuffers drm/radeon: Lower the severity of the radeon lockup messages. drm/i915/dp: Fix eDP on PCH DP on CPT/PPT drm/i915/dp: Introduce is_cpu_edp() drm/i915: use correct SPD type value drm/i915: fix ILK+ infoframe support drm/i915: add DP test request handling drm/i915: read full receiver capability field during DP hot plug drm/i915/dp: Remove eDP special cases from bandwidth checks drm/i915/dp: Fix the math in intel_dp_link_required drm/i915/panel: Always record the backlight level again (but cleverly) i915: Move i915_read/write out of line drm/i915: remove transcoder PLL mashing from mode_set per specs drm/i915: if transcoder disable fails, say which drm/i915: set watermarks for third pipe on IVB drm/i915: export a CPT mode set verification function drm/i915: fix transcoder PLL select masking ...
Diffstat (limited to 'drivers/char/agp')
-rw-r--r--drivers/char/agp/intel-gtt.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index 2774ac1086d3..66cd0b8096ca 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -923,6 +923,9 @@ static int intel_fake_agp_insert_entries(struct agp_memory *mem,
923{ 923{
924 int ret = -EINVAL; 924 int ret = -EINVAL;
925 925
926 if (intel_private.base.do_idle_maps)
927 return -ENODEV;
928
926 if (intel_private.clear_fake_agp) { 929 if (intel_private.clear_fake_agp) {
927 int start = intel_private.base.stolen_size / PAGE_SIZE; 930 int start = intel_private.base.stolen_size / PAGE_SIZE;
928 int end = intel_private.base.gtt_mappable_entries; 931 int end = intel_private.base.gtt_mappable_entries;
@@ -985,6 +988,9 @@ static int intel_fake_agp_remove_entries(struct agp_memory *mem,
985 if (mem->page_count == 0) 988 if (mem->page_count == 0)
986 return 0; 989 return 0;
987 990
991 if (intel_private.base.do_idle_maps)
992 return -ENODEV;
993
988 intel_gtt_clear_range(pg_start, mem->page_count); 994 intel_gtt_clear_range(pg_start, mem->page_count);
989 995
990 if (intel_private.base.needs_dmar) { 996 if (intel_private.base.needs_dmar) {
@@ -1177,6 +1183,25 @@ static void gen6_cleanup(void)
1177{ 1183{
1178} 1184}
1179 1185
1186/* Certain Gen5 chipsets require require idling the GPU before
1187 * unmapping anything from the GTT when VT-d is enabled.
1188 */
1189extern int intel_iommu_gfx_mapped;
1190static inline int needs_idle_maps(void)
1191{
1192 const unsigned short gpu_devid = intel_private.pcidev->device;
1193
1194 /* Query intel_iommu to see if we need the workaround. Presumably that
1195 * was loaded first.
1196 */
1197 if ((gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB ||
1198 gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG) &&
1199 intel_iommu_gfx_mapped)
1200 return 1;
1201
1202 return 0;
1203}
1204
1180static int i9xx_setup(void) 1205static int i9xx_setup(void)
1181{ 1206{
1182 u32 reg_addr; 1207 u32 reg_addr;
@@ -1211,6 +1236,9 @@ static int i9xx_setup(void)
1211 intel_private.gtt_bus_addr = reg_addr + gtt_offset; 1236 intel_private.gtt_bus_addr = reg_addr + gtt_offset;
1212 } 1237 }
1213 1238
1239 if (needs_idle_maps());
1240 intel_private.base.do_idle_maps = 1;
1241
1214 intel_i9xx_setup_flush(); 1242 intel_i9xx_setup_flush();
1215 1243
1216 return 0; 1244 return 0;