protocols: add Fifo-v1 and commit-timing-v1#12052
Conversation
|
playing video in mpv keeps freezing, continuously moving the mouse avoids it |
Bleh, so it wasnt buffers being held up. made it work here. Hrmhm. Thanks |
|
this generally LGTM
|
i think tearing might be affected aswell, however i still havent figured out why mpv is being annoyed. its almost like there is an upper render scheduling/damage issue. vfr = 0 or damage_bling = 1 or simply scheduling a monitor frame at the end of each |
|
@fxzzi i assume something like this makes mpv work for you too? |
I'm also having this issue with mpv, I tested the latest commit and if I launch a video from the terminal it works fine. But if I open the video from dolphin without background applications causing damage (pressing Enter or double-click without moving the mouse) The mpv window doesn't appear until I move the mouse, after that it seems to works fine. |
yeah probably didnt have entered an output, yet. and poof that scheduleframe never triggers. atleast we are rounding in where the issue is just gotta figure out something proper, thanks. |
how about now? |
Tested mpv and vkcube. All seems to be fine now. Thanks. |
|
added 720a468 since we already are touching all sorts of surface state commits, lets improve if further if possible. still needs some VRR and random other usage testing so it doesnt regress. |
i think it might be problematic if a later buffer commit becomes ready before the first. so it essentially skips the first and just merges into the last one. but i havent yet seen that occur here |
i think it might be problematic if a later buffer commit becomes ready before the first. so it essentially skips the first and just merges into the last one. but i havent yet seen that occur here
nvm 0a3d39d thinking about it. certain changes are relative to the buffer attached, cant go beyond it |
|
SDL2 and SDL3 are still causing Hyprland to crash when in native wayland. osu!lazer with (mpv issues from before are fixed) |
|
After some quick testing i came across 2 issues:
This PR fifo_pr.mp4Master master.mp4
cs2.mp4Also i'm on nvidia if it's relevant |
|
👀 weird, person above also has same crash |
yeah, atleast i got proof i did test things :D , il dig hrmlm. this is why i wanted more people testing because weird things happends all the time when it comes to buffers lol. fix one thing break 3 other. thanks. |
|
ok that should handle the crashes, kwin apparently also blocks fifo when actively tearing. i guess its up to debate what todo here. block fifo or block tearing?. and il see if i cant make it cleaner later. il see what that resizing vkcube is about, might be a day away if i dont find it shortly. working 2 long days. |
can confirm it doesn't crash anymore 🎉 |
dont fifo lock on tearing.
queue the state directly and use the .lock function instead of directly modify the lockMask on the state.
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.
ok how about now? |
|
b188e1b should atleast solve resizing issues, cs2 im unsure since i cant reproduce it |
it solved both vkcube and mpv on my end :O |
do you have vrr on and you sure this doesnt occur on -git without this PR? |
eLockReason and LOCK_REASON_NONE.
|
@AntoSkate what about that cs2 issue? |
i have vrr off and i retested it doesn't happen on master |
|
also tested this pr with vrr and without mangohud for science and it still freezes |
|
yeah gonna need some way to reproduce it to figure out why, tried nvidia, intel, dual monitors. single monitor. vrr, tearing, you name it. still doesnt occur here |
|
|
|
i forgot to set game to native wayland on his pc. can riproduce now on full amd system💀 |
i pulled my hair until i got a bald spot for the past 12 hours. it might have been there already who knows. I CAN REPRODUCE. for some reason i never figured the ingame vsync option was the important bit to hit it. now im making an appointment to the barber and while waiting im looking into this freeze. |
Dang I might have to send some to cover for barber expenses 😂 |
|
Freezes might be caused by modeset or other vrr/ds/hdr transitions. Cyberpunk freezes for a couple of seconds when it starts (audio keeps playing). VRR seems to have less jitter now. Earlier it could jump all the way between min and max rate while keeping the same average, now it's only +-3hz or so. |
nah its fifo. the nuke debug it alll patch makes it not freeze. now just to figure out why. |
can confirm, vrr feels great now with this PR, and my OSD reports only fluctuations of about 1-2Hz all the way from 49Hz to 170Hz for me. I am wondering whether VRR below the minimum VRR range is up to the compositor or the driver to handle? With my Nvidia GPU on linux and using |
workaround cursor commits causing fifo to get forever locked, this entire thing needs to be worked out.
|
ok so pushed a workaround, it however causes fifo to not work as intended in direct scanout. every once in a while it unlocks to early. but atleast things arent forever frozen. gonna see if i cant figure out something more proper later |
|
This PR breaks building plugins with following error: The include here should be relative, like Edit: Ignore the comment, didn't see #12228 which is now merged |
* 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.
* 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 d6e42ac and e036393 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.

introduce fifo-v1 and commit-timing-v1
TODO
fixes: #11386