ports/graphics/igt-gpu-tools/files/patch-benchmarks_gem__syslatency.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

24 lines
530 B
C

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