diff mbox series

mesa-tools-native: fix do_compile failure

Message ID 20260325073954.1176537-1-khem.raj@oss.qualcomm.com
State Changes Requested
Headers show
Series mesa-tools-native: fix do_compile failure | expand

Commit Message

Khem Raj March 25, 2026, 7:39 a.m. UTC
From: Changqing Li <changqing.li@windriver.com>

Fix do_compile failure:
../sources/mesa-26.0.1/src/panfrost/lib/kmod/pan_kmod.c:7:10: fatal error: xf86drm.h: No such file or directory

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-graphics/mesa/mesa-tools-native.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alexander Kanavin March 25, 2026, 12:51 p.m. UTC | #1
On Wed, 25 Mar 2026 at 08:40, Khem Raj via lists.openembedded.org
<raj.khem=gmail.com@lists.openembedded.org> wrote:
> Fix do_compile failure:
> ../sources/mesa-26.0.1/src/panfrost/lib/kmod/pan_kmod.c:7:10: fatal error: xf86drm.h: No such file or directory

> -DEPENDS += "libclc-native spirv-tools-native spirv-llvm-translator-native"
> +DEPENDS += "libclc-native spirv-tools-native spirv-llvm-translator-native libdrm-native"

Should this be in PACKAGECONFIG for panfrost?

Alex
Quentin Schulz March 25, 2026, 2:45 p.m. UTC | #2
Hi Khem, Changqing,

On 3/25/26 8:39 AM, Khem Raj via lists.openembedded.org wrote:
> From: Changqing Li <changqing.li@windriver.com>
> 
> Fix do_compile failure:
> ../sources/mesa-26.0.1/src/panfrost/lib/kmod/pan_kmod.c:7:10: fatal error: xf86drm.h: No such file or directory
> 

What's the setup for this failure?

> Signed-off-by: Changqing Li <changqing.li@windriver.com>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>   meta/recipes-graphics/mesa/mesa-tools-native.bb | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-graphics/mesa/mesa-tools-native.bb b/meta/recipes-graphics/mesa/mesa-tools-native.bb
> index 50d2f5cbb0..743e3391e9 100644
> --- a/meta/recipes-graphics/mesa/mesa-tools-native.bb
> +++ b/meta/recipes-graphics/mesa/mesa-tools-native.bb
> @@ -11,7 +11,7 @@ PACKAGECONFIG += "gallium-llvm"
>   # to PACKAGECONFIG like in mesa.inc
>   PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'x11 wayland', d)}"
>   
> -DEPENDS += "libclc-native spirv-tools-native spirv-llvm-translator-native"
> +DEPENDS += "libclc-native spirv-tools-native spirv-llvm-translator-native libdrm-native"
>   

libdrm-native is brought in via the wayland PACKAGECONFIG, which is 
enabled if DISTRO_FEATURES has it, so I'm assuming this issue can be 
reproduced on non-wayland setups?

Reading the code...

src/panfrost/lib/kmod/meson.build

clearly highlights there's a dependency on libdrm (dep_libdrm), but 
dep_libdrm (created in meson.build) isn't created as a required 
dependency, while it probably should since 
src/panfrost/lib/kmod/panfrost_kmod.c clearly calls functions from 
xf86drm.h which are only defined in the lib. Maybe something to patch in 
mesa itself as well, so that it complains it cannot build the tool 
because of missing libdrm dependency.

libdrm is apparently necessary for DRI, GBM and any Vulkan driver (see 
with_dri2 in meson.build). DRI is true when building Gallium drivers (we 
have this correct in PACKAGECONFIG[gallium]).
We would need to check but I'm assuming we're missing the libdrm 
dependency in PACKAGECONFIG[vulkan] if we're building without gallium in 
PACKAGECONFIG.
That still wouldn't fix the missing libdrm dependency for panfrost tool 
though, for that I'm suggesting we add it to mesa.inc via:

TOOLS_DEPS:append = "${@bb.utils.contains('PACKAGECONFIG', 'panfrost', 
'libdrm ', '', d)}"

to match what we're doing for the freedreno tool.

Cheers,
Quentin
Khem Raj March 25, 2026, 2:46 p.m. UTC | #3
On Wed, Mar 25, 2026 at 5:52 AM Alexander Kanavin <alex.kanavin@gmail.com>
wrote:

> On Wed, 25 Mar 2026 at 08:40, Khem Raj via lists.openembedded.org
> <raj.khem=gmail.com@lists.openembedded.org> wrote:
> > Fix do_compile failure:
> > ../sources/mesa-26.0.1/src/panfrost/lib/kmod/pan_kmod.c:7:10: fatal
> error: xf86drm.h: No such file or directory
>
> > -DEPENDS += "libclc-native spirv-tools-native
> spirv-llvm-translator-native"
> > +DEPENDS += "libclc-native spirv-tools-native
> spirv-llvm-translator-native libdrm-native"
>
> Should this be in PACKAGECONFIG for panfrost?
>

I have opengl-only image to build for odroid-c4 which does not have
panfrost.


>
> Alex
>
Quentin Schulz March 25, 2026, 2:53 p.m. UTC | #4
Hi Khem,

On 3/25/26 3:46 PM, Khem Raj via lists.openembedded.org wrote:
> On Wed, Mar 25, 2026 at 5:52 AM Alexander Kanavin <alex.kanavin@gmail.com>
> wrote:
> 
>> On Wed, 25 Mar 2026 at 08:40, Khem Raj via lists.openembedded.org
>> <raj.khem=gmail.com@lists.openembedded.org> wrote:
>>> Fix do_compile failure:
>>> ../sources/mesa-26.0.1/src/panfrost/lib/kmod/pan_kmod.c:7:10: fatal
>> error: xf86drm.h: No such file or directory
>>
>>> -DEPENDS += "libclc-native spirv-tools-native
>> spirv-llvm-translator-native"
>>> +DEPENDS += "libclc-native spirv-tools-native
>> spirv-llvm-translator-native libdrm-native"
>>
>> Should this be in PACKAGECONFIG for panfrost?
>>
> 
> I have opengl-only image to build for odroid-c4 which does not have
> panfrost.
> 

It "has", due to building mesa-tools-native which enables building 
panfrost tools unconditionally.

panfrost PACKAGECONFIG may enable building the gallium driver (if 
combined with gallium PACKAGECONFIG), the vulkan (panvk) driver (if 
combined with vulkan PACKAGECONFIG) and/or the panfrost tools (if 
combined with tools PACKAGECONFIG).

So it's a missing dependency for the panfrost tools and should be added 
as dependency to the panfrost tools (see my other mail). I don't think 
you need it if you're not building the panfrost tools.

Cheers,
Quentin
Khem Raj March 25, 2026, 4:26 p.m. UTC | #5
On Wed, Mar 25, 2026 at 7:53 AM Quentin Schulz <quentin.schulz@cherry.de>
wrote:

> Hi Khem,
>
> On 3/25/26 3:46 PM, Khem Raj via lists.openembedded.org wrote:
> > On Wed, Mar 25, 2026 at 5:52 AM Alexander Kanavin <
> alex.kanavin@gmail.com>
> > wrote:
> >
> >> On Wed, 25 Mar 2026 at 08:40, Khem Raj via lists.openembedded.org
> >> <raj.khem=gmail.com@lists.openembedded.org> wrote:
> >>> Fix do_compile failure:
> >>> ../sources/mesa-26.0.1/src/panfrost/lib/kmod/pan_kmod.c:7:10: fatal
> >> error: xf86drm.h: No such file or directory
> >>
> >>> -DEPENDS += "libclc-native spirv-tools-native
> >> spirv-llvm-translator-native"
> >>> +DEPENDS += "libclc-native spirv-tools-native
> >> spirv-llvm-translator-native libdrm-native"
> >>
> >> Should this be in PACKAGECONFIG for panfrost?
> >>
> >
> > I have opengl-only image to build for odroid-c4 which does not have
> > panfrost.
> >
>
> It "has", due to building mesa-tools-native which enables building
> panfrost tools unconditionally.
>
> panfrost PACKAGECONFIG may enable building the gallium driver (if
> combined with gallium PACKAGECONFIG), the vulkan (panvk) driver (if
> combined with vulkan PACKAGECONFIG) and/or the panfrost tools (if
> combined with tools PACKAGECONFIG).
>
> So it's a missing dependency for the panfrost tools and should be added
> as dependency to the panfrost tools (see my other mail). I don't think
> you need it if you're not building the panfrost tools.
>

It uses mali binary driver not lima, and panfrost is not in distro features
or packageconfig for mesa-gl


>
> Cheers,
> Quentin
>
Quentin Schulz March 25, 2026, 4:35 p.m. UTC | #6
Hi Khem,

On 3/25/26 5:26 PM, Khem Raj wrote:
> On Wed, Mar 25, 2026 at 7:53 AM Quentin Schulz <quentin.schulz@cherry.de>
> wrote:
> 
>> Hi Khem,
>>
>> On 3/25/26 3:46 PM, Khem Raj via lists.openembedded.org wrote:
>>> On Wed, Mar 25, 2026 at 5:52 AM Alexander Kanavin <
>> alex.kanavin@gmail.com>
>>> wrote:
>>>
>>>> On Wed, 25 Mar 2026 at 08:40, Khem Raj via lists.openembedded.org
>>>> <raj.khem=gmail.com@lists.openembedded.org> wrote:
>>>>> Fix do_compile failure:
>>>>> ../sources/mesa-26.0.1/src/panfrost/lib/kmod/pan_kmod.c:7:10: fatal
>>>> error: xf86drm.h: No such file or directory
>>>>
>>>>> -DEPENDS += "libclc-native spirv-tools-native
>>>> spirv-llvm-translator-native"
>>>>> +DEPENDS += "libclc-native spirv-tools-native
>>>> spirv-llvm-translator-native libdrm-native"
>>>>
>>>> Should this be in PACKAGECONFIG for panfrost?
>>>>
>>>
>>> I have opengl-only image to build for odroid-c4 which does not have
>>> panfrost.
>>>
>>
>> It "has", due to building mesa-tools-native which enables building
>> panfrost tools unconditionally.
>>
>> panfrost PACKAGECONFIG may enable building the gallium driver (if
>> combined with gallium PACKAGECONFIG), the vulkan (panvk) driver (if
>> combined with vulkan PACKAGECONFIG) and/or the panfrost tools (if
>> combined with tools PACKAGECONFIG).
>>
>> So it's a missing dependency for the panfrost tools and should be added
>> as dependency to the panfrost tools (see my other mail). I don't think
>> you need it if you're not building the panfrost tools.
>>
> 
> It uses mali binary driver not lima, and panfrost is not in distro features
> or packageconfig for mesa-gl
> 

The error is in mesa-tools-native and you're fixing the 
mesa-tools-native here, not mesa-gl.

You **are** building the panfrost tools, unconditionally when building 
mesa-tools-native. This is a deliberate choice, see

https://git.openembedded.org/openembedded-core/tree/meta/recipes-graphics/mesa/mesa-tools-native.bb#n6

I'm not sure what brings mesa-tools-native in the first place for you as 
it's brought in when libclc PACKAGECONFIG is selected in a target or 
native mesa recipe (excluding mesa-tools-native).

mesa-gl brings this in but only for x86 (see the various 
PACKAGECONFIG:append: in mesa-gl.bb).

Quentin
diff mbox series

Patch

diff --git a/meta/recipes-graphics/mesa/mesa-tools-native.bb b/meta/recipes-graphics/mesa/mesa-tools-native.bb
index 50d2f5cbb0..743e3391e9 100644
--- a/meta/recipes-graphics/mesa/mesa-tools-native.bb
+++ b/meta/recipes-graphics/mesa/mesa-tools-native.bb
@@ -11,7 +11,7 @@  PACKAGECONFIG += "gallium-llvm"
 # to PACKAGECONFIG like in mesa.inc
 PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'x11 wayland', d)}"
 
-DEPENDS += "libclc-native spirv-tools-native spirv-llvm-translator-native"
+DEPENDS += "libclc-native spirv-tools-native spirv-llvm-translator-native libdrm-native"
 
 EXTRA_OEMESON += " \
     -Dmesa-clc=enabled -Dinstall-mesa-clc=true -Dmesa-clc-bundle-headers=enabled \