summaryrefslogtreecommitdiff
path: root/src/protocols/core/Shm.cpp
Commit message (Collapse)AuthorAgeFilesLines
* egl: move over to use hyprgraphics (#12988)Tom Englund2026-04-051-1/+4
| | | use the hyprgraphics helpers instead.
* renderer: refactor resources and flags (#13471)UjinT342026-03-071-2/+0
|
* proto/shm: update wl_shm to v2 (#13187)EvilLary2026-02-061-0/+1
|
* debug: move to hyprutils' logger (#12673)Vaxry2025-12-181-3/+3
|
* protocols: add Fifo-v1 and commit-timing-v1 (#12052)Tom Englund2025-11-061-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-0/+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.
* shm: refactor to UP and correct m_data check (#11820)Tom Englund2025-09-251-9/+14
| | | | | | | | | | use unique pointers and rvalue references where applicable, buffer is still a shared pointer because CHLBufferReference uses it to hold it locked. in CSHMPool destructor add a check for m_data != MAP_FAILED same in resize, because mmap returns (void *) -1 on failure and that is not comparable to nullptr. delete default constructor so we dont end up in weird states with m_data.
* refactor: Use new hyprutils casts (#11377)Kamikadze2025-08-141-4/+4
|
* core: use new typed signals from hu (#10853)outfoxxed2025-07-081-1/+1
|
* refactor: use std::ranges whenever possible (#10584)Kamikadze2025-05-301-1/+1
|
* protocols: refactor class member vars (types) (#10261)davc0n2025-05-031-5/+5
|
* protocols: refactor class member vars (core) (#10259)davc0n2025-05-031-58/+58
|
* core/compositor: Correctly track SHM buffer damage (#9678)Lee Bousfield2025-03-221-9/+2
|
* syncobj: use eventfd instead of stalling fd checks (#9437)Tom Englund2025-03-141-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* core: begin using CFileDescriptor from hyprutils (#9122)Tom Englund2025-01-301-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * config: make fd use CFileDescriptor make use of the new hyprutils CFileDescriptor instead of manual FD handling. * hyprctl: make fd use CFileDescriptor make use of the new hyprutils CFileDescriptor instead of manual FD handling. * ikeyboard: make fd use CFileDescriptor make use of the new CFileDescriptor instead of manual FD handling, also in sendKeymap remove dead code, it already early returns if keyboard isnt valid, and dont try to close the FD that ikeyboard owns. * core: make SHMFile functions use CFileDescriptor make SHMFile misc functions use CFileDescriptor and its associated usage in dmabuf and keyboard. * core: make explicit sync use CFileDescriptor begin using CFileDescriptor in explicit sync and its timelines and eglsync usage in opengl, there is still a bit left with manual handling that requires future aquamarine change aswell. * eventmgr: make fd and sockets use CFileDescriptor make use of the hyprutils CFileDescriptor instead of manual FD and socket handling and closing. * eventloopmgr: make timerfd use CFileDescriptor make the timerfd use CFileDescriptor instead of manual fd handling * opengl: make gbm fd use CFileDescriptor make the gbm rendernode fd use CFileDescriptor instead of manual fd handling * core: make selection source/offer use CFileDescriptor make data selection source and offers use CFileDescriptor and its associated use in xwm and protocols * protocols: convert protocols fd to CFileDescriptor make most fd handling use CFileDescriptor in protocols * shm: make SHMPool use CfileDescriptor make SHMPool use CFileDescriptor instead of manual fd handling. * opengl: duplicate fd with CFileDescriptor duplicate fenceFD with CFileDescriptor duplicate instead. * xwayland: make sockets and fds use CFileDescriptor instead of manual opening/closing make sockets and fds use CFileDescriptor * keybindmgr: make sockets and fds use CFileDescriptor make sockets and fds use CFileDescriptor instead of manual handling.
* core,hyprctl: clang, clang-tidy, typo fixes and dtors changes (#9233)Honkazel2025-01-301-4/+0
| | | | | | | * declare dtor once + DMABBUF typo fix * dup include + clang moment * linux-dmabuf: last minute nit change
* core: add LIKELY and UNLIKELY macrosvaxerski2025-01-171-16/+16
| | | | helps the compiler optimize
* core: cleanup header includes (#9088)user1111111111111111111111111111111112025-01-171-1/+1
| | | Cleanup some unneeded includes to speed up compilation
* core: Add clang-tidy (#8664)Vaxry2024-12-071-6/+6
| | | | | This adds a .clang-tidy file for us. It's not a strict requirement to be compliant, but I tuned it to be alright.
* shm: fix shm fd size check before creating or resizing shm_pool (#8572)Nabil Otsmane2024-11-251-0/+21
| | | | | * protocols: fix shm fd size check before creating or resizing shm_pool * added static to function
* shm: send a static list of shm formatsVaxry2024-09-201-5/+2
| | | | fixes #7733
* misc: constify the remaining for loops (#7534)Tom Englund2024-08-261-2/+2
| | | now we roll loops at blazing constified speed.
* shm: align size to stride (#7383)Tom Englund2024-08-181-1/+1
| | | calculate the size to the stride we got to better align it.
* protocols: refactor protocol logging to a macro (#7324)Tom Englund2024-08-151-2/+0
| | | | | | this avoids the usage of the unique_ptr PROTO::protocol before it has been constructed incase one wants to log something inside the constructor itself, move the logging to macros and print file:linenumber on ERR,CRIT,WARN and classname on the rest of the levels.
* Core: Move to aquamarine (#6608)Vaxry2024-07-211-10/+17
| | | | | | | | | | | | | | Moves Hyprland from wlroots to aquamarine for the backend. --------- Signed-off-by: Vaxry <vaxry@vaxry.net> Co-authored-by: Mihai Fufezan <mihai@fufexan.net> Co-authored-by: Jan Beich <jbeich@FreeBSD.org> Co-authored-by: vaxerski <vaxerski@users.noreply.github.com> Co-authored-by: UjinT34 <41110182+UjinT34@users.noreply.github.com> Co-authored-by: Tom Englund <tomenglund26@gmail.com> Co-authored-by: Ikalco <73481042+ikalco@users.noreply.github.com> Co-authored-by: diniamo <diniamo53@gmail.com>
* wayland: consistently check mmap error after 6967a3145044 (#6402)Jan Beich2024-06-101-2/+2
| | | mmap() returns MAP_FAILED on error, not nullptr.
* buffer: track asynchronous buffers and don't release them until unrefVaxry2024-06-081-0/+4
| | | | synchronous buffers are read instantly and we can release them, but asynchronous ones have to be locked until they are unref'd from .current to avoid reading from a buffer after .release()
* wayland/core: move to new impl (#6268)Vaxry2024-06-081-0/+214
* wayland/core/dmabuf: move to new impl it's the final countdown