core/compositor: make wl_surface::frame follow pending states (#11896)

* compositor: make pending states store frame callbacks

move frame callbacks to pending states so they are only committed in the
order they came depending on the buffer wait for readyness.

* buffer: damage is relative to current commit

ensure the damage is only used once, or we are constantly redrawing
things on state commits that isnt a buffer.

thanks PlasmaPower.

* compositor: move callbacks back to compositor

move SSurfaceStateFrameCB back to compositor in the class
CWLCallbackResource as per request, but still keep the state as owning.

* compositor: ensure commits come in order

if a buffer is waiting any commits after it might be non buffer commits
from the "future" and applying directly. and when the old buffer that
was waiting becomes ready it applies its states and overwrites the
future changes.

move things to scheduleState and add a m_pendingWaiting guard. and
schedule the next pending state from the old buffer commit when done.
and as such it loops itself and keeps thing orderly.
This commit is contained in:
Tom Englund 2025-10-06 13:20:04 +02:00 committed by GitHub
parent cfac27251a
commit 17e77e0407
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 95 additions and 49 deletions

View file

@ -111,6 +111,9 @@ void CTexture::createFromDma(const Aquamarine::SDMABUFAttrs& attrs, void* image)
}
void CTexture::update(uint32_t drmFormat, uint8_t* pixels, uint32_t stride, const CRegion& damage) {
if (damage.empty())
return;
g_pHyprRenderer->makeEGLCurrent();
const auto format = NFormatUtils::getPixelFormatFromDRM(drmFormat);