diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2016-01-14 05:46:17 -0500 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-02-05 15:44:47 -0500 |
commit | 04f4f2334e42ddf1c261e0c938949d74fbfe14a0 (patch) | |
tree | 243567253f9ca96a01bebb7ab67dd75892a38509 /drivers/gpu/nvgpu/gk20a | |
parent | 595fa7158551ef130ddd5e04d3edd38aab4f0006 (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')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 21 | ||||
-rw-r--r-- | 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) | |||
1810 | return; | 1810 | return; |
1811 | } | 1811 | } |
1812 | 1812 | ||
1813 | void 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 | |||
1813 | static int __locked_fifo_preempt(struct gk20a *g, u32 id, bool is_tsg) | 1825 | static 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 */ |
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, | |||
196 | 196 | ||
197 | struct channel_gk20a *gk20a_fifo_channel_from_hw_chid(struct gk20a *g, | 197 | struct channel_gk20a *gk20a_fifo_channel_from_hw_chid(struct gk20a *g, |
198 | u32 hw_chid); | 198 | u32 hw_chid); |
199 | |||
200 | void gk20a_fifo_issue_preempt(struct gk20a *g, u32 id, bool is_tsg); | ||
199 | #endif /*__GR_GK20A_H__*/ | 201 | #endif /*__GR_GK20A_H__*/ |