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
vo_dmabuf_wayland: wayland VO displaying dmabuf buffers using vaapi or drm hwdec #10533
Conversation
e3d08bf
to
dfc3eb0
Compare
Tested on an AMD Ryzen 7 Pro 3700U, appears to work (with usual no osc/osd caveats) on Weston aside from fullscreening refusing to cover Weston's launcher bar. KWin seemingly lacks NV12 support. Will test on aarch64 when I get the time. |
30df46e
to
ef31dd5
Compare
ef31dd5
to
076436b
Compare
3bf7e74
to
39d11c8
Compare
nods done rebased that one |
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.
Thanks for bearing with all this. General VO/wayland code looks good to me. I'll just have @philipl ACK the hwdec stuff real quick.
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.
I still have a couple of questions.
And also, what is the mechanism that allows the VO compatibility check to pass when hwupload is deciding what formats should be available? You previously commented all that code out but I don't see anything that will make it work here. That code relies on having supported ra formats being provided and you're not doing that either.
fd0e5f6
to
123e3cc
Compare
123e3cc
to
46c37f2
Compare
I think that's just the |
https://github.com/mpv-player/mpv/blob/master/filters/f_hwtransfer.c#L377 |
Thanks. Is that not taken care of by this part? mpv/video/out/vo_dmabuf_wayland.c Lines 273 to 280 in 46c37f2
|
No. This is the logic that compares sw formats. I just tested the latest code from this PR and the hwupload formats that it ultimately accepts is weird. It rejects some of the basic ones (like yuv420p which we know works) and accepts weirder ones. The list also doesn't reflect the actual compositor capabilities. ie: GNOME only supports bgra and friends but this weird list we get is the same as I see on weston so it tries to send nv12 and just shows black. If I force a conversion in software to a format that GNOME supports, it will hwupload and display correctly. This goes back to - in principle, the ra format list needs to reflect the compositor's supported formats for hwupload to work correctly. |
Oh yeah I'm stupid. This hardcodes the drmplanes no wonder. |
As we discussed, let's not block merging this on the hwupload behaviour, but we do need to fix the lack of error if there are no usable formats in |
46c37f2
to
ca6508f
Compare
I've added this error log. |
ca6508f
to
8a3e99f
Compare
Wayland VO that can display images from either vaapi or drm hwdec The PR adds the following changes: 1. a context_wldmabuf context with no gl dependencies 2. no-op ra_wldmabuf and dmabuf_interop_wldmabuf objects no-op because there is no need to map/unmap the drmprime buffer, and there is no need to manage any textures. Tested on both x86_64 and rk3399 AArch64
Pulled from mpv-player#10382 The zwp_linux_dmabuf_v1 protocol version 4 provides a file descriptor containing both formats and modifiers, which makes it possible for the compositor to import the buffers onto planes using explicit modifiers. This is an extremely important efficiency improvement, as the 3D hardware can be left powered off altogether, the vaapi buffer being sent directly from the video hardware to the display controller. It could be possible to support zwp_linux_dmabuf_v1 version 3 as well, but there is no reason beyond compatibility with old stacks. I would recommend to ditch version 2 as well, as modifier-less formats aren’t very useful nowadays.
8a3e99f
to
8416e9b
Compare
Thanks for all the work on this! |
Wayland VO that can display images from either
vaapi
ordrm
hwdecs.The PR adds the following changes:
context_wayland
Wayland context with no gl dependenciesra
anddmabuf_interop
objects - no-op because there is no need to map/unmap the drmprime buffer, and there is no need to manage any textures.Tested on both
x86_64
andrk3399
AArch64
cc @philipl