mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-04 14:11:59 -07:00
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
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user