From 521253acb761041a5d9ba97a7a789fe02682a03d Mon Sep 17 00:00:00 2001 From: seshendra Gadagottu Date: Mon, 6 Feb 2017 15:54:37 -0800 Subject: gpu: nvgpu: implement chip specific init_elcg_mode Added function pointer to implement chip specific init_elcg mode and updated this pointer for legacy chips. JIRA GV11B-58 Change-Id: I3fff4f771eaa5dad98a3d8166c9127ecd6b745e4 Signed-off-by: seshendra Gadagottu Reviewed-on: http://git-master/r/1300120 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.h | 1 + drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 4 +++- drivers/gpu/nvgpu/gm20b/gr_gm20b.c | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 2f6e83a4..19fa4e26 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -337,6 +337,7 @@ struct gpu_ops { struct mem_desc *mem, u64 gpu_va); void (*write_pm_ptr)(struct gk20a *g, struct mem_desc *mem, u64 gpu_va); + void (*init_elcg_mode)(struct gk20a *g, u32 mode, u32 engine); } gr; const char *name; struct { diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 488a6fcb..5802cb68 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -4455,7 +4455,8 @@ void gr_gk20a_init_cg_mode(struct gk20a *g, u32 cgmode, u32 mode_config) gr_gk20a_init_blcg_mode(g, mode_config, active_engine_id); break; } else if (cgmode == ELCG_MODE) - gr_gk20a_init_elcg_mode(g, mode_config, active_engine_id); + g->ops.gr.init_elcg_mode(g, mode_config, + active_engine_id); else gk20a_err(dev_from_gk20a(g), "invalid cg mode %d %d", cgmode, mode_config); } @@ -9316,4 +9317,5 @@ void gk20a_init_gr_ops(struct gpu_ops *gops) gops->gr.commit_inst = gr_gk20a_commit_inst; gops->gr.write_zcull_ptr = gr_gk20a_write_zcull_ptr; gops->gr.write_pm_ptr = gr_gk20a_write_pm_ptr; + gops->gr.init_elcg_mode = gr_gk20a_init_elcg_mode; } diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c index 391fb8a2..0e0d3f62 100644 --- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c @@ -1605,5 +1605,6 @@ void gm20b_init_gr(struct gpu_ops *gops) gops->gr.commit_inst = gr_gk20a_commit_inst; gops->gr.write_zcull_ptr = gr_gk20a_write_zcull_ptr; gops->gr.write_pm_ptr = gr_gk20a_write_pm_ptr; + gops->gr.init_elcg_mode = gr_gk20a_init_elcg_mode; } -- cgit v1.2.2