]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 23 Oct 2008 17:18:40 +0000 (10:18 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 23 Oct 2008 17:18:40 +0000 (10:18 -0700)
* 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm: Avoid oops in DRM_IOCTL_RM_DRAW if a bad handle is supplied.
  drm: Add 32-bit compatibility for DRM_IOCTL_UPDATE_DRAW.
  drm/i915: use pipes, not planes to label vblank data
  drm/i915: hold dev->struct_mutex and DRM lock during vblank ring operations
  i915: Fix format string warnings on x86-64.
  i915: Don't dereference HWS in /proc debug files when it isn't initialized.
  i915: Enable IMR passthrough of vblank events before enabling it in pipestat.
  drm: Remove two leaks of vblank reference count in error paths.
  drm: fix leak of cliprects in drm_rmdraw()
  i915: Disable MSI on GM965 (errata says it doesn't work)
  drm: Set cliprects to NULL when changing drawable to having 0 cliprects.
  i915: Protect vblank IRQ reg access with spinlock

1  2 
drivers/gpu/drm/i915/i915_gem.c

index dc2e6fdb6ca33b7b6930f049d41495da0c8b17ef,92550883d191bc5780f0cfb0cf43e0ba13cbccba..17ae330ff269b10610d12a237ed9412f8e5e5856
@@@ -171,37 -171,6 +171,37 @@@ i915_gem_pread_ioctl(struct drm_device 
        return 0;
  }
  
 +/*
 + * Try to write quickly with an atomic kmap. Return true on success.
 + *
 + * If this fails (which includes a partial write), we'll redo the whole
 + * thing with the slow version.
 + *
 + * This is a workaround for the low performance of iounmap (approximate
 + * 10% cpu cost on normal 3D workloads).  kmap_atomic on HIGHMEM kernels
 + * happens to let us map card memory without taking IPIs.  When the vmap
 + * rework lands we should be able to dump this hack.
 + */
 +static inline int fast_user_write(unsigned long pfn, char __user *user_data,
 +                                int l, int o)
 +{
 +#ifdef CONFIG_HIGHMEM
 +      unsigned long unwritten;
 +      char *vaddr_atomic;
 +
 +      vaddr_atomic = kmap_atomic_pfn(pfn, KM_USER0);
 +#if WATCH_PWRITE
 +      DRM_INFO("pwrite i %d o %d l %d pfn %ld vaddr %p\n",
 +               i, o, l, pfn, vaddr_atomic);
 +#endif
 +      unwritten = __copy_from_user_inatomic_nocache(vaddr_atomic + o, user_data, l);
 +      kunmap_atomic(vaddr_atomic, KM_USER0);
 +      return !unwritten;
 +#else
 +      return 0;
 +#endif
 +}
 +
  static int
  i915_gem_gtt_pwrite(struct drm_device *dev, struct drm_gem_object *obj,
                    struct drm_i915_gem_pwrite *args,
        ssize_t remain;
        loff_t offset;
        char __user *user_data;
 -      char __iomem *vaddr;
 -      char *vaddr_atomic;
 -      int i, o, l;
        int ret = 0;
 -      unsigned long pfn;
 -      unsigned long unwritten;
  
        user_data = (char __user *) (uintptr_t) args->data_ptr;
        remain = args->size;
        obj_priv->dirty = 1;
  
        while (remain > 0) {
 +              unsigned long pfn;
 +              int i, o, l;
 +
                /* Operation in this page
                 *
                 * i = page number
  
                pfn = (dev->agp->base >> PAGE_SHIFT) + i;
  
 -#ifdef CONFIG_HIGHMEM
 -              /* This is a workaround for the low performance of iounmap
 -               * (approximate 10% cpu cost on normal 3D workloads).
 -               * kmap_atomic on HIGHMEM kernels happens to let us map card
 -               * memory without taking IPIs.  When the vmap rework lands
 -               * we should be able to dump this hack.
 -               */
 -              vaddr_atomic = kmap_atomic_pfn(pfn, KM_USER0);
 -#if WATCH_PWRITE
 -              DRM_INFO("pwrite i %d o %d l %d pfn %ld vaddr %p\n",
 -                       i, o, l, pfn, vaddr_atomic);
 -#endif
 -              unwritten = __copy_from_user_inatomic_nocache(vaddr_atomic + o,
 -                                                            user_data, l);
 -              kunmap_atomic(vaddr_atomic, KM_USER0);
 +              if (!fast_user_write(pfn, user_data, l, o)) {
 +                      unsigned long unwritten;
 +                      char __iomem *vaddr;
  
 -              if (unwritten)
 -#endif /* CONFIG_HIGHMEM */
 -              {
                        vaddr = ioremap_wc(pfn << PAGE_SHIFT, PAGE_SIZE);
  #if WATCH_PWRITE
                        DRM_INFO("pwrite slow i %d o %d l %d "
@@@ -2564,8 -2550,6 +2564,6 @@@ i915_gem_load(struct drm_device *dev
        INIT_LIST_HEAD(&dev_priv->mm.request_list);
        INIT_DELAYED_WORK(&dev_priv->mm.retire_work,
                          i915_gem_retire_work_handler);
-       INIT_WORK(&dev_priv->mm.vblank_work,
-                 i915_gem_vblank_work_handler);
        dev_priv->mm.next_gem_seqno = 1;
  
        i915_gem_detect_bit_6_swizzle(dev);