gpu: nvgpu: add common.gr.setup apis to allocate/free context

Add below apis in common.gr.setup to allocate/free context
nvgpu_gr_setup_alloc_obj_ctx()
nvgpu_gr_setup_free_gr_ctx()

Define two new hals
g->ops.gr.setup.alloc_obj_ctx()
g->ops.gr.setup.free_gr_ctx()

Move corresponding code from gr_gk20a.c to common.gr.setup unit

Jira NVGPU-1886

Change-Id: Icf170a6ed8979afebcedaa98e3df1483437b427b
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2092169
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Deepak Nibade
2019-04-04 16:19:26 +05:30
committed by mobile promotions
parent d7bdca94d8
commit f5c093d47e
15 changed files with 141 additions and 144 deletions

View File

@@ -552,7 +552,7 @@ static int gk20a_init_cde_required_class(struct gk20a_cde_ctx *cde_ctx,
/* CDE enabled */
cde_ctx->ch->cde = true;
err = gk20a_alloc_obj_ctx(cde_ctx->ch, required_class, 0);
err = g->ops.gr.setup.alloc_obj_ctx(cde_ctx->ch, required_class, 0);
if (err) {
nvgpu_warn(g, "cde: failed to allocate ctx. err=%d",
err);