summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-07-21 19:25:01 +0200
committerVaxry <vaxry@vaxry.net>2024-07-21 19:25:07 +0200
commit3b6bcd6ddcfebd1fed0694aa2c0bd9753f4d5d46 (patch)
tree22f1bf03a7619e88bca3cc797731146c035cf1ba
parente6fc9873b5e10e7ac00085da7d599776ed72f297 (diff)
presentation-feedback: fix invalid values sent after aq merge
-rw-r--r--src/protocols/PresentationTime.cpp10
-rw-r--r--src/protocols/core/Compositor.cpp2
2 files changed, 10 insertions, 2 deletions
diff --git a/src/protocols/PresentationTime.cpp b/src/protocols/PresentationTime.cpp
index e9472fc3..a2fc270c 100644
--- a/src/protocols/PresentationTime.cpp
+++ b/src/protocols/PresentationTime.cpp
@@ -60,7 +60,7 @@ void CPresentationFeedback::sendQueued(SP<CQueuedPresentationData> data, timespe
if (reportedFlags & Aquamarine::IOutput::AQ_OUTPUT_PRESENT_HW_COMPLETION)
flags |= WP_PRESENTATION_FEEDBACK_KIND_HW_COMPLETION;
- if (data->wasPresented && when)
+ if (data->wasPresented)
resource->sendPresented((uint32_t)(when->tv_sec >> 32), (uint32_t)(when->tv_sec & 0xFFFFFFFF), (uint32_t)(when->tv_nsec), untilRefreshNs, (uint32_t)(seq >> 32),
(uint32_t)(seq & 0xFFFFFFFF), (wpPresentationFeedbackKind)flags);
else
@@ -104,6 +104,14 @@ void CPresentationProtocol::onGetFeedback(CWpPresentation* pMgr, wl_resource* su
}
void CPresentationProtocol::onPresented(CMonitor* pMonitor, timespec* when, uint32_t untilRefreshNs, uint64_t seq, uint32_t reportedFlags) {
+ timespec now;
+ timespec* presentedAt = when;
+ if (!presentedAt) {
+ // just put the current time, we don't have anything better
+ clock_gettime(CLOCK_MONOTONIC, &now);
+ when = &now;
+ }
+
for (auto& feedback : m_vFeedbacks) {
if (!feedback->surface)
continue;
diff --git a/src/protocols/core/Compositor.cpp b/src/protocols/core/Compositor.cpp
index 5cd6005a..d11ba40c 100644
--- a/src/protocols/core/Compositor.cpp
+++ b/src/protocols/core/Compositor.cpp
@@ -463,7 +463,7 @@ void CWLSurfaceResource::presentFeedback(timespec* when, CMonitor* pMonitor, boo
frame(when);
auto FEEDBACK = makeShared<CQueuedPresentationData>(self.lock());
FEEDBACK->attachMonitor(pMonitor);
- FEEDBACK->discarded();
+ FEEDBACK->presented();
PROTO::presentation->queueData(FEEDBACK);
if (!pMonitor || !pMonitor->outTimeline || !syncobj || !needsExplicitSync)