diff options
author | Peter Daifuku <pdaifuku@nvidia.com> | 2017-08-01 16:51:56 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-08-03 11:45:00 -0400 |
commit | c16797e35c2926bf34a61d5d8f37d5675ec23b1b (patch) | |
tree | 74c14d006af6f136793c23f335e8758ccf9d3e5c /drivers/gpu/nvgpu/common/mm/gmmu.c | |
parent | e1df72771ba5e5331888f5bfc171f71bd8f4aed7 (diff) |
gpu: nvgpu: fix warnings for GPUs with real vidmem
Fix kernel warnings for GPUs with real vidmem:
- dma.c: in nvgpu_dma_alloc_flags, ignore incoming flags when using vidmem,
since anything but NVGPU_DMA_NO_KERNEL_MAPPING will end up generating
kernel warnings, and the vidmem mapping functions ignore the other flags
anyway.
- gmmu.c: in __nvgpu_gmmu_update_page_table, use appropriate function for
memory type to retrieve physical address
Bug 1967748
Change-Id: I6fc01fd5f2c5cd7b81cba70ab59cc3c8fe4cda19
Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1530877
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/mm/gmmu.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/gmmu.c | 13 |
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), |