From 04f4f2334e42ddf1c261e0c938949d74fbfe14a0 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Thu, 14 Jan 2016 16:16:17 +0530 Subject: gpu: nvgpu: separate API to issue preempt Export separate API gk20a_fifo_issue_preempt() to issue preempt request to a channel or TSG Bug 200156699 Change-Id: Ib3b097ef66a6411d75c1fe213cdbe8b1d08d3418 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/935771 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 21 +++++++++++++-------- drivers/gpu/nvgpu/gk20a/fifo_gk20a.h | 2 ++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index 42e48901..337a9584 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c @@ -1810,6 +1810,18 @@ void gk20a_fifo_nonstall_isr(struct gk20a *g) return; } +void gk20a_fifo_issue_preempt(struct gk20a *g, u32 id, bool is_tsg) +{ + if (is_tsg) + gk20a_writel(g, fifo_preempt_r(), + fifo_preempt_id_f(id) | + fifo_preempt_type_tsg_f()); + else + gk20a_writel(g, fifo_preempt_r(), + fifo_preempt_chid_f(id) | + fifo_preempt_type_channel_f()); +} + static int __locked_fifo_preempt(struct gk20a *g, u32 id, bool is_tsg) { u32 delay = GR_IDLE_CHECK_DEFAULT; @@ -1820,14 +1832,7 @@ static int __locked_fifo_preempt(struct gk20a *g, u32 id, bool is_tsg) gk20a_dbg_fn("%d", id); /* issue preempt */ - if (is_tsg) - gk20a_writel(g, fifo_preempt_r(), - fifo_preempt_id_f(id) | - fifo_preempt_type_tsg_f()); - else - gk20a_writel(g, fifo_preempt_r(), - fifo_preempt_chid_f(id) | - fifo_preempt_type_channel_f()); + gk20a_fifo_issue_preempt(g, id, is_tsg); gk20a_dbg_fn("%d", id); /* wait for preempt */ diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h index 5305d007..ee4e7328 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h @@ -196,4 +196,6 @@ bool gk20a_fifo_set_ctx_mmu_error_ch(struct gk20a *g, struct channel_gk20a *gk20a_fifo_channel_from_hw_chid(struct gk20a *g, u32 hw_chid); + +void gk20a_fifo_issue_preempt(struct gk20a *g, u32 id, bool is_tsg); #endif /*__GR_GK20A_H__*/ -- cgit v1.2.2