summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2016-01-14 05:46:17 -0500
committerTerje Bergstrom <tbergstrom@nvidia.com>2016-02-05 15:44:47 -0500
commit04f4f2334e42ddf1c261e0c938949d74fbfe14a0 (patch)
tree243567253f9ca96a01bebb7ab67dd75892a38509 /drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
parent595fa7158551ef130ddd5e04d3edd38aab4f0006 (diff)
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>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/fifo_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/fifo_gk20a.c21
1 files changed, 13 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)
1810 return; 1810 return;
1811} 1811}
1812 1812
1813void gk20a_fifo_issue_preempt(struct gk20a *g, u32 id, bool is_tsg)
1814{
1815 if (is_tsg)
1816 gk20a_writel(g, fifo_preempt_r(),
1817 fifo_preempt_id_f(id) |
1818 fifo_preempt_type_tsg_f());
1819 else
1820 gk20a_writel(g, fifo_preempt_r(),
1821 fifo_preempt_chid_f(id) |
1822 fifo_preempt_type_channel_f());
1823}
1824
1813static int __locked_fifo_preempt(struct gk20a *g, u32 id, bool is_tsg) 1825static int __locked_fifo_preempt(struct gk20a *g, u32 id, bool is_tsg)
1814{ 1826{
1815 u32 delay = GR_IDLE_CHECK_DEFAULT; 1827 u32 delay = GR_IDLE_CHECK_DEFAULT;
@@ -1820,14 +1832,7 @@ static int __locked_fifo_preempt(struct gk20a *g, u32 id, bool is_tsg)
1820 gk20a_dbg_fn("%d", id); 1832 gk20a_dbg_fn("%d", id);
1821 1833
1822 /* issue preempt */ 1834 /* issue preempt */
1823 if (is_tsg) 1835 gk20a_fifo_issue_preempt(g, id, is_tsg);
1824 gk20a_writel(g, fifo_preempt_r(),
1825 fifo_preempt_id_f(id) |
1826 fifo_preempt_type_tsg_f());
1827 else
1828 gk20a_writel(g, fifo_preempt_r(),
1829 fifo_preempt_chid_f(id) |
1830 fifo_preempt_type_channel_f());
1831 1836
1832 gk20a_dbg_fn("%d", id); 1837 gk20a_dbg_fn("%d", id);
1833 /* wait for preempt */ 1838 /* wait for preempt */