Loading drivers/gpu/drm/nouveau/Makefile +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ nouveau-y := nouveau_drv.o nouveau_state.o nouveau_channel.o nouveau_mem.o \ nv10_gpio.o nv50_gpio.o \ nv50_calc.o \ nv04_pm.o nv50_pm.o nva3_pm.o \ nv50_vram.o nv50_vm.o nv50_vram.o nv50_vm.o nvc0_vm.o nouveau-$(CONFIG_DRM_NOUVEAU_DEBUG) += nouveau_debugfs.o nouveau-$(CONFIG_COMPAT) += nouveau_ioc32.o Loading drivers/gpu/drm/nouveau/nouveau_bo.c +3 −2 Original line number Diff line number Diff line Loading @@ -909,8 +909,9 @@ nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem) break; } ret = nouveau_vm_get(dev_priv->bar1_vm, mem->bus.size, 12, NV_MEM_ACCESS_RW, &vram->bar_vma); ret = nouveau_vm_get(dev_priv->bar1_vm, mem->bus.size, vram->page_shift, NV_MEM_ACCESS_RW, &vram->bar_vma); if (ret) return ret; Loading drivers/gpu/drm/nouveau/nouveau_drv.h +1 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,7 @@ struct nouveau_vram { struct drm_device *dev; struct nouveau_vma bar_vma; u8 page_shift; struct list_head regions; u32 memtype; Loading drivers/gpu/drm/nouveau/nouveau_mem.c +4 −0 Original line number Diff line number Diff line Loading @@ -731,6 +731,10 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man, if (ret) return ret; node->page_shift = 12; if (nvbo->vma.node) node->page_shift = nvbo->vma.node->type; mem->mm_node = node; mem->start = node->offset >> PAGE_SHIFT; return 0; Loading drivers/gpu/drm/nouveau/nouveau_vm.c +27 −4 Original line number Diff line number Diff line Loading @@ -295,7 +295,34 @@ nouveau_vm_new(struct drm_device *dev, u64 offset, u64 length, u64 mm_offset, vm->flush = nv50_vm_flush; vm->spg_shift = 12; vm->lpg_shift = 16; pgt_bits = 29; block = (1 << pgt_bits); if (length < block) block = length; } else if (dev_priv->card_type == NV_C0) { vm->map_pgt = nvc0_vm_map_pgt; vm->map = nvc0_vm_map; vm->map_sg = nvc0_vm_map_sg; vm->unmap = nvc0_vm_unmap; vm->flush = nvc0_vm_flush; vm->spg_shift = 12; vm->lpg_shift = 17; pgt_bits = 27; /* Should be 4096 everywhere, this is a hack that's * currently necessary to avoid an elusive bug that * causes corruption when mixing small/large pages */ if (length < (1ULL << 40)) block = 4096; else { block = (1 << pgt_bits); if (length < block) block = length; } } else { kfree(vm); return -ENOSYS; Loading @@ -314,10 +341,6 @@ nouveau_vm_new(struct drm_device *dev, u64 offset, u64 length, u64 mm_offset, vm->refcount = 1; vm->pgt_bits = pgt_bits - 12; block = (1 << pgt_bits); if (length < block) block = length; ret = nouveau_mm_init(&vm->mm, mm_offset >> 12, mm_length >> 12, block >> 12); if (ret) { Loading Loading
drivers/gpu/drm/nouveau/Makefile +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ nouveau-y := nouveau_drv.o nouveau_state.o nouveau_channel.o nouveau_mem.o \ nv10_gpio.o nv50_gpio.o \ nv50_calc.o \ nv04_pm.o nv50_pm.o nva3_pm.o \ nv50_vram.o nv50_vm.o nv50_vram.o nv50_vm.o nvc0_vm.o nouveau-$(CONFIG_DRM_NOUVEAU_DEBUG) += nouveau_debugfs.o nouveau-$(CONFIG_COMPAT) += nouveau_ioc32.o Loading
drivers/gpu/drm/nouveau/nouveau_bo.c +3 −2 Original line number Diff line number Diff line Loading @@ -909,8 +909,9 @@ nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem) break; } ret = nouveau_vm_get(dev_priv->bar1_vm, mem->bus.size, 12, NV_MEM_ACCESS_RW, &vram->bar_vma); ret = nouveau_vm_get(dev_priv->bar1_vm, mem->bus.size, vram->page_shift, NV_MEM_ACCESS_RW, &vram->bar_vma); if (ret) return ret; Loading
drivers/gpu/drm/nouveau/nouveau_drv.h +1 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,7 @@ struct nouveau_vram { struct drm_device *dev; struct nouveau_vma bar_vma; u8 page_shift; struct list_head regions; u32 memtype; Loading
drivers/gpu/drm/nouveau/nouveau_mem.c +4 −0 Original line number Diff line number Diff line Loading @@ -731,6 +731,10 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man, if (ret) return ret; node->page_shift = 12; if (nvbo->vma.node) node->page_shift = nvbo->vma.node->type; mem->mm_node = node; mem->start = node->offset >> PAGE_SHIFT; return 0; Loading
drivers/gpu/drm/nouveau/nouveau_vm.c +27 −4 Original line number Diff line number Diff line Loading @@ -295,7 +295,34 @@ nouveau_vm_new(struct drm_device *dev, u64 offset, u64 length, u64 mm_offset, vm->flush = nv50_vm_flush; vm->spg_shift = 12; vm->lpg_shift = 16; pgt_bits = 29; block = (1 << pgt_bits); if (length < block) block = length; } else if (dev_priv->card_type == NV_C0) { vm->map_pgt = nvc0_vm_map_pgt; vm->map = nvc0_vm_map; vm->map_sg = nvc0_vm_map_sg; vm->unmap = nvc0_vm_unmap; vm->flush = nvc0_vm_flush; vm->spg_shift = 12; vm->lpg_shift = 17; pgt_bits = 27; /* Should be 4096 everywhere, this is a hack that's * currently necessary to avoid an elusive bug that * causes corruption when mixing small/large pages */ if (length < (1ULL << 40)) block = 4096; else { block = (1 << pgt_bits); if (length < block) block = length; } } else { kfree(vm); return -ENOSYS; Loading @@ -314,10 +341,6 @@ nouveau_vm_new(struct drm_device *dev, u64 offset, u64 length, u64 mm_offset, vm->refcount = 1; vm->pgt_bits = pgt_bits - 12; block = (1 << pgt_bits); if (length < block) block = length; ret = nouveau_mm_init(&vm->mm, mm_offset >> 12, mm_length >> 12, block >> 12); if (ret) { Loading