From d8a729d1731339da141612be33c5e59bc9928748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20PORTAY?= Date: Fri, 22 Mar 2024 00:07:38 +0100 Subject: [PATCH] package/igt-gpu-tools: new package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IGT GPU Tools is a collection of tools for development and testing of the DRM drivers Signed-off-by: Gaƫl PORTAY Signed-off-by: Andy Yan Signed-off-by: Bernd Kuhls [Bernd: v4 - add myself to DEVELOPERS - add dependencies to locales, mmu, wchar and headers >= 4.11 - rework libunwind dependency - remove duplicate libglib2 dependency v5 - added optional dependency to json_c - remove broken igt_stats binary v6 - updated patch series after upstream review v8 - bumped to current git HEAD to fix musl build errors - removed all patches which are included in upstream repo - added fix for segfaults with hardened toolchains on x86/x86_64] Signed-off-by: Bernd Kuhls Signed-off-by: Francois Dugast [Francois: v7 - depend on !BR2_RELRO_FULL - remove specific workaround for igt_stats binary] Signed-off-by: Bernd Kuhls Signed-off-by: Arnout Vandecappelle --- DEVELOPERS | 1 + package/Config.in | 1 + package/igt-gpu-tools/Config.in | 32 +++++++++++++++ package/igt-gpu-tools/igt-gpu-tools.hash | 5 +++ package/igt-gpu-tools/igt-gpu-tools.mk | 52 ++++++++++++++++++++++++ 5 files changed, 91 insertions(+) create mode 100644 package/igt-gpu-tools/Config.in create mode 100644 package/igt-gpu-tools/igt-gpu-tools.hash create mode 100644 package/igt-gpu-tools/igt-gpu-tools.mk diff --git a/DEVELOPERS b/DEVELOPERS index 328c654fae..c045a8cd7c 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -372,6 +372,7 @@ F: package/gpsd/ F: package/gptfdisk/ F: package/hddtemp/ F: package/hdparm/ +F: package/igt-gpu-tools/ F: package/intel-gmmlib/ F: package/intel-mediadriver/ F: package/intel-mediasdk/ diff --git a/package/Config.in b/package/Config.in index c677c3ff4a..1a62bfb1be 100644 --- a/package/Config.in +++ b/package/Config.in @@ -323,6 +323,7 @@ comment "Graphic applications" source "package/glmark2/Config.in" source "package/glslsandbox-player/Config.in" source "package/gnuplot/Config.in" + source "package/igt-gpu-tools/Config.in" source "package/ivi-homescreen/Config.in" source "package/jhead/Config.in" source "package/kmscube/Config.in" diff --git a/package/igt-gpu-tools/Config.in b/package/igt-gpu-tools/Config.in new file mode 100644 index 0000000000..809c8e28ac --- /dev/null +++ b/package/igt-gpu-tools/Config.in @@ -0,0 +1,32 @@ +config BR2_PACKAGE_IGT_GPU_TOOLS + bool "igt-gpu-tools" + depends on BR2_USE_MMU # fork() + depends on BR2_ENABLE_LOCALE + depends on !BR2_STATIC_LIBS + depends on BR2_TOOLCHAIN_HAS_THREADS + depends on BR2_PACKAGE_HAS_UDEV + depends on BR2_USE_WCHAR # elfutils + depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_11 # linux/dma-buf.h + select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # procps-ng + select BR2_PACKAGE_CAIRO + select BR2_PACKAGE_CAIRO_PNG + select BR2_PACKAGE_ELFUTILS + select BR2_PACKAGE_KMOD + select BR2_PACKAGE_LIBDRM + select BR2_PACKAGE_LIBGLIB2 + select BR2_PACKAGE_LIBPCIACCESS + select BR2_PACKAGE_PIXMAN + select BR2_PACKAGE_PROCPS_NG + select BR2_PACKAGE_ZLIB + help + IGT GPU Tools is a collection of tools for development and + testing of the DRM drivers. + + https://gitlab.freedesktop.org/drm/igt-gpu-tools + +comment "igt-gpu-tools needs udev /dev management and toolchain w/ threads, wchar, dynamic library, locale, headers >= 4.11" + depends on BR2_USE_MMU + depends on !BR2_PACKAGE_HAS_UDEV || BR2_STATIC_LIBS || \ + !BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR || \ + !BR2_ENABLE_LOCALE || \ + !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_11 diff --git a/package/igt-gpu-tools/igt-gpu-tools.hash b/package/igt-gpu-tools/igt-gpu-tools.hash new file mode 100644 index 0000000000..bf760b91d7 --- /dev/null +++ b/package/igt-gpu-tools/igt-gpu-tools.hash @@ -0,0 +1,5 @@ +# Locally calculated from download +sha256 de6e9443d569e76333ec6c8ffc53937b6831224161fe69bf2f07efad3bd0e04a igt-gpu-tools-0ee4074685c1e184f2d3612ea6eb4d126f9a2e23.tar.bz2 + +# Hash for license file: +sha256 1b7e266857b05808660f42369a4a797459d7b7bec7245e378aa28a8db2f213da COPYING diff --git a/package/igt-gpu-tools/igt-gpu-tools.mk b/package/igt-gpu-tools/igt-gpu-tools.mk new file mode 100644 index 0000000000..927a1225a5 --- /dev/null +++ b/package/igt-gpu-tools/igt-gpu-tools.mk @@ -0,0 +1,52 @@ +################################################################################ +# +# igt-gpu-tools +# +################################################################################ + +IGT_GPU_TOOLS_VERSION = 0ee4074685c1e184f2d3612ea6eb4d126f9a2e23 +IGT_GPU_TOOLS_SOURCE = igt-gpu-tools-$(IGT_GPU_TOOLS_VERSION).tar.bz2 +IGT_GPU_TOOLS_SITE = https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/archive/$(IGT_GPU_TOOLS_VERSION) +IGT_GPU_TOOLS_LICENSE = MIT +IGT_GPU_TOOLS_LICENSE_FILES = COPYING +IGT_GPU_TOOLS_INSTALL_STAGING = YES +IGT_GPU_TOOLS_DEPENDENCIES = \ + host-pkgconf \ + cairo \ + elfutils \ + kmod \ + libdrm \ + libglib2 \ + libpciaccess \ + pixman \ + procps-ng \ + udev \ + zlib + +# On x86 systems, libigt resolves igt_half_to_float and igt_float_to_half as +# indirect functions at runtime by checking CPU features with igt_x86_features. +# The igt_x86_features function is implemented is a different object and the +# call uses the PLT itself. If lazy binding is disabled, this causes a segfault +# while resolving the symbols for libigt on x64 systems. Disable BINDNOW on X86 +# systems to prevent the segfaults. +# https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/102 +# https://bugs.gentoo.org/788625#c13 +ifeq ($(BR2_i386)$(BR2_x86_64)x$(BR2_RELRO_NONE),yx) +IGT_GPU_TOOLS_LDFLAGS = $(TARGET_LDFLAGS) -Wl,-z,lazy +endif + +ifeq ($(BR2_PACKAGE_JSON_C),y) +IGT_GPU_TOOLS_CONF_OPTS += -Drunner=enabled +IGT_GPU_TOOLS_DEPENDENCIES += json-c +else +IGT_GPU_TOOLS_CONF_OPTS += -Drunner=disabled +endif + +ifeq ($(BR2_PACKAGE_LIBUNWIND),y) +IGT_GPU_TOOLS_CONF_OPTS += -Dlibunwind=enabled +IGT_GPU_TOOLS_DEPENDENCIES += libunwind +else +IGT_GPU_TOOLS_CONF_OPTS += -Dlibunwind=disabled +endif + +$(eval $(meson-package))