summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/mm/gmmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/mm/gmmu.c')
-rw-r--r--drivers/gpu/nvgpu/common/mm/gmmu.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/gmmu.c b/drivers/gpu/nvgpu/common/mm/gmmu.c
index 2b579bdd..1be87c85 100644
--- a/drivers/gpu/nvgpu/common/mm/gmmu.c
+++ b/drivers/gpu/nvgpu/common/mm/gmmu.c
@@ -637,6 +637,8 @@ static int __nvgpu_gmmu_update_page_table(struct vm_gk20a *vm,
637 struct nvgpu_gmmu_attrs *attrs) 637 struct nvgpu_gmmu_attrs *attrs)
638{ 638{
639 struct gk20a *g = gk20a_from_vm(vm); 639 struct gk20a *g = gk20a_from_vm(vm);
640 struct nvgpu_page_alloc *alloc;
641 u64 phys_addr = 0;
640 u32 page_size; 642 u32 page_size;
641 int err; 643 int err;
642 644
@@ -662,6 +664,15 @@ static int __nvgpu_gmmu_update_page_table(struct vm_gk20a *vm,
662 return err; 664 return err;
663 } 665 }
664 666
667 if (sgt) {
668 if (attrs->aperture == APERTURE_VIDMEM) {
669 alloc = get_vidmem_page_alloc(sgt->sgl);
670
671 phys_addr = alloc->base;
672 } else
673 phys_addr = g->ops.mm.get_iova_addr(g, sgt->sgl, 0);
674 }
675
665 __gmmu_dbg(g, attrs, 676 __gmmu_dbg(g, attrs,
666 "vm=%s " 677 "vm=%s "
667 "%-5s GPU virt %#-12llx +%#-9llx phys %#-12llx " 678 "%-5s GPU virt %#-12llx +%#-9llx phys %#-12llx "
@@ -671,7 +682,7 @@ static int __nvgpu_gmmu_update_page_table(struct vm_gk20a *vm,
671 sgt ? "MAP" : "UNMAP", 682 sgt ? "MAP" : "UNMAP",
672 virt_addr, 683 virt_addr,
673 length, 684 length,
674 sgt ? g->ops.mm.get_iova_addr(g, sgt->sgl, 0) : 0ULL, 685 phys_addr,
675 space_to_skip, 686 space_to_skip,
676 page_size >> 10, 687 page_size >> 10,
677 nvgpu_gmmu_perm_str(attrs->rw_flag), 688 nvgpu_gmmu_perm_str(attrs->rw_flag),