Commit 231cdafc authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/ttm: drop ttm->dummy_read_page

Only used by the AGP backend and there it can be easily accessed using
ttm->bdev->glob.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 3231a769
...@@ -969,8 +969,7 @@ static struct ttm_backend_func amdgpu_backend_func = { ...@@ -969,8 +969,7 @@ static struct ttm_backend_func amdgpu_backend_func = {
}; };
static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_bo_device *bdev, static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_bo_device *bdev,
unsigned long size, uint32_t page_flags, unsigned long size, uint32_t page_flags)
struct page *dummy_read_page)
{ {
struct amdgpu_device *adev; struct amdgpu_device *adev;
struct amdgpu_ttm_tt *gtt; struct amdgpu_ttm_tt *gtt;
...@@ -983,7 +982,7 @@ static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_bo_device *bdev, ...@@ -983,7 +982,7 @@ static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_bo_device *bdev,
} }
gtt->ttm.ttm.func = &amdgpu_backend_func; gtt->ttm.ttm.func = &amdgpu_backend_func;
gtt->adev = adev; gtt->adev = adev;
if (ttm_dma_tt_init(&gtt->ttm, bdev, size, page_flags, dummy_read_page)) { if (ttm_dma_tt_init(&gtt->ttm, bdev, size, page_flags)) {
kfree(gtt); kfree(gtt);
return NULL; return NULL;
} }
......
...@@ -200,8 +200,7 @@ static struct ttm_backend_func ast_tt_backend_func = { ...@@ -200,8 +200,7 @@ static struct ttm_backend_func ast_tt_backend_func = {
static struct ttm_tt *ast_ttm_tt_create(struct ttm_bo_device *bdev, static struct ttm_tt *ast_ttm_tt_create(struct ttm_bo_device *bdev,
unsigned long size, uint32_t page_flags, unsigned long size, uint32_t page_flags)
struct page *dummy_read_page)
{ {
struct ttm_tt *tt; struct ttm_tt *tt;
...@@ -209,7 +208,7 @@ static struct ttm_tt *ast_ttm_tt_create(struct ttm_bo_device *bdev, ...@@ -209,7 +208,7 @@ static struct ttm_tt *ast_ttm_tt_create(struct ttm_bo_device *bdev,
if (tt == NULL) if (tt == NULL)
return NULL; return NULL;
tt->func = &ast_tt_backend_func; tt->func = &ast_tt_backend_func;
if (ttm_tt_init(tt, bdev, size, page_flags, dummy_read_page)) { if (ttm_tt_init(tt, bdev, size, page_flags)) {
kfree(tt); kfree(tt);
return NULL; return NULL;
} }
......
...@@ -178,8 +178,7 @@ static struct ttm_backend_func bochs_tt_backend_func = { ...@@ -178,8 +178,7 @@ static struct ttm_backend_func bochs_tt_backend_func = {
static struct ttm_tt *bochs_ttm_tt_create(struct ttm_bo_device *bdev, static struct ttm_tt *bochs_ttm_tt_create(struct ttm_bo_device *bdev,
unsigned long size, unsigned long size,
uint32_t page_flags, uint32_t page_flags)
struct page *dummy_read_page)
{ {
struct ttm_tt *tt; struct ttm_tt *tt;
...@@ -187,7 +186,7 @@ static struct ttm_tt *bochs_ttm_tt_create(struct ttm_bo_device *bdev, ...@@ -187,7 +186,7 @@ static struct ttm_tt *bochs_ttm_tt_create(struct ttm_bo_device *bdev,
if (tt == NULL) if (tt == NULL)
return NULL; return NULL;
tt->func = &bochs_tt_backend_func; tt->func = &bochs_tt_backend_func;
if (ttm_tt_init(tt, bdev, size, page_flags, dummy_read_page)) { if (ttm_tt_init(tt, bdev, size, page_flags)) {
kfree(tt); kfree(tt);
return NULL; return NULL;
} }
......
...@@ -200,8 +200,7 @@ static struct ttm_backend_func cirrus_tt_backend_func = { ...@@ -200,8 +200,7 @@ static struct ttm_backend_func cirrus_tt_backend_func = {
static struct ttm_tt *cirrus_ttm_tt_create(struct ttm_bo_device *bdev, static struct ttm_tt *cirrus_ttm_tt_create(struct ttm_bo_device *bdev,
unsigned long size, uint32_t page_flags, unsigned long size, uint32_t page_flags)
struct page *dummy_read_page)
{ {
struct ttm_tt *tt; struct ttm_tt *tt;
...@@ -209,7 +208,7 @@ static struct ttm_tt *cirrus_ttm_tt_create(struct ttm_bo_device *bdev, ...@@ -209,7 +208,7 @@ static struct ttm_tt *cirrus_ttm_tt_create(struct ttm_bo_device *bdev,
if (tt == NULL) if (tt == NULL)
return NULL; return NULL;
tt->func = &cirrus_tt_backend_func; tt->func = &cirrus_tt_backend_func;
if (ttm_tt_init(tt, bdev, size, page_flags, dummy_read_page)) { if (ttm_tt_init(tt, bdev, size, page_flags)) {
kfree(tt); kfree(tt);
return NULL; return NULL;
} }
......
...@@ -202,8 +202,7 @@ static struct ttm_backend_func hibmc_tt_backend_func = { ...@@ -202,8 +202,7 @@ static struct ttm_backend_func hibmc_tt_backend_func = {
static struct ttm_tt *hibmc_ttm_tt_create(struct ttm_bo_device *bdev, static struct ttm_tt *hibmc_ttm_tt_create(struct ttm_bo_device *bdev,
unsigned long size, unsigned long size,
u32 page_flags, u32 page_flags)
struct page *dummy_read_page)
{ {
struct ttm_tt *tt; struct ttm_tt *tt;
int ret; int ret;
...@@ -214,7 +213,7 @@ static struct ttm_tt *hibmc_ttm_tt_create(struct ttm_bo_device *bdev, ...@@ -214,7 +213,7 @@ static struct ttm_tt *hibmc_ttm_tt_create(struct ttm_bo_device *bdev,
return NULL; return NULL;
} }
tt->func = &hibmc_tt_backend_func; tt->func = &hibmc_tt_backend_func;
ret = ttm_tt_init(tt, bdev, size, page_flags, dummy_read_page); ret = ttm_tt_init(tt, bdev, size, page_flags);
if (ret) { if (ret) {
DRM_ERROR("failed to initialize ttm_tt: %d\n", ret); DRM_ERROR("failed to initialize ttm_tt: %d\n", ret);
kfree(tt); kfree(tt);
......
...@@ -200,8 +200,7 @@ static struct ttm_backend_func mgag200_tt_backend_func = { ...@@ -200,8 +200,7 @@ static struct ttm_backend_func mgag200_tt_backend_func = {
static struct ttm_tt *mgag200_ttm_tt_create(struct ttm_bo_device *bdev, static struct ttm_tt *mgag200_ttm_tt_create(struct ttm_bo_device *bdev,
unsigned long size, uint32_t page_flags, unsigned long size, uint32_t page_flags)
struct page *dummy_read_page)
{ {
struct ttm_tt *tt; struct ttm_tt *tt;
...@@ -209,7 +208,7 @@ static struct ttm_tt *mgag200_ttm_tt_create(struct ttm_bo_device *bdev, ...@@ -209,7 +208,7 @@ static struct ttm_tt *mgag200_ttm_tt_create(struct ttm_bo_device *bdev,
if (tt == NULL) if (tt == NULL)
return NULL; return NULL;
tt->func = &mgag200_tt_backend_func; tt->func = &mgag200_tt_backend_func;
if (ttm_tt_init(tt, bdev, size, page_flags, dummy_read_page)) { if (ttm_tt_init(tt, bdev, size, page_flags)) {
kfree(tt); kfree(tt);
return NULL; return NULL;
} }
......
...@@ -605,18 +605,18 @@ nouveau_bo_wr32(struct nouveau_bo *nvbo, unsigned index, u32 val) ...@@ -605,18 +605,18 @@ nouveau_bo_wr32(struct nouveau_bo *nvbo, unsigned index, u32 val)
static struct ttm_tt * static struct ttm_tt *
nouveau_ttm_tt_create(struct ttm_bo_device *bdev, unsigned long size, nouveau_ttm_tt_create(struct ttm_bo_device *bdev, unsigned long size,
uint32_t page_flags, struct page *dummy_read) uint32_t page_flags)
{ {
#if IS_ENABLED(CONFIG_AGP) #if IS_ENABLED(CONFIG_AGP)
struct nouveau_drm *drm = nouveau_bdev(bdev); struct nouveau_drm *drm = nouveau_bdev(bdev);
if (drm->agp.bridge) { if (drm->agp.bridge) {
return ttm_agp_tt_create(bdev, drm->agp.bridge, size, return ttm_agp_tt_create(bdev, drm->agp.bridge, size,
page_flags, dummy_read); page_flags);
} }
#endif #endif
return nouveau_sgdma_create_ttm(bdev, size, page_flags, dummy_read); return nouveau_sgdma_create_ttm(bdev, size, page_flags);
} }
static int static int
......
...@@ -83,8 +83,7 @@ static struct ttm_backend_func nv50_sgdma_backend = { ...@@ -83,8 +83,7 @@ static struct ttm_backend_func nv50_sgdma_backend = {
struct ttm_tt * struct ttm_tt *
nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev, nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev,
unsigned long size, uint32_t page_flags, unsigned long size, uint32_t page_flags)
struct page *dummy_read_page)
{ {
struct nouveau_drm *drm = nouveau_bdev(bdev); struct nouveau_drm *drm = nouveau_bdev(bdev);
struct nouveau_sgdma_be *nvbe; struct nouveau_sgdma_be *nvbe;
...@@ -98,7 +97,7 @@ nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev, ...@@ -98,7 +97,7 @@ nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev,
else else
nvbe->ttm.ttm.func = &nv50_sgdma_backend; nvbe->ttm.ttm.func = &nv50_sgdma_backend;
if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags, dummy_read_page)) if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags))
/* /*
* A failing ttm_dma_tt_init() will call ttm_tt_destroy() * A failing ttm_dma_tt_init() will call ttm_tt_destroy()
* and thus our nouveau_sgdma_destroy() hook, so we don't need * and thus our nouveau_sgdma_destroy() hook, so we don't need
......
...@@ -13,8 +13,7 @@ extern const struct ttm_mem_type_manager_func nouveau_gart_manager; ...@@ -13,8 +13,7 @@ extern const struct ttm_mem_type_manager_func nouveau_gart_manager;
extern const struct ttm_mem_type_manager_func nv04_gart_manager; extern const struct ttm_mem_type_manager_func nv04_gart_manager;
struct ttm_tt *nouveau_sgdma_create_ttm(struct ttm_bo_device *, struct ttm_tt *nouveau_sgdma_create_ttm(struct ttm_bo_device *,
unsigned long size, u32 page_flags, unsigned long size, u32 page_flags);
struct page *dummy_read_page);
int nouveau_ttm_init(struct nouveau_drm *drm); int nouveau_ttm_init(struct nouveau_drm *drm);
void nouveau_ttm_fini(struct nouveau_drm *drm); void nouveau_ttm_fini(struct nouveau_drm *drm);
......
...@@ -292,8 +292,7 @@ static struct ttm_backend_func qxl_backend_func = { ...@@ -292,8 +292,7 @@ static struct ttm_backend_func qxl_backend_func = {
}; };
static struct ttm_tt *qxl_ttm_tt_create(struct ttm_bo_device *bdev, static struct ttm_tt *qxl_ttm_tt_create(struct ttm_bo_device *bdev,
unsigned long size, uint32_t page_flags, unsigned long size, uint32_t page_flags)
struct page *dummy_read_page)
{ {
struct qxl_device *qdev; struct qxl_device *qdev;
struct qxl_ttm_tt *gtt; struct qxl_ttm_tt *gtt;
...@@ -304,8 +303,7 @@ static struct ttm_tt *qxl_ttm_tt_create(struct ttm_bo_device *bdev, ...@@ -304,8 +303,7 @@ static struct ttm_tt *qxl_ttm_tt_create(struct ttm_bo_device *bdev,
return NULL; return NULL;
gtt->ttm.ttm.func = &qxl_backend_func; gtt->ttm.ttm.func = &qxl_backend_func;
gtt->qdev = qdev; gtt->qdev = qdev;
if (ttm_dma_tt_init(&gtt->ttm, bdev, size, page_flags, if (ttm_dma_tt_init(&gtt->ttm, bdev, size, page_flags)) {
dummy_read_page)) {
kfree(gtt); kfree(gtt);
return NULL; return NULL;
} }
......
...@@ -687,8 +687,7 @@ static struct ttm_backend_func radeon_backend_func = { ...@@ -687,8 +687,7 @@ static struct ttm_backend_func radeon_backend_func = {
}; };
static struct ttm_tt *radeon_ttm_tt_create(struct ttm_bo_device *bdev, static struct ttm_tt *radeon_ttm_tt_create(struct ttm_bo_device *bdev,
unsigned long size, uint32_t page_flags, unsigned long size, uint32_t page_flags)
struct page *dummy_read_page)
{ {
struct radeon_device *rdev; struct radeon_device *rdev;
struct radeon_ttm_tt *gtt; struct radeon_ttm_tt *gtt;
...@@ -697,7 +696,7 @@ static struct ttm_tt *radeon_ttm_tt_create(struct ttm_bo_device *bdev, ...@@ -697,7 +696,7 @@ static struct ttm_tt *radeon_ttm_tt_create(struct ttm_bo_device *bdev,
#if IS_ENABLED(CONFIG_AGP) #if IS_ENABLED(CONFIG_AGP)
if (rdev->flags & RADEON_IS_AGP) { if (rdev->flags & RADEON_IS_AGP) {
return ttm_agp_tt_create(bdev, rdev->ddev->agp->bridge, return ttm_agp_tt_create(bdev, rdev->ddev->agp->bridge,
size, page_flags, dummy_read_page); size, page_flags);
} }
#endif #endif
...@@ -707,7 +706,7 @@ static struct ttm_tt *radeon_ttm_tt_create(struct ttm_bo_device *bdev, ...@@ -707,7 +706,7 @@ static struct ttm_tt *radeon_ttm_tt_create(struct ttm_bo_device *bdev,
} }
gtt->ttm.ttm.func = &radeon_backend_func; gtt->ttm.ttm.func = &radeon_backend_func;
gtt->rdev = rdev; gtt->rdev = rdev;
if (ttm_dma_tt_init(&gtt->ttm, bdev, size, page_flags, dummy_read_page)) { if (ttm_dma_tt_init(&gtt->ttm, bdev, size, page_flags)) {
kfree(gtt); kfree(gtt);
return NULL; return NULL;
} }
......
...@@ -50,6 +50,7 @@ struct ttm_agp_backend { ...@@ -50,6 +50,7 @@ struct ttm_agp_backend {
static int ttm_agp_bind(struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem) static int ttm_agp_bind(struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem)
{ {
struct ttm_agp_backend *agp_be = container_of(ttm, struct ttm_agp_backend, ttm); struct ttm_agp_backend *agp_be = container_of(ttm, struct ttm_agp_backend, ttm);
struct page *dummy_read_page = ttm->bdev->glob->dummy_read_page;
struct drm_mm_node *node = bo_mem->mm_node; struct drm_mm_node *node = bo_mem->mm_node;
struct agp_memory *mem; struct agp_memory *mem;
int ret, cached = (bo_mem->placement & TTM_PL_FLAG_CACHED); int ret, cached = (bo_mem->placement & TTM_PL_FLAG_CACHED);
...@@ -64,7 +65,7 @@ static int ttm_agp_bind(struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem) ...@@ -64,7 +65,7 @@ static int ttm_agp_bind(struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem)
struct page *page = ttm->pages[i]; struct page *page = ttm->pages[i];
if (!page) if (!page)
page = ttm->dummy_read_page; page = dummy_read_page;
mem->pages[mem->page_count++] = page; mem->pages[mem->page_count++] = page;
} }
...@@ -111,8 +112,7 @@ static struct ttm_backend_func ttm_agp_func = { ...@@ -111,8 +112,7 @@ static struct ttm_backend_func ttm_agp_func = {
struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev, struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev,
struct agp_bridge_data *bridge, struct agp_bridge_data *bridge,
unsigned long size, uint32_t page_flags, unsigned long size, uint32_t page_flags)
struct page *dummy_read_page)
{ {
struct ttm_agp_backend *agp_be; struct ttm_agp_backend *agp_be;
...@@ -124,7 +124,7 @@ struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev, ...@@ -124,7 +124,7 @@ struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev,
agp_be->bridge = bridge; agp_be->bridge = bridge;
agp_be->ttm.func = &ttm_agp_func; agp_be->ttm.func = &ttm_agp_func;
if (ttm_tt_init(&agp_be->ttm, bdev, size, page_flags, dummy_read_page)) { if (ttm_tt_init(&agp_be->ttm, bdev, size, page_flags)) {
kfree(agp_be); kfree(agp_be);
return NULL; return NULL;
} }
......
...@@ -228,7 +228,6 @@ EXPORT_SYMBOL(ttm_bo_move_to_lru_tail); ...@@ -228,7 +228,6 @@ EXPORT_SYMBOL(ttm_bo_move_to_lru_tail);
static int ttm_bo_add_ttm(struct ttm_buffer_object *bo, bool zero_alloc) static int ttm_bo_add_ttm(struct ttm_buffer_object *bo, bool zero_alloc)
{ {
struct ttm_bo_device *bdev = bo->bdev; struct ttm_bo_device *bdev = bo->bdev;
struct ttm_bo_global *glob = bdev->glob;
int ret = 0; int ret = 0;
uint32_t page_flags = 0; uint32_t page_flags = 0;
...@@ -247,14 +246,13 @@ static int ttm_bo_add_ttm(struct ttm_buffer_object *bo, bool zero_alloc) ...@@ -247,14 +246,13 @@ static int ttm_bo_add_ttm(struct ttm_buffer_object *bo, bool zero_alloc)
page_flags |= TTM_PAGE_FLAG_ZERO_ALLOC; page_flags |= TTM_PAGE_FLAG_ZERO_ALLOC;
case ttm_bo_type_kernel: case ttm_bo_type_kernel:
bo->ttm = bdev->driver->ttm_tt_create(bdev, bo->num_pages << PAGE_SHIFT, bo->ttm = bdev->driver->ttm_tt_create(bdev, bo->num_pages << PAGE_SHIFT,
page_flags, glob->dummy_read_page); page_flags);
if (unlikely(bo->ttm == NULL)) if (unlikely(bo->ttm == NULL))
ret = -ENOMEM; ret = -ENOMEM;
break; break;
case ttm_bo_type_sg: case ttm_bo_type_sg:
bo->ttm = bdev->driver->ttm_tt_create(bdev, bo->num_pages << PAGE_SHIFT, bo->ttm = bdev->driver->ttm_tt_create(bdev, bo->num_pages << PAGE_SHIFT,
page_flags | TTM_PAGE_FLAG_SG, page_flags | TTM_PAGE_FLAG_SG);
glob->dummy_read_page);
if (unlikely(bo->ttm == NULL)) { if (unlikely(bo->ttm == NULL)) {
ret = -ENOMEM; ret = -ENOMEM;
break; break;
......
...@@ -191,14 +191,12 @@ void ttm_tt_destroy(struct ttm_tt *ttm) ...@@ -191,14 +191,12 @@ void ttm_tt_destroy(struct ttm_tt *ttm)
} }
int ttm_tt_init(struct ttm_tt *ttm, struct ttm_bo_device *bdev, int ttm_tt_init(struct ttm_tt *ttm, struct ttm_bo_device *bdev,
unsigned long size, uint32_t page_flags, unsigned long size, uint32_t page_flags)
struct page *dummy_read_page)
{ {
ttm->bdev = bdev; ttm->bdev = bdev;
ttm->num_pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; ttm->num_pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
ttm->caching_state = tt_cached; ttm->caching_state = tt_cached;
ttm->page_flags = page_flags; ttm->page_flags = page_flags;
ttm->dummy_read_page = dummy_read_page;
ttm->state = tt_unpopulated; ttm->state = tt_unpopulated;
ttm->swap_storage = NULL; ttm->swap_storage = NULL;
...@@ -219,8 +217,7 @@ void ttm_tt_fini(struct ttm_tt *ttm) ...@@ -219,8 +217,7 @@ void ttm_tt_fini(struct ttm_tt *ttm)
EXPORT_SYMBOL(ttm_tt_fini); EXPORT_SYMBOL(ttm_tt_fini);
int ttm_dma_tt_init(struct ttm_dma_tt *ttm_dma, struct ttm_bo_device *bdev, int ttm_dma_tt_init(struct ttm_dma_tt *ttm_dma, struct ttm_bo_device *bdev,
unsigned long size, uint32_t page_flags, unsigned long size, uint32_t page_flags)
struct page *dummy_read_page)
{ {
struct ttm_tt *ttm = &ttm_dma->ttm; struct ttm_tt *ttm = &ttm_dma->ttm;
...@@ -228,7 +225,6 @@ int ttm_dma_tt_init(struct ttm_dma_tt *ttm_dma, struct ttm_bo_device *bdev, ...@@ -228,7 +225,6 @@ int ttm_dma_tt_init(struct ttm_dma_tt *ttm_dma, struct ttm_bo_device *bdev,
ttm->num_pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; ttm->num_pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
ttm->caching_state = tt_cached; ttm->caching_state = tt_cached;
ttm->page_flags = page_flags; ttm->page_flags = page_flags;
ttm->dummy_read_page = dummy_read_page;
ttm->state = tt_unpopulated; ttm->state = tt_unpopulated;
ttm->swap_storage = NULL; ttm->swap_storage = NULL;
......
...@@ -326,8 +326,7 @@ static struct ttm_backend_func virtio_gpu_backend_func = { ...@@ -326,8 +326,7 @@ static struct ttm_backend_func virtio_gpu_backend_func = {
static struct ttm_tt *virtio_gpu_ttm_tt_create(struct ttm_bo_device *bdev, static struct ttm_tt *virtio_gpu_ttm_tt_create(struct ttm_bo_device *bdev,
unsigned long size, unsigned long size,
uint32_t page_flags, uint32_t page_flags)
struct page *dummy_read_page)
{ {
struct virtio_gpu_device *vgdev; struct virtio_gpu_device *vgdev;
struct virtio_gpu_ttm_tt *gtt; struct virtio_gpu_ttm_tt *gtt;
...@@ -338,8 +337,7 @@ static struct ttm_tt *virtio_gpu_ttm_tt_create(struct ttm_bo_device *bdev, ...@@ -338,8 +337,7 @@ static struct ttm_tt *virtio_gpu_ttm_tt_create(struct ttm_bo_device *bdev,
return NULL; return NULL;
gtt->ttm.ttm.func = &virtio_gpu_backend_func; gtt->ttm.ttm.func = &virtio_gpu_backend_func;
gtt->vgdev = vgdev; gtt->vgdev = vgdev;
if (ttm_dma_tt_init(&gtt->ttm, bdev, size, page_flags, if (ttm_dma_tt_init(&gtt->ttm, bdev, size, page_flags)) {
dummy_read_page)) {
kfree(gtt); kfree(gtt);
return NULL; return NULL;
} }
......
...@@ -694,8 +694,7 @@ static struct ttm_backend_func vmw_ttm_func = { ...@@ -694,8 +694,7 @@ static struct ttm_backend_func vmw_ttm_func = {
}; };
static struct ttm_tt *vmw_ttm_tt_create(struct ttm_bo_device *bdev, static struct ttm_tt *vmw_ttm_tt_create(struct ttm_bo_device *bdev,
unsigned long size, uint32_t page_flags, unsigned long size, uint32_t page_flags)
struct page *dummy_read_page)
{ {
struct vmw_ttm_tt *vmw_be; struct vmw_ttm_tt *vmw_be;
int ret; int ret;
...@@ -709,11 +708,9 @@ static struct ttm_tt *vmw_ttm_tt_create(struct ttm_bo_device *bdev, ...@@ -709,11 +708,9 @@ static struct ttm_tt *vmw_ttm_tt_create(struct ttm_bo_device *bdev,
vmw_be->mob = NULL; vmw_be->mob = NULL;
if (vmw_be->dev_priv->map_mode == vmw_dma_alloc_coherent) if (vmw_be->dev_priv->map_mode == vmw_dma_alloc_coherent)
ret = ttm_dma_tt_init(&vmw_be->dma_ttm, bdev, size, page_flags, ret = ttm_dma_tt_init(&vmw_be->dma_ttm, bdev, size, page_flags);
dummy_read_page);
else else
ret = ttm_tt_init(&vmw_be->dma_ttm.ttm, bdev, size, page_flags, ret = ttm_tt_init(&vmw_be->dma_ttm.ttm, bdev, size, page_flags);
dummy_read_page);
if (unlikely(ret != 0)) if (unlikely(ret != 0))
goto out_no_init; goto out_no_init;
......
...@@ -195,8 +195,7 @@ static struct ttm_backend_func vbox_tt_backend_func = { ...@@ -195,8 +195,7 @@ static struct ttm_backend_func vbox_tt_backend_func = {
static struct ttm_tt *vbox_ttm_tt_create(struct ttm_bo_device *bdev, static struct ttm_tt *vbox_ttm_tt_create(struct ttm_bo_device *bdev,
unsigned long size, unsigned long size,
u32 page_flags, u32 page_flags)
struct page *dummy_read_page)
{ {
struct ttm_tt *tt; struct ttm_tt *tt;
...@@ -205,7 +204,7 @@ static struct ttm_tt *vbox_ttm_tt_create(struct ttm_bo_device *bdev, ...@@ -205,7 +204,7 @@ static struct ttm_tt *vbox_ttm_tt_create(struct ttm_bo_device *bdev,
return NULL; return NULL;
tt->func = &vbox_tt_backend_func; tt->func = &vbox_tt_backend_func;
if (ttm_tt_init(tt, bdev, size, page_flags, dummy_read_page)) { if (ttm_tt_init(tt, bdev, size, page_flags)) {
kfree(tt); kfree(tt);
return NULL; return NULL;
} }
......
...@@ -100,7 +100,6 @@ enum ttm_caching_state { ...@@ -100,7 +100,6 @@ enum ttm_caching_state {
* @bdev: Pointer to a struct ttm_bo_device. * @bdev: Pointer to a struct ttm_bo_device.
* @func: Pointer to a struct ttm_backend_func that describes * @func: Pointer to a struct ttm_backend_func that describes
* the backend methods. * the backend methods.
* @dummy_read_page: Page to map where the ttm_tt page array contains a NULL
* pointer. * pointer.
* @pages: Array of pages backing the data. * @pages: Array of pages backing the data.
* @num_pages: Number of pages in the page array. * @num_pages: Number of pages in the page array.
...@@ -118,7 +117,6 @@ enum ttm_caching_state { ...@@ -118,7 +117,6 @@ enum ttm_caching_state {
struct ttm_tt { struct ttm_tt {
struct ttm_bo_device *bdev; struct ttm_bo_device *bdev;
struct ttm_backend_func *func; struct ttm_backend_func *func;
struct page *dummy_read_page;
struct page **pages; struct page **pages;
uint32_t page_flags; uint32_t page_flags;
unsigned long num_pages; unsigned long num_pages;
...@@ -331,7 +329,6 @@ struct ttm_bo_driver { ...@@ -331,7 +329,6 @@ struct ttm_bo_driver {
* @bdev: pointer to a struct ttm_bo_device: * @bdev: pointer to a struct ttm_bo_device:
* @size: Size of the data needed backing. * @size: Size of the data needed backing.
* @page_flags: Page flags as identified by TTM_PAGE_FLAG_XX flags. * @page_flags: Page flags as identified by TTM_PAGE_FLAG_XX flags.
* @dummy_read_page: See struct ttm_bo_device.
* *
* Create a struct ttm_tt to back data with system memory pages. * Create a struct ttm_tt to back data with system memory pages.
* No pages are actually allocated. * No pages are actually allocated.
...@@ -340,8 +337,7 @@ struct ttm_bo_driver { ...@@ -340,8 +337,7 @@ struct ttm_bo_driver {
*/ */
struct ttm_tt *(*ttm_tt_create)(struct ttm_bo_device *bdev, struct ttm_tt *(*ttm_tt_create)(struct ttm_bo_device *bdev,
unsigned long size, unsigned long size,
uint32_t page_flags, uint32_t page_flags);
struct page *dummy_read_page);
/** /**
* ttm_tt_populate * ttm_tt_populate
...@@ -621,7 +617,6 @@ ttm_flag_masked(uint32_t *old, uint32_t new, uint32_t mask) ...@@ -621,7 +617,6 @@ ttm_flag_masked(uint32_t *old, uint32_t new, uint32_t mask)
* @bdev: pointer to a struct ttm_bo_device: * @bdev: pointer to a struct ttm_bo_device:
* @size: Size of the data needed backing. * @size: Size of the data needed backing.
* @page_flags: Page flags as identified by TTM_PAGE_FLAG_XX flags. * @page_flags: Page flags as identified by TTM_PAGE_FLAG_XX flags.
* @dummy_read_page: See struct ttm_bo_device.
* *
* Create a struct ttm_tt to back data with system memory pages. * Create a struct ttm_tt to back data with system memory pages.
* No pages are actually allocated. * No pages are actually allocated.
...@@ -629,11 +624,9 @@ ttm_flag_masked(uint32_t *old, uint32_t new, uint32_t mask) ...@@ -629,11 +624,9 @@ ttm_flag_masked(uint32_t *old, uint32_t new, uint32_t mask)
* NULL: Out of memory. * NULL: Out of memory.
*/ */
int ttm_tt_init(struct ttm_tt *ttm, struct ttm_bo_device *bdev, int ttm_tt_init(struct ttm_tt *ttm, struct ttm_bo_device *bdev,
unsigned long size, uint32_t page_flags, unsigned long size, uint32_t page_flags);
struct page *dummy_read_page);
int ttm_dma_tt_init(struct ttm_dma_tt *ttm_dma, struct ttm_bo_device *bdev, int ttm_dma_tt_init(struct ttm_dma_tt *ttm_dma, struct ttm_bo_device *bdev,
unsigned long size, uint32_t page_flags, unsigned long size, uint32_t page_flags);
struct page *dummy_read_page);
/** /**
* ttm_tt_fini * ttm_tt_fini
...@@ -1080,7 +1073,6 @@ extern const struct ttm_mem_type_manager_func ttm_bo_manager_func; ...@@ -1080,7 +1073,6 @@ extern const struct ttm_mem_type_manager_func ttm_bo_manager_func;
* @bridge: The agp bridge this device is sitting on. * @bridge: The agp bridge this device is sitting on.
* @size: Size of the data needed backing. * @size: Size of the data needed backing.
* @page_flags: Page flags as identified by TTM_PAGE_FLAG_XX flags. * @page_flags: Page flags as identified by TTM_PAGE_FLAG_XX flags.
* @dummy_read_page: See struct ttm_bo_device.
* *
* *
* Create a TTM backend that uses the indicated AGP bridge as an aperture * Create a TTM backend that uses the indicated AGP bridge as an aperture
...@@ -1089,8 +1081,7 @@ extern const struct ttm_mem_type_manager_func ttm_bo_manager_func; ...@@ -1089,8 +1081,7 @@ extern const struct ttm_mem_type_manager_func ttm_bo_manager_func;
*/ */
struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev, struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev,
struct agp_bridge_data *bridge, struct agp_bridge_data *bridge,
unsigned long size, uint32_t page_flags, unsigned long size, uint32_t page_flags);
struct page *dummy_read_page);
int ttm_agp_tt_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx); int ttm_agp_tt_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx);
void ttm_agp_tt_unpopulate(struct ttm_tt *ttm); void ttm_agp_tt_unpopulate(struct ttm_tt *ttm);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment