diff mbox series

mesa: provide support for packing development and testing tools

Message ID 20230215132454.4114658-1-dmitry.baryshkov@linaro.org
State Accepted, archived
Commit 95eb4008350424f25d08da96bc6d7d56bf4cc161
Headers show
Series mesa: provide support for packing development and testing tools | expand

Commit Message

Dmitry Baryshkov Feb. 15, 2023, 1:24 p.m. UTC
Mesa contains several optional tools that can be useful for application
and driver developers. Add a packageconfig option to build a mesa-tools
package containing relevant programs.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 meta/recipes-graphics/mesa/mesa.inc | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

Comments

Alexander Kanavin Feb. 15, 2023, 1:31 p.m. UTC | #1
On Wed, 15 Feb 2023 at 14:25, Dmitry Baryshkov <dbaryshkov@gmail.com> wrote:
> +# dependencies for tools. libconfig is optional, it is a part of meta-oe so it needs special treatment
> +TOOLS_DEPS_FREEDRENO_LIBCONFIG = " ${@bb.utils.contains('BBFILE_COLLECTIONS', 'openembedded-layer', 'libconfig', '', d)} "

Oe-core cannot build things differently depending on whether other
layers are present.

On the other hand, it is fine to refer to dependencies from other
layers if the corresponding options are disabled by default. You
probably want to have the option for freedreno tools separate from the
option for freedreno driver.

Alex
Dmitry Baryshkov Feb. 18, 2023, 4:31 a.m. UTC | #2
On Wed, 15 Feb 2023 at 15:32, Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>
> On Wed, 15 Feb 2023 at 14:25, Dmitry Baryshkov <dbaryshkov@gmail.com> wrote:
> > +# dependencies for tools. libconfig is optional, it is a part of meta-oe so it needs special treatment
> > +TOOLS_DEPS_FREEDRENO_LIBCONFIG = " ${@bb.utils.contains('BBFILE_COLLECTIONS', 'openembedded-layer', 'libconfig', '', d)} "
>
> Oe-core cannot build things differently depending on whether other
> layers are present.
>
> On the other hand, it is fine to refer to dependencies from other
> layers if the corresponding options are disabled by default. You
> probably want to have the option for freedreno tools separate from the
> option for freedreno driver.

I tried to represent the fact that the dependency is optional. It is
possible to build useful tools without libconfig, but adding libconfig
dependency enables the fdperf tool.
Of course I can add an extra freedreno-fdperf PKGCONFIG entry, it I
understand your suggestion correctly.

>
> Alex
diff mbox series

Patch

diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index 0a3dc1dd62a0..96e4a1959332 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -107,6 +107,20 @@  VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',fre
 VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'broadcom', ',broadcom', '', d)}"
 PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${@strip_comma('${VULKAN_DRIVERS}')}, -Dvulkan-drivers='',glslang-native vulkan-loader vulkan-headers"
 
+# mesa development and testing tools support, per driver
+TOOLS = ""
+TOOLS_DEPS = ""
+TOOLS:append = "${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}"
+TOOLS:append = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}"
+TOOLS:append = "${@bb.utils.contains('PACKAGECONFIG', 'lima', ',lima', '', d)}"
+TOOLS:append = "${@bb.utils.contains('PACKAGECONFIG', 'panfrost', ',panfrost', '', d)}"
+
+# dependencies for tools. libconfig is optional, it is a part of meta-oe so it needs special treatment
+TOOLS_DEPS_FREEDRENO_LIBCONFIG = " ${@bb.utils.contains('BBFILE_COLLECTIONS', 'openembedded-layer', 'libconfig', '', d)} "
+TOOLS_DEPS:append = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ' ncurses libxml2 ${TOOLS_DEPS_FREEDRENO_LIBCONFIG} ', '', d)}"
+
+PACKAGECONFIG[tools] = "-Dtools=${@strip_comma('${TOOLS}')}, -Dtools='', ${TOOLS_DEPS}"
+
 PACKAGECONFIG[opengl] = "-Dopengl=true, -Dopengl=false"
 PACKAGECONFIG[glvnd] = "-Dglvnd=true, -Dglvnd=false, libglvnd"
 
@@ -211,7 +225,7 @@  PACKAGES =+ "libegl-mesa libegl-mesa-dev \
              libopencl-mesa libopencl-mesa-dev \
              libxatracker libxatracker-dev \
              mesa-megadriver mesa-vulkan-drivers \
-             mesa-vdpau-drivers \
+             mesa-vdpau-drivers mesa-tools \
             "
 
 do_install:append () {
@@ -323,6 +337,9 @@  FILES:libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir}
 FILES:libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \
                           ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \
                           ${libdir}/pkgconfig/xatracker.pc"
+# catch all to get all the tools and data
+FILES:${PN}-tools = "${bindir} ${datadir}"
+ALLOW_EMPTY:${PN}-tools = "1"
 
 # Fix upgrade path from mesa to mesa-megadriver
 RREPLACES:mesa-megadriver = "mesa"