[Buildroot] [PATCH 3/6] package/mesa3d: is a full-openGL provider if X.org is present

Paul Cercueil paul at crapouillou.net
Tue Apr 1 20:14:11 UTC 2014


Hi,

Comments embedded.

On 01/04/2014 20:14, Yann E. MORIN wrote:
> Paul, All,
>
> On 2014-04-01 09:48 +0200, Paul Cercueil spake thusly:
>> I don't see the "if X.org is present" part in your patch, what would prevent
>> me from trying to enable OpenGL on a X11-less system?
> Right, the commit log does not really match the changeset.
>
>> You make BR2_PACKAGE_MESA3D_DRIVER select BR2_PACKAGE_HAS_OPENGL but that is
>> wrong. Typically a X11-less system will enable a Gallium driver, while
>> Mesa's OpenGL requires a DRI driver (hence the dependency on X11).
> This is the same change Bernd did in his patch. I initially did:
>
>      config BR2_PACKAGE_MESA3D
>          bool "mesa3d"
>          select BR2_PACKAGE_HAS_OPENGL if BR2_PACKAGE_XORG7
>
>      if BR2_PACKAGE_MESA3D
>
>      config BR2_PACKAGE_PROVIDES_OPENGL
>          default "mesa3d" if BR2_PACKAGE_XORG7
>
>      endif
>
> (only quoting the relevant parts)
>
> But as Bernd (who seems much more knowledgeable than I in mesa3d) made
> than depend on BR2_PACKAGE_MESA3D_DRIVER, I eventually did the same.
>
>> What I suggest is to select BR2_PACKAGE_HAS_OPENGL only from
>> BR2_PACKAGE_MESA3D_DRI_DRIVER, and make BR2_PACKAGE_MESA3D_DRI_DRIVER
>> available only if X11 is enabled, since it makes no sense building X11-only
>> drivers in that case.
> But MESA3D_DRI_DRIVE is a blind option that is selected by the various
> Gallium or DRI drivers.
>
> Of those drivers, only the i965 DRI driver depends on XORG7, the other
> DRI drivers, as well as the Gallium drivers, do not depend on XORG7.
>
> Here are all the drivers:
>      nouveau (Gallium)
>      vmware  (Gallium)
>      swrast  (Gallium)
>      swrast  (DRI)
>      i965    (DRI) depends on XORG7
>      radeon  (DRI)
>
> So, taking your comment into account, only the i965 should provide
> full-openGL, since it's the only one that guarantees X.org is present.
>
> However, are the others missing a dependency on XORG7? Is it possible
> (and meaningful) to build the nouveau Gallium driver without X.org? The
> radeon driver? ...
>
> I have to admit I am a bit lost in all this mess... :-(

It works like this: regular OpenGL only works with DRI drivers, and DRI 
drivers are only usable under X11.
Which means that all DRI drivers should depend on XORG7 (even the swrast 
one), and they should all select OpenGL.

Gallium drivers are meant to be used with EGL and OpenGL ES, and only 
some of them can be used under X11 using a DRI compatibility layer (for 
instance, "nouveau" in Mesa is both a Gallium and a DRI driver). But 
they should also all work fine without X11, and will support Wayland, 
which is not the case for DRI drivers.
>
> So, here is basically what I propose for now:
>
>    - move the select _HAS_OPENGL to BR2_PACKAGE_MESA3D_DRI_DRIVER
>    - do the select only if XORG7 is selected
>    - add missing dependencies on XORG7 based on your feedback on the
>      above question.
>
>
> BTW, there is a bug in the way BR2_PACKAGE_MESA3D_DRI_DRIVER is defined:
>
>      config BR2_PACKAGE_MESA3D_DRI_DRIVER
>          select BR2_PACKAGE_MESA3D_DRIVER
>          depends on !BR2_PREFER_STATIC_LIB
>          bool
>
> None of the symbols that select BR2_PACKAGE_MESA3D_DRI_DRIVER do depend
> on !BR2_PREFER_STATIC_LIB, so we can end-up in an unmet-dependency hell.
>
> Basically, adding a 'depends on' to a no-prompt symbol is just wrong.
>
> I'll fix that in my series.
>
>> Also, the original Config.in has options to enable EGL/GLES, having an
>> option to toggle OpenGL would be nice too, I think
> Well, we can add such an option in a follow-up patch; I do not like to
> mix fixes and enhancements in the same patch.
>
>> (and OpenVG, but that's a
>> separate issue).
> Ditto, it can be in a follow-up patch.
>
> Thank you for the review! :-)
>
> Regards,
> Yann E. MORIN.
>




More information about the buildroot mailing list