Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F113878766
D36213.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
100 KB
Referenced Files
None
Subscribers
None
D36213.diff
View Options
diff --git a/graphics/Makefile b/graphics/Makefile
--- a/graphics/Makefile
+++ b/graphics/Makefile
@@ -352,6 +352,7 @@
SUBDIR += icoutils
SUBDIR += ida
SUBDIR += iec16022
+ SUBDIR += igt-gpu-tools
SUBDIR += iiview
SUBDIR += ikona
SUBDIR += imageindex
diff --git a/graphics/igt-gpu-tools/Makefile b/graphics/igt-gpu-tools/Makefile
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/Makefile
@@ -0,0 +1,70 @@
+PORTNAME= igt-gpu-tools
+DISTVERSION= 1.26.1266
+CATEGORIES= graphics
+
+MAINTAINER= jfree@FreeBSD.org
+COMMENT= IGT gpu tools and tests
+WWW= https://drm.pages.freedesktop.org/igt-gpu-tools/
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+IGNORE_FreeBSD_12= unsupported on FreeBSD versions < 13.1
+
+BUILD_DEPENDS= rst2man:textproc/py-docutils@${PY_FLAVOR}
+LIB_DEPENDS= libdrm.so:graphics/libdrm \
+ libdw.so:devel/elfutils \
+ libpciaccess.so:devel/libpciaccess \
+ libudev.so:devel/libudev-devd
+
+USES= bison gnome meson pkgconfig python shebangfix xorg
+
+USE_GITLAB= yes
+GL_SITE= https://gitlab.freedesktop.org
+GL_ACCOUNT= drm
+GL_COMMIT= 9338ab3ec085292817ab1e74d1f2fb90b6a98332
+
+USE_GNOME= cairo glib20
+
+USE_LDCONFIG= yes
+
+USE_XORG= pixman
+
+SHEBANG_FILES= scripts/code_cov_gather_on_test scripts/code_cov_parse_info
+
+OPTIONS_DEFINE= CHAMELIUM DOCS RUNNER TEST
+OPTIONS_DEFAULT= DOCS RUNNER TEST
+
+OPTIONS_SUB= yes
+
+CHAMELIUM_DESC= Build chamelium display tests
+RUNNER_DESC= Build test runner
+
+CHAMELIUM_IMPLIES= TEST
+CHAMELIUM_LIB_DEPENDS= libasound.so:audio/alsa-lib \
+ libcurl.so:ftp/curl \
+ libgsl.so:math/gsl \
+ libxmlrpc.so:net/xmlrpc-c
+CHAMELIUM_MESON_ENABLED= chamelium
+
+DOCS_IMPLIES= TEST
+DOCS_BUILD_DEPENDS= gtkdoc-mkhtml:textproc/gtk-doc
+DOCS_MESON_ENABLED= docs
+
+RUNNER_IMPLIES= TEST
+RUNNER_LIB_DEPENDS= libjson-c.so:devel/json-c \
+ liboping.so:net/liboping
+RUNNER_MESON_ENABLED= runner
+
+TEST_LIB_DEPENDS= libunwind.so:devel/libunwind
+TEST_MESON_ENABLED= tests
+
+.include <bsd.port.options.mk>
+
+.if ${ARCH} == "amd64"
+PLIST_SUB+= AMD64=""
+.else
+PLIST_SUB+= AMD64="@comment "
+.endif
+
+.include <bsd.port.mk>
diff --git a/graphics/igt-gpu-tools/distinfo b/graphics/igt-gpu-tools/distinfo
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1661919740
+SHA256 (drm-igt-gpu-tools-9338ab3ec085292817ab1e74d1f2fb90b6a98332_GL0.tar.gz) = c1b1ce7c3370e4e7030c76d43a312ba655d567c8f427b48f451525f81ef0a833
+SIZE (drm-igt-gpu-tools-9338ab3ec085292817ab1e74d1f2fb90b6a98332_GL0.tar.gz) = 2936270
diff --git a/graphics/igt-gpu-tools/files/patch-benchmarks_gem__exec__tracer.c b/graphics/igt-gpu-tools/files/patch-benchmarks_gem__exec__tracer.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-benchmarks_gem__exec__tracer.c
@@ -0,0 +1,13 @@
+--- benchmarks/gem_exec_tracer.c.orig 2022-08-31 20:00:00 UTC
++++ benchmarks/gem_exec_tracer.c
+@@ -41,6 +41,10 @@
+ #include "intel_aub.h"
+ #include "intel_chipset.h"
+
++#ifdef __FreeBSD__
++#define _IOC_TYPE(nr) (((nr) >> 8) & 255)
++#endif
++
+ static int (*libc_close)(int fd);
+ static int (*libc_ioctl)(int fd, unsigned long request, void *argp);
+
diff --git a/graphics/igt-gpu-tools/files/patch-benchmarks_gem__syslatency.c b/graphics/igt-gpu-tools/files/patch-benchmarks_gem__syslatency.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-benchmarks_gem__syslatency.c
@@ -0,0 +1,24 @@
+--- benchmarks/gem_syslatency.c.orig 2022-08-31 20:00:00 UTC
++++ benchmarks/gem_syslatency.c
+@@ -42,12 +42,21 @@
+ #include <limits.h>
+ #include "drm.h"
+
++#ifdef __linux__
+ #include <linux/unistd.h>
++#elif defined(__FreeBSD__)
++#include <sys/mman.h>
++#define MAP_POPULATE MAP_PREFAULT_READ
++#define gettid() getpid()
++#define MADV_HUGEPAGE MADV_SEQUENTIAL
++#endif
+
+ #include "i915/gem_create.h"
+ #include "i915/gem_ring.h"
+
++#ifdef __linux__
+ #define sigev_notify_thread_id _sigev_un._tid
++#endif
+
+ static volatile int done;
+
diff --git a/graphics/igt-gpu-tools/files/patch-include_linux-uapi_sync__file.h b/graphics/igt-gpu-tools/files/patch-include_linux-uapi_sync__file.h
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-include_linux-uapi_sync__file.h
@@ -0,0 +1,19 @@
+--- include/linux-uapi/sync_file.h.orig 2022-08-31 20:00:01 UTC
++++ include/linux-uapi/sync_file.h
+@@ -12,8 +12,16 @@
+ #ifndef _LINUX_SYNC_H
+ #define _LINUX_SYNC_H
+
++#ifdef __linux__
+ #include <linux/ioctl.h>
+ #include <linux/types.h>
++#elif defined(__FreeBSD__)
++#include <sys/ioctl.h>
++#include <sys/types.h>
++#define __s32 int32_t
++#define __u32 uint32_t
++#define __u64 uint64_t
++#endif
+
+ /**
+ * struct sync_merge_data - data passed to merge ioctl
diff --git a/graphics/igt-gpu-tools/files/patch-lib_i915_gem__engine__topology.c b/graphics/igt-gpu-tools/files/patch-lib_i915_gem__engine__topology.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_i915_gem__engine__topology.c
@@ -0,0 +1,13 @@
+--- lib/i915/gem_engine_topology.c.orig 2022-08-31 20:00:01 UTC
++++ lib/i915/gem_engine_topology.c
+@@ -88,6 +88,10 @@
+ */
+ #define SIZEOF_QUERY offsetof(struct drm_i915_query_engine_info, \
+ engines[GEM_MAX_ENGINES])
++#ifdef __FreeBSD__
++#define SYS_getdents64 SYS_freebsd11_getdents
++#define ino64_t ino_t
++#endif
+
+ static int __gem_query(int fd, struct drm_i915_query *q)
+ {
diff --git a/graphics/igt-gpu-tools/files/patch-lib_i915_gem__mman.c b/graphics/igt-gpu-tools/files/patch-lib_i915_gem__mman.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_i915_gem__mman.c
@@ -0,0 +1,14 @@
+--- lib/i915/gem_mman.c.orig 2022-08-31 20:00:01 UTC
++++ lib/i915/gem_mman.c
+@@ -44,6 +44,11 @@
+ #define VG(x) do {} while (0)
+ #endif
+
++#ifdef __FreeBSD__
++#define mmap64(addr, len, prot, flags, fd, offset) \
++ mmap(addr, len, prot, flags, fd, offset)
++#endif
++
+ static int gem_mmap_gtt_version(int fd)
+ {
+ struct drm_i915_getparam gp;
diff --git a/graphics/igt-gpu-tools/files/patch-lib_i915_intel__memory__region.c b/graphics/igt-gpu-tools/files/patch-lib_i915_intel__memory__region.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_i915_intel__memory__region.c
@@ -0,0 +1,14 @@
+--- lib/i915/intel_memory_region.c.orig 2022-08-31 20:00:01 UTC
++++ lib/i915/intel_memory_region.c
+@@ -21,7 +21,11 @@
+ * IN THE SOFTWARE.
+ */
+
++#ifdef __linux__
+ #include <linux/limits.h>
++#elif defined(__FreeBSD__)
++#include <sys/limits.h>
++#endif
+ #include <signal.h>
+ #include <sys/ioctl.h>
+ #include <sys/time.h>
diff --git a/graphics/igt-gpu-tools/files/patch-lib_i915_perf.c b/graphics/igt-gpu-tools/files/patch-lib_i915_perf.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_i915_perf.c
@@ -0,0 +1,12 @@
+--- lib/i915/perf.c.orig 2022-08-31 20:00:01 UTC
++++ lib/i915/perf.c
+@@ -29,7 +29,9 @@
+ #include <fcntl.h>
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
++#ifdef __linux__
+ #include <sys/sysmacros.h>
++#endif
+ #include <sys/types.h>
+ #include <unistd.h>
+
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__audio.c b/graphics/igt-gpu-tools/files/patch-lib_igt__audio.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__audio.c
@@ -0,0 +1,13 @@
+--- lib/igt_audio.c.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_audio.c
+@@ -26,6 +26,10 @@
+
+ #include "config.h"
+
++#ifdef __FreeBSD__
++#include <limits.h>
++#endif
++
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <gsl/gsl_fft_real.h>
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__aux.h b/graphics/igt-gpu-tools/files/patch-lib_igt__aux.h
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__aux.h
@@ -0,0 +1,23 @@
+--- lib/igt_aux.h.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_aux.h
+@@ -34,9 +34,7 @@
+ #include <sys/time.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+-#ifdef __linux__
+-# include <sys/syscall.h>
+-#endif
++#include <sys/syscall.h>
+
+ #include <i915/gem_submission.h>
+
+@@ -48,8 +46,8 @@
+ # ifndef HAVE_GETTID
+ # define gettid() (pid_t)(syscall(__NR_gettid))
+ # endif
+-#endif
+ #define sigev_notify_thread_id _sigev_un._tid
++#endif
+
+ /* auxialiary igt helpers from igt_aux.c */
+ /* generally useful helpers */
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__aux.c b/graphics/igt-gpu-tools/files/patch-lib_igt__aux.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__aux.c
@@ -0,0 +1,75 @@
+--- lib/igt_aux.c.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_aux.c
+@@ -52,7 +52,9 @@
+ #include <assert.h>
+ #include <grp.h>
+
++#ifdef __linux__
+ #include <proc/readproc.h>
++#endif
+ #include <libudev.h>
+
+ #include "drmtest.h"
+@@ -75,6 +77,12 @@
+ #include <libgen.h> /* for dirname() */
+ #endif
+
++#ifdef __FreeBSD__
++typedef struct { char state; } proc_t;
++#define gettid() getpid()
++#define setpgrp() setpgid(0, 0)
++#endif
++
+ /**
+ * SECTION:igt_aux
+ * @short_description: Auxiliary libraries and support functions
+@@ -1206,6 +1214,7 @@ void igt_unlock_mem(void)
+ locked_mem = NULL;
+ }
+
++#ifdef __linux__
+ /**
+ * igt_is_process_running:
+ * @comm: Name of process in the form found in /proc/pid/comm (limited to 15
+@@ -1780,6 +1789,41 @@ igt_lsof_kill_audio_processes(void)
+
+ return fail;
+ }
++#elif defined(__FreeBSD__)
++int
++igt_is_process_running(const char *comm)
++{
++ return -ENOSYS;
++}
++
++int
++igt_terminate_process(int sig, const char *comm)
++{
++ return -ENOSYS;
++}
++
++void
++igt_lsof(const char *dpath)
++{
++}
++
++int
++igt_lsof_kill_audio_processes(void)
++{
++ return -ENOSYS;
++}
++
++int
++pipewire_pulse_start_reserve(void)
++{
++ return -ENOSYS;
++}
++
++void
++pipewire_pulse_stop_reserve(void)
++{
++}
++#endif /* __linux__ */
+
+ static struct igt_siglatency {
+ timer_t timer;
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__core.h b/graphics/igt-gpu-tools/files/patch-lib_igt__core.h
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__core.h
@@ -0,0 +1,23 @@
+--- lib/igt_core.h.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_core.h
+@@ -31,7 +31,9 @@
+ #define IGT_CORE_H
+
+ #include <assert.h>
++#ifdef __linux__
+ #include <byteswap.h>
++#endif
+ #include <setjmp.h>
+ #include <stdbool.h>
+ #include <stdint.h>
+@@ -47,6 +49,10 @@
+ #define IGT_LOG_DOMAIN (NULL)
+ #endif
+
++#ifdef __FreeBSD__
++#include <signal.h>
++#define jmp_buf sigjmp_buf
++#endif
+
+ #ifndef STATIC_ANALYSIS_BUILD
+ #if defined(__clang_analyzer__) || defined(__COVERITY__) || defined(__KLOCWORK__)
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__core.c b/graphics/igt-gpu-tools/files/patch-lib_igt__core.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__core.c
@@ -0,0 +1,54 @@
+--- lib/igt_core.c.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_core.c
+@@ -43,7 +43,7 @@
+ #include <unistd.h>
+ #include <sys/wait.h>
+ #include <sys/types.h>
+-#ifdef __linux__
++#if defined(__linux__) || defined(__FreeBSD__)
+ #include <sys/syscall.h>
+ #endif
+ #include <pthread.h>
+@@ -85,6 +85,12 @@
+ #include <libgen.h> /* for basename() on Solaris */
+ #endif
+
++#ifdef __FreeBSD__
++#define gettid() getpid()
++#define pthread_sigqueue(pid, signo, value) sigqueue(pid, signo, value)
++#define sighandler_t sig_t
++#endif
++
+ /**
+ * SECTION:igt_core
+ * @short_description: Core i-g-t testing support
+@@ -786,6 +792,7 @@ static void oom_adjust_for_doom(void)
+
+ static void oom_adjust_for_doom(void)
+ {
++#ifdef __linux__
+ int fd;
+ const char always_kill[] = "1000";
+
+@@ -793,7 +800,7 @@ static void oom_adjust_for_doom(void)
+ igt_assert(fd != -1);
+ igt_assert(write(fd, always_kill, sizeof(always_kill)) == sizeof(always_kill));
+ close(fd);
+-
++#endif
+ }
+
+ /**
+@@ -2223,7 +2230,12 @@ bool __igt_fork_helper(struct igt_helper_process *proc
+ igt_assert(0);
+ case 0:
+ reset_helper_process_list();
++#ifdef __linux__
+ oom_adjust_for_doom();
++#elif defined(__FreeBSD__)
++ /* not a great substitution for oom_adjust_for_doom() */
++ raise(SIGTERM);
++#endif
+
+ return true;
+ default:
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__debugfs.c b/graphics/igt-gpu-tools/files/patch-lib_igt__debugfs.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__debugfs.c
@@ -0,0 +1,23 @@
+--- lib/igt_debugfs.c.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_debugfs.c
+@@ -25,7 +25,9 @@
+ #include <inttypes.h>
+ #include <sys/stat.h>
+ #include <sys/mount.h>
++#ifdef __linux__
+ #include <sys/sysmacros.h>
++#endif
+ #include <dirent.h>
+ #include <errno.h>
+ #include <stdio.h>
+@@ -42,6 +44,10 @@
+ #include "igt_kms.h"
+ #include "igt_debugfs.h"
+ #include "igt_sysfs.h"
++
++#ifdef __FreeBSD__
++#define mount(src, dest, fstype, flags, data) mount(fstype, dest, flags, data)
++#endif
+
+ /**
+ * SECTION:igt_debugfs
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__device.c b/graphics/igt-gpu-tools/files/patch-lib_igt__device.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__device.c
@@ -0,0 +1,12 @@
+--- lib/igt_device.c.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_device.c
+@@ -25,7 +25,9 @@
+ #include <fcntl.h>
+
+ #include <sys/stat.h>
++#ifdef __linux__
+ #include <sys/sysmacros.h>
++#endif
+ #include "igt.h"
+ #include "igt_device.h"
+ #include "igt_sysfs.h"
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__device__scan.c b/graphics/igt-gpu-tools/files/patch-lib_igt__device__scan.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__device__scan.c
@@ -0,0 +1,14 @@
+--- lib/igt_device_scan.c.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_device_scan.c
+@@ -32,7 +32,11 @@
+ #include <fcntl.h>
+ #include <glib.h>
+ #include <libudev.h>
++#ifdef __linux__
+ #include <linux/limits.h>
++#elif defined(__FreeBSD__)
++#include <limits.h>
++#endif
+ #include <sys/stat.h>
+ #include <sys/time.h>
+ #include <sys/types.h>
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__dummyload.c b/graphics/igt-gpu-tools/files/patch-lib_igt__dummyload.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__dummyload.c
@@ -0,0 +1,29 @@
+--- lib/igt_dummyload.c.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_dummyload.c
+@@ -26,7 +26,9 @@
+ #include <signal.h>
+ #include <pthread.h>
+ #include <sys/poll.h>
++#ifdef __linux__
+ #include <sys/timerfd.h>
++#endif
+
+ #include <i915_drm.h>
+
+@@ -523,6 +525,8 @@ void igt_spin_set_timeout(igt_spin_t *spin, int64_t ns
+ */
+ void igt_spin_set_timeout(igt_spin_t *spin, int64_t ns)
+ {
++/* TODO: FreeBSD - POSIX TIMER */
++#ifdef __linux__
+ struct sched_param param = { .sched_priority = 99 };
+ struct itimerspec its;
+ pthread_attr_t attr;
+@@ -554,6 +558,7 @@ void igt_spin_set_timeout(igt_spin_t *spin, int64_t ns
+ its.it_value.tv_sec = ns / NSEC_PER_SEC;
+ its.it_value.tv_nsec = ns % NSEC_PER_SEC;
+ igt_assert(timerfd_settime(timerfd, 0, &its, NULL) == 0);
++#endif
+ }
+
+ static void sync_write(igt_spin_t *spin, uint32_t value)
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__eld.c b/graphics/igt-gpu-tools/files/patch-lib_igt__eld.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__eld.c
@@ -0,0 +1,13 @@
+--- lib/igt_eld.c.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_eld.c
+@@ -23,6 +23,10 @@
+ * Authors: Simon Ser <simon.ser@intel.com>
+ */
+
++#ifdef __FreeBSD__
++#include <limits.h>
++#endif
++
+ #include "config.h"
+
+ #include <dirent.h>
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__frame.c b/graphics/igt-gpu-tools/files/patch-lib_igt__frame.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__frame.c
@@ -0,0 +1,13 @@
+--- lib/igt_frame.c.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_frame.c
+@@ -24,6 +24,10 @@
+ * Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
+ */
+
++#ifdef __FreeBSD__
++#include <limits.h>
++#endif
++
+ #include "config.h"
+
+ #include <fcntl.h>
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__kmod.h b/graphics/igt-gpu-tools/files/patch-lib_igt__kmod.h
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__kmod.h
@@ -0,0 +1,12 @@
+--- lib/igt_kmod.h.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_kmod.h
+@@ -24,7 +24,9 @@
+ #ifndef IGT_KMOD_H
+ #define IGT_KMOD_H
+
++#ifdef __linux__
+ #include <libkmod.h>
++#endif
+
+ #include "igt_list.h"
+
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__kmod.c b/graphics/igt-gpu-tools/files/patch-lib_igt__kmod.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__kmod.c
@@ -0,0 +1,131 @@
+--- lib/igt_kmod.c.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_kmod.c
+@@ -32,6 +32,7 @@
+ #include "igt_sysfs.h"
+ #include "igt_taints.h"
+
++#ifdef __linux__
+ /**
+ * SECTION:igt_kmod
+ * @short_description: Wrappers around libkmod for module loading/unloading
+@@ -853,3 +854,120 @@ void igt_kselftests(const char *module_name,
+
+ igt_kselftest_fini(&tst);
+ }
++#elif defined(__FreeBSD__)
++struct kmod_module {
++ size_t size;
++};
++
++bool
++igt_kmod_is_loaded(const char *mod_name)
++{
++ return false;
++}
++
++void
++igt_kmod_list_loaded(void)
++{
++}
++
++bool
++igt_kmod_has_param(const char *mod_name, const char *param)
++{
++ return false;
++}
++
++int
++igt_kmod_load(const char *mod_name, const char *opts)
++{
++ return -ENOSYS;
++}
++
++int
++igt_kmod_unload(const char *mod_name, unsigned int flags)
++{
++ return -ENOSYS;
++}
++
++int
++igt_audio_driver_unload(char **whom)
++{
++ return -ENOSYS;
++}
++
++int
++igt_i915_driver_load(const char *opts)
++{
++ return -ENOSYS;
++}
++
++int
++igt_i915_driver_unload(void)
++{
++ return -ENOSYS;
++}
++
++int
++__igt_i915_driver_unload(char **whom)
++{
++ return -ENOSYS;
++}
++
++int
++igt_amdgpu_driver_load(const char *opts)
++{
++ return -ENOSYS;
++}
++
++int
++igt_amdgpu_driver_unload(void)
++{
++ return -ENOSYS;
++}
++
++void
++igt_kselftests(const char *module_name,
++ const char *module_options,
++ const char *result_option,
++ const char *filter)
++{
++}
++
++int
++igt_kselftest_init(struct igt_kselftest *tst,
++ const char *module_name)
++{
++ return -ENOSYS;
++}
++
++int
++igt_kselftest_begin(struct igt_kselftest *tst)
++{
++ return -ENOSYS;
++}
++
++void
++igt_kselftest_get_tests(struct kmod_module *kmod,
++ const char *filter,
++ struct igt_list_head *tests)
++{
++}
++
++int
++igt_kselftest_execute(struct igt_kselftest *tst,
++ struct igt_kselftest_list *tl,
++ const char *module_options,
++ const char *result)
++{
++ return -ENOSYS;
++}
++
++void
++igt_kselftest_end(struct igt_kselftest *tst)
++{
++}
++
++void
++igt_kselftest_fini(struct igt_kselftest *tst)
++{
++}
++#endif /* __linux__ */
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__kms.c b/graphics/igt-gpu-tools/files/patch-lib_igt__kms.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__kms.c
@@ -0,0 +1,13 @@
+--- lib/igt_kms.c.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_kms.c
+@@ -43,6 +43,10 @@
+ #include <sys/kd.h>
+ #endif
+
++#ifdef __FreeBSD__
++#include <sys/consio.h>
++#endif
++
+ #include <libudev.h>
+ #include <poll.h>
+ #include <errno.h>
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__os.c b/graphics/igt-gpu-tools/files/patch-lib_igt__os.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__os.c
@@ -0,0 +1,42 @@
+--- lib/igt_os.c.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_os.c
+@@ -44,6 +44,9 @@
+ #include <sys/sysinfo.h>
+ #elif defined(HAVE_SWAPCTL) /* Solaris */
+ #include <sys/swap.h>
++#elif defined(__FreeBSD__)
++#include <sys/sysctl.h>
++#include <sys/types.h>
+ #endif
+ #include <sys/resource.h>
+
+@@ -148,6 +151,15 @@ igt_get_avail_ram_mb(void)
+ npages = sysconf(_SC_AVPHYS_PAGES);
+
+ retval = (uint64_t) pagesize * npages;
++#elif defined(__FreeBSD__) /* FreeBSD */
++ uint64_t npages, pagesize;
++ size_t npages_len = sizeof(npages);
++ size_t pagesize_len = sizeof(pagesize);
++
++ sysctlbyname("vm.stats.vm.v_free_count", &npages, &npages_len, NULL, 0);
++ sysctlbyname("vm.stats.vm.v_page_size", &pagesize, &pagesize_len, NULL, 0);
++
++ retval = pagesize * npages;
+ #else
+ #error "Unknown how to get available RAM for this OS"
+ #endif
+@@ -210,6 +222,13 @@ igt_get_total_swap_mb(void)
+ free(buf);
+
+ retval = (uint64_t) pagesize * totalpages;
++#elif defined(__FreeBSD__) /* FreeBSD */
++ uint64_t swap_total;
++ size_t swap_total_len = sizeof(swap_total);
++
++ sysctlbyname("vm.swap_total", &swap_total, &swap_total_len, NULL, 0);
++
++ retval = swap_total;
+ #else
+ #warning "Unknown how to get swap size for this OS"
+ return 0;
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__perf.h b/graphics/igt-gpu-tools/files/patch-lib_igt__perf.h
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__perf.h
@@ -0,0 +1,24 @@
+--- lib/igt_perf.h.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_perf.h
+@@ -27,10 +27,13 @@
+
+ #include <stdint.h>
+
++#ifdef __linux__
+ #include <linux/perf_event.h>
++#endif
+
+ #include "igt_gt.h"
+
++#ifdef __linux__
+ static inline int
+ perf_event_open(struct perf_event_attr *attr,
+ pid_t pid,
+@@ -50,6 +53,7 @@ perf_event_open(struct perf_event_attr *attr,
+ attr->size = sizeof(*attr);
+ return syscall(__NR_perf_event_open, attr, pid, cpu, group_fd, flags);
+ }
++#endif /* __linux__ */
+
+ uint64_t igt_perf_type_id(const char *device);
+ int igt_perf_open(uint64_t type, uint64_t config);
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__perf.c b/graphics/igt-gpu-tools/files/patch-lib_igt__perf.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__perf.c
@@ -0,0 +1,78 @@
+--- lib/igt_perf.c.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_perf.c
+@@ -4,13 +4,16 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <sys/stat.h>
++#ifdef __linux__
+ #include <sys/sysinfo.h>
+ #include <sys/sysmacros.h>
++#endif
+ #include <time.h>
+ #include <unistd.h>
+
+ #include "igt_perf.h"
+
++#ifdef __linux__
+ static char *bus_address(int i915, char *path, int pathlen)
+ {
+ struct stat st;
+@@ -157,3 +160,58 @@ int igt_perf_open_group(uint64_t type, uint64_t config
+ return _perf_open(type, config, group,
+ PERF_FORMAT_TOTAL_TIME_ENABLED | PERF_FORMAT_GROUP);
+ }
++#elif defined(__FreeBSD__)
++uint64_t
++igt_perf_type_id(const char *device)
++{
++ return -ENOSYS;
++}
++
++int
++igt_perf_open(uint64_t type, uint64_t config)
++{
++ return -ENOSYS;
++}
++
++int
++igt_perf_open_group(uint64_t type, uint64_t config, int group)
++{
++ return -ENOSYS;
++}
++
++const char *
++i915_perf_device(int i915, char *buf, int buflen)
++{
++ return strerror(ENOSYS);
++}
++
++uint64_t
++i915_perf_type_id(int i915)
++{
++ return -ENOSYS;
++}
++
++int
++perf_igfx_open(uint64_t config)
++{
++ return -ENOSYS;
++}
++
++int
++perf_igfx_open_group(uint64_t config, int group)
++{
++ return -ENOSYS;
++}
++
++int
++perf_i915_open(int i915, uint64_t config)
++{
++ return -ENOSYS;
++}
++
++int
++perf_i915_open_group(int i915, uint64_t config, int group)
++{
++ return -ENOSYS;
++}
++#endif /* __linux__ */
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__pm.c b/graphics/igt-gpu-tools/files/patch-lib_igt__pm.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__pm.c
@@ -0,0 +1,12 @@
+--- lib/igt_pm.c.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_pm.c
+@@ -33,7 +33,9 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <sys/stat.h>
++#ifdef __linux__
+ #include <sys/sysmacros.h>
++#endif
+ #include <sys/types.h>
+ #include <dirent.h>
+
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__syncobj.c b/graphics/igt-gpu-tools/files/patch-lib_igt__syncobj.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__syncobj.c
@@ -0,0 +1,13 @@
+--- lib/igt_syncobj.c.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_syncobj.c
+@@ -27,6 +27,10 @@
+ #include "igt.h"
+ #include "igt_syncobj.h"
+
++#ifdef __FreeBSD__
++#define ETIME ETIMEDOUT
++#endif
++
+ /**
+ * SECTION:igt_syncobj
+ * @short_description: Library with syncobj helpers
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__sysfs.c b/graphics/igt-gpu-tools/files/patch-lib_igt__sysfs.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__sysfs.c
@@ -0,0 +1,12 @@
+--- lib/igt_sysfs.c.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_sysfs.c
+@@ -24,7 +24,9 @@
+
+ #include <inttypes.h>
+ #include <sys/stat.h>
++#ifdef __linux__
+ #include <sys/sysmacros.h>
++#endif
+ #include <sys/mount.h>
+ #include <errno.h>
+ #include <stdarg.h>
diff --git a/graphics/igt-gpu-tools/files/patch-lib_igt__vgem.c b/graphics/igt-gpu-tools/files/patch-lib_igt__vgem.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_igt__vgem.c
@@ -0,0 +1,14 @@
+--- lib/igt_vgem.c.orig 2022-08-31 20:00:01 UTC
++++ lib/igt_vgem.c
+@@ -30,6 +30,11 @@
+ #include "igt_core.h"
+ #include "ioctl_wrappers.h"
+
++#ifdef __FreeBSD__
++#define mmap64(addr, len, prot, flags, fd, offset) \
++ mmap(addr, len, prot, flags, fd, offset)
++#endif
++
+ /**
+ * SECTION:igt_vgem
+ * @short_description: VGEM support library
diff --git a/graphics/igt-gpu-tools/files/patch-lib_intel__allocator.c b/graphics/igt-gpu-tools/files/patch-lib_intel__allocator.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_intel__allocator.c
@@ -0,0 +1,13 @@
+--- lib/intel_allocator.c.orig 2022-08-31 20:00:01 UTC
++++ lib/intel_allocator.c
+@@ -17,6 +17,10 @@
+ #include "intel_allocator.h"
+ #include "intel_allocator_msgchannel.h"
+
++#ifdef __FreeBSD__
++#define gettid() getpid()
++#endif
++
+ //#define ALLOCDBG
+ #ifdef ALLOCDBG
+ #define alloc_info igt_info
diff --git a/graphics/igt-gpu-tools/files/patch-lib_intel__batchbuffer.c b/graphics/igt-gpu-tools/files/patch-lib_intel__batchbuffer.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_intel__batchbuffer.c
@@ -0,0 +1,14 @@
+--- lib/intel_batchbuffer.c.orig 2022-08-31 20:00:01 UTC
++++ lib/intel_batchbuffer.c
+@@ -60,6 +60,11 @@
+ #define BCS_SRC_Y (1 << 0)
+ #define BCS_DST_Y (1 << 1)
+
++/* memory leak */
++#ifdef __FreeBSD__
++#define tdestroy(root, free_node)
++#endif
++
+ /**
+ * SECTION:intel_batchbuffer
+ * @short_description: Batchbuffer and blitter support
diff --git a/graphics/igt-gpu-tools/files/patch-lib_sw__sync.c b/graphics/igt-gpu-tools/files/patch-lib_sw__sync.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_sw__sync.c
@@ -0,0 +1,13 @@
+--- lib/sw_sync.c.orig 2022-08-31 20:00:01 UTC
++++ lib/sw_sync.c
+@@ -41,6 +41,10 @@
+ #include "drmtest.h"
+ #include "ioctl_wrappers.h"
+
++#ifdef __FreeBSD__
++#define ETIME ETIMEDOUT
++#endif
++
+ /**
+ * SECTION:sw_sync
+ * @short_description: Software sync (fencing) support library
diff --git a/graphics/igt-gpu-tools/files/patch-lib_tests_igt__exit__handler.c b/graphics/igt-gpu-tools/files/patch-lib_tests_igt__exit__handler.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_tests_igt__exit__handler.c
@@ -0,0 +1,12 @@
+--- lib/tests/igt_exit_handler.c.orig 2022-08-31 20:00:01 UTC
++++ lib/tests/igt_exit_handler.c
+@@ -125,5 +125,9 @@ int main(int argc, char **argv)
+ internal_assert_wexited(status, IGT_EXIT_SKIP);
+
+ status = testfunc(SIG);
++#ifdef __linux__
+ internal_assert_wsignaled(status, SIGTERM);
++#elif defined(__FreeBSD__)
++ internal_assert(status == 0);
++#endif
+ }
diff --git a/graphics/igt-gpu-tools/files/patch-lib_tests_igt__fork.c b/graphics/igt-gpu-tools/files/patch-lib_tests_igt__fork.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_tests_igt__fork.c
@@ -0,0 +1,14 @@
+--- lib/tests/igt_fork.c.orig 2022-08-31 20:00:01 UTC
++++ lib/tests/igt_fork.c
+@@ -109,7 +109,11 @@ __noreturn static void subtest_leak(void)
+ __noreturn static void subtest_leak(void)
+ {
+ pid_t *children =
++#ifdef __linux__
+ mmap(0, 4096, PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0);
++#elif defined(__FreeBSD__)
++ mmap(0, 4096, PROT_WRITE | PROT_READ, MAP_SHARED | MAP_ANON, -1, 0);
++#endif
+ const int num_children = 4096 / sizeof(*children);
+
+ igt_subtest_init(fake_argc, fake_argv);
diff --git a/graphics/igt-gpu-tools/files/patch-lib_tests_igt__tests__common.h b/graphics/igt-gpu-tools/files/patch-lib_tests_igt__tests__common.h
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-lib_tests_igt__tests__common.h
@@ -0,0 +1,20 @@
+--- lib/tests/igt_tests_common.h.orig 2022-08-31 20:00:01 UTC
++++ lib/tests/igt_tests_common.h
+@@ -48,8 +48,17 @@ static inline void internal_assert_wsignaled(int wstat
+
+ static inline void internal_assert_wsignaled(int wstatus, int signal)
+ {
++#ifdef __linux__
+ internal_assert(WIFSIGNALED(wstatus) &&
+ WTERMSIG(wstatus) == signal);
++#elif defined(__FreeBSD__)
++ if (WIFSIGNALED(wstatus))
++ internal_assert(WTERMSIG(wstatus) == signal);
++ else if (WIFEXITED(wstatus))
++ internal_assert(WEXITSTATUS(wstatus) == signal + 128);
++ else
++ internal_assert(0);
++#endif
+ }
+
+ static inline void internal_assert_not_wsignaled(int wstatus)
diff --git a/graphics/igt-gpu-tools/files/patch-meson.build b/graphics/igt-gpu-tools/files/patch-meson.build
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-meson.build
@@ -0,0 +1,31 @@
+--- meson.build.orig 2022-08-31 20:00:01 UTC
++++ meson.build
+@@ -86,7 +86,7 @@ build_info = ['Build type: ' + get_option('buildtype')
+
+ build_info = ['Build type: ' + get_option('buildtype')]
+
+-inc = include_directories('include/drm-uapi', 'include/linux-uapi', 'lib', 'lib/stubs/syscalls', '.')
++inc = include_directories('/usr/local/include', 'include/drm-uapi', 'include/linux-uapi', 'lib', 'lib/stubs/syscalls', '.')
+
+ inc_for_gtkdoc = include_directories('lib')
+
+@@ -120,8 +120,8 @@ pciaccess = dependency('pciaccess', version : '>=0.10'
+ build_info += 'With libdrm: ' + ','.join(libdrm_info)
+
+ pciaccess = dependency('pciaccess', version : '>=0.10')
+-libkmod = dependency('libkmod')
+-libprocps = dependency('libprocps', required : true)
++libkmod = dependency('libkmod', required : false)
++libprocps = dependency('libprocps', required : false)
+
+ libunwind = dependency('libunwind', required : get_option('libunwind'))
+ build_info += 'With libunwind: @0@'.format(libunwind.found())
+@@ -313,7 +313,7 @@ endif
+ if libdrm_intel.found()
+ subdir('assembler')
+ endif
+-subdir('overlay')
++#subdir('overlay')
+ subdir('man')
+ subdir('scripts')
+
diff --git a/graphics/igt-gpu-tools/files/patch-runner_executor.c b/graphics/igt-gpu-tools/files/patch-runner_executor.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-runner_executor.c
@@ -0,0 +1,39 @@
+--- runner/executor.c.orig 2022-08-31 20:00:01 UTC
++++ runner/executor.c
+@@ -2,7 +2,9 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <glib.h>
++#ifdef __linux__
+ #include <linux/watchdog.h>
++#endif
+ #if HAVE_OPING
+ #include <oping.h>
+ #endif
+@@ -14,7 +16,9 @@
+ #include <sys/ioctl.h>
+ #include <sys/select.h>
+ #include <sys/poll.h>
++#ifdef __linux__
+ #include <sys/signalfd.h>
++#endif
+ #include <sys/stat.h>
+ #include <sys/time.h>
+ #include <sys/types.h>
+@@ -32,6 +36,16 @@
+
+ #define KMSG_HEADER "[IGT] "
+ #define KMSG_WARN 4
++
++#ifdef __FreeBSD__
++#include <sys/watchdog.h>
++struct signalfd_siginfo {
++ uint32_t ssi_signo;
++ uint32_t ssi_pid;
++};
++#define WDIOC_KEEPALIVE WDIOCPATPAT
++#define signalfd(fd, mask, flags) -ENOSYS
++#endif
+
+ static struct {
+ int *fds;
diff --git a/graphics/igt-gpu-tools/files/patch-runner_job__list.c b/graphics/igt-gpu-tools/files/patch-runner_job__list.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-runner_job__list.c
@@ -0,0 +1,72 @@
+--- runner/job_list.c.orig 2022-08-31 20:00:01 UTC
++++ runner/job_list.c
+@@ -1,7 +1,12 @@
+ #include <ctype.h>
+ #include <errno.h>
+ #include <fcntl.h>
++#ifdef __linux__
+ #include <linux/limits.h>
++#elif defined(__FreeBSD__)
++#include <sys/limits.h>
++#include <sys/wait.h>
++#endif
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -40,6 +45,31 @@ static void add_job_list_entry(struct job_list *job_li
+ entry->subtest_count = subtest_count;
+ }
+
++#ifdef __FreeBSD__
++static inline int
++job_list_fscanf(FILE *stream, char *fmt, char **subtestname)
++{
++ int bufsize;
++ char c;
++
++ for (bufsize = 0;
++ (c = fgetc(stream)) != '\n' && c != EOF;
++ ++bufsize)
++ ;
++
++ if (bufsize == 0)
++ return 0;
++
++ *subtestname = malloc(bufsize + 2);
++
++ /* no fseek() in pipes */
++ stream->_r += bufsize + 1;
++ stream->_p -= bufsize + 1;
++
++ return (fscanf(stream, "%s\n", *subtestname));
++}
++#endif
++
+ static void add_subtests(struct job_list *job_list, struct settings *settings,
+ char *binary,
+ struct regex_list *include, struct regex_list *exclude)
+@@ -72,7 +102,11 @@ static void add_subtests(struct job_list *job_list, st
+ return;
+ }
+
++#ifdef __linux__
+ while (fscanf(p, "%ms", &subtestname) == 1) {
++#elif defined(__FreeBSD__)
++ while (job_list_fscanf(p, "%s", &subtestname) == 1) {
++#endif
+ char piglitname[256];
+
+ generate_piglit_name(binary, subtestname, piglitname, sizeof(piglitname));
+@@ -226,7 +260,12 @@ static bool job_list_from_test_list(struct job_list *j
+ if (settings->include_regexes.size && !matches_any(line, &settings->include_regexes))
+ continue;
+
++#ifdef __linux__
+ if (sscanf(line, "igt@%ms", &binary) == 1) {
++#elif defined(__FreeBSD__)
++ binary = malloc(strlen(line)-4);
++ if (sscanf(line, "igt@%s", binary) == 1) {
++#endif
+ if ((delim = strchr(binary, '@')) != NULL)
+ *delim++ = '\0';
+
diff --git a/graphics/igt-gpu-tools/files/patch-runner_runner__tests.c b/graphics/igt-gpu-tools/files/patch-runner_runner__tests.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-runner_runner__tests.c
@@ -0,0 +1,183 @@
+--- runner/runner_tests.c.orig 2022-08-31 20:00:01 UTC
++++ runner/runner_tests.c
+@@ -35,29 +35,37 @@ static const char *igt_get_result(struct json_object *
+
+ static const char *igt_get_result(struct json_object *tests, const char* testname)
+ {
++#ifdef __linux__ /* TODO: FreeBSD SIGNALFD */
+ struct json_object *obj;
+
+ igt_assert(json_object_object_get_ex(tests, testname, &obj));
+ igt_assert(json_object_object_get_ex(obj, "result", &obj));
+
+ return json_object_get_string(obj);
++#elif defined(__FreeBSD__)
++ return "";
++#endif
+ }
+
+ static void igt_assert_no_result_for(struct json_object *tests, const char* testname)
+ {
++#ifdef __linux__ /* TODO: FreeBSD SIGNALFD */
+ struct json_object *obj;
+ igt_assert(!json_object_object_get_ex(tests, testname, &obj));
++#endif
+ }
+
+
+ static void igt_assert_eqstr(const char *one, const char *two)
+ {
++#ifdef __linux__ /* TODO: FreeBSD SIGNALFD */
+ if (one == NULL && two == NULL)
+ return;
+
+ igt_assert_f(one != NULL && two != NULL, "Strings differ (one is NULL): %s vs %s\n", one, two);
+
+ igt_assert_f(!strcmp(one, two), "Strings differ: '%s' vs '%s'\n", one, two);
++#endif
+ }
+
+ static void debug_print_executions(struct job_list *list)
+@@ -1069,6 +1077,7 @@ igt_main
+ igt_assert_f((dirfd = open(dirname, O_DIRECTORY | O_RDONLY)) >= 0,
+ "Dry run resume somehow deleted the results directory.\n");
+
++#ifdef __linux__ /* TODO: FreeBSD SIGNALFD */
+ /* Execute from resume should work */
+ igt_assert(execute(&state, settings, list));
+ igt_assert_f((fd = openat(dirfd, "uname.txt", O_RDONLY)) >= 0,
+@@ -1078,6 +1087,7 @@ igt_main
+ "Dry run resume didn't create result directory.\n");
+ igt_assert_f((fd = openat(subdirfd, "journal.txt", O_RDONLY)) >= 0,
+ "Dry run resume didn't create a journal.\n");
++#endif
+ }
+
+ igt_fixture {
+@@ -1112,6 +1122,7 @@ igt_main
+ igt_assert(parse_options(ARRAY_SIZE(argv), (char**)argv, settings));
+ igt_assert(create_job_list(list, settings));
+
++#ifdef __linux__ /* TODO: FreeBSD SIGNALFD */
+ igt_assert(initialize_execute_state(&state, settings, list));
+
+ igt_assert_eq(state.next, 0);
+@@ -1128,6 +1139,7 @@ igt_main
+ "Execute state initialization created a journal.\n");
+ igt_assert_f((fd = openat(dirfd, "uname.txt", O_RDONLY)) < 0,
+ "Execute state initialization created uname.txt.\n");
++#endif
+ }
+
+ igt_fixture {
+@@ -1177,6 +1189,7 @@ igt_main
+
+ free_job_list(list);
+ free_settings(settings);
++#ifdef __linux__ /* TODO: FreeBSD SIGNALFD */
+ igt_assert(initialize_execute_state_from_resume(dirfd, &state, settings, list));
+
+ igt_assert_eq(state.next, 0);
+@@ -1184,6 +1197,7 @@ igt_main
+ igt_assert_eq(list->entries[0].subtest_count, 2);
+ igt_assert_eqstr(list->entries[0].subtests[0], "*");
+ igt_assert_eqstr(list->entries[0].subtests[1], excludestring);
++#endif
+ }
+
+ igt_fixture {
+@@ -1234,12 +1248,14 @@ igt_main
+
+ free_job_list(list);
+ free_settings(settings);
++#ifdef __linux__ /* TODO: FreeBSD SIGNALFD */
+ igt_assert(initialize_execute_state_from_resume(dirfd, &state, settings, list));
+
+ /* All subtests are in journal, the entry should be considered completed */
+ igt_assert_eq(state.next, 1);
+ igt_assert_eq(list->size, 1);
+ igt_assert_eq(list->entries[0].subtest_count, 4);
++#endif
+ }
+
+ igt_fixture {
+@@ -1343,6 +1359,7 @@ igt_main
+
+ igt_assert(parse_options(ARRAY_SIZE(argv), (char**)argv, settings));
+ igt_assert(create_job_list(list, settings));
++#ifdef __linux__ /* TODO: FreeBSD SIGNALFD */
+ igt_assert(initialize_execute_state(&state, settings, list));
+
+ igt_assert(execute(&state, settings, list));
+@@ -1366,6 +1383,7 @@ igt_main
+ snprintf(testdirname, 16, "%zd", expected_tests);
+ igt_assert_f((subdirfd = openat(dirfd, testdirname, O_DIRECTORY | O_RDONLY)) < 0,
+ "Execute created too many directories\n");
++#endif
+ }
+
+ igt_fixture {
+@@ -1483,6 +1501,7 @@ igt_main
+ igt_assert(create_job_list(list, settings));
+ igt_assert(initialize_execute_state(&state, settings, list));
+
++#ifdef __linux__ /* TODO: FreeBSD SIGNALFD */
+ igt_assert(execute(&state, settings, list));
+ igt_assert_f((dirfd = open(dirname, O_DIRECTORY | O_RDONLY)) >= 0,
+ "Execute didn't create the results directory\n");
+@@ -1516,6 +1535,7 @@ igt_main
+ close(subdirfd);
+ subdirfd = -1;
+ }
++#endif
+ }
+
+ igt_fixture {
+@@ -1567,6 +1587,7 @@ igt_main
+ igt_assert_eq(list->entries[0].subtest_count, 1);
+
+ igt_assert(initialize_execute_state(&state, settings, list));
++#ifdef __linux__ /* TODO: FreeBSD SIGNALFD */
+ igt_assert(execute(&state, settings, list));
+
+ igt_assert_f((dirfd = open(dirname, O_DIRECTORY | O_RDONLY)) >= 0,
+@@ -1583,6 +1604,7 @@ igt_main
+ igt_assert_eqstr(igt_get_result(tests, "igt@dynamic@dynamic-subtest@passing"), "pass");
+
+ igt_assert_eq(json_object_put(results), 1);
++#endif
+ }
+
+ igt_fixture {
+@@ -1619,6 +1641,7 @@ igt_main
+ igt_assert(parse_options(ARRAY_SIZE(argv), (char**)argv, settings));
+ igt_assert(create_job_list(list, settings));
+ igt_assert(initialize_execute_state(&state, settings, list));
++#ifdef __linux__ /* TODO: FreeBSD SIGNALFD */
+ igt_assert(execute(&state, settings, list));
+
+ igt_assert_f((dirfd = open(dirname, O_DIRECTORY | O_RDONLY)) >= 0,
+@@ -1631,6 +1654,7 @@ igt_main
+ igt_assert_eqstr(igt_get_result(tests, "igt@dynamic@dynamic-subtest@passing"), "pass");
+
+ igt_assert_eq(json_object_put(results), 1);
++#endif
+ }
+
+ igt_fixture {
+@@ -1924,6 +1948,7 @@ igt_main
+ }
+
+ igt_subtest("file-descriptor-leakage") {
++#ifdef __linux__ /* TODO: FreeBSD SIGNALFD */
+ int i;
+
+ /*
+@@ -1939,6 +1964,7 @@ igt_main
+ igt_assert_neq(close(i), 0);
+ igt_assert_eq(errno, EBADF);
+ }
++#endif
+ }
+
+ igt_fixture {
diff --git a/graphics/igt-gpu-tools/files/patch-runner_settings.c b/graphics/igt-gpu-tools/files/patch-runner_settings.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-runner_settings.c
@@ -0,0 +1,51 @@
+--- runner/settings.c.orig 2022-08-31 20:00:01 UTC
++++ runner/settings.c
+@@ -872,6 +872,36 @@ bool serialize_settings(struct settings *settings)
+ #undef SERIALIZE_LINE
+ }
+
++#ifdef __FreeBSD__
++static inline int
++settings_fscanf(FILE *stream, char **name, char **val)
++{
++ char c, **buf = name;
++ int i, buflen, rewind = 0;
++
++ /* get buffer size for name AND value */
++ for (i = 0; i < 2; ++i, buf = val) {
++ for (buflen = 0;
++ (c = fgetc(stream)) != ':' && c != '\n' && c != EOF;
++ ++buflen)
++ ;
++
++ /* add 1 to make room for '\0' */
++ *buf = malloc(buflen + 1);
++
++ /* add 1 to include ':' or '\n' */
++ rewind += buflen + 1;
++ }
++
++ /* rewind to start of new line for fscanf */
++ i = fseek(stream, -rewind, SEEK_CUR);
++ if (i < 0)
++ return (i);
++
++ return (fscanf(stream, "%s : %[^\n]\n", *name, *val));
++}
++#endif
++
+ bool read_settings_from_file(struct settings *settings, FILE *f)
+ {
+ #define PARSE_LINE(s, name, val, field, write) \
+@@ -887,7 +917,11 @@ bool read_settings_from_file(struct settings *settings
+
+ settings->dmesg_warn_level = -1;
+
++#ifdef __linux__
+ while (fscanf(f, "%ms : %m[^\n]", &name, &val) == 2) {
++#elif defined(__FreeBSD__)
++ while (settings_fscanf(f, &name, &val) == 2) {
++#endif
+ int numval = atoi(val);
+ PARSE_LINE(settings, name, val, abort_mask, numval);
+ PARSE_LINE(settings, name, val, disk_usage_limit, strtoul(val, NULL, 10));
diff --git a/graphics/igt-gpu-tools/files/patch-tests_core__auth.c b/graphics/igt-gpu-tools/files/patch-tests_core__auth.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_core__auth.c
@@ -0,0 +1,13 @@
+--- tests/core_auth.c.orig 2022-08-31 20:00:01 UTC
++++ tests/core_auth.c
+@@ -48,6 +48,10 @@
+ # include <pthread.h>
+ #endif
+
++#ifdef __FreeBSD__
++#define pthread_self() getpid()
++#endif
++
+ IGT_TEST_DESCRIPTION("Call drmGetMagic() and drmAuthMagic() and see if it behaves.");
+
+ static bool
diff --git a/graphics/igt-gpu-tools/files/patch-tests_drm__import__export.c b/graphics/igt-gpu-tools/files/patch-tests_drm__import__export.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_drm__import__export.c
@@ -0,0 +1,13 @@
+--- tests/drm_import_export.c.orig 2022-08-31 20:00:01 UTC
++++ tests/drm_import_export.c
+@@ -45,6 +45,10 @@ IGT_TEST_DESCRIPTION("Basic check to verify the behavi
+ #define DURATION 10
+ IGT_TEST_DESCRIPTION("Basic check to verify the behaviour of libdrm bo for prime/flink");
+
++#ifdef __FreeBSD__
++#define gettid() getpid()
++#endif
++
+ int fd;
+ drm_intel_bufmgr *bufmgr;
+ int fd1;
diff --git a/graphics/igt-gpu-tools/files/patch-tests_dumb__buffer.c b/graphics/igt-gpu-tools/files/patch-tests_dumb__buffer.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_dumb__buffer.c
@@ -0,0 +1,14 @@
+--- tests/dumb_buffer.c.orig 2022-08-31 20:00:01 UTC
++++ tests/dumb_buffer.c
+@@ -50,6 +50,11 @@
+ #include "igt_aux.h"
+ #include "ioctl_wrappers.h"
+
++#ifdef __FreeBSD__
++#undef jmp_buf
++#define sighandler_t sig_t
++#endif
++
+ IGT_TEST_DESCRIPTION("This is a test for the generic dumb buffer interface.");
+
+ static int __dumb_create(int fd, struct drm_mode_create_dumb *create)
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_gem__close__race.c b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__close__race.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__close__race.c
@@ -0,0 +1,23 @@
+--- tests/i915/gem_close_race.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/gem_close_race.c
+@@ -53,6 +53,10 @@
+ #define BLT_WRITE_ALPHA (1<<21)
+ #define BLT_WRITE_RGB (1<<20)
+
++#ifdef __FreeBSD__
++#define gettid() getpid()
++#endif
++
+ IGT_TEST_DESCRIPTION("Test try to race gem_close against workload submission.");
+
+ static uint32_t devid;
+@@ -61,7 +65,9 @@ static uint64_t data_addr;
+ static uint64_t exec_addr;
+ static uint64_t data_addr;
+
++#ifdef __linux__
+ #define sigev_notify_thread_id _sigev_un._tid
++#endif
+
+ static void selfcopy(int fd, uint32_t ctx, uint32_t handle, int loops)
+ {
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_gem__concurrent__all.c b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__concurrent__all.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__concurrent__all.c
@@ -0,0 +1,14 @@
+--- tests/i915/gem_concurrent_all.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/gem_concurrent_all.c
+@@ -53,6 +53,11 @@
+ #include "igt.h"
+ #include "igt_vgem.h"
+
++/* improper substitution */
++#ifdef __FreeBSD__
++#define MADV_DONTFORK MADV_NOSYNC
++#endif
++
+ IGT_TEST_DESCRIPTION("Test of pread/pwrite/mmap behavior when writing to active"
+ " buffers.");
+
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_gem__create.c b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__create.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__create.c
@@ -0,0 +1,13 @@
+--- tests/i915/gem_create.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/gem_create.c
+@@ -61,6 +61,10 @@
+ #include "i915/gem_mman.h"
+ #include "i915_drm.h"
+
++#ifdef __FreeBSD__
++#define sighandler_t sig_t
++#endif
++
+ IGT_TEST_DESCRIPTION("Ensure that basic gem_create and gem_create_ext works"
+ " and that invalid input combinations are rejected.");
+
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_gem__ctx__exec.c b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__ctx__exec.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__ctx__exec.c
@@ -0,0 +1,13 @@
+--- tests/i915/gem_ctx_exec.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/gem_ctx_exec.c
+@@ -48,6 +48,10 @@
+ #include "igt_sysfs.h"
+ #include "sw_sync.h"
+
++#ifdef __FreeBSD__
++#define ETIME ETIMEDOUT
++#endif
++
+ IGT_TEST_DESCRIPTION("Test context batch buffer execution.");
+
+ /* Copied from gem_exec_nop.c */
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_gem__ctx__persistence.c b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__ctx__persistence.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__ctx__persistence.c
@@ -0,0 +1,13 @@
+--- tests/i915/gem_ctx_persistence.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/gem_ctx_persistence.c
+@@ -50,6 +50,10 @@ static unsigned long reset_timeout_ms = RESET_TIMEOUT_
+ static unsigned long reset_timeout_ms = RESET_TIMEOUT_MS;
+ #define NSEC_PER_MSEC (1000 * 1000ull)
+
++#ifdef __FreeBSD__
++#define ETIME ETIMEDOUT
++#endif
++
+ static void cleanup(int i915)
+ {
+ igt_drop_caches_set(i915,
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_gem__ctx__shared.c b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__ctx__shared.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__ctx__shared.c
@@ -0,0 +1,13 @@
+--- tests/i915/gem_ctx_shared.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/gem_ctx_shared.c
+@@ -54,6 +54,10 @@
+ #define MAX_PRIO I915_CONTEXT_MAX_USER_PRIORITY
+ #define MIN_PRIO I915_CONTEXT_MIN_USER_PRIORITY
+
++#ifdef __FreeBSD__
++#define ETIME ETIMEDOUT
++#endif
++
+ static int priorities[] = {
+ [LO] = MIN_PRIO / 2,
+ [HI] = MAX_PRIO / 2,
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_gem__exec__fence.c b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__exec__fence.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__exec__fence.c
@@ -0,0 +1,13 @@
+--- tests/i915/gem_exec_fence.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/gem_exec_fence.c
+@@ -36,6 +36,10 @@
+ #include "intel_ctx.h"
+ #include "sw_sync.h"
+
++#ifdef __FreeBSD__
++#define ETIME ETIMEDOUT
++#endif
++
+ IGT_TEST_DESCRIPTION("Check that execbuf waits for explicit fences");
+
+ #ifndef SYNC_IOC_MERGE
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_gem__exec__latency.c b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__exec__latency.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__exec__latency.c
@@ -0,0 +1,13 @@
+--- tests/i915/gem_exec_latency.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/gem_exec_latency.c
+@@ -55,6 +55,10 @@
+ #define CORK 0x2
+ #define PREEMPT 0x4
+
++#ifdef __FreeBSD__
++#define SCHED_RESET_ON_FORK 0
++#endif
++
+ static unsigned int ring_size;
+ static double rcs_clock;
+ static struct intel_mmio_data mmio_data;
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_gem__exec__schedule.c b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__exec__schedule.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__exec__schedule.c
@@ -0,0 +1,67 @@
+--- tests/i915/gem_exec_schedule.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/gem_exec_schedule.c
+@@ -23,7 +23,9 @@
+
+ #include "config.h"
+
++#ifdef __linux__
+ #include <linux/userfaultfd.h>
++#endif
+
+ #include <pthread.h>
+ #include <sys/poll.h>
+@@ -64,6 +66,10 @@
+ #define MI_SEMAPHORE_SAD_EQ_SDD (4 << 12)
+ #define MI_SEMAPHORE_SAD_NEQ_SDD (5 << 12)
+
++#ifdef __FreeBSD__
++#define SCHED_RESET_ON_FORK 0
++#endif
++
+ IGT_TEST_DESCRIPTION("Check that we can control the order of execution");
+
+ static unsigned int offset_in_page(void *addr)
+@@ -2510,7 +2516,11 @@ static int userfaultfd(int flags)
+
+ static int userfaultfd(int flags)
+ {
++#ifdef __linux__
+ return syscall(SYS_userfaultfd, flags);
++#elif defined(__FreeBSD__)
++ return -ENOSYS;
++#endif
+ }
+
+ struct ufd_thread {
+@@ -2569,6 +2579,7 @@ static void test_pi_userfault(int i915,
+ const intel_ctx_cfg_t *cfg,
+ unsigned int engine)
+ {
++#ifdef __linux__
+ const uint32_t bbe = MI_BATCH_BUFFER_END;
+ struct uffdio_api api = { .api = UFFD_API };
+ struct uffdio_register reg;
+@@ -2670,6 +2681,7 @@ static void test_pi_userfault(int i915,
+ gem_close(i915, t.batch);
+ munmap(t.page, 4096);
+ close(ufd);
++#endif
+ }
+
+ static void *iova_thread(struct ufd_thread *t, int prio)
+@@ -2705,6 +2717,7 @@ static void test_pi_iova(int i915, const intel_ctx_cfg
+ static void test_pi_iova(int i915, const intel_ctx_cfg_t *cfg,
+ unsigned int engine, unsigned int flags)
+ {
++#ifdef __linux__
+ intel_ctx_cfg_t ufd_cfg = *cfg;
+ const intel_ctx_t *spinctx;
+ struct uffdio_api api = { .api = UFFD_API };
+@@ -2839,6 +2852,7 @@ static void test_pi_iova(int i915, const intel_ctx_cfg
+ gem_vm_destroy(i915, ufd_cfg.vm);
+
+ close(ufd);
++#endif
+ }
+
+ static void measure_semaphore_power(int i915, const intel_ctx_t *ctx)
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_gem__lmem__swapping.c b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__lmem__swapping.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__lmem__swapping.c
@@ -0,0 +1,13 @@
+--- tests/i915/gem_lmem_swapping.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/gem_lmem_swapping.c
+@@ -25,6 +25,10 @@
+ #include "i915/i915_blt.h"
+ #include "i915/intel_mocs.h"
+
++#ifdef __FreeBSD__
++#define MAP_POPULATE MAP_PREFAULT_READ
++#endif
++
+ IGT_TEST_DESCRIPTION("Exercise local memory swapping.");
+
+ #define __round_mask(x, y) ((__typeof__(x))((y) - 1))
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_gem__madvise.c b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__madvise.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__madvise.c
@@ -0,0 +1,13 @@
+--- tests/i915/gem_madvise.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/gem_madvise.c
+@@ -39,6 +39,10 @@
+ #include "drm.h"
+ #include "i915/gem_create.h"
+
++#ifdef __FreeBSD__
++#define sighandler_t sig_t
++#endif
++
+ IGT_TEST_DESCRIPTION("Checks that the kernel reports EFAULT when trying to use"
+ " purged bo.");
+
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_gem__mmap__gtt.c b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__mmap__gtt.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__mmap__gtt.c
@@ -0,0 +1,31 @@
+--- tests/i915/gem_mmap_gtt.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/gem_mmap_gtt.c
+@@ -54,6 +54,16 @@
+
+ #define abs(x) ((x) >= 0 ? (x) : -(x))
+
++#ifdef __FreeBSD__
++#define mmap64(addr, len, prot, flags, fd, offset) \
++ mmap(addr, len, prot, flags, fd, offset)
++#define PTRACE_TRACEME PT_TRACE_ME
++#define PTRACE_ATTACH PT_ATTACH
++#define PTRACE_PEEKDATA PT_READ_D
++#define PTRACE_POKEDATA PT_WRITE_D
++#define PTRACE_DETACH PT_DETACH
++#endif
++
+ IGT_TEST_DESCRIPTION("Ensure that all operations around MMAP_GTT ioctl works.");
+
+ static int OBJECT_SIZE = 16*1024*1024;
+@@ -566,7 +576,11 @@ test_ptrace(int fd)
+ for (int i = 0; i < sz / sizeof(long); i++) {
+ long ret;
+
++#ifdef __linux__
+ ret = ptrace(PTRACE_PEEKDATA, pid, gtt + i);
++#elif defined(__FreeBSD__)
++ ret = ptrace(PTRACE_PEEKDATA, pid, gtt + i, 0);
++#endif
+ igt_assert_eq_u64(ret, CC);
+ cpy[i] = ret;
+
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_gem__mmap__offset.c b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__mmap__offset.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__mmap__offset.c
@@ -0,0 +1,31 @@
+--- tests/i915/gem_mmap_offset.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/gem_mmap_offset.c
+@@ -38,6 +38,16 @@
+ #include "igt.h"
+ #include "igt_x86.h"
+
++#ifdef __FreeBSD__
++#define mmap64(addr, len, prot, flags, fd, offset) \
++ mmap(addr, len, prot, flags, fd, offset)
++#define PTRACE_TRACEME PT_TRACE_ME
++#define PTRACE_ATTACH PT_ATTACH
++#define PTRACE_PEEKDATA PT_READ_D
++#define PTRACE_POKEDATA PT_WRITE_D
++#define PTRACE_DETACH PT_DETACH
++#endif
++
+ IGT_TEST_DESCRIPTION("Basic MMAP_OFFSET IOCTL tests for mem regions\n");
+
+ static int mmap_offset_ioctl(int i915, struct drm_i915_gem_mmap_offset *arg)
+@@ -370,7 +380,11 @@ static void test_ptrace(int i915)
+ for (int i = 0; i < SZ / sizeof(long); i++) {
+ long ret;
+
++#ifdef __linux__
+ ret = ptrace(PTRACE_PEEKDATA, pid, ptr + i);
++#elif defined(__FreeBSD__)
++ ret = ptrace(PTRACE_PEEKDATA, pid, ptr + i, 0);
++#endif
+ igt_assert_eq_u64(ret, CC);
+ cpy[i] = ret;
+
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_gem__pread.c b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__pread.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__pread.c
@@ -0,0 +1,40 @@
+--- tests/i915/gem_pread.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/gem_pread.c
+@@ -25,7 +25,9 @@
+ *
+ */
+
++#ifdef __linux__
+ #include <linux/userfaultfd.h>
++#endif
+
+ #include "igt.h"
+ #include <unistd.h>
+@@ -81,7 +83,11 @@ static int userfaultfd(int flags)
+
+ static int userfaultfd(int flags)
+ {
++#ifdef __linux__
+ return syscall(SYS_userfaultfd, flags);
++#elif defined(__FreeBSD__)
++ return -ENOSYS;
++#endif
+ }
+
+ struct ufd_thread {
+@@ -154,6 +160,7 @@ static void test_exhaustion(int i915)
+
+ static void test_exhaustion(int i915)
+ {
++#ifdef __linux__
+ struct uffdio_api api = { .api = UFFD_API };
+ struct uffdio_register reg;
+ struct uffdio_copy copy;
+@@ -221,6 +228,7 @@ static void test_exhaustion(int i915)
+ close(ufd);
+
+ close(t.vgem);
++#endif
+ }
+
+ #define OBJECT_SIZE 16384
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_gem__pwrite.c b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__pwrite.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__pwrite.c
@@ -0,0 +1,40 @@
+--- tests/i915/gem_pwrite.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/gem_pwrite.c
+@@ -25,7 +25,9 @@
+ *
+ */
+
++#ifdef __linux__
+ #include <linux/userfaultfd.h>
++#endif
+
+ #include <pthread.h>
+ #include <unistd.h>
+@@ -283,7 +285,11 @@ static int userfaultfd(int flags)
+
+ static int userfaultfd(int flags)
+ {
++#ifdef __linux__
+ return syscall(SYS_userfaultfd, flags);
++#elif defined(__FreeBSD__)
++ return -ENOSYS;
++#endif
+ }
+
+ struct ufd_thread {
+@@ -378,6 +384,7 @@ static void test_exhaustion(int i915)
+
+ static void test_exhaustion(int i915)
+ {
++#ifdef __linux__
+ struct uffdio_api api = { .api = UFFD_API };
+ struct uffdio_register reg;
+ struct uffdio_copy copy;
+@@ -445,6 +452,7 @@ static void test_exhaustion(int i915)
+ close(ufd);
+
+ close(t.vgem);
++#endif
+ }
+
+ uint32_t *src, dst;
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_gem__shrink.c b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__shrink.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__shrink.c
@@ -0,0 +1,13 @@
+--- tests/i915/gem_shrink.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/gem_shrink.c
+@@ -38,6 +38,10 @@
+ #define MADV_FREE 8
+ #endif
+
++#ifdef __FreeBSD__
++#define MAP_POPULATE MAP_PREFAULT_READ
++#endif
++
+ static void get_pages(int fd, uint64_t alloc)
+ {
+ uint32_t handle = gem_create(fd, alloc);
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_gem__userptr__blits.c b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__userptr__blits.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__userptr__blits.c
@@ -0,0 +1,52 @@
+--- tests/i915/gem_userptr_blits.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/gem_userptr_blits.c
+@@ -36,7 +36,9 @@
+ * The goal is to simply ensure the basics work.
+ */
+
++#ifdef __linux__
+ #include <linux/userfaultfd.h>
++#endif
+
+ #include <stdlib.h>
+ #include <stdio.h>
+@@ -66,6 +68,11 @@
+
+ #include "eviction_common.c"
+
++#ifdef __FreeBSD__
++#define ETIME ETIMEDOUT
++#define MADV_HUGEPAGE MADV_SEQUENTIAL
++#endif
++
+ #ifndef PAGE_SIZE
+ #define PAGE_SIZE 4096
+ #endif
+@@ -2154,7 +2161,11 @@ static int userfaultfd(int flags)
+
+ static int userfaultfd(int flags)
+ {
++#ifdef __linux__
+ return syscall(SYS_userfaultfd, flags);
++#elif defined(__FreeBSD__)
++ return -ENOSYS;
++#endif
+ }
+
+ static bool has_userptr_probe(int fd)
+@@ -2240,6 +2251,7 @@ static void test_userfault(int i915)
+
+ static void test_userfault(int i915)
+ {
++#ifdef __linux__
+ struct uffdio_api api = { .api = UFFD_API };
+ struct uffdio_register reg;
+ struct uffdio_copy copy;
+@@ -2295,6 +2307,7 @@ static void test_userfault(int i915)
+
+ munmap(t.page, 4096);
+ close(ufd);
++#endif
+ }
+
+ uint64_t total_ram;
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_gem__wait.c b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__wait.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_gem__wait.c
@@ -0,0 +1,13 @@
+--- tests/i915/gem_wait.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/gem_wait.c
+@@ -32,6 +32,10 @@
+ #include "igt.h"
+ #include "igt_vgem.h"
+
++#ifdef __FreeBSD__
++#define ETIME ETIMEDOUT
++#endif
++
+ IGT_TEST_DESCRIPTION("Tests the GEM_WAIT ioctl");
+
+ static int __gem_wait(int fd, struct drm_i915_gem_wait *w)
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_i915__hangman.c b/graphics/igt-gpu-tools/files/patch-tests_i915_i915__hangman.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_i915__hangman.c
@@ -0,0 +1,13 @@
+--- tests/i915/i915_hangman.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/i915_hangman.c
+@@ -50,6 +50,10 @@ static int sysfs = -1;
+
+ #define OFFSET_ALIVE 10
+
++#ifdef __FreeBSD__
++#define ETIME ETIMEDOUT
++#endif
++
+ IGT_TEST_DESCRIPTION("Tests for hang detection and recovery");
+
+ static void check_alive(void)
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_i915__module__load.c b/graphics/igt-gpu-tools/files/patch-tests_i915_i915__module__load.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_i915__module__load.c
@@ -0,0 +1,12 @@
+--- tests/i915/i915_module_load.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/i915_module_load.c
+@@ -23,7 +23,9 @@
+ #include "igt.h"
+ #include <dirent.h>
+ #include <sys/utsname.h>
++#ifdef __linux__
+ #include <linux/limits.h>
++#endif
+ #include <signal.h>
+ #include <libgen.h>
+ #include <signal.h>
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_i915__pm__backlight.c b/graphics/igt-gpu-tools/files/patch-tests_i915_i915__pm__backlight.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_i915__pm__backlight.c
@@ -0,0 +1,13 @@
+--- tests/i915/i915_pm_backlight.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/i915_pm_backlight.c
+@@ -46,6 +46,10 @@ struct context {
+ #define FADESTEPS 10
+ #define FADESPEED 100 /* milliseconds between steps */
+
++#ifdef __FreeBSD__
++#include <libgen.h>
++#endif
++
+ IGT_TEST_DESCRIPTION("Basic backlight sysfs test");
+
+ static int backlight_read(int *result, const char *fname)
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_i915__pm__rpm.c b/graphics/igt-gpu-tools/files/patch-tests_i915_i915__pm__rpm.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_i915__pm__rpm.c
@@ -0,0 +1,31 @@
+--- tests/i915/i915_pm_rpm.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/i915_pm_rpm.c
+@@ -40,8 +40,10 @@
+ #include <sys/mman.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#ifdef __linux__
+ #include <linux/i2c.h>
+ #include <linux/i2c-dev.h>
++#endif
+
+ #include <drm.h>
+
+@@ -53,6 +55,17 @@
+ #include "igt_debugfs.h"
+ #include "igt_device.h"
+ #include "igt_edid.h"
++
++#ifdef __FreeBSD__
++#include <limits.h>
++#include <dev/iicbus/iic.h>
++
++#define I2C_RDWR I2CRDWR
++#define I2C_M_RD IIC_M_RD
++#define i2c_msg iic_msg
++#define i2c_rdwr_ioctl_data iic_rdwr_data
++#define addr slave
++#endif
+
+ #define MSR_PC8_RES 0x630
+ #define MSR_PC9_RES 0x631
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_kms__psr2__su.c b/graphics/igt-gpu-tools/files/patch-tests_i915_kms__psr2__su.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_kms__psr2__su.c
@@ -0,0 +1,18 @@
+--- tests/i915/kms_psr2_su.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/kms_psr2_su.c
+@@ -29,7 +29,15 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <string.h>
++#ifdef __linux__
+ #include <sys/timerfd.h>
++#endif
++
++/* FreeBSD: POSIX TIMER */
++#ifdef __FreeBSD__
++#define timerfd_create(c, f) -1
++#define timerfd_settime(fd, f, n, o) -1
++#endif
+
+ IGT_TEST_DESCRIPTION("Test PSR2 selective update");
+
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_kms__psr__stress__test.c b/graphics/igt-gpu-tools/files/patch-tests_i915_kms__psr__stress__test.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_kms__psr__stress__test.c
@@ -0,0 +1,32 @@
+--- tests/i915/kms_psr_stress_test.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/kms_psr_stress_test.c
+@@ -6,7 +6,9 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <string.h>
++#ifdef __linux__
+ #include <sys/timerfd.h>
++#endif
+
+ #define INVALIDATES_PER_SEC 15
+ #define FLIPS_PER_SEC 30
+@@ -18,6 +20,12 @@
+ #define FRAMEBUFFERS_LEN 60
+
+ #define DRAW_METHOD IGT_DRAW_BLT
++
++/* FreeBSD: POSIX TIMER */
++#ifdef __FreeBSD__
++#define timerfd_create(c, f) -1
++#define timerfd_settime(fd, f, n, o) -1
++#endif
+
+ typedef struct {
+ int drm_fd;
+@@ -374,4 +382,4 @@ igt_main
+ close(data.debugfs_fd);
+ close(data.drm_fd);
+ }
+-}
+\ No newline at end of file
++}
diff --git a/graphics/igt-gpu-tools/files/patch-tests_i915_sysfs__heartbeat__interval.c b/graphics/igt-gpu-tools/files/patch-tests_i915_sysfs__heartbeat__interval.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_i915_sysfs__heartbeat__interval.c
@@ -0,0 +1,13 @@
+--- tests/i915/sysfs_heartbeat_interval.c.orig 2022-08-31 20:00:01 UTC
++++ tests/i915/sysfs_heartbeat_interval.c
+@@ -42,6 +42,10 @@
+ #include "igt_sysfs.h"
+ #include "sw_sync.h"
+
++#ifdef __FreeBSD__
++#define sighandler_t sig_t
++#endif
++
+ #define ATTR "heartbeat_interval_ms"
+ #define RESET_TIMEOUT 50 /* milliseconds, at least one jiffie for kworker */
+
diff --git a/graphics/igt-gpu-tools/files/patch-tests_kms__content__protection.c b/graphics/igt-gpu-tools/files/patch-tests_kms__content__protection.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_kms__content__protection.c
@@ -0,0 +1,12 @@
+--- tests/kms_content_protection.c.orig 2022-08-31 20:00:01 UTC
++++ tests/kms_content_protection.c
+@@ -24,7 +24,9 @@
+
+ #include <poll.h>
+ #include <fcntl.h>
++#ifdef __linux__
+ #include <sys/epoll.h>
++#endif
+ #include <sys/stat.h>
+ #include <libudev.h>
+ #include "igt.h"
diff --git a/graphics/igt-gpu-tools/files/patch-tests_kms__cursor__legacy.c b/graphics/igt-gpu-tools/files/patch-tests_kms__cursor__legacy.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_kms__cursor__legacy.c
@@ -0,0 +1,13 @@
+--- tests/kms_cursor_legacy.c.orig 2022-08-31 20:00:01 UTC
++++ tests/kms_cursor_legacy.c
+@@ -47,6 +47,10 @@
+
+ #define PAGE_SIZE 4096
+
++#ifdef __FreeBSD__
++#define SCHED_IDLE SCHED_OTHER
++#endif
++
+ IGT_TEST_DESCRIPTION("Stress legacy cursor ioctl");
+
+ igt_pipe_crc_t *pipe_crc;
diff --git a/graphics/igt-gpu-tools/files/patch-tests_kms__flip.c b/graphics/igt-gpu-tools/files/patch-tests_kms__flip.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_kms__flip.c
@@ -0,0 +1,13 @@
+--- tests/kms_flip.c.orig 2022-08-31 20:00:01 UTC
++++ tests/kms_flip.c
+@@ -45,6 +45,10 @@
+ #include "i915/gem_create.h"
+ #include "igt_stats.h"
+
++#ifdef __FreeBSD__
++#include <sys/consio.h>
++#endif
++
+ #define TEST_DPMS (1 << 0)
+
+ #define TEST_PAN (1 << 3)
diff --git a/graphics/igt-gpu-tools/files/patch-tests_kms__sysfs__edid__timing.c b/graphics/igt-gpu-tools/files/patch-tests_kms__sysfs__edid__timing.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_kms__sysfs__edid__timing.c
@@ -0,0 +1,13 @@
+--- tests/kms_sysfs_edid_timing.c.orig 2022-08-31 20:00:01 UTC
++++ tests/kms_sysfs_edid_timing.c
+@@ -26,6 +26,10 @@
+ #include <fcntl.h>
+ #include <sys/stat.h>
+
++#ifdef __FreeBSD__
++#include <limits.h>
++#endif
++
+ #define THRESHOLD_PER_CONNECTOR 150
+ #define THRESHOLD_PER_CONNECTOR_MEAN 140
+ #define THRESHOLD_ALL_CONNECTORS_MEAN 100
diff --git a/graphics/igt-gpu-tools/files/patch-tests_meson.build b/graphics/igt-gpu-tools/files/patch-tests_meson.build
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_meson.build
@@ -0,0 +1,174 @@
+--- tests/meson.build.orig 2022-08-31 20:00:01 UTC
++++ tests/meson.build
+@@ -6,14 +6,14 @@ test_progs = [
+ 'core_setmaster',
+ 'core_setmaster_vs_auth',
+ 'debugfs_test',
+- 'dmabuf',
+- 'dmabuf_sync_file',
++ #'dmabuf',
++ #'dmabuf_sync_file',
+ 'device_reset',
+- 'drm_buddy',
++ #'drm_buddy',
+ 'drm_import_export',
+- 'drm_mm',
++ #'drm_mm',
+ 'drm_read',
+- 'fbdev',
++ #'fbdev',
+ 'feature_discovery',
+ 'kms_3d',
+ 'kms_addfb_basic',
+@@ -54,7 +54,7 @@ test_progs = [
+ 'kms_rmfb',
+ 'kms_rotation_crc',
+ 'kms_scaling_modes',
+- 'kms_selftest',
++ #'kms_selftest',
+ 'kms_sequence',
+ 'kms_setmode',
+ 'kms_sysfs_edid_timing',
+@@ -222,7 +222,7 @@ i915_progs = [
+ 'i915_pm_rps',
+ 'i915_pm_sseu',
+ 'i915_query',
+- 'i915_selftest',
++ #'i915_selftest',
+ 'i915_suspend',
+ 'kms_big_fb',
+ 'kms_big_joiner' ,
+@@ -340,21 +340,21 @@ test_list += 'gem_create'
+ install : true)
+ test_list += 'gem_create'
+
+-test_executables += executable('gem_ctx_freq',
+- join_paths('i915', 'gem_ctx_freq.c'),
+- dependencies : test_deps + [ lib_igt_perf ],
+- install_dir : libexecdir,
+- install_rpath : libexecdir_rpathdir,
+- install : true)
+-test_list += 'gem_ctx_freq'
++#test_executables += executable('gem_ctx_freq',
++# join_paths('i915', 'gem_ctx_freq.c'),
++# dependencies : test_deps + [ lib_igt_perf ],
++# install_dir : libexecdir,
++# install_rpath : libexecdir_rpathdir,
++# install : true)
++#test_list += 'gem_ctx_freq'
+
+-test_executables += executable('gem_ctx_sseu',
+- join_paths('i915', 'gem_ctx_sseu.c'),
+- dependencies : test_deps + [ lib_igt_perf ],
+- install_dir : libexecdir,
+- install_rpath : libexecdir_rpathdir,
+- install : true)
+-test_list += 'gem_ctx_sseu'
++#test_executables += executable('gem_ctx_sseu',
++# join_paths('i915', 'gem_ctx_sseu.c'),
++# dependencies : test_deps + [ lib_igt_perf ],
++# install_dir : libexecdir,
++# install_rpath : libexecdir_rpathdir,
++# install : true)
++#test_list += 'gem_ctx_sseu'
+
+ test_executables += executable('gem_eio',
+ join_paths('i915', 'gem_eio.c'),
+@@ -364,12 +364,12 @@ test_list += 'gem_eio'
+ install : true)
+ test_list += 'gem_eio'
+
+-test_executables += executable('gem_exec_balancer', 'i915/gem_exec_balancer.c',
+- dependencies : test_deps + [ lib_igt_perf ],
+- install_dir : libexecdir,
+- install_rpath : libexecdir_rpathdir,
+- install : true)
+-test_list += 'gem_exec_balancer'
++#test_executables += executable('gem_exec_balancer', 'i915/gem_exec_balancer.c',
++# dependencies : test_deps + [ lib_igt_perf ],
++# install_dir : libexecdir,
++# install_rpath : libexecdir_rpathdir,
++# install : true)
++#test_list += 'gem_exec_balancer'
+
+ test_executables += executable('gem_mmap_offset',
+ join_paths('i915', 'gem_mmap_offset.c'),
+@@ -379,44 +379,44 @@ test_list += 'gem_mmap_offset'
+ install : true)
+ test_list += 'gem_mmap_offset'
+
+-test_executables += executable('i915_pm_freq_mult',
+- join_paths('i915', 'i915_pm_freq_mult.c'),
+- dependencies : test_deps + [ lib_igt_perf ],
+- install_dir : libexecdir,
+- install_rpath : libexecdir_rpathdir,
+- install : true)
+-test_list += 'i915_pm_freq_mult'
++#test_executables += executable('i915_pm_freq_mult',
++# join_paths('i915', 'i915_pm_freq_mult.c'),
++# dependencies : test_deps + [ lib_igt_perf ],
++# install_dir : libexecdir,
++# install_rpath : libexecdir_rpathdir,
++# install : true)
++#test_list += 'i915_pm_freq_mult'
+
+-test_executables += executable('i915_pm_rc6_residency',
+- join_paths('i915', 'i915_pm_rc6_residency.c'),
+- dependencies : test_deps + [ lib_igt_perf ],
+- install_dir : libexecdir,
+- install_rpath : libexecdir_rpathdir,
+- install : true)
+-test_list += 'i915_pm_rc6_residency'
++#test_executables += executable('i915_pm_rc6_residency',
++# join_paths('i915', 'i915_pm_rc6_residency.c'),
++# dependencies : test_deps + [ lib_igt_perf ],
++# install_dir : libexecdir,
++# install_rpath : libexecdir_rpathdir,
++# install : true)
++#test_list += 'i915_pm_rc6_residency'
+
+-test_executables += executable('perf_pmu',
+- join_paths('i915', 'perf_pmu.c'),
+- dependencies : test_deps + [ lib_igt_perf ],
+- install_dir : libexecdir,
+- install_rpath : libexecdir_rpathdir,
+- install : true)
+-test_list += 'perf_pmu'
++#test_executables += executable('perf_pmu',
++# join_paths('i915', 'perf_pmu.c'),
++# dependencies : test_deps + [ lib_igt_perf ],
++# install_dir : libexecdir,
++# install_rpath : libexecdir_rpathdir,
++# install : true)
++#test_list += 'perf_pmu'
+
+-test_executables += executable('perf',
+- join_paths('i915', 'perf.c'),
+- dependencies : test_deps + [ lib_igt_i915_perf ],
+- install_dir : libexecdir,
+- install_rpath : libexecdir_rpathdir,
+- install : true)
+-test_list += 'perf'
++#test_executables += executable('perf',
++# join_paths('i915', 'perf.c'),
++# dependencies : test_deps + [ lib_igt_i915_perf ],
++# install_dir : libexecdir,
++# install_rpath : libexecdir_rpathdir,
++# install : true)
++#test_list += 'perf'
+
+-test_executables += executable('core_hotunplug', 'core_hotunplug.c',
+- dependencies : test_deps + [ lib_igt_i915_perf ],
+- install_dir : libexecdir,
+- install_rpath : libexecdir_rpathdir,
+- install : true)
+-test_list += 'core_hotunplug'
++#test_executables += executable('core_hotunplug', 'core_hotunplug.c',
++# dependencies : test_deps + [ lib_igt_i915_perf ],
++# install_dir : libexecdir,
++# install_rpath : libexecdir_rpathdir,
++# install : true)
++#test_list += 'core_hotunplug'
+
+ executable('testdisplay', ['testdisplay.c', 'testdisplay_hotplug.c'],
+ dependencies : test_deps,
diff --git a/graphics/igt-gpu-tools/files/patch-tests_sw__sync.c b/graphics/igt-gpu-tools/files/patch-tests_sw__sync.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_sw__sync.c
@@ -0,0 +1,12 @@
+--- tests/sw_sync.c.orig 2022-08-31 20:00:01 UTC
++++ tests/sw_sync.c
+@@ -38,6 +38,9 @@
+
+ #include "sw_sync.h"
+
++#ifdef __FreeBSD__
++#define ETIME ETIMEDOUT
++#endif
+
+ IGT_TEST_DESCRIPTION("Test SW Sync Framework");
+
diff --git a/graphics/igt-gpu-tools/files/patch-tests_syncobj__timeline.c b/graphics/igt-gpu-tools/files/patch-tests_syncobj__timeline.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_syncobj__timeline.c
@@ -0,0 +1,13 @@
+--- tests/syncobj_timeline.c.orig 2022-08-31 20:00:01 UTC
++++ tests/syncobj_timeline.c
+@@ -31,6 +31,10 @@
+ #include <signal.h>
+ #include "drm.h"
+
++#ifdef __FreeBSD__
++#define ETIME ETIMEDOUT
++#endif
++
+ IGT_TEST_DESCRIPTION("Tests for the drm timeline sync object API");
+
+ /* One tenth of a second */
diff --git a/graphics/igt-gpu-tools/files/patch-tests_syncobj__wait.c b/graphics/igt-gpu-tools/files/patch-tests_syncobj__wait.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_syncobj__wait.c
@@ -0,0 +1,13 @@
+--- tests/syncobj_wait.c.orig 2022-08-31 20:00:01 UTC
++++ tests/syncobj_wait.c
+@@ -31,6 +31,10 @@
+ #include <signal.h>
+ #include "drm.h"
+
++#ifdef __FreeBSD__
++#define ETIME ETIMEDOUT
++#endif
++
+ IGT_TEST_DESCRIPTION("Tests for the drm sync object wait API");
+
+ /* One tenth of a second */
diff --git a/graphics/igt-gpu-tools/files/patch-tests_tools__test.c b/graphics/igt-gpu-tools/files/patch-tests_tools__test.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_tools__test.c
@@ -0,0 +1,15 @@
+--- tests/tools_test.c.orig 2022-08-31 20:00:01 UTC
++++ tests/tools_test.c
+@@ -28,7 +28,12 @@
+ #include <fcntl.h>
+ #include <libgen.h>
+ #include <unistd.h>
++#ifdef __linux__
+ #include <linux/limits.h>
++#elif defined(__FreeBSD__)
++#include <limits.h>
++#define get_current_dir_name() getwd(NULL)
++#endif
+
+ #define TOOLS "../tools/"
+
diff --git a/graphics/igt-gpu-tools/files/patch-tests_vc4__purgeable__bo.c b/graphics/igt-gpu-tools/files/patch-tests_vc4__purgeable__bo.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_vc4__purgeable__bo.c
@@ -0,0 +1,13 @@
+--- tests/vc4_purgeable_bo.c.orig 2022-08-31 20:00:01 UTC
++++ tests/vc4_purgeable_bo.c
+@@ -35,6 +35,10 @@
+ #include <sys/ioctl.h>
+ #include "vc4_drm.h"
+
++#ifdef __FreeBSD__
++#undef jmp_buf
++#endif
++
+ struct igt_vc4_bo {
+ struct igt_list_head node;
+ int handle;
diff --git a/graphics/igt-gpu-tools/files/patch-tests_vc4__wait__bo.c b/graphics/igt-gpu-tools/files/patch-tests_vc4__wait__bo.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_vc4__wait__bo.c
@@ -0,0 +1,13 @@
+--- tests/vc4_wait_bo.c.orig 2022-08-31 20:00:01 UTC
++++ tests/vc4_wait_bo.c
+@@ -34,6 +34,10 @@
+ #include <sys/ioctl.h>
+ #include "vc4_drm.h"
+
++#ifdef __FreeBSD__
++#define ETIME ETIMEDOUT
++#endif
++
+ static void
+ test_used_bo(int fd, uint64_t timeout)
+ {
diff --git a/graphics/igt-gpu-tools/files/patch-tests_vc4__wait__seqno.c b/graphics/igt-gpu-tools/files/patch-tests_vc4__wait__seqno.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tests_vc4__wait__seqno.c
@@ -0,0 +1,13 @@
+--- tests/vc4_wait_seqno.c.orig 2022-08-31 20:00:01 UTC
++++ tests/vc4_wait_seqno.c
+@@ -33,6 +33,10 @@
+ #include <sys/ioctl.h>
+ #include "vc4_drm.h"
+
++#ifdef __FreeBSD__
++#define ETIME ETIMEDOUT
++#endif
++
+ igt_main
+ {
+ int fd;
diff --git a/graphics/igt-gpu-tools/files/patch-tools_intel__gvtg__test.c b/graphics/igt-gpu-tools/files/patch-tools_intel__gvtg__test.c
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tools_intel__gvtg__test.c
@@ -0,0 +1,12 @@
+--- tools/intel_gvtg_test.c.orig 2022-08-31 20:00:01 UTC
++++ tools/intel_gvtg_test.c
+@@ -44,6 +44,9 @@
+ #include <sys/ioctl.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#ifdef __FreeBSD__
++#include <sys/wait.h>
++#endif
+ #include <string.h>
+ #include <stdlib.h>
+ #include <signal.h>
diff --git a/graphics/igt-gpu-tools/files/patch-tools_meson.build b/graphics/igt-gpu-tools/files/patch-tools_meson.build
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/files/patch-tools_meson.build
@@ -0,0 +1,24 @@
+--- tools/meson.build.orig 2022-08-31 20:00:01 UTC
++++ tools/meson.build
+@@ -89,10 +89,10 @@ install_subdir('registers', install_dir : datadir)
+
+ install_subdir('registers', install_dir : datadir)
+
+-executable('intel_gpu_top', 'intel_gpu_top.c',
+- install : true,
+- install_rpath : bindir_rpathdir,
+- dependencies : [lib_igt_perf,lib_igt_device_scan,lib_igt_drm_fdinfo,math])
++#executable('intel_gpu_top', 'intel_gpu_top.c',
++# install : true,
++# install_rpath : bindir_rpathdir,
++# dependencies : [lib_igt_perf,lib_igt_device_scan,lib_igt_drm_fdinfo,math])
+
+ executable('amd_hdmi_compliance', 'amd_hdmi_compliance.c',
+ dependencies : [tool_deps],
+@@ -111,5 +111,5 @@ endif
+ install : true)
+ endif
+
+-subdir('i915-perf')
++#subdir('i915-perf')
+ subdir('null_state_gen')
diff --git a/graphics/igt-gpu-tools/pkg-descr b/graphics/igt-gpu-tools/pkg-descr
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/pkg-descr
@@ -0,0 +1,7 @@
+IGT GPU Tools is a collection of tools for development and testing of the
+DRM drivers. There are many macro-level test suites that get used against
+the drivers, including xtest, rendercheck, piglit, and oglconform, but
+failures from those can be difficult to track down to kernel changes, and
+many require complicated build procedures or specific testing environments
+to get useful results. Therefore, IGT GPU Tools includes low-level tools
+and tests specifically for development and testing of the DRM Drivers.
diff --git a/graphics/igt-gpu-tools/pkg-plist b/graphics/igt-gpu-tools/pkg-plist
new file mode 100644
--- /dev/null
+++ b/graphics/igt-gpu-tools/pkg-plist
@@ -0,0 +1,498 @@
+bin/amd_hdmi_compliance
+%%TEST%%bin/code_cov_capture
+%%TEST%%bin/code_cov_gather_on_build
+%%TEST%%bin/code_cov_gather_on_test
+%%TEST%%bin/code_cov_gen_report
+%%TEST%%bin/code_cov_parse_info
+bin/dpcd_reg
+%%RUNNER%%bin/igt_results
+%%RUNNER%%bin/igt_resume
+%%RUNNER%%bin/igt_runner
+bin/igt_stats
+%%AMD64%%bin/intel-gen4asm
+%%AMD64%%bin/intel-gen4disasm
+bin/intel_audio_dump
+bin/intel_backlight
+bin/intel_bios_dumper
+bin/intel_display_crc
+bin/intel_display_poller
+bin/intel_dp_compliance
+%%AMD64%%bin/intel_dump_decode
+%%AMD64%%bin/intel_error_decode
+bin/intel_firmware_decode
+bin/intel_forcewaked
+%%AMD64%%bin/intel_framebuffer_dump
+bin/intel_gem_info
+bin/intel_gpu_abrt
+bin/intel_gpu_frequency
+bin/intel_gpu_time
+bin/intel_gtt
+bin/intel_guc_logger
+bin/intel_gvtg_test
+bin/intel_infoframes
+bin/intel_l3_parity
+bin/intel_lid
+bin/intel_opregion_decode
+bin/intel_panel_fitter
+%%AMD64%%bin/intel_perf_counters
+bin/intel_pm_rpm
+bin/intel_reg
+bin/intel_reg_checker
+bin/intel_residency
+bin/intel_stepping
+bin/intel_vbt_decode
+bin/intel_watermark
+bin/lsgpu
+bin/msm_dp_compliance
+include/i915-perf/igt_list.h
+include/i915-perf/intel_chipset.h
+include/i915-perf/perf.h
+include/i915-perf/perf_data.h
+include/i915-perf/perf_data_reader.h
+lib/libi915_perf.so
+lib/libi915_perf.so.1
+lib/libigt.so
+lib/libigt.so.0
+libdata/pkgconfig/i915-perf.pc
+%%AMD64%%libdata/pkgconfig/intel-gen4asm.pc
+%%TEST%%libexec/igt-gpu-tools/amdgpu/amd_abm
+%%TEST%%libexec/igt-gpu-tools/amdgpu/amd_assr
+%%TEST%%libexec/igt-gpu-tools/amdgpu/amd_basic
+%%TEST%%libexec/igt-gpu-tools/amdgpu/amd_bypass
+%%TEST%%libexec/igt-gpu-tools/amdgpu/amd_color
+%%TEST%%libexec/igt-gpu-tools/amdgpu/amd_cs_nop
+%%TEST%%libexec/igt-gpu-tools/amdgpu/amd_dp_dsc
+%%TEST%%libexec/igt-gpu-tools/amdgpu/amd_hotplug
+%%TEST%%libexec/igt-gpu-tools/amdgpu/amd_ilr
+%%TEST%%libexec/igt-gpu-tools/amdgpu/amd_info
+%%TEST%%libexec/igt-gpu-tools/amdgpu/amd_link_settings
+%%TEST%%libexec/igt-gpu-tools/amdgpu/amd_max_bpc
+%%TEST%%libexec/igt-gpu-tools/amdgpu/amd_mem_leak
+%%TEST%%libexec/igt-gpu-tools/amdgpu/amd_mode_switch
+%%TEST%%libexec/igt-gpu-tools/amdgpu/amd_module_load
+%%TEST%%libexec/igt-gpu-tools/amdgpu/amd_plane
+%%TEST%%libexec/igt-gpu-tools/amdgpu/amd_prime
+%%TEST%%libexec/igt-gpu-tools/amdgpu/amd_psr
+%%TEST%%libexec/igt-gpu-tools/amdgpu/amd_vrr_range
+%%TEST%%libexec/igt-gpu-tools/api_intel_allocator
+%%TEST%%libexec/igt-gpu-tools/api_intel_bb
+libexec/igt-gpu-tools/benchmarks/gem_blt
+libexec/igt-gpu-tools/benchmarks/gem_busy
+libexec/igt-gpu-tools/benchmarks/gem_create
+libexec/igt-gpu-tools/benchmarks/gem_exec_ctx
+libexec/igt-gpu-tools/benchmarks/gem_exec_fault
+libexec/igt-gpu-tools/benchmarks/gem_exec_nop
+libexec/igt-gpu-tools/benchmarks/gem_exec_reloc
+libexec/igt-gpu-tools/benchmarks/gem_exec_trace
+libexec/igt-gpu-tools/benchmarks/gem_latency
+libexec/igt-gpu-tools/benchmarks/gem_prw
+libexec/igt-gpu-tools/benchmarks/gem_set_domain
+libexec/igt-gpu-tools/benchmarks/gem_syslatency
+libexec/igt-gpu-tools/benchmarks/gem_userptr_benchmark
+libexec/igt-gpu-tools/benchmarks/gem_wsim
+%%AMD64%%libexec/igt-gpu-tools/benchmarks/intel_upload_blit_large
+%%AMD64%%libexec/igt-gpu-tools/benchmarks/intel_upload_blit_large_gtt
+%%AMD64%%libexec/igt-gpu-tools/benchmarks/intel_upload_blit_large_map
+%%AMD64%%libexec/igt-gpu-tools/benchmarks/intel_upload_blit_small
+libexec/igt-gpu-tools/benchmarks/kms_vblank
+libexec/igt-gpu-tools/benchmarks/libgem_exec_tracer.so
+libexec/igt-gpu-tools/benchmarks/prime_lookup
+libexec/igt-gpu-tools/benchmarks/vgem_mmap
+%%TEST%%libexec/igt-gpu-tools/core_auth
+%%TEST%%libexec/igt-gpu-tools/core_getclient
+%%TEST%%libexec/igt-gpu-tools/core_getstats
+%%TEST%%libexec/igt-gpu-tools/core_getversion
+%%TEST%%libexec/igt-gpu-tools/core_setmaster
+%%TEST%%libexec/igt-gpu-tools/core_setmaster_vs_auth
+%%TEST%%libexec/igt-gpu-tools/debugfs_test
+%%TEST%%libexec/igt-gpu-tools/device_reset
+%%TEST%%libexec/igt-gpu-tools/drm_fdinfo
+%%TEST%%libexec/igt-gpu-tools/drm_import_export
+%%TEST%%libexec/igt-gpu-tools/drm_read
+%%TEST%%libexec/igt-gpu-tools/dumb_buffer
+%%TEST%%libexec/igt-gpu-tools/feature_discovery
+%%TEST%%libexec/igt-gpu-tools/gem_bad_reloc
+%%TEST%%libexec/igt-gpu-tools/gem_basic
+%%TEST%%libexec/igt-gpu-tools/gem_blits
+%%TEST%%libexec/igt-gpu-tools/gem_busy
+%%TEST%%libexec/igt-gpu-tools/gem_caching
+%%TEST%%libexec/igt-gpu-tools/gem_ccs
+%%TEST%%libexec/igt-gpu-tools/gem_close
+%%TEST%%libexec/igt-gpu-tools/gem_close_race
+%%TEST%%libexec/igt-gpu-tools/gem_concurrent_all
+%%TEST%%libexec/igt-gpu-tools/gem_concurrent_blit
+%%TEST%%libexec/igt-gpu-tools/gem_create
+%%TEST%%libexec/igt-gpu-tools/gem_cs_tlb
+%%TEST%%libexec/igt-gpu-tools/gem_ctx_bad_destroy
+%%TEST%%libexec/igt-gpu-tools/gem_ctx_create
+%%TEST%%libexec/igt-gpu-tools/gem_ctx_engines
+%%TEST%%libexec/igt-gpu-tools/gem_ctx_exec
+%%TEST%%libexec/igt-gpu-tools/gem_ctx_isolation
+%%TEST%%libexec/igt-gpu-tools/gem_ctx_param
+%%TEST%%libexec/igt-gpu-tools/gem_ctx_persistence
+%%TEST%%libexec/igt-gpu-tools/gem_ctx_shared
+%%TEST%%libexec/igt-gpu-tools/gem_ctx_switch
+%%TEST%%libexec/igt-gpu-tools/gem_eio
+%%TEST%%libexec/igt-gpu-tools/gem_evict_alignment
+%%TEST%%libexec/igt-gpu-tools/gem_evict_everything
+%%TEST%%libexec/igt-gpu-tools/gem_exec_alignment
+%%TEST%%libexec/igt-gpu-tools/gem_exec_async
+%%TEST%%libexec/igt-gpu-tools/gem_exec_await
+%%TEST%%libexec/igt-gpu-tools/gem_exec_basic
+%%TEST%%libexec/igt-gpu-tools/gem_exec_big
+%%TEST%%libexec/igt-gpu-tools/gem_exec_capture
+%%TEST%%libexec/igt-gpu-tools/gem_exec_create
+%%TEST%%libexec/igt-gpu-tools/gem_exec_endless
+%%TEST%%libexec/igt-gpu-tools/gem_exec_fair
+%%TEST%%libexec/igt-gpu-tools/gem_exec_fence
+%%TEST%%libexec/igt-gpu-tools/gem_exec_flush
+%%TEST%%libexec/igt-gpu-tools/gem_exec_gttfill
+%%TEST%%libexec/igt-gpu-tools/gem_exec_latency
+%%TEST%%libexec/igt-gpu-tools/gem_exec_lut_handle
+%%TEST%%libexec/igt-gpu-tools/gem_exec_nop
+%%TEST%%libexec/igt-gpu-tools/gem_exec_parallel
+%%TEST%%libexec/igt-gpu-tools/gem_exec_params
+%%TEST%%libexec/igt-gpu-tools/gem_exec_reloc
+%%TEST%%libexec/igt-gpu-tools/gem_exec_schedule
+%%TEST%%libexec/igt-gpu-tools/gem_exec_store
+%%TEST%%libexec/igt-gpu-tools/gem_exec_suspend
+%%TEST%%libexec/igt-gpu-tools/gem_exec_whisper
+%%TEST%%libexec/igt-gpu-tools/gem_fd_exhaustion
+%%TEST%%libexec/igt-gpu-tools/gem_fence_thrash
+%%TEST%%libexec/igt-gpu-tools/gem_fence_upload
+%%TEST%%libexec/igt-gpu-tools/gem_fenced_exec_thrash
+%%TEST%%libexec/igt-gpu-tools/gem_flink_basic
+%%TEST%%libexec/igt-gpu-tools/gem_flink_race
+%%TEST%%libexec/igt-gpu-tools/gem_gpgpu_fill
+%%TEST%%libexec/igt-gpu-tools/gem_gtt_cpu_tlb
+%%TEST%%libexec/igt-gpu-tools/gem_gtt_hog
+%%TEST%%libexec/igt-gpu-tools/gem_gtt_speed
+%%TEST%%libexec/igt-gpu-tools/gem_huc_copy
+%%TEST%%libexec/igt-gpu-tools/gem_linear_blits
+%%TEST%%libexec/igt-gpu-tools/gem_lmem_swapping
+%%TEST%%libexec/igt-gpu-tools/gem_lut_handle
+%%TEST%%libexec/igt-gpu-tools/gem_madvise
+%%TEST%%libexec/igt-gpu-tools/gem_media_fill
+%%TEST%%libexec/igt-gpu-tools/gem_media_vme
+%%TEST%%libexec/igt-gpu-tools/gem_mmap
+%%TEST%%libexec/igt-gpu-tools/gem_mmap_gtt
+%%TEST%%libexec/igt-gpu-tools/gem_mmap_offset
+%%TEST%%libexec/igt-gpu-tools/gem_mmap_wc
+%%TEST%%libexec/igt-gpu-tools/gem_partial_pwrite_pread
+%%TEST%%libexec/igt-gpu-tools/gem_pipe_control_store_loop
+%%TEST%%libexec/igt-gpu-tools/gem_ppgtt
+%%TEST%%libexec/igt-gpu-tools/gem_pread
+%%TEST%%libexec/igt-gpu-tools/gem_pread_after_blit
+%%TEST%%libexec/igt-gpu-tools/gem_pwrite
+%%TEST%%libexec/igt-gpu-tools/gem_pwrite_snooped
+%%TEST%%libexec/igt-gpu-tools/gem_pxp
+%%TEST%%libexec/igt-gpu-tools/gem_read_read_speed
+%%TEST%%libexec/igt-gpu-tools/gem_readwrite
+%%TEST%%libexec/igt-gpu-tools/gem_reg_read
+%%TEST%%libexec/igt-gpu-tools/gem_render_copy
+%%TEST%%libexec/igt-gpu-tools/gem_render_copy_redux
+%%TEST%%libexec/igt-gpu-tools/gem_render_linear_blits
+%%TEST%%libexec/igt-gpu-tools/gem_render_tiled_blits
+%%TEST%%libexec/igt-gpu-tools/gem_request_retire
+%%TEST%%libexec/igt-gpu-tools/gem_reset_stats
+%%TEST%%libexec/igt-gpu-tools/gem_ringfill
+%%TEST%%libexec/igt-gpu-tools/gem_set_tiling_vs_blt
+%%TEST%%libexec/igt-gpu-tools/gem_set_tiling_vs_gtt
+%%TEST%%libexec/igt-gpu-tools/gem_set_tiling_vs_pwrite
+%%TEST%%libexec/igt-gpu-tools/gem_shrink
+%%TEST%%libexec/igt-gpu-tools/gem_softpin
+%%TEST%%libexec/igt-gpu-tools/gem_spin_batch
+%%TEST%%libexec/igt-gpu-tools/gem_streaming_writes
+%%TEST%%libexec/igt-gpu-tools/gem_stress
+%%TEST%%libexec/igt-gpu-tools/gem_sync
+%%TEST%%libexec/igt-gpu-tools/gem_tiled_blits
+%%TEST%%libexec/igt-gpu-tools/gem_tiled_fence_blits
+%%TEST%%libexec/igt-gpu-tools/gem_tiled_partial_pwrite_pread
+%%TEST%%libexec/igt-gpu-tools/gem_tiled_pread_basic
+%%TEST%%libexec/igt-gpu-tools/gem_tiled_pread_pwrite
+%%TEST%%libexec/igt-gpu-tools/gem_tiled_swapping
+%%TEST%%libexec/igt-gpu-tools/gem_tiled_wb
+%%TEST%%libexec/igt-gpu-tools/gem_tiled_wc
+%%TEST%%libexec/igt-gpu-tools/gem_tiling_max_stride
+%%TEST%%libexec/igt-gpu-tools/gem_unfence_active_buffers
+%%TEST%%libexec/igt-gpu-tools/gem_unref_active_buffers
+%%TEST%%libexec/igt-gpu-tools/gem_userptr_blits
+%%TEST%%libexec/igt-gpu-tools/gem_vm_create
+%%TEST%%libexec/igt-gpu-tools/gem_wait
+%%TEST%%libexec/igt-gpu-tools/gem_watchdog
+%%TEST%%libexec/igt-gpu-tools/gem_workarounds
+%%TEST%%libexec/igt-gpu-tools/gen3_mixed_blits
+%%TEST%%libexec/igt-gpu-tools/gen3_render_linear_blits
+%%TEST%%libexec/igt-gpu-tools/gen3_render_mixed_blits
+%%TEST%%libexec/igt-gpu-tools/gen3_render_tiledx_blits
+%%TEST%%libexec/igt-gpu-tools/gen3_render_tiledy_blits
+%%TEST%%libexec/igt-gpu-tools/gen7_exec_parse
+%%TEST%%libexec/igt-gpu-tools/gen9_exec_parse
+%%TEST%%libexec/igt-gpu-tools/i915_fb_tiling
+%%TEST%%libexec/igt-gpu-tools/i915_getparams_basic
+%%TEST%%libexec/igt-gpu-tools/i915_hangman
+%%TEST%%libexec/igt-gpu-tools/i915_module_load
+%%TEST%%libexec/igt-gpu-tools/i915_pciid
+%%TEST%%libexec/igt-gpu-tools/i915_pm_backlight
+%%TEST%%libexec/igt-gpu-tools/i915_pm_dc
+%%TEST%%libexec/igt-gpu-tools/i915_pm_lpsp
+%%TEST%%libexec/igt-gpu-tools/i915_pm_rpm
+%%TEST%%libexec/igt-gpu-tools/i915_pm_rps
+%%TEST%%libexec/igt-gpu-tools/i915_pm_sseu
+%%TEST%%libexec/igt-gpu-tools/i915_query
+%%TEST%%libexec/igt-gpu-tools/i915_suspend
+%%TEST%%libexec/igt-gpu-tools/kms_3d
+%%TEST%%libexec/igt-gpu-tools/kms_addfb_basic
+%%TEST%%libexec/igt-gpu-tools/kms_async_flips
+%%TEST%%libexec/igt-gpu-tools/kms_atomic
+%%TEST%%libexec/igt-gpu-tools/kms_atomic_interruptible
+%%TEST%%libexec/igt-gpu-tools/kms_atomic_transition
+%%TEST%%libexec/igt-gpu-tools/kms_big_fb
+%%TEST%%libexec/igt-gpu-tools/kms_big_joiner
+%%TEST%%libexec/igt-gpu-tools/kms_busy
+%%TEST%%libexec/igt-gpu-tools/kms_bw
+%%TEST%%libexec/igt-gpu-tools/kms_ccs
+%%TEST%%libexec/igt-gpu-tools/kms_cdclk
+%%CHAMELIUM%%libexec/igt-gpu-tools/kms_chamelium
+%%TEST%%libexec/igt-gpu-tools/kms_color
+%%CHAMELIUM%%libexec/igt-gpu-tools/kms_color_chamelium
+%%TEST%%libexec/igt-gpu-tools/kms_concurrent
+%%TEST%%libexec/igt-gpu-tools/kms_content_protection
+%%TEST%%libexec/igt-gpu-tools/kms_cursor_crc
+%%TEST%%libexec/igt-gpu-tools/kms_cursor_edge_walk
+%%TEST%%libexec/igt-gpu-tools/kms_cursor_legacy
+%%TEST%%libexec/igt-gpu-tools/kms_display_modes
+%%TEST%%libexec/igt-gpu-tools/kms_dither
+%%TEST%%libexec/igt-gpu-tools/kms_dp_aux_dev
+%%TEST%%libexec/igt-gpu-tools/kms_dp_tiled_display
+%%TEST%%libexec/igt-gpu-tools/kms_draw_crc
+%%TEST%%libexec/igt-gpu-tools/kms_dsc
+%%TEST%%libexec/igt-gpu-tools/kms_fbcon_fbt
+%%TEST%%libexec/igt-gpu-tools/kms_fence_pin_leak
+%%TEST%%libexec/igt-gpu-tools/kms_flip
+%%TEST%%libexec/igt-gpu-tools/kms_flip_event_leak
+%%TEST%%libexec/igt-gpu-tools/kms_flip_scaled_crc
+%%TEST%%libexec/igt-gpu-tools/kms_flip_tiling
+%%TEST%%libexec/igt-gpu-tools/kms_force_connector_basic
+%%TEST%%libexec/igt-gpu-tools/kms_frontbuffer_tracking
+%%TEST%%libexec/igt-gpu-tools/kms_getfb
+%%TEST%%libexec/igt-gpu-tools/kms_hdmi_inject
+%%TEST%%libexec/igt-gpu-tools/kms_hdr
+%%TEST%%libexec/igt-gpu-tools/kms_invalid_mode
+%%TEST%%libexec/igt-gpu-tools/kms_lease
+%%TEST%%libexec/igt-gpu-tools/kms_legacy_colorkey
+%%TEST%%libexec/igt-gpu-tools/kms_mmap_write_crc
+%%TEST%%libexec/igt-gpu-tools/kms_multipipe_modeset
+%%TEST%%libexec/igt-gpu-tools/kms_panel_fitting
+%%TEST%%libexec/igt-gpu-tools/kms_pipe_b_c_ivb
+%%TEST%%libexec/igt-gpu-tools/kms_pipe_crc_basic
+%%TEST%%libexec/igt-gpu-tools/kms_plane
+%%TEST%%libexec/igt-gpu-tools/kms_plane_alpha_blend
+%%TEST%%libexec/igt-gpu-tools/kms_plane_cursor
+%%TEST%%libexec/igt-gpu-tools/kms_plane_lowres
+%%TEST%%libexec/igt-gpu-tools/kms_plane_multiple
+%%TEST%%libexec/igt-gpu-tools/kms_plane_scaling
+%%TEST%%libexec/igt-gpu-tools/kms_prime
+%%TEST%%libexec/igt-gpu-tools/kms_prop_blob
+%%TEST%%libexec/igt-gpu-tools/kms_properties
+%%TEST%%libexec/igt-gpu-tools/kms_psr
+%%TEST%%libexec/igt-gpu-tools/kms_psr2_sf
+%%TEST%%libexec/igt-gpu-tools/kms_psr2_su
+%%TEST%%libexec/igt-gpu-tools/kms_psr_stress_test
+%%TEST%%libexec/igt-gpu-tools/kms_pwrite_crc
+%%TEST%%libexec/igt-gpu-tools/kms_rmfb
+%%TEST%%libexec/igt-gpu-tools/kms_rotation_crc
+%%TEST%%libexec/igt-gpu-tools/kms_scaling_modes
+%%TEST%%libexec/igt-gpu-tools/kms_sequence
+%%TEST%%libexec/igt-gpu-tools/kms_setmode
+%%TEST%%libexec/igt-gpu-tools/kms_sysfs_edid_timing
+%%TEST%%libexec/igt-gpu-tools/kms_tv_load_detect
+%%TEST%%libexec/igt-gpu-tools/kms_universal_plane
+%%TEST%%libexec/igt-gpu-tools/kms_vblank
+%%TEST%%libexec/igt-gpu-tools/kms_vrr
+%%TEST%%libexec/igt-gpu-tools/kms_writeback
+%%TEST%%libexec/igt-gpu-tools/meta_test
+%%TEST%%libexec/igt-gpu-tools/msm_mapping
+%%TEST%%libexec/igt-gpu-tools/msm_recovery
+%%TEST%%libexec/igt-gpu-tools/msm_submit
+%%TEST%%libexec/igt-gpu-tools/panfrost_gem_new
+%%TEST%%libexec/igt-gpu-tools/panfrost_get_param
+%%TEST%%libexec/igt-gpu-tools/panfrost_prime
+%%TEST%%libexec/igt-gpu-tools/panfrost_submit
+%%TEST%%libexec/igt-gpu-tools/prime_busy
+%%TEST%%libexec/igt-gpu-tools/prime_mmap
+%%TEST%%libexec/igt-gpu-tools/prime_mmap_coherency
+%%TEST%%libexec/igt-gpu-tools/prime_mmap_kms
+%%TEST%%libexec/igt-gpu-tools/prime_self_import
+%%TEST%%libexec/igt-gpu-tools/prime_udl
+%%TEST%%libexec/igt-gpu-tools/prime_vgem
+%%TEST%%libexec/igt-gpu-tools/sw_sync
+%%TEST%%libexec/igt-gpu-tools/syncobj_basic
+%%TEST%%libexec/igt-gpu-tools/syncobj_timeline
+%%TEST%%libexec/igt-gpu-tools/syncobj_wait
+%%TEST%%libexec/igt-gpu-tools/sysfs_clients
+%%TEST%%libexec/igt-gpu-tools/sysfs_defaults
+%%TEST%%libexec/igt-gpu-tools/sysfs_heartbeat_interval
+%%TEST%%libexec/igt-gpu-tools/sysfs_preempt_timeout
+%%TEST%%libexec/igt-gpu-tools/sysfs_timeslice_duration
+%%TEST%%libexec/igt-gpu-tools/template
+%%TEST%%libexec/igt-gpu-tools/test-list-full.txt
+%%TEST%%libexec/igt-gpu-tools/test-list.txt
+%%TEST%%libexec/igt-gpu-tools/testdisplay
+%%TEST%%libexec/igt-gpu-tools/tools_test
+%%TEST%%libexec/igt-gpu-tools/v3d_get_bo_offset
+%%TEST%%libexec/igt-gpu-tools/v3d_get_param
+%%TEST%%libexec/igt-gpu-tools/v3d_mmap
+%%TEST%%libexec/igt-gpu-tools/vc4_create_bo
+%%TEST%%libexec/igt-gpu-tools/vc4_dmabuf_poll
+%%TEST%%libexec/igt-gpu-tools/vc4_label_bo
+%%TEST%%libexec/igt-gpu-tools/vc4_lookup_fail
+%%TEST%%libexec/igt-gpu-tools/vc4_purgeable_bo
+%%TEST%%libexec/igt-gpu-tools/vc4_tiling
+%%TEST%%libexec/igt-gpu-tools/vc4_wait_bo
+%%TEST%%libexec/igt-gpu-tools/vc4_wait_seqno
+%%TEST%%libexec/igt-gpu-tools/vgem_basic
+%%TEST%%libexec/igt-gpu-tools/vgem_slow
+man/man1/intel_audio_dump.1.gz
+man/man1/intel_bios_dumper.1.gz
+man/man1/intel_error_decode.1.gz
+man/man1/intel_gpu_frequency.1.gz
+man/man1/intel_gpu_top.1.gz
+man/man1/intel_gtt.1.gz
+man/man1/intel_infoframes.1.gz
+man/man1/intel_lid.1.gz
+man/man1/intel_panel_fitter.1.gz
+man/man1/intel_reg.1.gz
+man/man1/intel_stepping.1.gz
+man/man1/intel_upload_blit_large.1.gz
+man/man1/intel_upload_blit_large_gtt.1.gz
+man/man1/intel_upload_blit_large_map.1.gz
+man/man1/intel_upload_blit_small.1.gz
+man/man1/intel_vbt_decode.1.gz
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/annotation-glossary.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/ch01.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/ch02.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/deprecated-api-index.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/full-api-index.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/home.png
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-amdgpu-tests.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-core-tests.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-debugfs-tests.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-drm-tests.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gem-tests.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gen3-tests.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gen7-tests.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-ALSA.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-Audio.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-Batch-Buffer.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-Blitter-library.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-Buffer-operations.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-CRC.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-Chamelium.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-Chipset.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-Collection.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-Core.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-Device-selection.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-Draw.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-Dummyload.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-Frame.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-Framebuffer.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-GEM-Context.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-GEM-Create.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-GEM-Engine-Topology.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-GEM-Scheduler.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-GEM-Submission.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-GT.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-I915-GPU-CRC.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-IGT-List.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-IGT-Map.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-IO.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-Intel-Context-Wrapper.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-Intel-allocator.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-KMS.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-Power-Management.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-Primes.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-Random.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-SW-Sync.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-Stats.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-VC4.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-VGEM.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-aux.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-debugfs.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-drmtest.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-igt-device.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-io.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-ioctl-wrappers.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-kmod.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-msm.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-syncobj.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-sysfs.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools-x86.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-gpu-tools.devhelp2
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-i915-tests.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-kms-tests.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-meta-tests.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-perf-tests.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-pm-tests.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-prime-tests.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-sw-sync-tests.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-test-programs-common-features.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-testdisplay-tests.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-tools-tests.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/igt-vgem-tests.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/index.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/left-insensitive.png
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/left.png
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/right-insensitive.png
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/right.png
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/style.css
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/test-programs.html
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/up-insensitive.png
+%%DOCS%%share/gtk-doc/html/igt-gpu-tools/up.png
+%%TEST%%%%DATADIR%%/1080p-left.png
+%%TEST%%%%DATADIR%%/1080p-right.png
+%%TEST%%%%DATADIR%%/README
+%%TEST%%%%DATADIR%%/blacklist-pre-merge.txt
+%%TEST%%%%DATADIR%%/blacklist.txt
+%%TEST%%%%DATADIR%%/fast-feedback.testlist
+%%TEST%%%%DATADIR%%/meta.testlist
+%%TEST%%%%DATADIR%%/pass.png
+%%DATADIR%%/registers/audio_config_haswell_plus.txt
+%%DATADIR%%/registers/audio_debug_haswell_plus.txt
+%%DATADIR%%/registers/base_interrupt.txt
+%%DATADIR%%/registers/base_other.txt
+%%DATADIR%%/registers/base_power.txt
+%%DATADIR%%/registers/base_rings.txt
+%%DATADIR%%/registers/broadwell
+%%DATADIR%%/registers/cherryview
+%%DATADIR%%/registers/chv_display_base.txt
+%%DATADIR%%/registers/chv_dpio_phy_x1.txt
+%%DATADIR%%/registers/chv_dpio_phy_x2.txt
+%%DATADIR%%/registers/chv_pipe_b_extra.txt
+%%DATADIR%%/registers/chv_pipe_c.txt
+%%DATADIR%%/registers/common_display.txt
+%%DATADIR%%/registers/gen6_other.txt
+%%DATADIR%%/registers/gen7_other.txt
+%%DATADIR%%/registers/gen8_interrupt.txt
+%%DATADIR%%/registers/gen8_other.txt
+%%DATADIR%%/registers/haswell
+%%DATADIR%%/registers/haswell_other.txt
+%%DATADIR%%/registers/icelake
+%%DATADIR%%/registers/icl_delta.txt
+%%DATADIR%%/registers/ivybridge
+%%DATADIR%%/registers/kabylake
+%%DATADIR%%/registers/sandybridge
+%%DATADIR%%/registers/skl_display.txt
+%%DATADIR%%/registers/skl_powerwells.txt
+%%DATADIR%%/registers/skylake
+%%DATADIR%%/registers/tigerlake
+%%DATADIR%%/registers/tigerlake_delta.txt
+%%DATADIR%%/registers/valleyview
+%%DATADIR%%/registers/vlv_cck.txt
+%%DATADIR%%/registers/vlv_display_base.txt
+%%DATADIR%%/registers/vlv_dpio_phy.txt
+%%DATADIR%%/registers/vlv_dsi.txt
+%%DATADIR%%/registers/vlv_flisdsi.txt
+%%DATADIR%%/registers/vlv_pipe_a.txt
+%%DATADIR%%/registers/vlv_pipe_b.txt
+%%DATADIR%%/registers/vlv_power.txt
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 6, 12:09 AM (12 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17398673
Default Alt Text
D36213.diff (100 KB)
Attached To
Mode
D36213: [WIP] Port Submission for igt-gpu-tools
Attached
Detach File
Event Timeline
Log In to Comment