drm/msm: always wait for the exclusive fence
authorChristian König <ckoenig.leichtzumerken@gmail.com>
Fri, 2 Jul 2021 11:16:42 +0000 (13:16 +0200)
committerChristian König <christian.koenig@amd.com>
Fri, 9 Jul 2021 10:30:37 +0000 (12:30 +0200)
Drivers also need to to sync to the exclusive fence when
a shared one is present.

Completely untested since the driver won't even compile on !ARM.

Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210702111642.17259-5-christian.koenig@amd.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/msm/msm_gem.c

index a94a43d..72a07e3 100644 (file)
@@ -817,17 +817,15 @@ int msm_gem_sync_object(struct drm_gem_object *obj,
        struct dma_fence *fence;
        int i, ret;
 
-       fobj = dma_resv_shared_list(obj->resv);
-       if (!fobj || (fobj->shared_count == 0)) {
-               fence = dma_resv_excl_fence(obj->resv);
-               /* don't need to wait on our own fences, since ring is fifo */
-               if (fence && (fence->context != fctx->context)) {
-                       ret = dma_fence_wait(fence, true);
-                       if (ret)
-                               return ret;
-               }
+       fence = dma_resv_excl_fence(obj->resv);
+       /* don't need to wait on our own fences, since ring is fifo */
+       if (fence && (fence->context != fctx->context)) {
+               ret = dma_fence_wait(fence, true);
+               if (ret)
+                       return ret;
        }
 
+       fobj = dma_resv_shared_list(obj->resv);
        if (!exclusive || !fobj)
                return 0;