summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-05-23 13:21:14 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-05-30 16:24:35 -0400
commit66a2511a366113fa4d42dc500c9df9b348d9f208 (patch)
tree5d2367412887214d040d9ade1f1d48c93c434a46 /drivers/gpu/nvgpu/gk20a/mm_gk20a.c
parentb817e9e207cca88698d28b6b4ab410f03d715171 (diff)
gpu: nvgpu: Begin removing variables in struct gk20a
Begin removing all of the myriad flag variables in struct gk20a and replace that with one API that checks for flags being enabled or disabled. The API is as follows: bool nvgpu_is_enabled(struct gk20a *g, int flag); bool __nvgpu_set_enabled(struct gk20a *g, int flag, bool state); These APIs allow many of the gk20a flags to be replaced by defines. This makes flag usage consistent and saves a small amount of memory in struct gk20a. Also it makes struct gk20a easier to read since there's less clutter scattered through out. JIRA NVGPU-84 Change-Id: I6525cecbe97c4e8379e5f53e29ef0b4dbd1a7fc2 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1488049 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index 17fa0c17..786a6693 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -39,6 +39,7 @@
39#include <nvgpu/log.h> 39#include <nvgpu/log.h>
40#include <nvgpu/bug.h> 40#include <nvgpu/bug.h>
41#include <nvgpu/log2.h> 41#include <nvgpu/log2.h>
42#include <nvgpu/enabled.h>
42 43
43#include <nvgpu/linux/dma.h> 44#include <nvgpu/linux/dma.h>
44 45
@@ -824,7 +825,7 @@ void free_gmmu_pages(struct vm_gk20a *vm,
824 if (entry->woffset) /* fake shadow mem */ 825 if (entry->woffset) /* fake shadow mem */
825 return; 826 return;
826 827
827 if (g->is_fmodel) { 828 if (nvgpu_is_enabled(g, NVGPU_IS_FMODEL)) {
828 free_gmmu_phys_pages(vm, entry); 829 free_gmmu_phys_pages(vm, entry);
829 return; 830 return;
830 } 831 }
@@ -836,7 +837,7 @@ int map_gmmu_pages(struct gk20a *g, struct gk20a_mm_entry *entry)
836{ 837{
837 gk20a_dbg_fn(""); 838 gk20a_dbg_fn("");
838 839
839 if (g->is_fmodel) 840 if (nvgpu_is_enabled(g, NVGPU_IS_FMODEL))
840 return map_gmmu_phys_pages(entry); 841 return map_gmmu_phys_pages(entry);
841 842
842 if (IS_ENABLED(CONFIG_ARM64)) { 843 if (IS_ENABLED(CONFIG_ARM64)) {
@@ -860,7 +861,7 @@ void unmap_gmmu_pages(struct gk20a *g, struct gk20a_mm_entry *entry)
860{ 861{
861 gk20a_dbg_fn(""); 862 gk20a_dbg_fn("");
862 863
863 if (g->is_fmodel) { 864 if (nvgpu_is_enabled(g, NVGPU_IS_FMODEL)) {
864 unmap_gmmu_phys_pages(entry); 865 unmap_gmmu_phys_pages(entry);
865 return; 866 return;
866 } 867 }