From: Ao Xu Date: Tue, 10 Dec 2019 11:06:31 +0000 (+0800) Subject: sw_sync: fix video_composer fence timeout issue [1/1] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=547c96318ebca46fa71b0dfc3af3c3b7f3a24228;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git sw_sync: fix video_composer fence timeout issue [1/1] PD#SWPL-18237 Problem: SF poll sync-a and sync-b, then merge them to sync-c. sync-c refer the sync-b's fence in sync_merge function. SF close sync-a, fence-a was released. SF close sync-b, it just remove sync_pt from the timeline's active_list, fence-b was not released due to the reference count. OMX poll the sync-c, call fence_add_callback, but it will not call enable_signaling because SF has polled fence-b. It will lead OMX fence wait timeout. Solution: when SF call fence_remove_callback, clear the FENCE_FLAG_ENABLE_SIGNAL_BIT. Verify: U212 Change-Id: I2ff690e5f73067b9289b9cbc35fa34a6362f0dfa Signed-off-by: Ao Xu --- diff --git a/drivers/dma-buf/fence.c b/drivers/dma-buf/fence.c index 883b3bea143c..a239799a60b8 100644 --- a/drivers/dma-buf/fence.c +++ b/drivers/dma-buf/fence.c @@ -331,8 +331,16 @@ fence_remove_callback(struct fence *fence, struct fence_cb *cb) if (ret) { list_del_init(&cb->node); if (list_empty(&fence->cb_list)) +#ifdef CONFIG_AMLOGIC_MODIFY + if (fence->ops->disable_signaling) { + fence->ops->disable_signaling(fence); + clear_bit(FENCE_FLAG_ENABLE_SIGNAL_BIT, + &fence->flags); + } +#else if (fence->ops->disable_signaling) fence->ops->disable_signaling(fence); +#endif } spin_unlock_irqrestore(fence->lock, flags);