summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
diff options
context:
space:
mode:
authorSachit Kadle <skadle@nvidia.com>2016-09-14 14:45:38 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-10-21 14:23:53 -0400
commitab593b9ccd3132404406ef6340348fdb28c23bf0 (patch)
tree394624e853fdb5e7fbe380c1ee8f4f2fca9fe24d /drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
parent55dba9f1a91a6f94fb63090880ae28eedf4189a2 (diff)
gpu: nvgpu: make deferred clean-up conditional
This change makes the invocation of the deferred job clean-up mechanism conditional. For submissions that require job tracking, deferred clean-up is only required if any of the following conditions are met: 1) Channel's deterministic flag is not set 2) Rail-gating is enabled 3) Channel WDT is enabled 4) Buffer refcounting is enabled 5) Dependency on Sync Framework In case deferred clean-up is not needed, we clean-up a single job tracking resource in the submit path. For deterministic channels, we do not allow deferred clean-up to occur and fail any submits that require it. Bug 1795076 Change-Id: I4021dffe8a71aa58f12db6b58518d3f4021f3313 Signed-off-by: Sachit Kadle <skadle@nvidia.com> Reviewed-on: http://git-master/r/1220920 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> (cherry picked from commit b09f7589d5ad3c496e7350f1ed583a4fe2db574a) Reviewed-on: http://git-master/r/1223941 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
index 767738ea..febea719 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
@@ -285,13 +285,14 @@ static int gk20a_channel_syncpt_incr_wfi(struct gk20a_channel_sync *s,
285static int gk20a_channel_syncpt_incr(struct gk20a_channel_sync *s, 285static int gk20a_channel_syncpt_incr(struct gk20a_channel_sync *s,
286 struct priv_cmd_entry *entry, 286 struct priv_cmd_entry *entry,
287 struct gk20a_fence *fence, 287 struct gk20a_fence *fence,
288 bool need_sync_fence) 288 bool need_sync_fence,
289 bool register_irq)
289{ 290{
290 /* Don't put wfi cmd to this one since we're not returning 291 /* Don't put wfi cmd to this one since we're not returning
291 * a fence to user space. */ 292 * a fence to user space. */
292 return __gk20a_channel_syncpt_incr(s, 293 return __gk20a_channel_syncpt_incr(s,
293 false /* no wfi */, 294 false /* no wfi */,
294 true /* register irq */, 295 register_irq /* register irq */,
295 entry, fence, need_sync_fence); 296 entry, fence, need_sync_fence);
296} 297}
297 298
@@ -300,13 +301,14 @@ static int gk20a_channel_syncpt_incr_user(struct gk20a_channel_sync *s,
300 struct priv_cmd_entry *entry, 301 struct priv_cmd_entry *entry,
301 struct gk20a_fence *fence, 302 struct gk20a_fence *fence,
302 bool wfi, 303 bool wfi,
303 bool need_sync_fence) 304 bool need_sync_fence,
305 bool register_irq)
304{ 306{
305 /* Need to do 'wfi + host incr' since we return the fence 307 /* Need to do 'wfi + host incr' since we return the fence
306 * to user space. */ 308 * to user space. */
307 return __gk20a_channel_syncpt_incr(s, 309 return __gk20a_channel_syncpt_incr(s,
308 wfi, 310 wfi,
309 true /* register irq */, 311 register_irq /* register irq */,
310 entry, fence, need_sync_fence); 312 entry, fence, need_sync_fence);
311} 313}
312 314
@@ -756,7 +758,8 @@ static int gk20a_channel_semaphore_incr(
756 struct gk20a_channel_sync *s, 758 struct gk20a_channel_sync *s,
757 struct priv_cmd_entry *entry, 759 struct priv_cmd_entry *entry,
758 struct gk20a_fence *fence, 760 struct gk20a_fence *fence,
759 bool need_sync_fence) 761 bool need_sync_fence,
762 bool register_irq)
760{ 763{
761 /* Don't put wfi cmd to this one since we're not returning 764 /* Don't put wfi cmd to this one since we're not returning
762 * a fence to user space. */ 765 * a fence to user space. */
@@ -772,7 +775,8 @@ static int gk20a_channel_semaphore_incr_user(
772 struct priv_cmd_entry *entry, 775 struct priv_cmd_entry *entry,
773 struct gk20a_fence *fence, 776 struct gk20a_fence *fence,
774 bool wfi, 777 bool wfi,
775 bool need_sync_fence) 778 bool need_sync_fence,
779 bool register_irq)
776{ 780{
777#ifdef CONFIG_SYNC 781#ifdef CONFIG_SYNC
778 struct sync_fence *dependency = NULL; 782 struct sync_fence *dependency = NULL;
@@ -889,3 +893,12 @@ struct gk20a_channel_sync *gk20a_channel_sync_create(struct channel_gk20a *c)
889#endif 893#endif
890 return gk20a_channel_semaphore_create(c); 894 return gk20a_channel_semaphore_create(c);
891} 895}
896
897bool gk20a_channel_sync_needs_sync_framework(struct channel_gk20a *c)
898{
899#ifdef CONFIG_TEGRA_GK20A
900 if (gk20a_platform_has_syncpoints(c->g->dev))
901 return false;
902#endif
903 return true;
904}