diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-02-09 11:15:44 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-02-09 15:23:18 -0500 |
commit | 50a4c4a94d24fe13167e3ab1dc1486623369c31a (patch) | |
tree | 6499c1453002d9b61dd5ab9d9d33ab2cb648111f /drivers/char | |
parent | 7e3b8737e719c4de7dd79b096b80ece444b2f0ba (diff) |
agp/intel-gtt: export the scratch page dma address
To implement a PPGTT for drm/i915 that fully aliases the GTT, we also
need to properly alias the scratch page.
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/agp/intel-gtt.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index c92424ca1a55..0a305acb0374 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c | |||
@@ -76,7 +76,6 @@ static struct _intel_private { | |||
76 | struct resource ifp_resource; | 76 | struct resource ifp_resource; |
77 | int resource_valid; | 77 | int resource_valid; |
78 | struct page *scratch_page; | 78 | struct page *scratch_page; |
79 | dma_addr_t scratch_page_dma; | ||
80 | } intel_private; | 79 | } intel_private; |
81 | 80 | ||
82 | #define INTEL_GTT_GEN intel_private.driver->gen | 81 | #define INTEL_GTT_GEN intel_private.driver->gen |
@@ -306,9 +305,9 @@ static int intel_gtt_setup_scratch_page(void) | |||
306 | if (pci_dma_mapping_error(intel_private.pcidev, dma_addr)) | 305 | if (pci_dma_mapping_error(intel_private.pcidev, dma_addr)) |
307 | return -EINVAL; | 306 | return -EINVAL; |
308 | 307 | ||
309 | intel_private.scratch_page_dma = dma_addr; | 308 | intel_private.base.scratch_page_dma = dma_addr; |
310 | } else | 309 | } else |
311 | intel_private.scratch_page_dma = page_to_phys(page); | 310 | intel_private.base.scratch_page_dma = page_to_phys(page); |
312 | 311 | ||
313 | intel_private.scratch_page = page; | 312 | intel_private.scratch_page = page; |
314 | 313 | ||
@@ -631,7 +630,7 @@ static unsigned int intel_gtt_mappable_entries(void) | |||
631 | static void intel_gtt_teardown_scratch_page(void) | 630 | static void intel_gtt_teardown_scratch_page(void) |
632 | { | 631 | { |
633 | set_pages_wb(intel_private.scratch_page, 1); | 632 | set_pages_wb(intel_private.scratch_page, 1); |
634 | pci_unmap_page(intel_private.pcidev, intel_private.scratch_page_dma, | 633 | pci_unmap_page(intel_private.pcidev, intel_private.base.scratch_page_dma, |
635 | PAGE_SIZE, PCI_DMA_BIDIRECTIONAL); | 634 | PAGE_SIZE, PCI_DMA_BIDIRECTIONAL); |
636 | put_page(intel_private.scratch_page); | 635 | put_page(intel_private.scratch_page); |
637 | __free_page(intel_private.scratch_page); | 636 | __free_page(intel_private.scratch_page); |
@@ -975,7 +974,7 @@ void intel_gtt_clear_range(unsigned int first_entry, unsigned int num_entries) | |||
975 | unsigned int i; | 974 | unsigned int i; |
976 | 975 | ||
977 | for (i = first_entry; i < (first_entry + num_entries); i++) { | 976 | for (i = first_entry; i < (first_entry + num_entries); i++) { |
978 | intel_private.driver->write_entry(intel_private.scratch_page_dma, | 977 | intel_private.driver->write_entry(intel_private.base.scratch_page_dma, |
979 | i, 0); | 978 | i, 0); |
980 | } | 979 | } |
981 | readl(intel_private.gtt+i-1); | 980 | readl(intel_private.gtt+i-1); |