-
-
Notifications
You must be signed in to change notification settings - Fork 958
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
[aquamarine] try to fix direct scanout #6875
Conversation
Found an interesting repro case for the random artifacts during ds, xonotic edit: |
another repro case for artifacting edit: |
gamescope has a bug report that looks a lot like the artifacting edit: |
so is that a kernel bug? |
not entirely sure, it supposedly works on nvidia and igpu without artifacting but amd gets artifacting
not sure how to test how many fps the client is actually rendering to test if this is true though edit: |
recorded on this branch, intel iGPU direct_scanout_tearing.mp4 |
After a lot of testing the artifacts dont seem to be a kernel/driver/mesa bug PS: |
@phonetic112 in 6608 said the glitches go away on legacy drm api, perhaps something there is off?
render ---> submit with flip event submit submits a frame to be presented on next vblank (monitor changes image = vblank) |
wild guess, do the glitches happen without hardware cursors but when the cursor isnt on the screen? (if that doesnt allow DS then just patch it out, probably in attemptDirectScanout) |
no disabling hw cursors doesnt fix artifacting btw to get artifacting to go away i used vrrtest, vsync on, fps cap 1 fps above vsync, and busy wait on (busy wait says it more accurately tracks vsync) edit: |
…but enabled on the other
wait, so how do we make sure we dont schedule more than, lets say, 60 fps? |
backend will err out if you commit a new buffer before handlePF |
with this commit artifacting now only occurs when the client's fps is above the refresh rate of the monitor
043e229
to
9c24ec6
Compare
last commit was able to make artifacting only appear when vrrtest frame cap is above monitor refresh rate except when starting it up when it happens for a few frames also arch ci seems to be broken, something with updating packages |
the wlroots ds pr mentions holding client buffers longer
didn't have time to check this out but if we arent then that could be causing artifacts |
heh I did once make a patch to do that but it didnt stop the glitches, I can do it again |
committed the new infra impl here, feel free to drop it if it doesnt work |
it worked!!! artifacting is now completely gone on AMD, should be gtg other than testing on nvidia and igpu |
works on nvidia but something is going wrong with the cursor |
yeah i just saw that, i think i might know that it is edit: btw if you get a crash related to sendReleaseWithSurface i think i found the bug |
Yeah, works on nvidia. Occasionally spams entered/left direct scanout in logs when initially starting a fullscreen window or when system is under heavy load when starting the direct scanout but that's a non-issue and stabilizes in a few seconds. Will test intel in a moment. Unsurprisingly, it also works on intel 👍 |
202fec0
to
1c543b2
Compare
ready to merge then? or no |
yes this is ready |
thanks! |
* make linux-dmabuf use monitor primary plane formats for ds * add support for monitor connects/disconnects in linux-dmabuf * the weird bug was because ds was global, and disabled on one monitor but enabled on the other * forgot to remove attemptDirectScanout from hyprRenderer * add renderer fallback tranche on ds and a few other improvements * use set when making format table * mitigate ds artifacting and update linux-dmabuf comments with this commit artifacting now only occurs when the client's fps is above the refresh rate of the monitor * use new backend release infra * revert earlier artifacting mitigation that broke stuff ;) * ... i should test before push ;-; --------- Co-authored-by: Vaxry <[email protected]>
* make linux-dmabuf use monitor primary plane formats for ds * add support for monitor connects/disconnects in linux-dmabuf * the weird bug was because ds was global, and disabled on one monitor but enabled on the other * forgot to remove attemptDirectScanout from hyprRenderer * add renderer fallback tranche on ds and a few other improvements * use set when making format table * mitigate ds artifacting and update linux-dmabuf comments with this commit artifacting now only occurs when the client's fps is above the refresh rate of the monitor * use new backend release infra * revert earlier artifacting mitigation that broke stuff ;) * ... i should test before push ;-; --------- Co-authored-by: Vaxry <[email protected]>
Describe your PR, what does it fix/add?
will try to fix direct scanout and linux-dmabuf protocol for #6608
Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
Is it ready for merging, or does it need work?
only send formats than can fallback to renderer even in scanout tranchesadd renderer fallback tranche when attempting ds 2
maybe create seperate format_tables to mitigate bad clients 3Footnotes
after reading some of weston's code this might be related to plane damaging (drm.c@470)? this is a guess so far tho ↩
https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/stable/linux-dmabuf/feedback.rst
after some more reading the ds tranche is allowed to have formats that the egl doesnt support as long as there is a fallback tranche that the renderer does support ↩
the format_table contains all the formats from egl and planes but some wl clients only use format_table to find formats instead of tranches
only "bad" client i could find was mpv so I just bug reported there ↩