Merge branch 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/keith...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 28 Jun 2011 18:15:57 +0000 (11:15 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 28 Jun 2011 18:15:57 +0000 (11:15 -0700)
* 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/keithp/linux-2.6:
  drm/i915: Use chipset-specific irq installers
  drm/i915: forcewake fix after reset
  drm/i915: add Ivy Bridge page flip support
  drm/i915: split page flip queueing into per-chipset functions

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

@@@ -31,7 -31,6 +31,7 @@@
  #include "i915_drv.h"
  #include "i915_trace.h"
  #include "intel_drv.h"
 +#include <linux/shmem_fs.h>
  #include <linux/slab.h>
  #include <linux/swap.h>
  #include <linux/pci.h>
@@@ -360,7 -359,8 +360,7 @@@ i915_gem_shmem_pread_fast(struct drm_de
                if ((page_offset + remain) > PAGE_SIZE)
                        page_length = PAGE_SIZE - page_offset;
  
 -              page = read_cache_page_gfp(mapping, offset >> PAGE_SHIFT,
 -                                         GFP_HIGHUSER | __GFP_RECLAIMABLE);
 +              page = shmem_read_mapping_page(mapping, offset >> PAGE_SHIFT);
                if (IS_ERR(page))
                        return PTR_ERR(page);
  
@@@ -463,7 -463,8 +463,7 @@@ i915_gem_shmem_pread_slow(struct drm_de
                if ((data_page_offset + page_length) > PAGE_SIZE)
                        page_length = PAGE_SIZE - data_page_offset;
  
 -              page = read_cache_page_gfp(mapping, offset >> PAGE_SHIFT,
 -                                         GFP_HIGHUSER | __GFP_RECLAIMABLE);
 +              page = shmem_read_mapping_page(mapping, offset >> PAGE_SHIFT);
                if (IS_ERR(page)) {
                        ret = PTR_ERR(page);
                        goto out;
@@@ -796,7 -797,8 +796,7 @@@ i915_gem_shmem_pwrite_fast(struct drm_d
                if ((page_offset + remain) > PAGE_SIZE)
                        page_length = PAGE_SIZE - page_offset;
  
 -              page = read_cache_page_gfp(mapping, offset >> PAGE_SHIFT,
 -                                         GFP_HIGHUSER | __GFP_RECLAIMABLE);
 +              page = shmem_read_mapping_page(mapping, offset >> PAGE_SHIFT);
                if (IS_ERR(page))
                        return PTR_ERR(page);
  
@@@ -905,7 -907,8 +905,7 @@@ i915_gem_shmem_pwrite_slow(struct drm_d
                if ((data_page_offset + page_length) > PAGE_SIZE)
                        page_length = PAGE_SIZE - data_page_offset;
  
 -              page = read_cache_page_gfp(mapping, offset >> PAGE_SHIFT,
 -                                         GFP_HIGHUSER | __GFP_RECLAIMABLE);
 +              page = shmem_read_mapping_page(mapping, offset >> PAGE_SHIFT);
                if (IS_ERR(page)) {
                        ret = PTR_ERR(page);
                        goto out;
@@@ -1555,10 -1558,12 +1555,10 @@@ i915_gem_object_get_pages_gtt(struct dr
  
        inode = obj->base.filp->f_path.dentry->d_inode;
        mapping = inode->i_mapping;
 +      gfpmask |= mapping_gfp_mask(mapping);
 +
        for (i = 0; i < page_count; i++) {
 -              page = read_cache_page_gfp(mapping, i,
 -                                         GFP_HIGHUSER |
 -                                         __GFP_COLD |
 -                                         __GFP_RECLAIMABLE |
 -                                         gfpmask);
 +              page = shmem_read_mapping_page_gfp(mapping, i, gfpmask);
                if (IS_ERR(page))
                        goto err_pages;
  
@@@ -1696,10 -1701,13 +1696,10 @@@ i915_gem_object_truncate(struct drm_i91
        /* Our goal here is to return as much of the memory as
         * is possible back to the system as we are called from OOM.
         * To do this we must instruct the shmfs to drop all of its
 -       * backing pages, *now*. Here we mirror the actions taken
 -       * when by shmem_delete_inode() to release the backing store.
 +       * backing pages, *now*.
         */
        inode = obj->base.filp->f_path.dentry->d_inode;
 -      truncate_inode_pages(inode->i_mapping, 0);
 -      if (inode->i_op->truncate_range)
 -              inode->i_op->truncate_range(inode, 0, (loff_t)-1);
 +      shmem_truncate_range(inode, 0, (loff_t)-1);
  
        obj->madv = __I915_MADV_PURGED;
  }
@@@ -2072,8 -2080,8 +2072,8 @@@ i915_wait_request(struct intel_ring_buf
                if (!ier) {
                        DRM_ERROR("something (likely vbetool) disabled "
                                  "interrupts, re-enabling\n");
-                       i915_driver_irq_preinstall(ring->dev);
-                       i915_driver_irq_postinstall(ring->dev);
+                       ring->dev->driver->irq_preinstall(ring->dev);
+                       ring->dev->driver->irq_postinstall(ring->dev);
                }
  
                trace_i915_gem_request_wait_begin(ring, seqno);
@@@ -3557,7 -3565,6 +3557,7 @@@ struct drm_i915_gem_object *i915_gem_al
  {
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct drm_i915_gem_object *obj;
 +      struct address_space *mapping;
  
        obj = kzalloc(sizeof(*obj), GFP_KERNEL);
        if (obj == NULL)
                return NULL;
        }
  
 +      mapping = obj->base.filp->f_path.dentry->d_inode->i_mapping;
 +      mapping_set_gfp_mask(mapping, GFP_HIGHUSER | __GFP_RECLAIMABLE);
 +
        i915_gem_info_add_obj(dev_priv, size);
  
        obj->base.write_domain = I915_GEM_DOMAIN_CPU;
@@@ -3946,7 -3950,8 +3946,7 @@@ void i915_gem_detach_phys_object(struc
  
        page_count = obj->base.size / PAGE_SIZE;
        for (i = 0; i < page_count; i++) {
 -              struct page *page = read_cache_page_gfp(mapping, i,
 -                                                      GFP_HIGHUSER | __GFP_RECLAIMABLE);
 +              struct page *page = shmem_read_mapping_page(mapping, i);
                if (!IS_ERR(page)) {
                        char *dst = kmap_atomic(page);
                        memcpy(dst, vaddr + i*PAGE_SIZE, PAGE_SIZE);
@@@ -4007,7 -4012,8 +4007,7 @@@ i915_gem_attach_phys_object(struct drm_
                struct page *page;
                char *dst, *src;
  
 -              page = read_cache_page_gfp(mapping, i,
 -                                         GFP_HIGHUSER | __GFP_RECLAIMABLE);
 +              page = shmem_read_mapping_page(mapping, i);
                if (IS_ERR(page))
                        return PTR_ERR(page);