Skip to content

Commit ed024ca

Browse files
drm/nouveau: stop using TTM_MEMTYPE_FLAG_MAPPABLE
The driver doesn't expose any not-mapable memory resources. Signed-off-by: Christian König <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/378244/
1 parent cd1d58e commit ed024ca

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

drivers/gpu/drm/nouveau/nouveau_bo.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -655,13 +655,12 @@ nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
655655

656656
switch (type) {
657657
case TTM_PL_SYSTEM:
658-
man->flags = TTM_MEMTYPE_FLAG_MAPPABLE;
658+
man->flags = 0;
659659
man->available_caching = TTM_PL_MASK_CACHING;
660660
man->default_caching = TTM_PL_FLAG_CACHED;
661661
break;
662662
case TTM_PL_VRAM:
663-
man->flags = TTM_MEMTYPE_FLAG_FIXED |
664-
TTM_MEMTYPE_FLAG_MAPPABLE;
663+
man->flags = TTM_MEMTYPE_FLAG_FIXED;
665664
man->available_caching = TTM_PL_FLAG_UNCACHED |
666665
TTM_PL_FLAG_WC;
667666
man->default_caching = TTM_PL_FLAG_WC;
@@ -690,12 +689,12 @@ nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
690689
man->func = &ttm_bo_manager_func;
691690

692691
if (drm->agp.bridge) {
693-
man->flags = TTM_MEMTYPE_FLAG_MAPPABLE;
692+
man->flags = 0;
694693
man->available_caching = TTM_PL_FLAG_UNCACHED |
695694
TTM_PL_FLAG_WC;
696695
man->default_caching = TTM_PL_FLAG_WC;
697696
} else {
698-
man->flags = TTM_MEMTYPE_FLAG_MAPPABLE;
697+
man->flags = 0;
699698
man->available_caching = TTM_PL_MASK_CACHING;
700699
man->default_caching = TTM_PL_FLAG_CACHED;
701700
}
@@ -1437,7 +1436,6 @@ nouveau_bo_verify_access(struct ttm_buffer_object *bo, struct file *filp)
14371436
static int
14381437
nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *reg)
14391438
{
1440-
struct ttm_mem_type_manager *man = &bdev->man[reg->mem_type];
14411439
struct nouveau_drm *drm = nouveau_bdev(bdev);
14421440
struct nvkm_device *device = nvxx_device(&drm->client.device);
14431441
struct nouveau_mem *mem = nouveau_mem(reg);
@@ -1447,8 +1445,7 @@ nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *reg)
14471445
reg->bus.size = reg->num_pages << PAGE_SHIFT;
14481446
reg->bus.base = 0;
14491447
reg->bus.is_iomem = false;
1450-
if (!(man->flags & TTM_MEMTYPE_FLAG_MAPPABLE))
1451-
return -EINVAL;
1448+
14521449
switch (reg->mem_type) {
14531450
case TTM_PL_SYSTEM:
14541451
/* System memory */

0 commit comments

Comments
 (0)