Merge tag 'drm-misc-next-2021-07-16' of git://anongit.freedesktop.org/drm/drm-misc...
[linux-2.6-microblaze.git] / drivers / gpu / drm / msm / msm_gem.c
index 1e8a971..39c3541 100644 (file)
@@ -812,17 +812,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;