syncobj: refactor point timelines (#9689)

no need to store the resource, just store the csynctimeline as a shared
pointer and make the timeline own the syncobj fd.
This commit is contained in:
Tom Englund 2025-03-21 20:19:53 +01:00 committed by GitHub
parent c7f0519faf
commit ccbdba7ee2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 27 additions and 61 deletions

View file

@ -17,13 +17,11 @@ struct SSurfaceState;
class CDRMSyncPointState {
public:
CDRMSyncPointState() = default;
CDRMSyncPointState(WP<CDRMSyncobjTimelineResource> resource_, uint64_t point_);
CDRMSyncPointState(SP<CSyncTimeline> timeline_, uint64_t point_);
~CDRMSyncPointState() = default;
const uint64_t& point();
WP<CDRMSyncobjTimelineResource> resource();
WP<CSyncTimeline> timeline();
bool expired();
Hyprutils::Memory::CUniquePointer<CSyncReleaser> createSyncRelease();
bool addWaiter(const std::function<void()>& waiter);
bool comitted();
@ -31,11 +29,10 @@ class CDRMSyncPointState {
void signal();
private:
WP<CDRMSyncobjTimelineResource> m_resource = {};
uint64_t m_point = 0;
WP<CSyncTimeline> m_timeline = {};
bool m_acquireCommitted = false;
bool m_releaseTaken = false;
SP<CSyncTimeline> m_timeline = {};
uint64_t m_point = 0;
bool m_acquireCommitted = false;
bool m_releaseTaken = false;
};
class CDRMSyncobjSurfaceResource {