summaryrefslogtreecommitdiff
path: root/src/managers/eventLoop/EventLoopManager.hpp
diff options
context:
space:
mode:
authorIkalco <73481042+ikalco@users.noreply.github.com>2025-04-15 18:02:31 -0500
committerGitHub <noreply@github.com>2025-04-16 01:02:31 +0200
commit0e521788bcc414c9cf81648d3167757d83deb60f (patch)
treebe5ff6f3773144f0f8af57969c3b1bd7eb350e74 /src/managers/eventLoop/EventLoopManager.hpp
parentffd6cf65e40a7140e82dc6e076c90b5119d41a54 (diff)
core: wait for dmabuf readiness (#9806)
* add doOnReadable to event loop manager * move syncTimeline addWaiter to doOnReadable * wait on dmabuf buffers to be readable * don't over synchronize in scanout, also give present feedback on same buffer commit
Diffstat (limited to 'src/managers/eventLoop/EventLoopManager.hpp')
-rw-r--r--src/managers/eventLoop/EventLoopManager.hpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/managers/eventLoop/EventLoopManager.hpp b/src/managers/eventLoop/EventLoopManager.hpp
index f240dae9..8a0e0439 100644
--- a/src/managers/eventLoop/EventLoopManager.hpp
+++ b/src/managers/eventLoop/EventLoopManager.hpp
@@ -38,6 +38,17 @@ class CEventLoopManager {
std::vector<std::function<void()>> fns;
};
+ struct SReadableWaiter {
+ wl_event_source* source;
+ Hyprutils::OS::CFileDescriptor fd;
+ std::function<void()> fn;
+ };
+
+ // schedule function to when fd is readable (WL_EVENT_READABLE / POLLIN),
+ // takes ownership of fd
+ void doOnReadable(Hyprutils::OS::CFileDescriptor fd, const std::function<void()>& fn);
+ void onFdReadable(SReadableWaiter* waiter);
+
private:
// Manages the event sources after AQ pollFDs change.
void syncPollFDs();
@@ -58,8 +69,9 @@ class CEventLoopManager {
Hyprutils::OS::CFileDescriptor timerfd;
} m_sTimers;
- SIdleData m_sIdle;
- std::map<int, SEventSourceData> aqEventSources;
+ SIdleData m_sIdle;
+ std::map<int, SEventSourceData> aqEventSources;
+ std::vector<UP<SReadableWaiter>> m_vReadableWaiters;
struct {
CHyprSignalListener pollFDsChanged;
@@ -67,7 +79,6 @@ class CEventLoopManager {
wl_event_source* m_configWatcherInotifySource = nullptr;
- friend class CSyncTimeline;
friend class CAsyncDialogBox;
};