summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu
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/vgpu
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/vgpu')
-rw-r--r--drivers/gpu/nvgpu/vgpu/vgpu.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c
index 248d2a1b..a88d9e09 100644
--- a/drivers/gpu/nvgpu/vgpu/vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/vgpu.c
@@ -21,6 +21,7 @@
21 21
22#include <nvgpu/kmem.h> 22#include <nvgpu/kmem.h>
23#include <nvgpu/bug.h> 23#include <nvgpu/bug.h>
24#include <nvgpu/enabled.h>
24 25
25#include "vgpu/vgpu.h" 26#include "vgpu/vgpu.h"
26#include "vgpu/fecs_trace_vgpu.h" 27#include "vgpu/fecs_trace_vgpu.h"
@@ -581,14 +582,20 @@ int vgpu_probe(struct platform_device *pdev)
581 return -ENOMEM; 582 return -ENOMEM;
582 } 583 }
583 584
585 nvgpu_kmem_init(gk20a);
586
587 err = nvgpu_init_enabled_flags(gk20a);
588 if (err) {
589 kfree(gk20a);
590 return err;
591 }
592
584 gk20a->dev = dev; 593 gk20a->dev = dev;
585 if (tegra_platform_is_linsim() || tegra_platform_is_vdk()) 594 if (tegra_platform_is_linsim() || tegra_platform_is_vdk())
586 gk20a->is_fmodel = true; 595 __nvgpu_set_enabled(gk20a, NVGPU_IS_FMODEL, true);
587 596
588 gk20a->is_virtual = true; 597 gk20a->is_virtual = true;
589 598
590 nvgpu_kmem_init(gk20a);
591
592 priv = nvgpu_kzalloc(gk20a, sizeof(*priv)); 599 priv = nvgpu_kzalloc(gk20a, sizeof(*priv));
593 if (!priv) { 600 if (!priv) {
594 kfree(gk20a); 601 kfree(gk20a);