[PATCH 6/7] radeon/nouveau/ttm/AGP: Use dma_addr if TTM has set it.

From: Konrad Rzeszutek Wilk
Date: Mon Dec 06 2010 - 21:09:23 EST


For the AGP case we are heavily relaying on the AGP API to
setup the GART, and insert the bus addresses of the pages in the
GART. Both radeon and nouveau use this for their AGP cards.

TTM, with the patch titled "ttm: Utilize the dma_addr_t array for
pages that are to in DMA32 pool", can create pages that have
already passed through the DMA API, and the DMA (bus) address
is saved. For this to work properly with the GART we need to
pass in the bus addresses to the AGP API, which we do
by setting the dma_addr field of 'struct agp_memory' with the
dma_address obtained from the TTM.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
drivers/gpu/drm/ttm/ttm_agp_backend.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_agp_backend.c b/drivers/gpu/drm/ttm/ttm_agp_backend.c
index 1c4a72f..df4e1a9 100644
--- a/drivers/gpu/drm/ttm/ttm_agp_backend.c
+++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c
@@ -64,7 +64,7 @@ static int ttm_agp_populate(struct ttm_backend *backend,
struct page *page = *cur_page;
if (!page)
page = dummy_read_page;
-
+ mem->dma_addr[mem->page_count] = dma_addrs[mem->page_count];
mem->pages[mem->page_count++] = page;
}
agp_be->mem = mem;
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/