Merge branch 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 27 Oct 2010 01:57:59 +0000 (18:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 27 Oct 2010 01:57:59 +0000 (18:57 -0700)
* 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (476 commits)
  vmwgfx: Implement a proper GMR eviction mechanism
  drm/radeon/kms: fix r6xx/7xx 1D tiling CS checker v2
  drm/radeon/kms: properly compute group_size on 6xx/7xx
  drm/radeon/kms: fix 2D tile height alignment in the r600 CS checker
  drm/radeon/kms/evergreen: set the clear state to the blit state
  drm/radeon/kms: don't poll dac load detect.
  gpu: Add Intel GMA500(Poulsbo) Stub Driver
  drm/radeon/kms: MC vram map needs to be >= pci aperture size
  drm/radeon/kms: implement display watermark support for evergreen
  drm/radeon/kms/evergreen: add some additional safe regs v2
  drm/radeon/r600: fix tiling issues in CS checker.
  drm/i915: Move gpu_write_list to per-ring
  drm/i915: Invalidate the to-ring, flush the old-ring when updating domains
  drm/i915/ringbuffer: Write the value passed in to the tail register
  agp/intel: Restore valid PTE bit for Sandybridge after bdd3072
  drm/i915: Fix flushing regression from 9af90d19f
  drm/i915/sdvo: Remove unused encoding member
  i915: enable AVI infoframe for intel_hdmi.c [v4]
  drm/i915: Fix current fb blocking for page flip
  drm/i915: IS_IRONLAKE is synonymous with gen == 5
  ...

Fix up conflicts in
 - drivers/gpu/drm/i915/{i915_gem.c, i915/intel_overlay.c}: due to the
   new simplified stack-based kmap_atomic() interface
 - drivers/gpu/drm/vmwgfx/vmwgfx_drv.c: added .llseek entry due to BKL
   removal cleanups.

25 files changed:
1  2 
MAINTAINERS
drivers/char/agp/generic.c
drivers/gpu/drm/drm_drv.c
drivers/gpu/drm/i810/i810_drv.c
drivers/gpu/drm/i830/i830_drv.c
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/i915/intel_overlay.c
drivers/gpu/drm/mga/mga_drv.c
drivers/gpu/drm/nouveau/nouveau_bios.c
drivers/gpu/drm/nouveau/nouveau_drv.c
drivers/gpu/drm/nouveau/nouveau_i2c.h
drivers/gpu/drm/r128/r128_drv.c
drivers/gpu/drm/radeon/radeon_drv.c
drivers/gpu/drm/radeon/radeon_mode.h
drivers/gpu/drm/radeon/radeon_ttm.c
drivers/gpu/drm/savage/savage_drv.c
drivers/gpu/drm/sis/sis_drv.c
drivers/gpu/drm/tdfx/tdfx_drv.c
drivers/gpu/drm/ttm/ttm_bo_util.c
drivers/gpu/drm/via/via_drv.c
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
drivers/video/Kconfig

diff --cc MAINTAINERS
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index eb6c473c6d1b40f9d55f6cb77f6c72f43ece9b5b,6c2618d884e7a841ce9ae97e9abd0ab6e46da6d2..8eb8453208b5ce491e77c1c06c77c1c0a2da41bc
@@@ -152,19 -265,14 +265,14 @@@ fast_shmem_read(struct page **pages
                char __user *data,
                int length)
  {
-       char __iomem *vaddr;
-       int unwritten;
+       char *vaddr;
+       int ret;
  
 -      vaddr = kmap_atomic(pages[page_base >> PAGE_SHIFT], KM_USER0);
 +      vaddr = kmap_atomic(pages[page_base >> PAGE_SHIFT]);
-       if (vaddr == NULL)
-               return -ENOMEM;
-       unwritten = __copy_to_user_inatomic(data, vaddr + page_offset, length);
+       ret = __copy_to_user_inatomic(data, vaddr + page_offset, length);
 -      kunmap_atomic(vaddr, KM_USER0);
 +      kunmap_atomic(vaddr);
  
-       if (unwritten)
-               return -EFAULT;
-       return 0;
+       return ret;
  }
  
  static int i915_gem_object_needs_bit17_swizzle(struct drm_gem_object *obj)
@@@ -509,13 -619,11 +619,11 @@@ fast_user_write(struct io_mapping *mapp
        char *vaddr_atomic;
        unsigned long unwritten;
  
 -      vaddr_atomic = io_mapping_map_atomic_wc(mapping, page_base, KM_USER0);
 +      vaddr_atomic = io_mapping_map_atomic_wc(mapping, page_base);
        unwritten = __copy_from_user_inatomic_nocache(vaddr_atomic + page_offset,
                                                      user_data, length);
 -      io_mapping_unmap_atomic(vaddr_atomic, KM_USER0);
 +      io_mapping_unmap_atomic(vaddr_atomic);
-       if (unwritten)
-               return -EFAULT;
-       return 0;
+       return unwritten;
  }
  
  /* Here's the write path which can sleep for
@@@ -548,18 -656,14 +656,14 @@@ fast_shmem_write(struct page **pages
                 char __user *data,
                 int length)
  {
-       char __iomem *vaddr;
-       unsigned long unwritten;
+       char *vaddr;
+       int ret;
  
 -      vaddr = kmap_atomic(pages[page_base >> PAGE_SHIFT], KM_USER0);
 +      vaddr = kmap_atomic(pages[page_base >> PAGE_SHIFT]);
-       if (vaddr == NULL)
-               return -ENOMEM;
-       unwritten = __copy_from_user_inatomic(vaddr + page_offset, data, length);
+       ret = __copy_from_user_inatomic(vaddr + page_offset, data, length);
 -      kunmap_atomic(vaddr, KM_USER0);
 +      kunmap_atomic(vaddr);
  
-       if (unwritten)
-               return -EFAULT;
-       return 0;
+       return ret;
  }
  
  /**
@@@ -3323,91 -3381,53 +3381,52 @@@ i915_gem_execbuffer_relocate(struct drm
                }
  
                /* and points to somewhere within the target object. */
-               if (reloc->delta >= target_obj->size) {
+               if (reloc.delta >= target_obj->size) {
                        DRM_ERROR("Relocation beyond target object bounds: "
                                  "obj %p target %d delta %d size %d.\n",
-                                 obj, reloc->target_handle,
-                                 (int) reloc->delta, (int) target_obj->size);
-                       drm_gem_object_unreference(target_obj);
-                       i915_gem_object_unpin(obj);
-                       return -EINVAL;
-               }
-               ret = i915_gem_object_set_to_gtt_domain(obj, 1);
-               if (ret != 0) {
-                       drm_gem_object_unreference(target_obj);
-                       i915_gem_object_unpin(obj);
-                       return -EINVAL;
+                                 obj, reloc.target_handle,
+                                 (int) reloc.delta, (int) target_obj->size);
+                       ret = -EINVAL;
+                       break;
                }
  
-               /* Map the page containing the relocation we're going to
-                * perform.
-                */
-               reloc_offset = obj_priv->gtt_offset + reloc->offset;
-               reloc_page = io_mapping_map_atomic_wc(dev_priv->mm.gtt_mapping,
-                                                     (reloc_offset &
-                                                      ~(PAGE_SIZE - 1)));
-               reloc_entry = (uint32_t __iomem *)(reloc_page +
-                                                  (reloc_offset & (PAGE_SIZE - 1)));
-               reloc_val = target_obj_priv->gtt_offset + reloc->delta;
- #if WATCH_BUF
-               DRM_INFO("Applied relocation: %p@0x%08x %08x -> %08x\n",
-                         obj, (unsigned int) reloc->offset,
-                         readl(reloc_entry), reloc_val);
- #endif
-               writel(reloc_val, reloc_entry);
-               io_mapping_unmap_atomic(reloc_page);
-               /* The updated presumed offset for this entry will be
-                * copied back out to the user.
-                */
-               reloc->presumed_offset = target_obj_priv->gtt_offset;
-               drm_gem_object_unreference(target_obj);
-       }
- #if WATCH_BUF
-       if (0)
-               i915_gem_dump_object(obj, 128, __func__, ~0);
- #endif
-       return 0;
- }
- /* Throttle our rendering by waiting until the ring has completed our requests
-  * emitted over 20 msec ago.
-  *
-  * Note that if we were to use the current jiffies each time around the loop,
-  * we wouldn't escape the function with any frames outstanding if the time to
-  * render a frame was over 20ms.
-  *
-  * This should get us reasonable parallelism between CPU and GPU but also
-  * relatively low latency when blocking on a particular request to finish.
-  */
- static int
- i915_gem_ring_throttle(struct drm_device *dev, struct drm_file *file_priv)
- {
-       struct drm_i915_file_private *i915_file_priv = file_priv->driver_priv;
-       int ret = 0;
-       unsigned long recent_enough = jiffies - msecs_to_jiffies(20);
+               reloc.delta += target_offset;
+               if (obj->base.write_domain == I915_GEM_DOMAIN_CPU) {
+                       uint32_t page_offset = reloc.offset & ~PAGE_MASK;
+                       char *vaddr;
  
-       mutex_lock(&dev->struct_mutex);
-       while (!list_empty(&i915_file_priv->mm.request_list)) {
-               struct drm_i915_gem_request *request;
 -                      vaddr = kmap_atomic(obj->pages[reloc.offset >> PAGE_SHIFT], KM_USER0);
++                      vaddr = kmap_atomic(obj->pages[reloc.offset >> PAGE_SHIFT]);
+                       *(uint32_t *)(vaddr + page_offset) = reloc.delta;
 -                      kunmap_atomic(vaddr, KM_USER0);
++                      kunmap_atomic(vaddr);
+               } else {
+                       uint32_t __iomem *reloc_entry;
+                       void __iomem *reloc_page;
  
-               request = list_first_entry(&i915_file_priv->mm.request_list,
-                                          struct drm_i915_gem_request,
-                                          client_list);
+                       ret = i915_gem_object_set_to_gtt_domain(&obj->base, 1);
+                       if (ret)
+                               break;
  
-               if (time_after_eq(request->emitted_jiffies, recent_enough))
-                       break;
+                       /* Map the page containing the relocation we're going to perform.  */
+                       reloc.offset += obj->gtt_offset;
+                       reloc_page = io_mapping_map_atomic_wc(dev_priv->mm.gtt_mapping,
 -                                                            reloc.offset & PAGE_MASK,
 -                                                            KM_USER0);
++                                                            reloc.offset & PAGE_MASK);
+                       reloc_entry = (uint32_t __iomem *)
+                               (reloc_page + (reloc.offset & ~PAGE_MASK));
+                       iowrite32(reloc.delta, reloc_entry);
 -                      io_mapping_unmap_atomic(reloc_page, KM_USER0);
++                      io_mapping_unmap_atomic(reloc_page);
+               }
  
-               ret = i915_wait_request(dev, request->seqno, request->ring);
-               if (ret != 0)
-                       break;
+               /* and update the user's relocation entry */
+               reloc.presumed_offset = target_offset;
+               if (__copy_to_user_inatomic(&user_relocs[i].presumed_offset,
+                                             &reloc.presumed_offset,
+                                             sizeof(reloc.presumed_offset))) {
+                   ret = -EFAULT;
+                   break;
+               }
        }
-       mutex_unlock(&dev->struct_mutex);
  
+       drm_gem_object_unreference(target_obj);
        return ret;
  }
  
Simple merge
index 3264bbd47e659e0b0e3e82b71bddad3789098073,375316a8420e84b1b49e2d0c38fd9ae57d1f0e78..afb96d25219afe473b116802f30616c0edb1cf86
@@@ -1426,6 -1464,32 +1464,29 @@@ struct intel_overlay_error_state 
        u32 isr;
  };
  
 -intel_overlay_map_regs_atomic(struct intel_overlay *overlay,
 -                            int slot)
+ static struct overlay_registers *
 -        drm_i915_private_t *dev_priv = overlay->dev->dev_private;
++intel_overlay_map_regs_atomic(struct intel_overlay *overlay)
+ {
 -                                              overlay->reg_bo->gtt_offset,
 -                                              slot);
++      drm_i915_private_t *dev_priv = overlay->dev->dev_private;
+       struct overlay_registers *regs;
+       if (OVERLAY_NEEDS_PHYSICAL(overlay->dev))
+               regs = overlay->reg_bo->phys_obj->handle->vaddr;
+       else
+               regs = io_mapping_map_atomic_wc(dev_priv->mm.gtt_mapping,
 -                                          int slot,
++                                              overlay->reg_bo->gtt_offset);
+       return regs;
+ }
+ static void intel_overlay_unmap_regs_atomic(struct intel_overlay *overlay,
 -              io_mapping_unmap_atomic(regs, slot);
+                                           struct overlay_registers *regs)
+ {
+       if (!OVERLAY_NEEDS_PHYSICAL(overlay->dev))
++              io_mapping_unmap_atomic(regs);
+ }
  struct intel_overlay_error_state *
  intel_overlay_capture_error_state(struct drm_device *dev)
  {
  
        error->dovsta = I915_READ(DOVSTA);
        error->isr = I915_READ(ISR);
-       if (OVERLAY_NONPHYSICAL(overlay->dev))
-               error->base = (long) overlay->reg_bo->gtt_offset;
-       else
+       if (OVERLAY_NEEDS_PHYSICAL(overlay->dev))
                error->base = (long) overlay->reg_bo->phys_obj->handle->vaddr;
+       else
+               error->base = (long) overlay->reg_bo->gtt_offset;
  
 -      regs = intel_overlay_map_regs_atomic(overlay, KM_IRQ0);
 +      regs = intel_overlay_map_regs_atomic(overlay);
        if (!regs)
                goto err;
  
        memcpy_fromio(&error->regs, regs, sizeof(struct overlay_registers));
-       intel_overlay_unmap_regs_atomic(overlay);
 -      intel_overlay_unmap_regs_atomic(overlay, KM_IRQ0, regs);
++      intel_overlay_unmap_regs_atomic(overlay, regs);
  
        return error;
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 454c1dc7ea45ea5975647680b15191d15f2bb470,61b9243db217b93bcfbc5f53a89196a49d8fb1e8..92457163d07094dba9bd5975dc63dfb4968e92a6
@@@ -35,7 -35,9 +35,8 @@@
  #include <drm_edid.h>
  #include <drm_dp_helper.h>
  #include <drm_fixed.h>
+ #include <drm_crtc_helper.h>
  #include <linux/i2c.h>
 -#include <linux/i2c-id.h>
  #include <linux/i2c-algo-bit.h>
  
  struct radeon_bo;
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 2ef93df9e8ae39f8c9e267a500ee5157f2fda420,d0ef624fbdccc7e9ef95cc42b583d3a4d881b344..10ca97ee02063c6c83c56b27f2d5ac895382dad1
@@@ -820,16 -907,16 +907,17 @@@ static struct drm_driver driver = 
  #if defined(CONFIG_COMPAT)
                 .compat_ioctl = drm_compat_ioctl,
  #endif
-                },
 +               .llseek = noop_llseek,
+       },
        .pci_driver = {
-                      .name = VMWGFX_DRIVER_NAME,
-                      .id_table = vmw_pci_id_list,
-                      .probe = vmw_probe,
-                      .remove = vmw_remove,
-                      .suspend = vmw_pci_suspend,
-                      .resume = vmw_pci_resume
-                      },
+                .name = VMWGFX_DRIVER_NAME,
+                .id_table = vmw_pci_id_list,
+                .probe = vmw_probe,
+                .remove = vmw_remove,
+                .driver = {
+                        .pm = &vmw_pm_ops
+                }
+        },
        .name = VMWGFX_DRIVER_NAME,
        .desc = VMWGFX_DRIVER_DESC,
        .date = VMWGFX_DRIVER_DATE,
Simple merge