summaryrefslogtreecommitdiff
path: root/src/protocols/DRMSyncobj.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2025-03-26 15:11:19 +0000
committerVaxry <vaxry@vaxry.net>2025-03-26 17:22:21 +0000
commit0cd04bd666665bfdeafc0f55a93e532cd8978827 (patch)
treeb5bd31ee41aff585ab45506278d4d17fee09d3a1 /src/protocols/DRMSyncobj.cpp
parent1c2b9a9ce3a58c76632834774a4716af1de45fe6 (diff)
surfacestate: track and apply updated state
fixes #9729
Diffstat (limited to 'src/protocols/DRMSyncobj.cpp')
-rw-r--r--src/protocols/DRMSyncobj.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/protocols/DRMSyncobj.cpp b/src/protocols/DRMSyncobj.cpp
index 5238d1fb..0a4ca439 100644
--- a/src/protocols/DRMSyncobj.cpp
+++ b/src/protocols/DRMSyncobj.cpp
@@ -75,20 +75,22 @@ CDRMSyncobjSurfaceResource::CDRMSyncobjSurfaceResource(UP<CWpLinuxDrmSyncobjSurf
});
listeners.surfacePrecommit = surface->events.precommit.registerListener([this](std::any d) {
- if (!surface->pending.buffer && surface->pending.newBuffer && !surface->pending.texture) {
+ const bool PENDING_HAS_NEW_BUFFER = surface->pending.updated & SSurfaceState::eUpdatedProperties::SURFACE_UPDATED_BUFFER;
+
+ if (!surface->pending.buffer && PENDING_HAS_NEW_BUFFER && !surface->pending.texture) {
removeAllWaiters();
surface->commitPendingState(surface->pending);
return; // null buffer attached.
}
- if (!surface->pending.buffer && !surface->pending.newBuffer && surface->current.buffer) {
+ if (!surface->pending.buffer && !PENDING_HAS_NEW_BUFFER && surface->current.buffer) {
surface->current.bufferDamage.clear();
surface->current.damage.clear();
surface->commitPendingState(surface->current);
return; // no new buffer, but we still have current around and a commit happend, commit current again.
}
- if (!surface->pending.buffer && !surface->pending.newBuffer && !surface->current.buffer) {
+ if (!surface->pending.buffer && !PENDING_HAS_NEW_BUFFER && !surface->current.buffer) {
surface->commitPendingState(surface->pending); // no pending buffer, no current buffer. probably first commit
return;
}
@@ -109,7 +111,8 @@ CDRMSyncobjSurfaceResource::CDRMSyncobjSurfaceResource(UP<CWpLinuxDrmSyncobjSurf
const auto& state = pendingStates.emplace_back(makeShared<SSurfaceState>(surface->pending));
surface->pending.damage.clear();
surface->pending.bufferDamage.clear();
- surface->pending.newBuffer = false;
+ surface->pending.updated &= ~SSurfaceState::eUpdatedProperties::SURFACE_UPDATED_BUFFER;
+ surface->pending.updated &= ~SSurfaceState::eUpdatedProperties::SURFACE_UPDATED_DAMAGE;
surface->pending.buffer.reset();
state->buffer->buffer->syncReleaser = state->buffer->release->createSyncRelease();