diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2014-05-05 07:57:39 -0400 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:09:49 -0400 |
commit | df1852752a3ba9365ae6dca2795af4d43267896d (patch) | |
tree | d8af4133cb8de3cd3bbb35d5cd41e632b75bf15b /drivers | |
parent | 2b48263b1f2757cda9690a5959853f72295c96de (diff) |
gpu: nvgpu: gk20a: free syncpt if last submit is complete
In channel_update(), we detect if channel is idle and if it is
idle then we free the syncpt. We do not free the syncpt if WFI is
scheduled on some other path.
Instead of checking for WFI, we can check if last submit is complete
or not (it can be WFI as well) and if last submit is complete then
we can free the syncpt.
Locking mechanism using submit lock will take care that syncpt is
kept alive until last submit or WFI completes
Bug 1305024
Change-Id: Ieafb82e1f924a01236ca73ed151eb03e88729835
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/405201
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 344223ae..00f8ac94 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -1423,11 +1423,12 @@ void gk20a_channel_update(struct channel_gk20a *c, int nr_completed) | |||
1423 | /* | 1423 | /* |
1424 | * If job list is empty then channel is idle and we can free | 1424 | * If job list is empty then channel is idle and we can free |
1425 | * the syncpt here (given aggressive_destroy flag is set) | 1425 | * the syncpt here (given aggressive_destroy flag is set) |
1426 | * Note: if WFI is already scheduled on some other path | 1426 | * Note: check if last submit is complete before destroying |
1427 | * then syncpt is still required to check for idle | 1427 | * the sync resource |
1428 | */ | 1428 | */ |
1429 | if (list_empty(&c->jobs) && !c->last_submit_fence.wfi) { | 1429 | if (list_empty(&c->jobs)) { |
1430 | if (c->sync && c->sync->syncpt_aggressive_destroy) { | 1430 | if (c->sync && c->sync->syncpt_aggressive_destroy && |
1431 | c->sync->is_expired(c->sync, &c->last_submit_fence)) { | ||
1431 | c->sync->destroy(c->sync); | 1432 | c->sync->destroy(c->sync); |
1432 | c->sync = NULL; | 1433 | c->sync = NULL; |
1433 | } | 1434 | } |