gpu: nvgpu: Use HAL for waiting for GR quiet

Create a HAL for waiting for GR to become quiet. Use it forall cases
where we require GR to be quiet, but where it does not need to be
idle.

Bug 1640378

Change-Id: Ic0222d595a2d049e0fa8864b069ab94a97fac143
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/745640
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
This commit is contained in:
Terje Bergstrom
2015-05-21 08:22:51 -07:00
parent e19d349858
commit f8cc28af38
3 changed files with 7 additions and 3 deletions

View File

@@ -173,6 +173,8 @@ struct gpu_ops {
u32 (*get_max_lts_per_ltc)(struct gk20a *g);
u32* (*get_rop_l2_en_mask)(struct gk20a *g);
void (*init_sm_dsm_reg_info)(void);
int (*wait_empty)(struct gk20a *g, unsigned long end_jiffies,
u32 expect_delay);
} gr;
const char *name;
struct {

View File

@@ -3475,7 +3475,7 @@ void gr_gk20a_pmu_save_zbc(struct gk20a *g, u32 entries)
return;
}
ret = gr_gk20a_wait_idle(g, end_jiffies, GR_IDLE_CHECK_DEFAULT);
ret = g->ops.gr.wait_empty(g, end_jiffies, GR_IDLE_CHECK_DEFAULT);
if (ret) {
gk20a_err(dev_from_gk20a(g),
"failed to idle graphics\n");
@@ -3758,7 +3758,7 @@ static int _gk20a_gr_zbc_set_table(struct gk20a *g, struct gr_gk20a *gr,
}
end_jiffies = jiffies + msecs_to_jiffies(gk20a_get_gr_idle_timeout(g));
ret = gr_gk20a_wait_idle(g, end_jiffies, GR_IDLE_CHECK_DEFAULT);
ret = g->ops.gr.wait_empty(g, end_jiffies, GR_IDLE_CHECK_DEFAULT);
if (ret) {
gk20a_err(dev_from_gk20a(g),
"failed to idle graphics\n");
@@ -5641,7 +5641,7 @@ int gk20a_gr_suspend(struct gk20a *g)
gk20a_dbg_fn("");
ret = gr_gk20a_wait_idle(g, end_jiffies, GR_IDLE_CHECK_DEFAULT);
ret = g->ops.gr.wait_empty(g, end_jiffies, GR_IDLE_CHECK_DEFAULT);
if (ret)
return ret;
@@ -7329,4 +7329,5 @@ void gk20a_init_gr_ops(struct gpu_ops *gops)
gops->gr.get_max_lts_per_ltc = gr_gk20a_get_max_lts_per_ltc;
gops->gr.get_rop_l2_en_mask = gr_gk20a_rop_l2_en_mask;
gops->gr.init_sm_dsm_reg_info = gr_gk20a_init_sm_dsm_reg_info;
gops->gr.wait_empty = gr_gk20a_wait_idle;
}

View File

@@ -1117,4 +1117,5 @@ void gm20b_init_gr(struct gpu_ops *gops)
gops->gr.get_rop_l2_en_mask = gr_gm20b_rop_l2_en_mask;
gops->gr.get_max_fbps_count = gr_gm20b_get_max_fbps_count;
gops->gr.init_sm_dsm_reg_info = gr_gm20b_init_sm_dsm_reg_info;
gops->gr.wait_empty = gr_gk20a_wait_idle;
}