Merge branch 'drm-core-next' of git://people.freedesktop.org/~airlied/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 28 Oct 2011 12:54:23 +0000 (05:54 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 28 Oct 2011 12:54:23 +0000 (05:54 -0700)
* '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
  ...

1  2 
drivers/char/agp/intel-gtt.c
drivers/gpu/drm/radeon/radeon_fence.c
drivers/staging/Kconfig
include/linux/io-mapping.h

  /*
   * If we have Intel graphics, we're not going to have anything other than
   * an Intel IOMMU. So make the correct use of the PCI DMA API contingent
 - * on the Intel IOMMU support (CONFIG_DMAR).
 + * on the Intel IOMMU support (CONFIG_INTEL_IOMMU).
   * Only newer chipsets need to bother with this, of course.
   */
 -#ifdef CONFIG_DMAR
 +#ifdef CONFIG_INTEL_IOMMU
  #define USE_PCI_DMA_API 1
  #else
  #define USE_PCI_DMA_API 0
@@@ -923,6 -923,9 +923,9 @@@ static int intel_fake_agp_insert_entrie
  {
        int ret = -EINVAL;
  
+       if (intel_private.base.do_idle_maps)
+               return -ENODEV;
        if (intel_private.clear_fake_agp) {
                int start = intel_private.base.stolen_size / PAGE_SIZE;
                int end = intel_private.base.gtt_mappable_entries;
@@@ -985,6 -988,9 +988,9 @@@ static int intel_fake_agp_remove_entrie
        if (mem->page_count == 0)
                return 0;
  
+       if (intel_private.base.do_idle_maps)
+               return -ENODEV;
        intel_gtt_clear_range(pg_start, mem->page_count);
  
        if (intel_private.base.needs_dmar) {
@@@ -1177,6 -1183,25 +1183,25 @@@ static void gen6_cleanup(void
  {
  }
  
+ /* Certain Gen5 chipsets require require idling the GPU before
+  * unmapping anything from the GTT when VT-d is enabled.
+  */
+ extern int intel_iommu_gfx_mapped;
+ static inline int needs_idle_maps(void)
+ {
+       const unsigned short gpu_devid = intel_private.pcidev->device;
+       /* Query intel_iommu to see if we need the workaround. Presumably that
+        * was loaded first.
+        */
+       if ((gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB ||
+            gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG) &&
+            intel_iommu_gfx_mapped)
+               return 1;
+       return 0;
+ }
  static int i9xx_setup(void)
  {
        u32 reg_addr;
                intel_private.gtt_bus_addr = reg_addr + gtt_offset;
        }
  
+       if (needs_idle_maps());
+               intel_private.base.do_idle_maps = 1;
        intel_i9xx_setup_flush();
  
        return 0;
@@@ -48,7 -48,7 +48,7 @@@ static void radeon_fence_write(struct r
                        scratch_index = R600_WB_EVENT_OFFSET + rdev->fence_drv.scratch_reg - rdev->scratch.reg_base;
                else
                        scratch_index = RADEON_WB_SCRATCH_OFFSET + rdev->fence_drv.scratch_reg - rdev->scratch.reg_base;
 -              rdev->wb.wb[scratch_index/4] = cpu_to_le32(seq);;
 +              rdev->wb.wb[scratch_index/4] = cpu_to_le32(seq);
        } else
                WREG32(rdev->fence_drv.scratch_reg, seq);
  }
@@@ -263,7 -263,7 +263,7 @@@ retry
                 */
                if (seq == rdev->fence_drv.last_seq && radeon_gpu_is_lockup(rdev)) {
                        /* good news we believe it's a lockup */
-                       WARN(1, "GPU lockup (waiting for 0x%08X last fence id 0x%08X)\n",
+                       printk(KERN_WARNING "GPU lockup (waiting for 0x%08X last fence id 0x%08X)\n",
                             fence->seq, seq);
                        /* FIXME: what should we do ? marking everyone
                         * as signaled for now
diff --combined drivers/staging/Kconfig
@@@ -24,8 -24,6 +24,8 @@@ menuconfig STAGIN
  
  if STAGING
  
 +source "drivers/staging/serial/Kconfig"
 +
  source "drivers/staging/et131x/Kconfig"
  
  source "drivers/staging/slicoss/Kconfig"
@@@ -46,6 -44,8 +46,6 @@@ source "drivers/staging/wlan-ng/Kconfig
  
  source "drivers/staging/echo/Kconfig"
  
 -source "drivers/staging/brcm80211/Kconfig"
 -
  source "drivers/staging/comedi/Kconfig"
  
  source "drivers/staging/olpc_dcon/Kconfig"
@@@ -64,8 -64,6 +64,8 @@@ source "drivers/staging/rtl8712/Kconfig
  
  source "drivers/staging/rts_pstor/Kconfig"
  
 +source "drivers/staging/rts5139/Kconfig"
 +
  source "drivers/staging/frontier/Kconfig"
  
  source "drivers/staging/pohmelfs/Kconfig"
@@@ -74,8 -72,6 +74,6 @@@ source "drivers/staging/phison/Kconfig
  
  source "drivers/staging/line6/Kconfig"
  
- source "drivers/gpu/drm/vmwgfx/Kconfig"
  source "drivers/gpu/drm/nouveau/Kconfig"
  
  source "drivers/staging/octeon/Kconfig"
@@@ -128,6 -124,8 +126,6 @@@ source "drivers/staging/quickstart/Kcon
  
  source "drivers/staging/sbe-2t3e3/Kconfig"
  
 -source "drivers/staging/ath6kl/Kconfig"
 -
  source "drivers/staging/keucr/Kconfig"
  
  source "drivers/staging/bcm/Kconfig"
@@@ -27,7 -27,7 +27,7 @@@
   * The io_mapping mechanism provides an abstraction for mapping
   * individual pages from an io device to the CPU in an efficient fashion.
   *
 - * See Documentation/io_mapping.txt
 + * See Documentation/io-mapping.txt
   */
  
  #ifdef CONFIG_HAVE_ATOMIC_IOMAP
@@@ -117,6 -117,8 +117,8 @@@ io_mapping_unmap(void __iomem *vaddr
  
  #else
  
+ #include <linux/uaccess.h>
  /* this struct isn't actually defined anywhere */
  struct io_mapping;
  
@@@ -138,12 -140,14 +140,14 @@@ static inline void __iomem 
  io_mapping_map_atomic_wc(struct io_mapping *mapping,
                         unsigned long offset)
  {
+       pagefault_disable();
        return ((char __force __iomem *) mapping) + offset;
  }
  
  static inline void
  io_mapping_unmap_atomic(void __iomem *vaddr)
  {
+       pagefault_enable();
  }
  
  /* Non-atomic map/unmap */