drm/i915: Remove unnecessary gen8_ppgtt_unmap_pages
authorMichel Thierry <michel.thierry@intel.com>
Wed, 8 Apr 2015 11:13:24 +0000 (12:13 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 10 Apr 2015 06:56:08 +0000 (08:56 +0200)
We are already unmapping them in gen8_ppgtt_free. This function became
redundant since commit 06fda602dbca9c59d87db7da71192e4b54c9f5ff
("drm/i915: Create page table allocators").

Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Signed-off-by: Michel Thierry <michel.thierry@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem_gtt.c

index c1a2fab9c7904ac654e6291a8b512d55296c857a..a7d364ae05181e09bce0bd7d537cdca8f575cdac 100644 (file)
@@ -617,44 +617,11 @@ static void gen8_ppgtt_free(struct i915_hw_ppgtt *ppgtt)
        }
 }
 
-static void gen8_ppgtt_unmap_pages(struct i915_hw_ppgtt *ppgtt)
-{
-       struct pci_dev *hwdev = ppgtt->base.dev->pdev;
-       int i, j;
-
-       for (i = 0; i < ppgtt->num_pd_pages; i++) {
-               /* TODO: In the future we'll support sparse mappings, so this
-                * will have to change. */
-               if (!ppgtt->pdp.page_directory[i]->daddr)
-                       continue;
-
-               pci_unmap_page(hwdev, ppgtt->pdp.page_directory[i]->daddr, PAGE_SIZE,
-                              PCI_DMA_BIDIRECTIONAL);
-
-               for (j = 0; j < I915_PDES; j++) {
-                       struct i915_page_directory *pd = ppgtt->pdp.page_directory[i];
-                       struct i915_page_table *pt;
-                       dma_addr_t addr;
-
-                       if (WARN_ON(!pd->page_table[j]))
-                               continue;
-
-                       pt = pd->page_table[j];
-                       addr = pt->daddr;
-
-                       if (addr)
-                               pci_unmap_page(hwdev, addr, PAGE_SIZE,
-                                              PCI_DMA_BIDIRECTIONAL);
-               }
-       }
-}
-
 static void gen8_ppgtt_cleanup(struct i915_address_space *vm)
 {
        struct i915_hw_ppgtt *ppgtt =
                container_of(vm, struct i915_hw_ppgtt, base);
 
-       gen8_ppgtt_unmap_pages(ppgtt);
        gen8_ppgtt_free(ppgtt);
 }
 
@@ -851,7 +818,6 @@ static int gen8_ppgtt_init(struct i915_hw_ppgtt *ppgtt, uint64_t size)
        return 0;
 
 bail:
-       gen8_ppgtt_unmap_pages(ppgtt);
        gen8_ppgtt_free(ppgtt);
        return ret;
 }