aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Krupenik <dennis@krupenik.com>2020-06-21 05:04:02 +0300
committerLeo <thinkabit.ukim@gmail.com>2020-06-22 18:11:29 +0000
commitf29031fa58a7237ba3424bbca2f5e2a07396fbfd (patch)
tree8699b61d46e117906084ec94105793b44dc16641
parenta16e048eb28b1b39f85564dc20d51be713ac3da1 (diff)
testing/igt-gpu-tools: new aport
-rw-r--r--testing/igt-gpu-tools/APKBUILD37
-rw-r--r--testing/igt-gpu-tools/bash-sh.patch66
-rw-r--r--testing/igt-gpu-tools/musl.patch170
3 files changed, 273 insertions, 0 deletions
diff --git a/testing/igt-gpu-tools/APKBUILD b/testing/igt-gpu-tools/APKBUILD
new file mode 100644
index 00000000000..427c5e0e8f4
--- /dev/null
+++ b/testing/igt-gpu-tools/APKBUILD
@@ -0,0 +1,37 @@
+# Contributor: Dennis Krupenik <dennis@krupenik.com>
+# Maintainer: Dennis Krupenik <dennis@krupenik.com>
+pkgname=igt-gpu-tools
+pkgver=1.25
+pkgrel=0
+pkgdesc="IGT GPU Tools is a collection of tools for development and testing of the DRM drivers."
+url="https://gitlab.freedesktop.org/drm/igt-gpu-tools/"
+arch="x86_64" # Mostly used for Intel integrated GPUs
+license="MIT"
+depends_dev="alsa-lib-dev cairo-dev curl-dev elfutils-dev eudev-dev gsl-dev
+ json-c-dev kmod-dev libdrm-dev liboping-dev libpciaccess-dev libunwind-dev
+ libxrandr-dev libxv-dev pixman-dev procps-dev xmlrpc-c-dev"
+makedepends="bison flex meson $depends_dev"
+subpackages="$pkgname-dev"
+source="https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/archive/igt-gpu-tools-$pkgver/igt-gpu-tools-igt-gpu-tools-$pkgver.tar.bz2
+ bash-sh.patch
+ musl.patch"
+builddir="$srcdir/igt-gpu-tools-igt-gpu-tools-$pkgver"
+
+build() {
+ abuild-meson \
+ -Dvalgrind=disabled \
+ . build
+ ninja -C build
+}
+
+check() {
+ ninja -C build test
+}
+
+package() {
+ DESTDIR="$pkgdir" ninja -C build install
+}
+
+sha512sums="47a31c0af733e9481e3e8e718adede0a05cb04064d80dae6a7753a346deb71333fb8310664084f4dddfec957629e93c188bc44f2a6895744a10107e4823a9ee6 igt-gpu-tools-igt-gpu-tools-1.25.tar.bz2
+0e24d93cdc56517c78fbcdc64dac63067c9cf49bed66e3b2b6dec6111d67c7e27a2ad7ddb9f1e373746b4b8e9e3535993f8261800fc3729d1f2cdef37e392fc5 bash-sh.patch
+a79a3d4134a75e450b18188189614ad0b3d4218007c8ce68c74f5a928258ca8838ccce5c1f64f920038c44e188896d8d504a36e3cbdf1f8f16c3904bb3b9955f musl.patch"
diff --git a/testing/igt-gpu-tools/bash-sh.patch b/testing/igt-gpu-tools/bash-sh.patch
new file mode 100644
index 00000000000..e0daf825796
--- /dev/null
+++ b/testing/igt-gpu-tools/bash-sh.patch
@@ -0,0 +1,66 @@
+Portability: run shell scripts with #!/bin/sh
+---
+--- a/tests/ddx_intel_after_fbdev
++++ b/tests/ddx_intel_after_fbdev
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # Testcase: Load Intel DDX after fbdev was loaded
+ #
+--- a/tests/igt_command_line.sh
++++ b/tests/igt_command_line.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # Copyright © 2014 Intel Corporation
+ #
+--- a/tests/generate_testlist.sh
++++ b/tests/generate_testlist.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ OUTPUT=$1
+ shift
+--- a/scripts/generate_clear_kernel.sh
++++ b/scripts/generate_clear_kernel.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # SPDX-License-Identifier: MIT
+ #
+--- a/scripts/who.sh
++++ b/scripts/who.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # usage: sudo who.sh
+ #
+--- a/scripts/run-tests.sh
++++ b/scripts/run-tests.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # Copyright © 2014 Intel Corporation
+ #
+--- a/meson.sh
++++ b/meson.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ cat > Makefile <<EOF
+
+--- a/man/rst2man.sh
++++ b/man/rst2man.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ rst2man=$1
+ input=$2
diff --git a/testing/igt-gpu-tools/musl.patch b/testing/igt-gpu-tools/musl.patch
new file mode 100644
index 00000000000..507d6b8e98c
--- /dev/null
+++ b/testing/igt-gpu-tools/musl.patch
@@ -0,0 +1,170 @@
+Allow building on musl
+
+---
+
+--- a/benchmarks/gem_syslatency.c
++++ b/benchmarks/gem_syslatency.c
+@@ -44,7 +44,11 @@
+
+ #include <linux/unistd.h>
+
+-#define sigev_notify_thread_id _sigev_un._tid
++#ifndef __GLIBC__
++#include "signal_compat.h"
++#endif
++
++#define sigev_notify_thread_id sigev_notify_function
+
+ static volatile int done;
+
+--- a/lib/igt_aux.c
++++ b/lib/igt_aux.c
+@@ -31,6 +31,7 @@
+ #endif
+ #include <stdio.h>
+ #include <fcntl.h>
++#include <limits.h> // PATH_MAX
+ #include <sys/stat.h>
+ #include <sys/ioctl.h>
+ #include <string.h>
+@@ -73,6 +74,12 @@
+ #include <libgen.h> /* for dirname() */
+ #endif
+
++#ifndef __GLIBC__
++#include "signal_compat.h"
++#endif
++
++//#include <asm-generic/siginfo.h>
++
+ /**
+ * SECTION:igt_aux
+ * @short_description: Auxiliary libraries and support functions
+
+--- a/lib/igt_aux.h
++++ b/lib/igt_aux.h
+@@ -46,7 +46,7 @@
+ # define gettid() (pid_t)(syscall(__NR_gettid))
+ # endif
+ #endif
+-#define sigev_notify_thread_id _sigev_un._tid
++#define sigev_notify_thread_id sigev_notify_function
+
+ /* auxialiary igt helpers from igt_aux.c */
+ /* generally useful helpers */
+
+--- a/lib/igt_halffloat.c
++++ b/lib/igt_halffloat.c
+@@ -162,7 +162,7 @@ static inline float _half_to_float(uint16_t val)
+ return fi.f;
+ }
+
+-#if defined(__x86_64__) && !defined(__clang__)
++#if defined(__x86_64__) && !defined(__clang__) && defined(__GLIBC__)
+ #pragma GCC push_options
+ #pragma GCC target("f16c")
+
+--- a/lib/igt_x86.c
++++ b/lib/igt_x86.c
+@@ -190,7 +190,7 @@ char *igt_x86_features_to_string(unsigned features, char *line)
+ }
+ #endif
+
+-#if defined(__x86_64__) && !defined(__clang__)
++#if defined(__x86_64__) && !defined(__clang__) && defined(__GLIBC__)
+ #pragma GCC push_options
+ #pragma GCC target("sse4.1")
+ #pragma GCC diagnostic ignored "-Wpointer-arith"
+
+--- /dev/null
++++ b/lib/signal_compat.h
+@@ -0,0 +1,8 @@
++#define SIGEV_SIGNAL 0
++#define SIGEV_NONE 1
++#define SIGEV_THREAD 2
++
++#define SIGEV_SIGNAL 0 /* notify via signal */
++#define SIGEV_NONE 1 /* other notification: meaningless */
++#define SIGEV_THREAD 2 /* deliver via thread creation */
++#define SIGEV_THREAD_ID 4 /* deliver to thread */
+
+--- a/tests/drm_read.c
++++ b/tests/drm_read.c
+@@ -220,7 +220,7 @@ static void test_short_buffer_wakeup(int in, enum pipe pipe)
+ pthread_mutex_unlock(&w.mutex);
+
+ /* Give each thread a chance to sleep in drm_read() */
+- pthread_yield();
++ sched_yield();
+
+ /* One event should wake all threads as none consume */
+ generate_event(w.fd, pipe);
+
+--- a/tests/kms_hdmi_inject.c
++++ b/tests/kms_hdmi_inject.c
+@@ -23,7 +23,7 @@
+ */
+
+ #include "config.h"
+-
++#include <limits.h>
+ #include <dirent.h>
+
+ #include "igt.h"
+
+--- a/tests/kms_sysfs_edid_timing.c
++++ b/tests/kms_sysfs_edid_timing.c
+@@ -24,6 +24,7 @@
+
+ #include <dirent.h>
+ #include <fcntl.h>
++#include <limits.h>
+ #include <sys/stat.h>
+
+ #define THRESHOLD_PER_CONNECTOR 10
+
+--- a/tests/i915/gem_close_race.c
++++ b/tests/i915/gem_close_race.c
+@@ -42,6 +42,10 @@
+ #include <sys/syscall.h>
+ #include "drm.h"
+
++#ifndef __GLIBC__
++#include "signal_compat.h"
++#endif
++
+ #define OBJECT_SIZE (256 * 1024)
+
+ #define COPY_BLT_CMD (2<<29|0x53<<22|0x6)
+@@ -51,7 +55,7 @@
+ static uint32_t devid;
+ static bool has_64bit_relocations;
+
+-#define sigev_notify_thread_id _sigev_un._tid
++#define sigev_notify_thread_id sigev_notify_function
+
+ static void selfcopy(int fd, uint32_t handle, int loops)
+ {
+
+--- a/tests/panfrost_submit.c
++++ b/tests/panfrost_submit.c
+@@ -68,7 +68,7 @@
+ static void check_fb(int fd, struct panfrost_bo *bo)
+ {
+ int gpu_prod_id = igt_panfrost_get_param(fd, DRM_PANFROST_PARAM_GPU_PROD_ID);
+- __uint32_t *fbo;
++ uint32_t *fbo;
+ int i;
+
+ fbo = bo->map;
+
+--- a/tests/kms_atomic.c
++++ b/tests/kms_atomic.c
+@@ -683,7 +683,6 @@
+ {
+ int timeline, fence_fd;
+ void *map;
+- const ptrdiff_t PAGE_SIZE = sysconf(_SC_PAGE_SIZE);
+ uint64_t old_mode_id = pipe->values[IGT_CRTC_MODE_ID];
+
+ igt_require_sw_sync();