summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/gr_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/gr_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/gr_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/gr_gm20b.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
index e7b6fa85..82c587f9 100644
--- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
@@ -19,6 +19,7 @@
19 19
20#include <nvgpu/kmem.h> 20#include <nvgpu/kmem.h>
21#include <nvgpu/log.h> 21#include <nvgpu/log.h>
22#include <nvgpu/enabled.h>
22 23
23#include "gk20a/gk20a.h" 24#include "gk20a/gk20a.h"
24#include "gk20a/gr_gk20a.h" 25#include "gk20a/gr_gk20a.h"
@@ -745,7 +746,7 @@ static int gr_gm20b_load_ctxsw_ucode(struct gk20a *g)
745 746
746 gk20a_dbg_fn(""); 747 gk20a_dbg_fn("");
747 748
748 if (g->is_fmodel) { 749 if (nvgpu_is_enabled(g, NVGPU_IS_FMODEL)) {
749 gk20a_writel(g, gr_fecs_ctxsw_mailbox_r(7), 750 gk20a_writel(g, gr_fecs_ctxsw_mailbox_r(7),
750 gr_fecs_ctxsw_mailbox_value_f(0xc0de7777)); 751 gr_fecs_ctxsw_mailbox_value_f(0xc0de7777));
751 gk20a_writel(g, gr_gpccs_ctxsw_mailbox_r(7), 752 gk20a_writel(g, gr_gpccs_ctxsw_mailbox_r(7),