From fabe964c7698527104d80aa006b5c4aca8402f17 Mon Sep 17 00:00:00 2001 From: seshendra Gadagottu Date: Thu, 27 Oct 2016 12:25:48 -0700 Subject: gpu: nvgpu: chip specific commit global timeslice Implement chip specific commit_global_timeslice function. JIRA GV11B-21 Change-Id: I937dda77870f164d034686d6d41482c875940320 Signed-off-by: seshendra Gadagottu Reviewed-on: http://git-master/r/1243944 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.h | 3 +++ drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 8 +++++--- drivers/gpu/nvgpu/gk20a/gr_gk20a.h | 3 +++ drivers/gpu/nvgpu/gm20b/gr_gm20b.c | 1 + 4 files changed, 12 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index a230e98a..d8687a37 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -310,6 +310,9 @@ struct gpu_ops { int (*init_sw_veid_bundle)(struct gk20a *g); void (*program_zcull_mapping)(struct gk20a *g, u32 zcull_alloc_num, u32 *zcull_map_tiles); + int (*commit_global_timeslice)(struct gk20a *g, + struct channel_gk20a *c, bool patch); + } gr; const char *name; struct { diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index ecc67167..84b0ed6e 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -954,7 +954,8 @@ static void gr_gk20a_commit_global_bundle_cb(struct gk20a *g, } -static int gr_gk20a_commit_global_timeslice(struct gk20a *g, struct channel_gk20a *c, bool patch) +int gr_gk20a_commit_global_timeslice(struct gk20a *g, struct channel_gk20a *c, + bool patch) { struct gr_gk20a *gr = &g->gr; struct channel_ctx_gk20a *ch_ctx = NULL; @@ -1607,7 +1608,7 @@ static int gr_gk20a_init_golden_ctx_image(struct gk20a *g, goto clean_up; /* override a few ctx state registers */ - gr_gk20a_commit_global_timeslice(g, c, false); + g->ops.gr.commit_global_timeslice(g, c, false); /* floorsweep anything left */ g->ops.gr.init_fs_state(g); @@ -4666,7 +4667,7 @@ static int gk20a_init_gr_setup_hw(struct gk20a *g) gr_fe_go_idle_timeout_count_disabled_f()); /* override a few ctx state registers */ - gr_gk20a_commit_global_timeslice(g, NULL, false); + g->ops.gr.commit_global_timeslice(g, NULL, false); /* floorsweep anything left */ err = g->ops.gr.init_fs_state(g); @@ -9119,4 +9120,5 @@ void gk20a_init_gr_ops(struct gpu_ops *gops) gr_gk20a_split_ltc_broadcast_addr_stub; gops->gr.setup_rop_mapping = gr_gk20a_setup_rop_mapping; gops->gr.program_zcull_mapping = gr_gk20a_program_zcull_mapping; + gops->gr.commit_global_timeslice = gr_gk20a_commit_global_timeslice; } diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index a0179b0d..e20207c5 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h @@ -659,6 +659,9 @@ int gr_gk20a_resume_contexts(struct gk20a *g, int *ctx_resident_ch_fd); void gk20a_gr_enable_gpc_exceptions(struct gk20a *g); +int gr_gk20a_commit_global_timeslice(struct gk20a *g, + struct channel_gk20a *c, bool patch); + static inline const char *gr_gk20a_graphics_preempt_mode_name(u32 graphics_preempt_mode) { switch (graphics_preempt_mode) { diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c index a1d032e4..44a1c2c7 100644 --- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c @@ -1568,4 +1568,5 @@ void gm20b_init_gr(struct gpu_ops *gops) gops->gr.split_lts_broadcast_addr = gr_gm20b_split_lts_broadcast_addr; gops->gr.split_ltc_broadcast_addr = gr_gm20b_split_ltc_broadcast_addr; gops->gr.program_zcull_mapping = gr_gk20a_program_zcull_mapping; + gops->gr.commit_global_timeslice = gr_gk20a_commit_global_timeslice; } -- cgit v1.2.2