Re: [poky] How to override mesa VULKAN_DRIVERS and GALLIUMDRIVERS variables?

Trent Piepho <[email protected]> Mon, 4 Aug 2025 10:19:11 -0700
Newsgroups org.yoctoproject.lists.poky
Message-ID <CAMHeXxN_eGUQpPTjKw1pZbzPX6s-BV-hWvGy97z-MRn42bFMFw@mail.gmail.com>
On Mon, Aug 4, 2025 at 3:15 AM Alexander Kanavin via
lists.yoctoproject.org <[email protected]>
wrote:
>
> On Sun, 3 Aug 2025 at 08:28, trent.piepho via lists.yoctoproject.org
> <[email protected]> wrote:
> > Setting VULKAN_DRIVERS in an bbappend or machine conf file to something like "intel" doesn't work, because the append actions still append to that value all additional drivers.
> > Trying to remove other drivers with something like VULKAN_DRIVERS:remove = ",amd" doesn't work either, as remove only matches on word boundaries and the list is command delimited, not space delimited.
>
> VULKAN_DRIVERS is basically internal to the recipe. You need to set
> PACKAGECONFIG for mesa to include the needed set:
>
> VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG',
> 'freedreno', ',freedreno', '', d)}"

Not sure I follow what you're saying.  If I add the above code inside
a machine conf file or via bbappend, I'm stuck only adding new drivers
and not able to remove those the recipe has already determined.  While
it is possible to turn off, e.g., freedreno by PACKAGECONFIG, it can
be done for neither intel nor amd.

Or are you saying that the mesa recipe should be modified to work
entirely this way: allowing *all* drivers to be configured via
PACKAGECONFIG?  Ditto for the GALLIUMDRIVERS configuration, which has
the same issue.

If the latter, is there a reason to not use `VULKAN_DRIVERS .= "${@…,
',driver', '', d)}"`.  It seems like as soon as recipes start to use
:append internally, they get harder to layer via bbappend and conf
files.

I did find a workaround to configure the mesa drivers.  In a mesa
bbappend, set the configure command line arguments directly:

PACKAGECONFIG[gallium] = "-Dgallium-drivers=iris, -Dgallium-drivers='', libdrm"
PACKAGECONFIG[vulkan] =
"-Dvulkan-drivers=intel,-Dvulkan-drivers='',glslang-native
vulkan-loader vulkan-headers"

But this unnecessarily duplicates internal code from the recipe that
will need to be kept in sync.  IMHO, being able to select drivers via
package config would be a better design.