diff options
author | Edgars Cīrulis <[email protected]> | 2024-10-12 03:12:07 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2024-10-12 01:12:07 +0100 |
commit | f5db4839730643169b7e8b7fb6ae2fbb8743ebe9 (patch) | |
tree | 99c531169c053e7b42025872d84a9c2c6b5a9c6d | |
parent | 7564b26b7d386d248eaa47c1a481c09eefd8e3ca (diff) | |
download | Hyprland-f5db4839730643169b7e8b7fb6ae2fbb8743ebe9.tar.gz Hyprland-f5db4839730643169b7e8b7fb6ae2fbb8743ebe9.zip |
drm-timeline: Add check for conflicting acquire and release points (#8083)
Signed-off-by: Edgars Cirulis <[email protected]>
-rw-r--r-- | src/protocols/DRMSyncobj.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/protocols/DRMSyncobj.cpp b/src/protocols/DRMSyncobj.cpp index 4993f1a4..a7f242ee 100644 --- a/src/protocols/DRMSyncobj.cpp +++ b/src/protocols/DRMSyncobj.cpp @@ -55,8 +55,13 @@ CDRMSyncobjSurfaceResource::CDRMSyncobjSurfaceResource(SP<CWpLinuxDrmSyncobjSurf return; } - if (!pending.acquireTimeline) - return; + if (pending.acquireTimeline && pending.releaseTimeline && pending.acquireTimeline == pending.releaseTimeline) { + if (pending.acquirePoint >= pending.releasePoint) { + resource->error(WP_LINUX_DRM_SYNCOBJ_SURFACE_V1_ERROR_CONFLICTING_POINTS, "Acquire and release points are on the same timeline, and acquire >= release"); + surface->pending.rejected = true; + return; + } + } // wait for the acquire timeline to materialize auto materialized = pending.acquireTimeline->timeline->check(pending.acquirePoint, DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE); |