sw_sync: fix video_composer fence timeout issue [1/1]
authorAo Xu <ao.xu@amlogic.com>
Tue, 10 Dec 2019 11:06:31 +0000 (19:06 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Wed, 11 Dec 2019 09:25:50 +0000 (02:25 -0700)
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 <ao.xu@amlogic.com>
drivers/dma-buf/fence.c

index 883b3bea143c1123e8559fb37eb943fd2d27a9cf..a239799a60b8200bafe90dd84f1603960868fdf0 100644 (file)
@@ -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);