Changeset View
Changeset View
Standalone View
Standalone View
graphics/igt-gpu-tools/files/patch-tests_i915_i915__pm__rpm.c
- This file was added.
--- tests/i915/i915_pm_rpm.c.orig 2022-08-17 23:41:17 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> | |||||
@@ -54,6 +56,17 @@ | |||||
#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 | |||||
#define MSR_PC10_RES 0x632 | |||||
@@ -124,7 +137,11 @@ static int modprobe(const char *driver) | |||||
static int modprobe(const char *driver) | |||||
{ | |||||
+#ifdef __linux__ | |||||
return igt_kmod_load(driver, NULL); | |||||
+#elif defined(__FreeBSD__) | |||||
+ return -ENOSYS; | |||||
+#endif | |||||
} | |||||
/* If the read fails, then the machine doesn't support PC8+ residencies. */ |