diff options
author | Christian König <christian.koenig@amd.com> | 2020-10-24 13:13:25 +0200 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2020-10-29 15:57:17 +0100 |
commit | 461619f5c3242aaee9ec3f0b7072719bd86ea207 (patch) | |
tree | 00ba0b40be1dc6a427c7e729412f742f5ee08500 | |
parent | 0fe3cf3a53b5c1205ec7d321be1185b075dff205 (diff) | |
download | linux-461619f5c3242aaee9ec3f0b7072719bd86ea207.tar.gz linux-461619f5c3242aaee9ec3f0b7072719bd86ea207.tar.bz2 linux-461619f5c3242aaee9ec3f0b7072719bd86ea207.zip |
drm/nouveau: switch to new allocator
It should be able to handle all cases now.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Madhav Chauhan <madhav.chauhan@amd.com>
Tested-by: Huang Rui <ray.huang@amd.com>
Link: https://patchwork.freedesktop.org/patch/397082/?series=83051&rev=1
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bo.c | 30 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drv.h | 1 |
2 files changed, 2 insertions, 29 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 75fddbcd7832..746c06ed195b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -1327,25 +1327,13 @@ nouveau_ttm_tt_populate(struct ttm_bo_device *bdev, drm = nouveau_bdev(bdev); dev = drm->dev->dev; -#if IS_ENABLED(CONFIG_AGP) - if (drm->agp.bridge) { - return ttm_pool_populate(ttm, ctx); - } -#endif - -#if IS_ENABLED(CONFIG_SWIOTLB) && IS_ENABLED(CONFIG_X86) - if (swiotlb_nr_tbl()) { - return ttm_dma_populate((void *)ttm, dev, ctx); - } -#endif - return ttm_populate_and_map_pages(dev, ttm_dma, ctx); + return ttm_pool_alloc(&drm->ttm.bdev.pool, ttm, ctx); } static void nouveau_ttm_tt_unpopulate(struct ttm_bo_device *bdev, struct ttm_tt *ttm) { - struct ttm_tt *ttm_dma = (void *)ttm; struct nouveau_drm *drm; struct device *dev; bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG); @@ -1356,21 +1344,7 @@ nouveau_ttm_tt_unpopulate(struct ttm_bo_device *bdev, drm = nouveau_bdev(bdev); dev = drm->dev->dev; -#if IS_ENABLED(CONFIG_AGP) - if (drm->agp.bridge) { - ttm_pool_unpopulate(ttm); - return; - } -#endif - -#if IS_ENABLED(CONFIG_SWIOTLB) && IS_ENABLED(CONFIG_X86) - if (swiotlb_nr_tbl()) { - ttm_dma_unpopulate((void *)ttm, dev); - return; - } -#endif - - ttm_unmap_and_unpopulate_pages(dev, ttm_dma); + return ttm_pool_free(&drm->ttm.bdev.pool, ttm); } static void diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index b8025507a9e4..9d04d1b36434 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h @@ -56,7 +56,6 @@ #include <drm/ttm/ttm_placement.h> #include <drm/ttm/ttm_memory.h> #include <drm/ttm/ttm_module.h> -#include <drm/ttm/ttm_page_alloc.h> #include <drm/drm_audio_component.h> |