agherzan / meta-raspberrypi

Yocto/OE BSP layer for the Raspberry Pi boards
https://www.yoctoproject.org/
MIT License
520 stars 407 forks source link

Fix build of mesa-gl 22 with userland graphics #1119

Closed clopez closed 1 year ago

clopez commented 1 year ago

mesa-gl 22.2.2 from Yocto Langdale fails to build when the userland graphics are enabled (DISABLE_VC4GRAPHICS=1) with this error:

| Target machine cpu family: arm
| Target machine cpu: arm
| Checking if "-mtls-dialect=gnu2" runs: YES
| 
| ../mesa-22.2.2/meson.build:555:6: ERROR: Problem encountered: xlib based GLX requires at least one gallium driver
| 

Fix the problem by ensuring to enable the gallium packageconfig option by default

agherzan commented 1 year ago

Shouldn't this be a dependency of xlib? I can't see how this is rpi specific unless I'm missing something.

clopez commented 1 year ago

This is the PACKAGECONFIG options for mesa-gl before this patch (current status-quo):

 $ bitbake -e mesa-gl|grep -P '^(GALLIUM|PACKAGECONFIG)'
    GALLIUMDRIVERS="swrast,swrast"
    GALLIUMDRIVERS:x86-x32=""
    GALLIUMDRIVERS_LLVM="r300,nouveau"
    GALLIUMDRIVERS_RADEONSI=""
    PACKAGECONFIG="opengl x11 gbm"
    PACKAGECONFIG:class-target="opengl x11"
    PACKAGECONFIG_CONFARGS="  -Ddri3=disabled  -Degl=disabled  -Dgallium-drivers=''  -Dllvm=disabled -Dgbm=enabled  -Dgles1=disabled -Dgles2=disabled -Dlmsensors=disabled -Dgallium-opencl=disabled -Dopencl-spirv=false -Dopengl=true -Dosmesa=false -Dperfetto=false -Dlibunwind=disabled -Dgallium-va=disabled -Dgallium-vdpau=disabled  -Dvulkan-drivers='' -Dvulkan-beta=false  -Dgallium-xa=disabled -Dgallium-xvmc=disabled"

And this are the values after this patch:

   $ bitbake -e mesa-gl|grep -P '^(GALLIUM|PACKAGECONFIG)'
    GALLIUMDRIVERS="swrast,swrast"
    GALLIUMDRIVERS:x86-x32=""
    GALLIUMDRIVERS_LLVM="r300,nouveau"
    GALLIUMDRIVERS_RADEONSI=""
    PACKAGECONFIG="opengl gallium x11 gbm"
    PACKAGECONFIG:class-target="opengl gallium x11"
    PACKAGECONFIG_CONFARGS="  -Ddri3=disabled  -Degl=disabled -Dgallium-drivers=swrast,swrast  -Dllvm=disabled -Dgbm=enabled  -Dgles1=disabled -Dgles2=disabled -Dlmsensors=disabled -Dgallium-opencl=disabled -Dopencl-spirv=false -Dopengl=true -Dosmesa=false -Dperfetto=false -Dlibunwind=disabled -Dgallium-va=disabled -Dgallium-vdpau=disabled  -Dvulkan-drivers='' -Dvulkan-beta=false  -Dgallium-xa=disabled -Dgallium-xvmc=disabled"

The issue is that the we are enabling the PACKAGECONFIG option x11 (alias xlib/glx) without enabling gallium and mesa complains about that.

But you are right that this doesn't seem to be an issue caused by meta-raspberrypi itself.

I have submitted a patch to oe-core to fix this there. Let's see if it is ok to merge that there.

agherzan commented 1 year ago

@clopez Yes, I reckon that would be the best. I'll close this MR for now but come back to us if this doesn't get accepted upstream (but I think it will).