core: refactor and improve surface commit (#9805)

* make CHLBufferReference not a SP anymore

* copy over release and acquire points in CHLBufferReference

* use CHLBufferReference in screencopy and toplevel export

TODO: use CHLBufferReference in direct scanout properly
      the only problem is the scanout buffer release timing,
      specifically the onBackendRelease mechanism

* cleanup SSurfaceState and surface pending commit tracking

* move surface code from DRMSyncobj, and move acquire to SSurfaceState

* use queue for comitted pending surface states like proto says

"The content update is placed in a queue until it becomes active." - wl_surface::commit

* drop, not release, prev buffer if 2nd buffer wl_surface.attach is sent

"A wl_buffer that has been attached and then replaced by another attach instead of committed will not receive a release event, and is not used by the compositor." - wl_surface::attach
This commit is contained in:
Ikalco 2025-04-07 14:03:27 -05:00 committed by GitHub
parent 70ae99f521
commit da86db43d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 285 additions and 223 deletions

View file

@ -40,7 +40,6 @@ class CToplevelExportClient {
class CToplevelExportFrame {
public:
CToplevelExportFrame(SP<CHyprlandToplevelExportFrameV1> resource_, int32_t overlayCursor, PHLWINDOW pWindow);
~CToplevelExportFrame();
bool good();
@ -55,7 +54,7 @@ class CToplevelExportFrame {
bool m_ignoreDamage = false;
bool lockedSWCursors = false;
WP<IHLBuffer> buffer;
CHLBufferReference buffer;
bool bufferDMA = false;
uint32_t shmFormat = 0;
uint32_t dmabufFormat = 0;