drm/syncobj: call drm_syncobj_fence_add_wait when WAIT_AVAILABLE flag is set
authorjsg <jsg@openbsd.org>
Mon, 4 Mar 2024 02:35:45 +0000 (02:35 +0000)
committerjsg <jsg@openbsd.org>
Mon, 4 Mar 2024 02:35:45 +0000 (02:35 +0000)
From Erik Kurzinger
716cfee8053e608b4ff8c698e91843bd985f4553 in linux-6.6.y/6.6.19
3c43177ffb54ea5be97505eb8e2690e99ac96bc9 in mainline linux

sys/dev/pci/drm/drm_syncobj.c

index 73b7395..9d722d5 100644 (file)
@@ -1096,7 +1096,8 @@ static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs,
        uint64_t *points;
        uint32_t signaled_count, i;
 
-       if (flags & DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT)
+       if (flags & (DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT |
+                    DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE))
                lockdep_assert_none_held_once();
 
        points = kmalloc_array(count, sizeof(*points), GFP_KERNEL);
@@ -1169,7 +1170,8 @@ static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs,
         * fallthough and try a 0 timeout wait!
         */
 
-       if (flags & DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT) {
+       if (flags & (DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT |
+                    DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE)) {
                for (i = 0; i < count; ++i)
                        drm_syncobj_fence_add_wait(syncobjs[i], &entries[i]);
        }