ports/graphics/igt-gpu-tools/files/patch-lib_igt__aux.c
Jake Freeland 5d303ab480
graphics/igt-gpu-tools: Test suite for drm drivers
The igt testing suite is separated into tests and tools that target kms,
memory management, and command submission.  These tests are especially
helpful for low-level reporting, transparent tracking of kernel changes,
and efficient debugging of modern drm drivers.

Reviewed by:	diizzy, lwhsu, jrm
Differential Revision:	https://reviews.freebsd.org/D36213
2022-09-09 12:06:45 -03:00

75 lines
1.3 KiB
C

--- 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;