gpu: nvgpu: Reorg pramin HAL initialization

Reorganize HAL initialization to remove inheritance and construct
the gpu_ops struct at compile time. This patch only covers the
pramin sub-module of the gpu_ops struct.

Perform HAL function assignments in hal_gxxxx.c through the
population of a chip-specific copy of gpu_ops.

Jira NVGPU-74

Change-Id: I0c0aecfb8f5ea436ef353b874f5e36ff24ebd130
Signed-off-by: Sunny He <suhe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1527421
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
Sunny He
2017-07-26 17:37:46 -07:00
committed by mobile promotions
parent 9d37d8b78c
commit f0593bb43f
4 changed files with 23 additions and 14 deletions

View File

@@ -25,7 +25,7 @@
#include <nvgpu/hw/gk20a/hw_pram_gk20a.h>
/* WARNING: returns pramin_window_lock taken, complement with pramin_exit() */
static u32 gk20a_pramin_enter(struct gk20a *g, struct nvgpu_mem *mem,
u32 gk20a_pramin_enter(struct gk20a *g, struct nvgpu_mem *mem,
struct page_alloc_chunk *chunk, u32 w)
{
u64 bufbase = chunk->base;
@@ -56,17 +56,10 @@ static u32 gk20a_pramin_enter(struct gk20a *g, struct nvgpu_mem *mem,
return lo;
}
static void gk20a_pramin_exit(struct gk20a *g, struct nvgpu_mem *mem,
void gk20a_pramin_exit(struct gk20a *g, struct nvgpu_mem *mem,
struct page_alloc_chunk *chunk)
{
gk20a_dbg(gpu_dbg_mem, "end for %p,%p", mem, chunk);
nvgpu_spinlock_release(&g->mm.pramin_window_lock);
}
void gk20a_init_pramin_ops(struct gpu_ops *gops)
{
gops->pramin.enter = gk20a_pramin_enter;
gops->pramin.exit = gk20a_pramin_exit;
gops->pramin.data032_r = pram_data032_r;
}