gpu: nvgpu: add hal.gr.init hal to commit gfxp timeout

Add new hal g->ops.gr.init.gfxp_wfi_timeout() in hal.gr.init unit
to commit gfxp timeout
Define gv11b chip specific operation

Use new hal in gr_gv11b_update_ctxsw_preemption_mode() instead of
directly committing using register accessors

Jira NVGPU-2961

Change-Id: I7694e3128920d9a2856faecf2e3d10a11f0f986e
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2084750
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Deepak Nibade
2019-03-18 18:26:10 +05:30
committed by mobile promotions
parent 48bb865324
commit 8586aca4de
8 changed files with 22 additions and 5 deletions

View File

@@ -409,6 +409,8 @@ static const struct gpu_ops vgpu_gv11b_ops = {
.commit_ctxsw_spill = gv11b_gr_init_commit_ctxsw_spill,
.commit_cbes_reserve =
gv11b_gr_init_commit_cbes_reserve,
.gfxp_wfi_timeout =
gv11b_gr_init_commit_gfxp_wfi_timeout,
},
},
.perf = {

View File

@@ -698,6 +698,8 @@ static const struct gpu_ops gv100_ops = {
.commit_ctxsw_spill = gv11b_gr_init_commit_ctxsw_spill,
.commit_cbes_reserve =
gv11b_gr_init_commit_cbes_reserve,
.gfxp_wfi_timeout =
gv11b_gr_init_commit_gfxp_wfi_timeout,
},
.intr = {
.handle_tex_exception = NULL,

View File

@@ -1393,11 +1393,8 @@ void gr_gv11b_update_ctxsw_preemption_mode(struct gk20a *g,
g->ops.gr.init.commit_ctxsw_spill(g, gr_ctx, addr, size, true);
g->ops.gr.init.commit_cbes_reserve(g, gr_ctx, true);
nvgpu_gr_ctx_patch_write(g, gr_ctx,
gr_fe_gfxp_wfi_timeout_r(),
g->gr.gfxp_wfi_timeout_count,
true);
g->ops.gr.init.gfxp_wfi_timeout(g, gr_ctx,
g->gr.gfxp_wfi_timeout_count, true);
if (g->ops.gr.init.commit_gfxp_rtv_cb != NULL) {
g->ops.gr.init.commit_gfxp_rtv_cb(g, gr_ctx, true);

View File

@@ -657,6 +657,8 @@ static const struct gpu_ops gv11b_ops = {
.commit_ctxsw_spill = gv11b_gr_init_commit_ctxsw_spill,
.commit_cbes_reserve =
gv11b_gr_init_commit_cbes_reserve,
.gfxp_wfi_timeout =
gv11b_gr_init_commit_gfxp_wfi_timeout,
},
.intr = {
.handle_tex_exception = NULL,

View File

@@ -969,3 +969,10 @@ void gv11b_gr_init_commit_cbes_reserve(struct gk20a *g,
patch);
}
void gv11b_gr_init_commit_gfxp_wfi_timeout(struct gk20a *g,
struct nvgpu_gr_ctx *gr_ctx, u32 timeout, bool patch)
{
nvgpu_gr_ctx_patch_write(g, gr_ctx, gr_fe_gfxp_wfi_timeout_r(),
timeout, patch);
}

View File

@@ -73,5 +73,7 @@ void gv11b_gr_init_commit_ctxsw_spill(struct gk20a *g,
struct nvgpu_gr_ctx *gr_ctx, u64 addr, u32 size, bool patch);
void gv11b_gr_init_commit_cbes_reserve(struct gk20a *g,
struct nvgpu_gr_ctx *gr_ctx, bool patch);
void gv11b_gr_init_commit_gfxp_wfi_timeout(struct gk20a *g,
struct nvgpu_gr_ctx *gr_ctx, u32 timeout, bool patch);
#endif /* NVGPU_GR_INIT_GV11B_H */

View File

@@ -762,6 +762,9 @@ struct gpu_ops {
bool patch);
void (*commit_cbes_reserve)(struct gk20a *g,
struct nvgpu_gr_ctx *gr_ctx, bool patch);
void (*gfxp_wfi_timeout)(struct gk20a *g,
struct nvgpu_gr_ctx *gr_ctx, u32 timeout,
bool patch);
} init;
struct {

View File

@@ -731,6 +731,8 @@ static const struct gpu_ops tu104_ops = {
.commit_ctxsw_spill = gv11b_gr_init_commit_ctxsw_spill,
.commit_cbes_reserve =
gv11b_gr_init_commit_cbes_reserve,
.gfxp_wfi_timeout =
gv11b_gr_init_commit_gfxp_wfi_timeout,
},
.intr = {
.handle_tex_exception = NULL,