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 <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/935771
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
Deepak Nibade
2016-01-14 16:16:17 +05:30
committed by Terje Bergstrom
parent 595fa71585
commit 04f4f2334e
2 changed files with 15 additions and 8 deletions

View File

@@ -1810,6 +1810,18 @@ void gk20a_fifo_nonstall_isr(struct gk20a *g)
return; 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) static int __locked_fifo_preempt(struct gk20a *g, u32 id, bool is_tsg)
{ {
u32 delay = GR_IDLE_CHECK_DEFAULT; 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); gk20a_dbg_fn("%d", id);
/* issue preempt */ /* issue preempt */
if (is_tsg) gk20a_fifo_issue_preempt(g, id, 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_dbg_fn("%d", id); gk20a_dbg_fn("%d", id);
/* wait for preempt */ /* wait for preempt */

View File

@@ -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, struct channel_gk20a *gk20a_fifo_channel_from_hw_chid(struct gk20a *g,
u32 hw_chid); u32 hw_chid);
void gk20a_fifo_issue_preempt(struct gk20a *g, u32 id, bool is_tsg);
#endif /*__GR_GK20A_H__*/ #endif /*__GR_GK20A_H__*/