summaryrefslogtreecommitdiff
path: root/src/protocols/core/Compositor.cpp
Commit message (Collapse)AuthorAgeFilesLines
* wayland/output: return all bound wl_output instances in outputResourceFrom ↵Vaxry2026-02-201-6/+14
| | | | | (#13315) ref https://github.com/hyprwm/Hyprland/discussions/13301
* compositor: dont unlock all states on empty commits (#13303)Tom Englund2026-02-181-1/+1
| | | | | | we cant unlock all states on empty commits, at best tryProcess them. for example if a state is locked and waiting for a fence to become readable, and another commit comes in we cant unlock it until the fence has actually signaled.
* protocols: commit and presentation timing fixes (#13174)UjinT342026-02-101-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | * move commit timing fields to surface state * fix toTimespec init * update sendQueued api * update onPresented api * set zero copy flag * send clock id * move presented calcs inside condition * use only CLOCK_MONOTONIC for commit/presentation timings * fix setSetTimestamp * do not wait for commit timing while tearing * proto config * fix config defaults
* fifo: miscellaneous fifo fixes (#13136)UjinT342026-02-041-0/+9
| | | | | | | | | | | * LOGM: clang-tidy fix * fix fifo state and scheduling * disable fifo_pending_workaround by default * fix tearing * fix "empty" commit skipping
* renderer: fix frame sync (#13061)UjinT342026-01-221-2/+2
| | | | | | | | | * fix commit timing timer * fix surface state lock/unlock * debug state sync todos * debug solitary vrr
* core/compositor: immediately do readable if adding waiter fails for ↵Vaxry2026-01-051-1/+4
| | | | scheduling state
* render/cm: various updates, remove old protocols (#12693)UjinT342025-12-271-1/+1
| | | | | | | | | | | | | * fix named primaries * default to gamma22 * mark mastering primaries as supported * remove xx-cm and frog support * immutable primaries and image descriptions * clang-format
* rules/windowRuleApplicator: fix min/max size effects (#12491)Vaxry2025-12-271-1/+1
| | | fixes #12412
* debug: move to hyprutils' logger (#12673)Vaxry2025-12-181-7/+7
|
* protocols/compositor: fix null deref on unassigned surface image descVaxry2025-12-081-1/+1
| | | | ref #12603
* desktop: cleanup, unify desktop elements as views (#12563)Vaxry2025-12-081-6/+8
|
* renderer: add quirks:prefer_hdr to fix HDR activation for some clients (#12436)UjinT342025-12-031-0/+4
|
* buffers: revert state merging (#12461)Tom Englund2025-11-251-7/+0
| | | | | | 8e8bfbb0b146fb1f3234b2a3e3e92b63989e1993 added fifo and merged non buffer states before comitting them, something about certain xwl non buffer commits expects a commit to happend and causes regressions as in low fps.
* renderer: Allow DS for surfaces with inert subsurfaces (#12133)Dominick DiMaggio2025-11-111-0/+13
|
* protocols: add Fifo-v1 and commit-timing-v1 (#12052)Tom Englund2025-11-061-40/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * protocols: add Fifo-v1 introduce fifo-v1 * fifo: only present locked surfaces dont present to unlocked surfaces and commit pending states from the fifo protocol. * fifo: cformat cformat * protocols: add committiming and surface state queue introduce CSurfaceStateQueue and commit-timing-v1 * fifo: schedule a frame if waiting on barrier if we are waiting on a barrier the state doesnt commit until the next refresh cycle meaning the monitor might have no pending damage and we never get onPresented to unlock the barrier, moment 22. so schedule a frame. * fifo: properly check monitor intersection check for m_enteredoutputs or monitor intersection if client hasnt bound one yet, and dont fifo lock it until the surface is mapped. * buffer: try to merge states before committing them try to merge states before committing them meaning way less churn and surface commits if a surface sends multiple small ones while we wait for buffer readyness from either fifo locks or simply fences. * buffer: dont commit states past the buffer certain changes are relative to the buffer attached, cant go beyond it and apply those onto the next buffer. * buffer: set the lockmask directly cant use .lock since the state hasnt been queued yet, set the lockmask directly when exporting buffer fence. * fifo: dont fifo lock on tearing dont fifo lock on tearing. * buffer: queue the state directly queue the state directly and use the .lock function instead of directly modify the lockMask on the state. * buffer: revert creating texture at commit time fifo barriers introduces such long wait that upon commit time a race happends with current xdg configure implentation that the buffer and image is actually destroyed when entering commitState, doing it at buffer creation time with EGL_PRESERVED_KHR means it sticks around until we are done. so revert 82759d4 and 32f3233 for now. * buffer: rename enum and lockreasons eLockReason and LOCK_REASON_NONE. * fifo: workaround direct scanout lock workaround cursor commits causing fifo to get forever locked, this entire thing needs to be worked out.
* buffer: move texture creation to commit time (#11964)Tom Englund2025-10-081-4/+4
| | | | | | | | | | | | | * buffer: move texture creation to commit time move creating texture away from buffer attach into commitstate in an attempt to postpone gpu work until its really needed. best case scenario gpu clocks have ramped up before because we are actively doing things causing surface states and a commit to happend meaning less visible lag. * buffer: simplify texture creation make createTexture return a shared ptr directly, remove not needed member variables as m_success and m_texture.
* compositor: make wl_surface::frame follow pending states (#11953)Tom Englund2025-10-071-44/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* core/compositor: revert make wl_surface::frame follow pending states (#11896)Vaxry2025-10-061-64/+44
| | | | | | | This reverts commit 17e77e0407bebd5d24521012ee1d04b156d6b9f4. Reverted due to severe performance degradation due to accumulating frame callbacks
* core/compositor: make wl_surface::frame follow pending states (#11896)Tom Englund2025-10-061-44/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* renderer: Fix CM for DS and SDR passthrough (#11503)UjinT342025-08-291-0/+4
|
* disable buffer readability checks on intel (#11515)Tom Englund2025-08-241-2/+2
| | | | | | | | | | | | * dmabuf: disable buffer read check on intel readability checks directly on buffer fds on some intel laptops is broken, see https://gitlab.freedesktop.org/drm/intel/-/issues/9415 * sync: use rvalue ref in addwaiter doonreadable use rvalue reference in addwaiter and doonreadable, because we store the function in the SReadableWaiter a lot of the time, move it into place there when that happends or let it go out of scope after function call.
* protocols/wayland: use UP and rvalue refs for callbacks (#11471)Tom Englund2025-08-181-2/+2
| | | use UP and rvalue refs in CWLCallbackResource and m_callbacks.
* refactor: Use new hyprutils casts (#11377)Kamikadze2025-08-141-10/+10
|
* renderer: use CRegion foreach over getRects (#10980)Tom Englund2025-07-301-2/+2
| | | | instead of allocating and returning a vector, use forEach to directly call a function on the rects.
* protocols/subcompositor: fix subsurface sorting (#11136)Vaxry2025-07-201-0/+24
|
* compositor: properly set infinite region on null inputVaxry2025-07-171-1/+1
| | | | fixes #11065
* protocols/cm: Fix preferred image description (#11026)UjinT342025-07-151-1/+14
|
* protocols: Remove incorrect CM proto debug check and fix preferred image ↵UjinT342025-07-141-0/+7
| | | | description (#11023)
* presentation: move to unique ptrsTom Englund2025-07-101-2/+2
| | | | less refcounting, move by rvalue.
* compositor: fix race to finish on null buffer (#10970)Tom Englund2025-07-081-0/+7
| | | | if a null buffer is commited and a pending state is awaiting, drop the pending state so we dont end up in race to finish brokeness.
* compositor: dont send around int max valuesTom Englund2025-07-071-7/+12
| | | | | | we know the buffersize use it instead of int max values that can potentially cause math issues and slowdowns. minor improvement to glmark2 aswell.
* internal: iso C++ prohibits anonymous structs (#10955)Tom Englund2025-07-071-16/+16
| | | turn on -Wpedantic and name the anonymous struct.
* refactor: use std::ranges whenever possible (#10584)Kamikadze2025-05-301-2/+2
|
* render: refactor class member vars (#10292)davc0n2025-05-051-1/+1
| | | | | * render: refactor class member vars * render: fix clang format
* protocols: refactor class member vars (types) (#10261)davc0n2025-05-031-6/+6
|
* protocols: refactor class member vars (core) (#10259)davc0n2025-05-031-187/+187
|
* helpers: refactor class member vars (#10218)davc0n2025-04-301-6/+6
|
* render: properly release rendered buffers (#9807)Ikalco2025-04-301-9/+1
| | | | | | | | | * cleanup eglSync * properly release buffers in renderer * add renderingDoneCallback and use it in screencopy * use static constructor for CEGLSync
* time: move to stl's clocks and move timerVaxry2025-04-161-7/+5
|
* core: wait for dmabuf readiness (#9806)Ikalco2025-04-161-9/+16
| | | | | | | | | * add doOnReadable to event loop manager * move syncTimeline addWaiter to doOnReadable * wait on dmabuf buffers to be readable * don't over synchronize in scanout, also give present feedback on same buffer commit
* compositor/surface: fix surface opaque and input regions not being updated ↵Ikalco2025-04-121-4/+4
| | | | (#10055)
* core: refactor and improve surface commit (#9805)Ikalco2025-04-071-29/+80
| | | | | | | | | | | | | | | | | | | | | | | * 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
* core: Don't damage the entire surface every frame (#9763)Lee Bousfield2025-03-281-8/+12
| | | | | | | * core: Don't damage the entire surface every frame * core: Damage buffer on dims or transform change * core: Use guards for scale and tr equality checks
* surfacestate: track and apply updated stateVaxry2025-03-261-14/+28
| | | | fixes #9729
* core/compositor: Fix dropping cursor buffer data early (#9700)Lee Bousfield2025-03-221-1/+3
|
* core/compositor: Correctly track SHM buffer damage (#9678)Lee Bousfield2025-03-221-39/+14
|
* screencopy, render: Use explicit sync for screencopy (#9697)Lee Bousfield2025-03-221-1/+1
| | | | | | | * screencopy, render: Use explicit sync for screencopy * screencopy: Check if explicit sync is enabled * screencopy: Don't require explicit KMS enabled
* types: Upgrade buffer ref from WP to SP (#9677)Lee Bousfield2025-03-201-2/+2
|
* syncobj: restore SHM buffer reset (#9675)Tom Englund2025-03-201-5/+3
| | | | | reset shm buffers early to mitigate stuttering animations, also reuse the monitors eglSync and store the eglsync per monitor. this however reintroduces flickering in dbeaver nonsyncobj application.
* syncobj: use eventfd instead of stalling fd checks (#9437)Tom Englund2025-03-141-35/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * syncobj: cleanup and use uniqueptrs cleanup a bit missing removals if resource not good, erasing from containers etc. make use of unique ptrs instead. and add default destructors. * syncobj: rework syncobj entirerly remove early buffer release that was breaking explicit sync, the buffer needs to exist until the surface commit event has been emitted and draw calls added egl sync points, move to eventfd signaling instead of stalling sync point checks, and recommit pending commits if waiting on a signal. add a CDRMSyncPointState helper class. move a few weak pointers to shared pointers so they dont destruct before we need to use them. * syncobj: queue pending states for eventfd eventfd requires us to queue pending stats until ready and then apply to current, and also when no ready state exist commit the client commit on the current existing buffer, if there is one. * syncobj: clear current buffer damage clear current buffer damage on current buffer commits. * syncobj: cleanup code and fix hyprlock remove unused code, and ensure we dont commit a empty texture causing locksession protocol and gtk4-layer-shell misbehaving. * syncobj: ensure buffers are cleaned up ensure the containers having the various buffers actually gets cleaned up from their containers, incase the CSignal isnt signaled because of expired smart pointers or just wrong order destruction because mishaps. also move the acquire/point setting to buffer attaching. instead of on precommit. * syncobj: remove unused code, optimize remove unused code and merge sync fds if fence is valid, remove manual directscanout buffer dropping that signals release point on pageflip, it can cause us to signal the release point while still keeping the current buffer and rendering it yet again causing wrong things. * syncobj: delay buffer release on non syncobj delay buffer releases on non syncobj surfaces until next commit, and check on async buffers if syncobj and drop and signal the release point on backend buffer release. * syncobj: ensure we follow protocol ensure we follow protocol by replacing acquire/release points if they arrive late and replace already existing ones. also remove unneded brackets, and dont try to manual lock/release buffers when it comes to explicit protocol. it doesnt care about buffer releases only about acquire and release points and signaling them. * syncobj: lets not complicate things set points in precommit, before checking protocol errors and we catch any pending acquire/release points arriving late. * syncobj: move SSurfaceState to types remove destructor resource destroying, let resources destroys them on their events, and move SSurfaceStates to types/SurfaceState.hpp * syncobj: actually store the merged fd have to actually store the mergedfd to use it. * syncobj: cleanup a bit around fences ensure the current asynchronous buffer is actually released on pageflip not the previous. cleanup a bit FD handling in commitPendingAndDoExplicitSync, and reuse the in fence when syncing surfaces. * syncobjs: ensure fence FD doesnt leak calling resetexplicitfence without properly ensuring the FD is closed before will leak it, store it per monitor and let it close itself with the CFileDescriptor class. * syncobj: ensure buffers are actually released buffers were never being sent released properly. * types: Defer buffer sync releaser until unlock * syncobj: store directscanout fence in monitor ensure the infence fd survives the scope of attemptdirectscanout so it doesnt close before it should have. * syncobj: check if if acquire is expired we might hit a race to finish on exit where the timeline just has destructed but the buffer waiter is still pending. and such we removeAllWaiters null dereferences. * syncobj: code style changes remove quack comment, change to m_foo and use a std::vector and weakpointer in the waiter for removal instead of a std::list. * syncobj: remove unused async buffer drop remove unused async buffer drop, only related to directscanout and is handled elsewhere. --------- Co-authored-by: Lee Bousfield <ljbousfield@gmail.com>