aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2010-12-02 10:24:13 -0500
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-01-27 16:07:58 -0500
commit27e8b237944af967e0a808580278d432cb028455 (patch)
tree28d1b8ef8ad2477afeb7874f3bdf5e86a9434e96
parent69a07f0b117a40fcc1a479358d8e1f41793617f2 (diff)
ttm: Expand (*populate) to support an array of DMA addresses.
We pass in the array of ttm pages to be populated in the GART/MM of the card (or AGP). Patch titled: "ttm: Utilize the DMA API for pages that have TTM_PAGE_FLAG_DMA32 set." uses the DMA API to make those pages have a proper DMA addresses (in the situation where page_to_phys or virt_to_phys do not give use the DMA (bus) address). Since we are using the DMA API on those pages, we should pass in the DMA address to this function so it can save it in its proper fields (later patches use it). [v2: Added reviewed-by tag] Reviewed-by: Thomas Hellstrom <thellstrom@shipmail.org> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Tested-by: Ian Campbell <ian.campbell@citrix.com>
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_sgdma.c3
-rw-r--r--drivers/gpu/drm/radeon/radeon_ttm.c3
-rw-r--r--drivers/gpu/drm/ttm/ttm_agp_backend.c3
-rw-r--r--drivers/gpu/drm/ttm/ttm_tt.c2
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c3
-rw-r--r--include/drm/ttm/ttm_bo_driver.h4
6 files changed, 12 insertions, 6 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_sgdma.c b/drivers/gpu/drm/nouveau/nouveau_sgdma.c
index 288bacac7e5a..edc140ab4df1 100644
--- a/drivers/gpu/drm/nouveau/nouveau_sgdma.c
+++ b/drivers/gpu/drm/nouveau/nouveau_sgdma.c
@@ -20,7 +20,8 @@ struct nouveau_sgdma_be {
20 20
21static int 21static int
22nouveau_sgdma_populate(struct ttm_backend *be, unsigned long num_pages, 22nouveau_sgdma_populate(struct ttm_backend *be, unsigned long num_pages,
23 struct page **pages, struct page *dummy_read_page) 23 struct page **pages, struct page *dummy_read_page,
24 dma_addr_t *dma_addrs)
24{ 25{
25 struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)be; 26 struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)be;
26 struct drm_device *dev = nvbe->dev; 27 struct drm_device *dev = nvbe->dev;
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 01c2c736a1da..6f156e9d3f31 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -655,7 +655,8 @@ struct radeon_ttm_backend {
655static int radeon_ttm_backend_populate(struct ttm_backend *backend, 655static int radeon_ttm_backend_populate(struct ttm_backend *backend,
656 unsigned long num_pages, 656 unsigned long num_pages,
657 struct page **pages, 657 struct page **pages,
658 struct page *dummy_read_page) 658 struct page *dummy_read_page,
659 dma_addr_t *dma_addrs)
659{ 660{
660 struct radeon_ttm_backend *gtt; 661 struct radeon_ttm_backend *gtt;
661 662
diff --git a/drivers/gpu/drm/ttm/ttm_agp_backend.c b/drivers/gpu/drm/ttm/ttm_agp_backend.c
index f999e36f30b4..1c4a72f681c1 100644
--- a/drivers/gpu/drm/ttm/ttm_agp_backend.c
+++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c
@@ -47,7 +47,8 @@ struct ttm_agp_backend {
47 47
48static int ttm_agp_populate(struct ttm_backend *backend, 48static int ttm_agp_populate(struct ttm_backend *backend,
49 unsigned long num_pages, struct page **pages, 49 unsigned long num_pages, struct page **pages,
50 struct page *dummy_read_page) 50 struct page *dummy_read_page,
51 dma_addr_t *dma_addrs)
51{ 52{
52 struct ttm_agp_backend *agp_be = 53 struct ttm_agp_backend *agp_be =
53 container_of(backend, struct ttm_agp_backend, backend); 54 container_of(backend, struct ttm_agp_backend, backend);
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index 0d39001259fb..86d5b1745a45 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -169,7 +169,7 @@ int ttm_tt_populate(struct ttm_tt *ttm)
169 } 169 }
170 170
171 be->func->populate(be, ttm->num_pages, ttm->pages, 171 be->func->populate(be, ttm->num_pages, ttm->pages,
172 ttm->dummy_read_page); 172 ttm->dummy_read_page, ttm->dma_address);
173 ttm->state = tt_unbound; 173 ttm->state = tt_unbound;
174 return 0; 174 return 0;
175} 175}
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
index 80bc37b274e7..87e43e0733bf 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
@@ -102,7 +102,8 @@ struct vmw_ttm_backend {
102 102
103static int vmw_ttm_populate(struct ttm_backend *backend, 103static int vmw_ttm_populate(struct ttm_backend *backend,
104 unsigned long num_pages, struct page **pages, 104 unsigned long num_pages, struct page **pages,
105 struct page *dummy_read_page) 105 struct page *dummy_read_page,
106 dma_addr_t *dma_addrs)
106{ 107{
107 struct vmw_ttm_backend *vmw_be = 108 struct vmw_ttm_backend *vmw_be =
108 container_of(backend, struct vmw_ttm_backend, backend); 109 container_of(backend, struct vmw_ttm_backend, backend);
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 6dc4fccda73c..ebcd3dd7203b 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -50,13 +50,15 @@ struct ttm_backend_func {
50 * @pages: Array of pointers to ttm pages. 50 * @pages: Array of pointers to ttm pages.
51 * @dummy_read_page: Page to be used instead of NULL pages in the 51 * @dummy_read_page: Page to be used instead of NULL pages in the
52 * array @pages. 52 * array @pages.
53 * @dma_addrs: Array of DMA (bus) address of the ttm pages.
53 * 54 *
54 * Populate the backend with ttm pages. Depending on the backend, 55 * Populate the backend with ttm pages. Depending on the backend,
55 * it may or may not copy the @pages array. 56 * it may or may not copy the @pages array.
56 */ 57 */
57 int (*populate) (struct ttm_backend *backend, 58 int (*populate) (struct ttm_backend *backend,
58 unsigned long num_pages, struct page **pages, 59 unsigned long num_pages, struct page **pages,
59 struct page *dummy_read_page); 60 struct page *dummy_read_page,
61 dma_addr_t *dma_addrs);
60 /** 62 /**
61 * struct ttm_backend_func member clear 63 * struct ttm_backend_func member clear
62 * 64 *