[PATCH weston 3/3 v4] simple-dmabuf-drm: use GBM generic calls
Guido Günther
agx at sigxcpu.org
Sat Jul 21 08:05:41 UTC 2018
Hi,
On Fri, Jul 20, 2018 at 11:10:29PM +0200, Guido Günther wrote:
> Hi,
> On Fri, Jul 13, 2018 at 05:43:50PM +0200, Guido Günther wrote:
> > Hi,
> > On Thu, Jul 12, 2018 at 01:46:25PM +0200, Emilio Pozuelo Monfort wrote:
> > > No need to write libdrm driver specific code for each supported
> > > driver, we can just let GBM call the right one for us now.
> >
> > This one breaks NV12 on intel when using rootston as compositor for me.
> >
> > $ ./weston-simple-dmabuf-drm --import-format=NV12
> > Error: zwp_linux_buffer_params.create failed.
> > Error: zwp_linux_buffer_params.create failed.
> > Error: zwp_linux_buffer_params.create failed.
>
> Reason is that in wlroot's wlr_egl_create_image_from_wl_drm[1] this
>
> return eglCreateImageKHR(egl->display, EGL_NO_CONTEXT,
> EGL_LINUX_DMA_BUF_EXT, NULL, attribs);
>
> returns ELG_BAD_ALLOC. The attribs passed in look sane. Looking at
> mesa's dri2_create_image_khr_texture that doesn't make much sense so I
> wonder if this rings a bell here?
I think I can answer this myself. While (in weston terms) the old NV12
code tested this code path:
https://gitlab.freedesktop.org/wayland/weston/blob/master/libweston/gl-renderer.c#L2071
(with > 1 plane so):
https://gitlab.freedesktop.org/wayland/weston/blob/master/libweston/gl-renderer.c#L1805
(which was the intention) the new code now tests
https://gitlab.freedesktop.org/wayland/weston/blob/master/libweston/gl-renderer.c#L2085
which is already covered by simple-dmabuf-v4l. Since wlroots does not
yet support importing multi planar formats by splitting them into singe
plane dmabufs NV12 fails now.
Can we achieve the same with gbm somehow?
As a related question: the current way to try one format first and then
fall back to import_yuv_dmabuf looks wired. Would it be better to check
if the format is in yuv_formats beforehand or is there a reason not to do
so?
Cheers,
-- Guido
More information about the wayland-devel
mailing list