[PATCH 29/49] drm/nouveau/ttm: use wrapper to access memory managers
Dave Airlie
airlied at gmail.com
Fri Jul 31 04:05:00 UTC 2020
From: Dave Airlie <airlied at redhat.com>
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
drivers/gpu/drm/nouveau/nouveau_ttm.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
index 2ccfdf203c52..ed651d7679fe 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
@@ -165,7 +165,7 @@ nouveau_ttm_init_host(struct nouveau_drm *drm, u8 kind)
static int
nouveau_ttm_init_vram(struct nouveau_drm *drm)
{
- struct ttm_mem_type_manager *man = &drm->ttm.bdev.man[TTM_PL_VRAM];
+ struct ttm_mem_type_manager *man = ttm_manager_type(&drm->ttm.bdev, TTM_PL_VRAM);
struct nvif_mmu *mmu = &drm->client.mmu;
man->available_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC;
@@ -195,7 +195,7 @@ nouveau_ttm_init_vram(struct nouveau_drm *drm)
static void
nouveau_ttm_fini_vram(struct nouveau_drm *drm)
{
- struct ttm_mem_type_manager *man = &drm->ttm.bdev.man[TTM_PL_VRAM];
+ struct ttm_mem_type_manager *man = ttm_manager_type(&drm->ttm.bdev, TTM_PL_VRAM);
if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA) {
ttm_bo_disable_mm(man);
@@ -208,7 +208,7 @@ nouveau_ttm_fini_vram(struct nouveau_drm *drm)
static int
nouveau_ttm_init_gtt(struct nouveau_drm *drm)
{
- struct ttm_mem_type_manager *man = &drm->ttm.bdev.man[TTM_PL_TT];
+ struct ttm_mem_type_manager *man = ttm_manager_type(&drm->ttm.bdev, TTM_PL_TT);
unsigned long size_pages = drm->gem.gart_available >> PAGE_SHIFT;
man->use_tt = true;
if (drm->agp.bridge) {
@@ -237,7 +237,7 @@ nouveau_ttm_init_gtt(struct nouveau_drm *drm)
static void
nouveau_ttm_fini_gtt(struct nouveau_drm *drm)
{
- struct ttm_mem_type_manager *man = &drm->ttm.bdev.man[TTM_PL_TT];
+ struct ttm_mem_type_manager *man = ttm_manager_type(&drm->ttm.bdev, TTM_PL_TT);
if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA &&
drm->agp.bridge)
--
2.26.2
More information about the dri-devel
mailing list