aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/protocols
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-08-31 18:32:57 +0200
committerVaxry <[email protected]>2024-08-31 18:33:04 +0200
commitcf6a1716ae719f9c59b1d175ca84a79015fab8e1 (patch)
tree214b40f1b4c479b4f09bff254ebbc62c5e1926b1 /src/protocols
parent10d7219807dd726d231e8df53a357018f5526432 (diff)
downloadHyprland-cf6a1716ae719f9c59b1d175ca84a79015fab8e1.tar.gz
Hyprland-cf6a1716ae719f9c59b1d175ca84a79015fab8e1.zip
syncobj: wait for deadline instead of available
avoids slow apps from lagging the desktop
Diffstat (limited to 'src/protocols')
-rw-r--r--src/protocols/DRMSyncobj.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/protocols/DRMSyncobj.cpp b/src/protocols/DRMSyncobj.cpp
index 4993f1a4..e0c90a3b 100644
--- a/src/protocols/DRMSyncobj.cpp
+++ b/src/protocols/DRMSyncobj.cpp
@@ -58,8 +58,8 @@ CDRMSyncobjSurfaceResource::CDRMSyncobjSurfaceResource(SP<CWpLinuxDrmSyncobjSurf
if (!pending.acquireTimeline)
return;
- // wait for the acquire timeline to materialize
- auto materialized = pending.acquireTimeline->timeline->check(pending.acquirePoint, DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE);
+ // wait for the buffer to be released by the gpu before sending a commit to avoid lagging the desktop
+ auto materialized = pending.acquireTimeline->timeline->check(pending.acquirePoint, DRM_SYNCOBJ_WAIT_FLAGS_WAIT_DEADLINE);
if (!materialized.has_value()) {
LOGM(ERR, "Failed to check the acquire timeline");
resource->noMemory();
@@ -70,7 +70,7 @@ CDRMSyncobjSurfaceResource::CDRMSyncobjSurfaceResource(SP<CWpLinuxDrmSyncobjSurf
return;
surface->lockPendingState();
- pending.acquireTimeline->timeline->addWaiter([this]() { surface->unlockPendingState(); }, pending.acquirePoint, DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE);
+ pending.acquireTimeline->timeline->addWaiter([this]() { surface->unlockPendingState(); }, pending.acquirePoint, DRM_SYNCOBJ_WAIT_FLAGS_WAIT_DEADLINE);
});
listeners.surfaceCommit = surface->events.roleCommit.registerListener([this](std::any d) {