How to obtain a drm lease from X for overlay planes as well as a primary plane?

John Cox jc at kynesim.co.uk
Wed Aug 11 11:40:47 UTC 2021


Hi

>On Wednesday, August 11th, 2021 at 11:43, Daniel Vetter <daniel at ffwll.ch> wrote:
>
>> For wayland this is still in the works, so might be good if you check
>> there that your use-case is properly supported. Protocol MR is here:
>>
>> https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/67
>
>The client requests a connector, and the compositor will decide which
>resources to lease. This may or may not include overlay planes. The
>connector you're interested in may or may not be available for lease.

Fair point

>What's your use-case?

Raspberry Pi displaying video with subtitles or other controls.  I was
thinking of the fullscreen case but if zero copy video can be made to
work to the main desktop then that would even better.

If displaying 4k video the Pi does not have enough bandwidth left for a
single frame copy, convert or merge so I need hardware scaling,
composition & display taking the raw video frame (its in a dmabuf).  The
raw video is in a somewhat unique format, I'd expect the other layers to
be ARGB.  The Pi h/w can do this and I believe I can make it work via
DRM if I own the screen so that was where I started.

>Why not use an xdg_toplevel and wl_subsurface?

Probably because I am woefully underinformed about how I should be doing
stuff properly.  Please feel free to point me in the correct direction -
any example that takes NV12 video (it isn't NV12 but if NV12 works then
SAND can probably be made to too) would be a great start.  Also Wayland
hasn't yet come to the Pi though it will shortly be using mutter.

>DRM leases are not a good idea for regular applications. They don't
>properly integrate with the rest of the desktop, and won't get input
>events. Letting the compositor deal with KMS planes is the preferred
>approach.

If that can be made to work then I agree I would like to do it like
that.

Many thanks for the response.

John Cox


More information about the dri-devel mailing list