Commit f301da74 authored by Dave Airlie's avatar Dave Airlie

drm/nouveau/ttm: use wrapper to access memory managers

Reviewed-by: default avatarBen Skeggs <bskeggs@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-40-airlied@gmail.com
parent 3004add0
...@@ -156,7 +156,7 @@ nouveau_ttm_init_host(struct nouveau_drm *drm, u8 kind) ...@@ -156,7 +156,7 @@ nouveau_ttm_init_host(struct nouveau_drm *drm, u8 kind)
static int static int
nouveau_ttm_init_vram(struct nouveau_drm *drm) 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; struct nvif_mmu *mmu = &drm->client.mmu;
man->available_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC; man->available_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC;
...@@ -186,7 +186,7 @@ nouveau_ttm_init_vram(struct nouveau_drm *drm) ...@@ -186,7 +186,7 @@ nouveau_ttm_init_vram(struct nouveau_drm *drm)
static void static void
nouveau_ttm_fini_vram(struct nouveau_drm *drm) 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) { if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA) {
ttm_mem_type_manager_disable(man); ttm_mem_type_manager_disable(man);
...@@ -199,7 +199,7 @@ nouveau_ttm_fini_vram(struct nouveau_drm *drm) ...@@ -199,7 +199,7 @@ nouveau_ttm_fini_vram(struct nouveau_drm *drm)
static int static int
nouveau_ttm_init_gtt(struct nouveau_drm *drm) 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; unsigned long size_pages = drm->gem.gart_available >> PAGE_SHIFT;
man->use_tt = true; man->use_tt = true;
if (drm->agp.bridge) { if (drm->agp.bridge) {
...@@ -228,7 +228,7 @@ nouveau_ttm_init_gtt(struct nouveau_drm *drm) ...@@ -228,7 +228,7 @@ nouveau_ttm_init_gtt(struct nouveau_drm *drm)
static void static void
nouveau_ttm_fini_gtt(struct nouveau_drm *drm) 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 && if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA &&
drm->agp.bridge) drm->agp.bridge)
......
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