Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27e8b237 authored by Konrad Rzeszutek Wilk's avatar Konrad Rzeszutek Wilk
Browse files

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: default avatarThomas Hellstrom <thellstrom@shipmail.org>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tested-by: default avatarIan Campbell <ian.campbell@citrix.com>
parent 69a07f0b
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -20,7 +20,8 @@ struct nouveau_sgdma_be {


static int
static int
nouveau_sgdma_populate(struct ttm_backend *be, unsigned long num_pages,
nouveau_sgdma_populate(struct ttm_backend *be, unsigned long num_pages,
		       struct page **pages, struct page *dummy_read_page)
		       struct page **pages, struct page *dummy_read_page,
		       dma_addr_t *dma_addrs)
{
{
	struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)be;
	struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)be;
	struct drm_device *dev = nvbe->dev;
	struct drm_device *dev = nvbe->dev;
+2 −1
Original line number Original line Diff line number Diff line
@@ -655,7 +655,8 @@ struct radeon_ttm_backend {
static int radeon_ttm_backend_populate(struct ttm_backend *backend,
static int radeon_ttm_backend_populate(struct ttm_backend *backend,
				       unsigned long num_pages,
				       unsigned long num_pages,
				       struct page **pages,
				       struct page **pages,
				       struct page *dummy_read_page)
				       struct page *dummy_read_page,
				       dma_addr_t *dma_addrs)
{
{
	struct radeon_ttm_backend *gtt;
	struct radeon_ttm_backend *gtt;


+2 −1
Original line number Original line Diff line number Diff line
@@ -47,7 +47,8 @@ struct ttm_agp_backend {


static int ttm_agp_populate(struct ttm_backend *backend,
static int ttm_agp_populate(struct ttm_backend *backend,
			    unsigned long num_pages, struct page **pages,
			    unsigned long num_pages, struct page **pages,
			    struct page *dummy_read_page)
			    struct page *dummy_read_page,
			    dma_addr_t *dma_addrs)
{
{
	struct ttm_agp_backend *agp_be =
	struct ttm_agp_backend *agp_be =
	    container_of(backend, struct ttm_agp_backend, backend);
	    container_of(backend, struct ttm_agp_backend, backend);
+1 −1
Original line number Original line Diff line number Diff line
@@ -169,7 +169,7 @@ int ttm_tt_populate(struct ttm_tt *ttm)
	}
	}


	be->func->populate(be, ttm->num_pages, ttm->pages,
	be->func->populate(be, ttm->num_pages, ttm->pages,
			   ttm->dummy_read_page);
			   ttm->dummy_read_page, ttm->dma_address);
	ttm->state = tt_unbound;
	ttm->state = tt_unbound;
	return 0;
	return 0;
}
}
+2 −1
Original line number Original line Diff line number Diff line
@@ -102,7 +102,8 @@ struct vmw_ttm_backend {


static int vmw_ttm_populate(struct ttm_backend *backend,
static int vmw_ttm_populate(struct ttm_backend *backend,
			    unsigned long num_pages, struct page **pages,
			    unsigned long num_pages, struct page **pages,
			    struct page *dummy_read_page)
			    struct page *dummy_read_page,
			    dma_addr_t *dma_addrs)
{
{
	struct vmw_ttm_backend *vmw_be =
	struct vmw_ttm_backend *vmw_be =
	    container_of(backend, struct vmw_ttm_backend, backend);
	    container_of(backend, struct vmw_ttm_backend, backend);
Loading