summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 152d3f5e..55262a8f 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -535,6 +535,32 @@ int gr_gk20a_submit_fecs_method_op(struct gk20a *g,
535 return ret; 535 return ret;
536} 536}
537 537
538/* Sideband mailbox writes are done a bit differently */
539int gr_gk20a_submit_fecs_sideband_method_op(struct gk20a *g,
540 struct fecs_method_op_gk20a op)
541{
542 struct gr_gk20a *gr = &g->gr;
543 int ret;
544
545 mutex_lock(&gr->fecs_mutex);
546
547 gk20a_writel(g, gr_fecs_ctxsw_mailbox_clear_r(op.mailbox.id),
548 gr_fecs_ctxsw_mailbox_clear_value_f(op.mailbox.clr));
549
550 gk20a_writel(g, gr_fecs_method_data_r(), op.method.data);
551 gk20a_writel(g, gr_fecs_method_push_r(),
552 gr_fecs_method_push_adr_f(op.method.addr));
553
554 ret = gr_gk20a_ctx_wait_ucode(g, op.mailbox.id, op.mailbox.ret,
555 op.cond.ok, op.mailbox.ok,
556 op.cond.fail, op.mailbox.fail,
557 false);
558
559 mutex_unlock(&gr->fecs_mutex);
560
561 return ret;
562}
563
538static int gr_gk20a_ctrl_ctxsw(struct gk20a *g, u32 fecs_method, u32 *ret) 564static int gr_gk20a_ctrl_ctxsw(struct gk20a *g, u32 fecs_method, u32 *ret)
539{ 565{
540 return gr_gk20a_submit_fecs_method_op(g, 566 return gr_gk20a_submit_fecs_method_op(g,