summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nouveau_ttm.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2020-08-04 12:56:12 +1000
committerDave Airlie <airlied@redhat.com>2020-08-06 12:32:03 +1000
commitf301da74a417a77b3a8ff96e87c219d5288a939f (patch)
treeb58eecfe26c01c475ffbee3ece4078fef819d6eb /drivers/gpu/drm/nouveau/nouveau_ttm.c
parent3004add06d1c99ea36bf6120b9ff9427e301ad95 (diff)
drm/nouveau/ttm: use wrapper to access memory managers
Reviewed-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-40-airlied@gmail.com
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_ttm.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_ttm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
index bb310719e3f5..cc6cf04553dd 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
@@ -156,7 +156,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;
@@ -186,7 +186,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_mem_type_manager_disable(man);
@@ -199,7 +199,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) {
@@ -228,7 +228,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)