diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2015-12-28 08:06:11 -0500 |
---|---|---|
committer | Sachin Nikam <snikam@nvidia.com> | 2016-01-13 02:01:21 -0500 |
commit | e8ebe36a2558d8a71e292986e2f286e94ed7da0a (patch) | |
tree | 578e76510e3bbd74a2ecb57c96d8d93f8d0f9002 | |
parent | 997f92566a9bfb4903490e79355f032597c92775 (diff) |
gpu: nvgpu: API to push fecs sideband methods
Add new API gr_gk20a_submit_fecs_sideband_method_op()
to support pushing fecs sideband methods
Bug 200156699
Change-Id: Ibacd7d03e05b3b67416aa2148a741ffc6e2215c9
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/927135
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 26 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.h | 2 |
2 files changed, 28 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 */ | ||
539 | int 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 | |||
538 | static int gr_gk20a_ctrl_ctxsw(struct gk20a *g, u32 fecs_method, u32 *ret) | 564 | static 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, |
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index 42e9fa5c..94d7c811 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h | |||
@@ -519,6 +519,8 @@ int gr_gk20a_init_ctx_state(struct gk20a *g); | |||
519 | int gr_gk20a_submit_fecs_method_op(struct gk20a *g, | 519 | int gr_gk20a_submit_fecs_method_op(struct gk20a *g, |
520 | struct fecs_method_op_gk20a op, | 520 | struct fecs_method_op_gk20a op, |
521 | bool sleepduringwait); | 521 | bool sleepduringwait); |
522 | int gr_gk20a_submit_fecs_sideband_method_op(struct gk20a *g, | ||
523 | struct fecs_method_op_gk20a op); | ||
522 | int gr_gk20a_alloc_gr_ctx(struct gk20a *g, | 524 | int gr_gk20a_alloc_gr_ctx(struct gk20a *g, |
523 | struct gr_ctx_desc **__gr_ctx, struct vm_gk20a *vm, | 525 | struct gr_ctx_desc **__gr_ctx, struct vm_gk20a *vm, |
524 | u32 class, u32 padding); | 526 | u32 class, u32 padding); |