Skip to content

Commit

Permalink
msm: kgsl: Don't try to wait for fences that have been signaled
Browse files Browse the repository at this point in the history
Trying to wait for fences that have already been signaled incurs a high
setup cost, since dynamic memory allocation must be used. Avoiding this
overhead when it isn't needed improves performance.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
  • Loading branch information
kerneltoast authored and acuicultor committed Feb 12, 2021
1 parent 9884681 commit 1da3188
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/gpu/msm/kgsl_sync.c
Expand Up @@ -407,6 +407,11 @@ struct kgsl_sync_fence_cb *kgsl_sync_fence_async_wait(int fd,
if (fence == NULL)
return ERR_PTR(-EINVAL);

if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) {
dma_fence_put(fence);
return NULL;
}

/* create the callback */
kcb = kzalloc(sizeof(*kcb), GFP_ATOMIC);
if (kcb == NULL) {
Expand Down

0 comments on commit 1da3188

Please sign in to comment.