From ab593b9ccd3132404406ef6340348fdb28c23bf0 Mon Sep 17 00:00:00 2001 From: Sachit Kadle Date: Wed, 14 Sep 2016 11:45:38 -0700 Subject: 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 Reviewed-on: http://git-master/r/1220920 Reviewed-by: mobile promotions Tested-by: mobile promotions (cherry picked from commit b09f7589d5ad3c496e7350f1ed583a4fe2db574a) Reviewed-on: http://git-master/r/1223941 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c') 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, static int gk20a_channel_syncpt_incr(struct gk20a_channel_sync *s, struct priv_cmd_entry *entry, struct gk20a_fence *fence, - bool need_sync_fence) + bool need_sync_fence, + bool register_irq) { /* Don't put wfi cmd to this one since we're not returning * a fence to user space. */ return __gk20a_channel_syncpt_incr(s, false /* no wfi */, - true /* register irq */, + register_irq /* register irq */, entry, fence, need_sync_fence); } @@ -300,13 +301,14 @@ static int gk20a_channel_syncpt_incr_user(struct gk20a_channel_sync *s, struct priv_cmd_entry *entry, struct gk20a_fence *fence, bool wfi, - bool need_sync_fence) + bool need_sync_fence, + bool register_irq) { /* Need to do 'wfi + host incr' since we return the fence * to user space. */ return __gk20a_channel_syncpt_incr(s, wfi, - true /* register irq */, + register_irq /* register irq */, entry, fence, need_sync_fence); } @@ -756,7 +758,8 @@ static int gk20a_channel_semaphore_incr( struct gk20a_channel_sync *s, struct priv_cmd_entry *entry, struct gk20a_fence *fence, - bool need_sync_fence) + bool need_sync_fence, + bool register_irq) { /* Don't put wfi cmd to this one since we're not returning * a fence to user space. */ @@ -772,7 +775,8 @@ static int gk20a_channel_semaphore_incr_user( struct priv_cmd_entry *entry, struct gk20a_fence *fence, bool wfi, - bool need_sync_fence) + bool need_sync_fence, + bool register_irq) { #ifdef CONFIG_SYNC struct sync_fence *dependency = NULL; @@ -889,3 +893,12 @@ struct gk20a_channel_sync *gk20a_channel_sync_create(struct channel_gk20a *c) #endif return gk20a_channel_semaphore_create(c); } + +bool gk20a_channel_sync_needs_sync_framework(struct channel_gk20a *c) +{ +#ifdef CONFIG_TEGRA_GK20A + if (gk20a_platform_has_syncpoints(c->g->dev)) + return false; +#endif + return true; +} -- cgit v1.2.2