diff options
author | Vinod G <vinodg@nvidia.com> | 2019-02-05 21:05:42 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2020-01-08 11:35:30 -0500 |
commit | dacb06f4647b924aa6455e8156b74df5098cf3bf (patch) | |
tree | 46b3e1bbde525c902b881613effd1ae50f8ceae0 /drivers/gpu/nvgpu/common/mm/gmmu.c | |
parent | 264691e69d825489e0a0bcee56f700e241186bb4 (diff) |
gpu: nvgpu: add platform atomic support
Add new variable in nvgpu_as_map_buffer_ex_args for app
to specify the platform atomic support for the page.
When platform atomic attribute flag is set, pte memory
aperture is set to be coherent type.
renamed nvgpu_aperture_mask_coh -> nvgpu_aperture_mask_raw
function.
bug 200580236
Change-Id: I18266724dafdc8dfd96a0711f23cf08e23682afc
Signed-off-by: Vinod G <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2012679
(cherry picked from commit 9e0a9004b71f92b7713fd3b30141b0d9d4cfa2c6)
Signed-off-by: Lakshmanan M <lm@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2274914
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Sreeniketh H <sh@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/mm/gmmu.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/gmmu.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/gmmu.c b/drivers/gpu/nvgpu/common/mm/gmmu.c index afbad75c..a5790e3a 100644 --- a/drivers/gpu/nvgpu/common/mm/gmmu.c +++ b/drivers/gpu/nvgpu/common/mm/gmmu.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * Permission is hereby granted, free of charge, to any person obtaining a | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
5 | * copy of this software and associated documentation files (the "Software"), | 5 | * copy of this software and associated documentation files (the "Software"), |
@@ -628,7 +628,7 @@ static int __nvgpu_gmmu_update_page_table(struct vm_gk20a *vm, | |||
628 | "vm=%s " | 628 | "vm=%s " |
629 | "%-5s GPU virt %#-12llx +%#-9llx phys %#-12llx " | 629 | "%-5s GPU virt %#-12llx +%#-9llx phys %#-12llx " |
630 | "phys offset: %#-4llx; pgsz: %3dkb perm=%-2s | " | 630 | "phys offset: %#-4llx; pgsz: %3dkb perm=%-2s | " |
631 | "kind=%#02x APT=%-6s %c%c%c%c%c", | 631 | "kind=%#02x APT=%-6s %c%c%c%c%c%c", |
632 | vm->name, | 632 | vm->name, |
633 | (sgt != NULL) ? "MAP" : "UNMAP", | 633 | (sgt != NULL) ? "MAP" : "UNMAP", |
634 | virt_addr, | 634 | virt_addr, |
@@ -643,7 +643,8 @@ static int __nvgpu_gmmu_update_page_table(struct vm_gk20a *vm, | |||
643 | attrs->sparse ? 'S' : '-', | 643 | attrs->sparse ? 'S' : '-', |
644 | attrs->priv ? 'P' : '-', | 644 | attrs->priv ? 'P' : '-', |
645 | attrs->coherent ? 'I' : '-', | 645 | attrs->coherent ? 'I' : '-', |
646 | attrs->valid ? 'V' : '-'); | 646 | attrs->valid ? 'V' : '-', |
647 | attrs->platform_atomic ? 'A' : '-'); | ||
647 | 648 | ||
648 | err = __nvgpu_gmmu_do_update_page_table(vm, | 649 | err = __nvgpu_gmmu_do_update_page_table(vm, |
649 | sgt, | 650 | sgt, |
@@ -702,7 +703,8 @@ u64 gk20a_locked_gmmu_map(struct vm_gk20a *vm, | |||
702 | .priv = priv, | 703 | .priv = priv, |
703 | .coherent = flags & NVGPU_VM_MAP_IO_COHERENT, | 704 | .coherent = flags & NVGPU_VM_MAP_IO_COHERENT, |
704 | .valid = (flags & NVGPU_VM_MAP_UNMAPPED_PTE) == 0U, | 705 | .valid = (flags & NVGPU_VM_MAP_UNMAPPED_PTE) == 0U, |
705 | .aperture = aperture | 706 | .aperture = aperture, |
707 | .platform_atomic = (flags & NVGPU_VM_MAP_PLATFORM_ATOMIC) != 0U | ||
706 | }; | 708 | }; |
707 | 709 | ||
708 | /* | 710 | /* |