diff options
Diffstat (limited to 'src/helpers/sync/SyncTimeline.hpp')
| -rw-r--r-- | src/helpers/sync/SyncTimeline.hpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/helpers/sync/SyncTimeline.hpp b/src/helpers/sync/SyncTimeline.hpp index 88ad4921..ba65e004 100644 --- a/src/helpers/sync/SyncTimeline.hpp +++ b/src/helpers/sync/SyncTimeline.hpp @@ -4,6 +4,7 @@ #include <optional> #include <vector> #include <functional> +#include <hyprutils/os/FileDescriptor.hpp> #include "../memory/Memory.hpp" /* @@ -20,26 +21,27 @@ class CSyncTimeline { ~CSyncTimeline(); struct SWaiter { - std::function<void()> fn; - wl_event_source* source = nullptr; - WP<CSyncTimeline> timeline; + std::function<void()> fn; + wl_event_source* source = nullptr; + WP<CSyncTimeline> timeline; + Hyprutils::OS::CFileDescriptor eventFd; }; // check if the timeline point has been signaled // flags: DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT or DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE // std::nullopt on fail - std::optional<bool> check(uint64_t point, uint32_t flags); - - bool addWaiter(const std::function<void()>& waiter, uint64_t point, uint32_t flags); - void removeWaiter(SWaiter*); - int exportAsSyncFileFD(uint64_t src); - bool importFromSyncFileFD(uint64_t dst, int fd); - bool transfer(SP<CSyncTimeline> from, uint64_t fromPoint, uint64_t toPoint); - void signal(uint64_t point); - - int drmFD = -1; - uint32_t handle = 0; - WP<CSyncTimeline> self; + std::optional<bool> check(uint64_t point, uint32_t flags); + + bool addWaiter(const std::function<void()>& waiter, uint64_t point, uint32_t flags); + void removeWaiter(SWaiter*); + Hyprutils::OS::CFileDescriptor exportAsSyncFileFD(uint64_t src); + bool importFromSyncFileFD(uint64_t dst, Hyprutils::OS::CFileDescriptor& fd); + bool transfer(SP<CSyncTimeline> from, uint64_t fromPoint, uint64_t toPoint); + void signal(uint64_t point); + + int drmFD = -1; + uint32_t handle = 0; + WP<CSyncTimeline> self; private: CSyncTimeline() = default; |
