summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/hal_gm20b.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/gm20b/hal_gm20b.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/gm20b/hal_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/hal_gm20b.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
index 33198c23..f5328f03 100644
--- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
@@ -39,6 +39,7 @@
39#include "hal_gm20b.h" 39#include "hal_gm20b.h"
40 40
41#include <nvgpu/bug.h> 41#include <nvgpu/bug.h>
42#include <nvgpu/enabled.h>
42 43
43#include <nvgpu/hw/gm20b/hw_proj_gm20b.h> 44#include <nvgpu/hw/gm20b/hw_proj_gm20b.h>
44#include <nvgpu/hw/gm20b/hw_fuse_gm20b.h> 45#include <nvgpu/hw/gm20b/hw_fuse_gm20b.h>
@@ -192,7 +193,7 @@ int gm20b_init_hal(struct gk20a *g)
192 gops->securegpccs = false; 193 gops->securegpccs = false;
193 gops->pmupstate = false; 194 gops->pmupstate = false;
194#ifdef CONFIG_TEGRA_ACR 195#ifdef CONFIG_TEGRA_ACR
195 if (g->is_fmodel) { 196 if (nvgpu_is_enabled(g, NVGPU_IS_FMODEL)) {
196 gops->privsecurity = 1; 197 gops->privsecurity = 1;
197 } else { 198 } else {
198 val = gk20a_readl(g, fuse_opt_priv_sec_en_r()); 199 val = gk20a_readl(g, fuse_opt_priv_sec_en_r());
@@ -204,7 +205,7 @@ int gm20b_init_hal(struct gk20a *g)
204 } 205 }
205 } 206 }
206#else 207#else
207 if (g->is_fmodel) { 208 if (nvgpu_is_enabled(g, NVGPU_IS_FMODEL)) {
208 gk20a_dbg_info("running ASIM with PRIV security disabled"); 209 gk20a_dbg_info("running ASIM with PRIV security disabled");
209 gops->privsecurity = 0; 210 gops->privsecurity = 0;
210 } else { 211 } else {