[Buildroot] [PATCH 1/1] package/glslsandbox: kms needs gbm

Fabrice Fontaine fontaine.fabrice at gmail.com
Sat Aug 28 10:38:37 UTC 2021


Hi Julien,

Le sam. 28 août 2021 à 12:04, Julien Olivain <ju.o at free.fr> a écrit :
>
> Hi Fabrice,
>
> On 28/08/2021 00:19, Fabrice Fontaine wrote:
> > Obviously, KMS/DRM/GBM needs gbm (and so mesa3d which is the only gbm
> > provider since commit 814bfc5ec1ab49188d1c8cb7f0d8d857b92d6a03):
>
> To my knowledge, imx-gpu-viv also provides a working gbm.
>
> > checking for gbm... no
> > configure: error: Package requirements (gbm) were not met:
> >
> > Package 'gbm', required by 'virtual:world', not found
> >
> > Fixes:
> >  -
> > http://autobuild.buildroot.org/results/31b3fff9748300e293b4efb5615176ccce48dd15
> >
> > Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
> > ---
> >  package/glslsandbox-player/Config.in             | 4 ++++
> >  package/glslsandbox-player/glslsandbox-player.mk | 4 +---
> >  2 files changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/package/glslsandbox-player/Config.in
> > b/package/glslsandbox-player/Config.in
> > index dc0d2c07f1..b85dff6a2f 100644
> > --- a/package/glslsandbox-player/Config.in
> > +++ b/package/glslsandbox-player/Config.in
> > @@ -67,8 +67,12 @@ choice
> >  config BR2_PACKAGE_GLSLSANDBOX_PLAYER_KMS
> >       bool "KMS/DRM/GBM"
> >       depends on BR2_TOOLCHAIN_HAS_THREADS # libdrm
> > +     depends on BR2_PACKAGE_MESA3D_GBM
>
> There was already few discussions to have a gbm virtual package, which
> was not
> accepted.  See [1].  I believe this is the kind of thing that would help
> in
> that case.  It is a valid case (but maybe not really common) to do
> OpenGL ES
> accelerated graphics, on top of KMS/GBM, without being a Wayland
> compositor.
>
> The next best candidate I see would be a dependency on
> BR2_PACKAGE_HAS_LIBEGL_WAYLAND, introduced in commit
> 1e3dfef19d8ae3804671a03b30003fa2d8115fc6.
>
> Since gbm is usually in those dependencies, that should fix this build
> failure,
> even if the dependency is not accurate (we depend on what a wayland
> compositor
> would need, and this package is not a compositor).
>
> See also commit fed835768aac18f2457544ff40f3b59b387117ed
>
> Finally, we could eventually introduce here a
> BR2_PACKAGE_GLSLSANDBOX_PLAYER_KMS_SUPPORTS
> which lists the dependencies known to work in that case:
> I see at least: BR2_PACKAGE_MESA3D_GBM and
> BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL
>
> >       select BR2_PACKAGE_LIBDRM
> >
> > +comment "KMS/DRM/GBM backend needs mesa3d w/ GBM"
> > +     depends on !BR2_PACKAGE_MESA3D_GBM
> > +
> >  config BR2_PACKAGE_GLSLSANDBOX_PLAYER_MALI
> >       bool "Allwinner ARM/Mali Frame Buffer"
> >       depends on BR2_PACKAGE_SUNXI_MALI_MAINLINE
> > diff --git a/package/glslsandbox-player/glslsandbox-player.mk
> > b/package/glslsandbox-player/glslsandbox-player.mk
> > index 5ace69d7dd..4f058772df 100644
> > --- a/package/glslsandbox-player/glslsandbox-player.mk
> > +++ b/package/glslsandbox-player/glslsandbox-player.mk
> > @@ -37,9 +37,7 @@ GLSLSANDBOX_PLAYER_CONF_OPTS +=
> > --disable-install-scripts
> >  endif
> >
> >  ifeq ($(BR2_PACKAGE_GLSLSANDBOX_PLAYER_KMS),y)
> > -# gbm dependency is not needed, as it is normally packaged with
> > -# libegl/libgles drivers.
> > -GLSLSANDBOX_PLAYER_DEPENDENCIES += libdrm
> > +GLSLSANDBOX_PLAYER_DEPENDENCIES += libdrm mesa3d
>
> Same comment: mesa3d is not the only gbm provider.
>
> >  GLSLSANDBOX_PLAYER_CONF_OPTS += --with-native-gfx=kms
> >  else ifeq ($(BR2_PACKAGE_GLSLSANDBOX_PLAYER_MALI),y)
> >  GLSLSANDBOX_PLAYER_DEPENDENCIES += sunxi-mali-mainline
>
> What do you think?
I'm not an expert in gbm and Thomas told me that Bootlin have a patch
series to improve the Buildroot handling of gbm:
https://patchwork.ozlabs.org/project/buildroot/patch/20210819160317.1045482-1-fontaine.fabrice@gmail.com/
So I'll let Thomas and gbm experts handle this long term solution.

As a short term solution (i.e. for the buildroot August release), I
think that adding a
"depends on BR2_PACKAGE_MESA3D_OPENGL_EGL || BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL"
as it is already done in weston is probably enough (without
BR2_PACKAGE_GLSLSANDBOX_PLAYER_KMS_SUPPORTS which seems a bit
overkilled).
I'll also drop the mesa3d dependency.
>
> Best regards,
>
> Julien.
>
> [1].
> https://patchwork.ozlabs.org/project/buildroot/patch/20180913194410.24077-1-bernd.kuhls@t-online.de/
Best Regards,

Fabrice


More information about the buildroot mailing list