gpu: nvgpu: set graphics specific PRI values for graphics contexts

Add new HAL gops.gr.init.set_default_gfx_regs() to set graphics specific
PRI values for graphics contexts in function nvgpu_gr_obj_ctx_alloc().

Add new HAL gops.gr.init.capture_gfx_regs() to capture and save init
values for the PRIs. Add new struct nvgpu_gr_obj_ctx_gfx_regs to hold the
PRI init values.

Define HAL functions gv11b_gr_init_set_default_gfx_regs() and
gv11b_gr_init_capture_gfx_regs(). Set the HAL functions for
gv11b and ga10b.

Register accessors required to set PRIs are auto-generated.

Bug 3506078

Change-Id: I4c2843a274f3c924e402541e600e104ed0c9ed1c
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2671598
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Shashank Singh <shashsingh@nvidia.com>
Reviewed-by: Jonathan Mccaffrey <jmccaffrey@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Deepak Nibade
2022-02-17 18:26:34 +05:30
committed by mobile promotions
parent e4cf52123f
commit a1ef716f9d
9 changed files with 179 additions and 3 deletions

View File

@@ -755,6 +755,16 @@ int nvgpu_gr_obj_ctx_alloc_golden_ctx_image(struct gk20a *g,
goto clean_up;
}
/*
* Read and save register init values that need to be configured
* differently for graphics contexts.
* Updated values are written to the context in
* gops.gr.init.set_default_gfx_regs().
*/
if (g->ops.gr.init.capture_gfx_regs != NULL) {
g->ops.gr.init.capture_gfx_regs(g, &golden_image->gfx_regs);
}
golden_image->ready = true;
#ifdef CONFIG_NVGPU_POWER_PG
nvgpu_pmu_set_golden_image_initialized(g, GOLDEN_IMG_READY);
@@ -897,6 +907,16 @@ int nvgpu_gr_obj_ctx_alloc(struct gk20a *g,
}
#endif
/*
* Register init values are saved in
* gops.gr.init.capture_gfx_regs(). Update and set the values as
* required for graphics contexts.
*/
if (g->ops.gpu_class.is_valid_gfx(class_num) &&
g->ops.gr.init.set_default_gfx_regs != NULL) {
g->ops.gr.init.set_default_gfx_regs(g, gr_ctx, &golden_image->gfx_regs);
}
nvgpu_log(g, gpu_dbg_fn | gpu_dbg_gr, "done");
return 0;
out:

View File

@@ -28,6 +28,19 @@
struct nvgpu_gr_global_ctx_local_golden_image;
/**
* Graphics specific context register values structure.
*
* This structure stores init values for some of the registers that need to be
* configured differently for Graphics contexts.
*/
struct nvgpu_gr_obj_ctx_gfx_regs {
u32 reg_sm_disp_ctrl;
u32 reg_gpcs_setup_debug;
u32 reg_tex_lod_dbg;
u32 reg_hww_warp_esr_report_mask;
};
/**
* Golden context image descriptor structure.
*
@@ -54,6 +67,11 @@ struct nvgpu_gr_obj_ctx_golden_image {
*/
struct nvgpu_gr_global_ctx_local_golden_image *local_golden_image;
/**
* Init values for graphics specific registers.
*/
struct nvgpu_gr_obj_ctx_gfx_regs gfx_regs;
#ifdef CONFIG_NVGPU_GR_GOLDEN_CTX_VERIFICATION
/**
* Pointer to local Golden context image struct used for Golden