gpu: nvgpu: Remove pmgr.h dependency from gk20a.h

gk20a.h depends on definition of struct pmgr_pmupstate. Change that
to a pointer and use forward declaration, and allocation and
free functions. Also set pointer to NULL when freed.

Fix a few build breaks by adding explicit includes where previously
a header file had gotten included implicitly.

JIRA NVGPU-596

Change-Id: I21ff1ae93ac7b92a71502f97785252c04964e72f
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1954003
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Terje Bergstrom
2018-11-09 08:46:44 -08:00
committed by mobile promotions
parent ae6e4d0572
commit 1cf6e4fc5e
11 changed files with 111 additions and 71 deletions

View File

@@ -27,6 +27,7 @@
#include <nvgpu/string.h>
#include "pwrdev.h"
#include "pmgr.h"
#include "gp106/bios_gp106.h"
static int _pwr_device_pmudata_instget(struct gk20a *g,
@@ -295,7 +296,7 @@ int pmgr_device_sw_setup(struct gk20a *g)
struct pwr_devices *ppwrdeviceobjs;
/* Construct the Super Class and override the Interfaces */
status = boardobjgrpconstruct_e32(g, &g->pmgr_pmu.pmgr_deviceobjs.super);
status = boardobjgrpconstruct_e32(g, &g->pmgr_pmu->pmgr_deviceobjs.super);
if (status != 0) {
nvgpu_err(g,
"error creating boardobjgrp for pmgr devices, status - 0x%x",
@@ -303,8 +304,8 @@ int pmgr_device_sw_setup(struct gk20a *g)
goto done;
}
pboardobjgrp = &g->pmgr_pmu.pmgr_deviceobjs.super.super;
ppwrdeviceobjs = &(g->pmgr_pmu.pmgr_deviceobjs);
pboardobjgrp = &g->pmgr_pmu->pmgr_deviceobjs.super.super;
ppwrdeviceobjs = &(g->pmgr_pmu->pmgr_deviceobjs);
/* Override the Interfaces */
pboardobjgrp->pmudatainstget = _pwr_device_pmudata_instget;