-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syncobj: use eventfd instead of stalling fd checks #9437
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huge if works
53df780
to
e331b6c
Compare
wait... for ds, shouldn't we release the wl_buffer whenever DRM signals the out fence? edit:
|
There is a lot wrong at the moment, explicit sync currently relies on new buffer attached, the client can commit multiple times on the same buffer if it wants to, and does sometimes, and this PR probably exposed that quirk even more, and yeah direct scanout i havent begun reading into but removed that buffer manual buffer shenanigans because it was conflicting with the changes i made, there is also a few other things im checking that has popped up while testing |
And "releasing" when it comes to explicit sync is sending the release point not the buffer .release |
Note that |
I tested this pr & it fixed glmark2 lag but minecraft lag is still the same and also it introduced slight lag in other areas like workspace switching and cursor lag when wlogout is opened. |
we use that fd, i think we import it as a sync_file, then wait for it to signal, meaning aq plane is done with the primary buffer |
yeah got a few very broken things to figure out, im trying tho. |
@gulafaran you did amazing work, now everything runs smoothly. I ran various gpu stress tests, they ran without any lag. |
for this part
the lockedByBackend is unlocked when page flip buffer swap happens, so technically that's when we should signal release point since DRM scanout is no longer using the buffer |
I can also say that this fixed my issue with my RX 580 so it might fix something like #8119 and others. |
Probably will, and also some minecraft flickering and other things, im pushing soon a fix for a gtk issue and hyprlock issue so its not quite flawless yet 👍 |
cleanup a bit missing removals if resource not good, erasing from containers etc. make use of unique ptrs instead. and add default destructors.
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.
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.
clear current buffer damage on current buffer commits.
remove unused code, and ensure we dont commit a empty texture causing locksession protocol and gtk4-layer-shell misbehaving.
should be in a better state now, but not done yet. |
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.
use eventfd and add it to the event loop and when it recieves a signal release the the queued surfacestate, this means we dont stall entire compositor when waiting for materilisation of the fd. and change its related usage.
should solve a lot of "compositor 5 fps while ingame overlay shows 300fps" and other similiar weird stalls.
on nvidia this shuffles compositor stalls to sometimes a noticeable rendering stutter, technically the acquire point isnt signaled fast enough so the buffer is stuck and nothing gets rendered until it is. pretty much the same stall as seen before only now its per surface rendering. but that i contribute to nvidia driver being simply shit, and is visible on other compositors.
NVIDIA/open-gpu-kernel-modules#777
NVIDIA/open-gpu-kernel-modules#743
fixes:
#7857
#9340
#9340
#8588
#7643
#7317
#9376
potentially helps:
#6617
#9011
remaining quirks to be fixed