@@ -3,6 +3,8 @@ lib_source_list = \
drmtest.c \
drmtest.h \
i830_reg.h \
+ i915/gem.c \
+ i915/gem.h \
i915/gem_context.c \
i915/gem_context.h \
i915/gem_engine_topology.c \
new file mode 100644
@@ -0,0 +1,80 @@
+/*
+ * Copyright © 2007,2014,2020 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include <fcntl.h>
+#include <sys/ioctl.h>
+
+#include "i915/gem.h"
+#include "igt.h"
+#include "igt_debugfs.h"
+#include "igt_sysfs.h"
+
+static void reset_device(int fd)
+{
+ int dir;
+
+ dir = igt_debugfs_dir(fd);
+ igt_require(dir >= 0);
+
+ if (ioctl(fd, DRM_IOCTL_I915_GEM_THROTTLE)) {
+ igt_info("Found wedged device, trying to reset and continue\n");
+ igt_sysfs_set(dir, "i915_wedged", "-1");
+ }
+ igt_sysfs_set(dir, "i915_next_seqno", "1");
+
+ close(dir);
+}
+
+void igt_require_gem(int fd)
+{
+ char path[256];
+ int err;
+
+ igt_require_intel(fd);
+
+ /*
+ * We only want to use the throttle-ioctl for its -EIO reporting
+ * of a wedged device, not for actually waiting on outstanding
+ * requests! So create a new drm_file for the device that is clean.
+ */
+ snprintf(path, sizeof(path), "/proc/self/fd/%d", fd);
+ fd = open(path, O_RDWR);
+ igt_assert_lte(0, fd);
+
+ /*
+ * Reset the global seqno at the start of each test. This ensures that
+ * the test will not wrap unless it explicitly sets up seqno wrapping
+ * itself, which avoids accidentally hanging when setting up long
+ * sequences of batches.
+ */
+ reset_device(fd);
+
+ err = 0;
+ if (ioctl(fd, DRM_IOCTL_I915_GEM_THROTTLE))
+ err = -errno;
+
+ close(fd);
+
+ igt_require_f(err == 0, "Unresponsive i915/GEM device\n");
+}
new file mode 100644
@@ -0,0 +1,30 @@
+/*
+ * Copyright © 2007,2014,2020 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#ifndef I915_GEM_H
+#define I915_GEM_H
+
+void igt_require_gem(int fd);
+
+#endif /* I915_GEM_H */
@@ -24,6 +24,7 @@
#ifndef GEM_VM_H
#define GEM_VM_H
+#include <stdbool.h>
#include <stdint.h>
bool gem_has_vm(int i915);
@@ -30,19 +30,20 @@
#include <i915_drm.h>
-#include "igt_core.h"
#include "drmtest.h"
+#include "i915/gem.h"
+#include "i915/gem_engine_topology.h"
+#include "i915/gem_mman.h"
+#include "i915/gem_submission.h"
+#include "igt_core.h"
#include "igt_device.h"
#include "igt_dummyload.h"
#include "igt_gt.h"
+#include "igt_vgem.h"
#include "intel_chipset.h"
#include "intel_reg.h"
#include "ioctl_wrappers.h"
#include "sw_sync.h"
-#include "igt_vgem.h"
-#include "i915/gem_engine_topology.h"
-#include "i915/gem_mman.h"
-#include "i915/gem_submission.h"
/**
* SECTION:igt_dummyload
@@ -32,6 +32,8 @@
#include <fcntl.h>
#include "drmtest.h"
+#include "i915/gem.h"
+#include "i915/gem_engine_topology.h"
#include "igt_aux.h"
#include "igt_core.h"
#include "igt_gt.h"
@@ -41,7 +43,6 @@
#include "intel_reg.h"
#include "intel_chipset.h"
#include "igt_dummyload.h"
-#include "i915/gem_engine_topology.h"
/**
* SECTION:igt_gt
@@ -1158,55 +1158,6 @@ void gem_require_caching(int fd)
errno = 0;
}
-static void reset_device(int fd)
-{
- int dir;
-
- dir = igt_debugfs_dir(fd);
- igt_require(dir >= 0);
-
- if (ioctl(fd, DRM_IOCTL_I915_GEM_THROTTLE)) {
- igt_info("Found wedged device, trying to reset and continue\n");
- igt_sysfs_set(dir, "i915_wedged", "-1");
- }
- igt_sysfs_set(dir, "i915_next_seqno", "1");
-
- close(dir);
-}
-
-void igt_require_gem(int fd)
-{
- char path[256];
- int err;
-
- igt_require_intel(fd);
-
- /*
- * We only want to use the throttle-ioctl for its -EIO reporting
- * of a wedged device, not for actually waiting on outstanding
- * requests! So create a new drm_file for the device that is clean.
- */
- snprintf(path, sizeof(path), "/proc/self/fd/%d", fd);
- fd = open(path, O_RDWR);
- igt_assert_lte(0, fd);
-
- /*
- * Reset the global seqno at the start of each test. This ensures that
- * the test will not wrap unless it explicitly sets up seqno wrapping
- * itself, which avoids accidentally hanging when setting up long
- * sequences of batches.
- */
- reset_device(fd);
-
- err = 0;
- if (ioctl(fd, DRM_IOCTL_I915_GEM_THROTTLE))
- err = -errno;
-
- close(fd);
-
- igt_require_f(err == 0, "Unresponsive i915/GEM device\n");
-}
-
/**
* gem_require_ring:
* @fd: open i915 drm file descriptor
@@ -120,7 +120,6 @@ void gem_sw_finish(int fd, uint32_t handle);
bool gem_bo_busy(int fd, uint32_t handle);
/* feature test helpers */
-void igt_require_gem(int fd);
bool gem_has_llc(int fd);
bool gem_has_bsd(int fd);
bool gem_has_blt(int fd);
@@ -1,5 +1,6 @@
lib_sources = [
'drmtest.c',
+ 'i915/gem.c',
'i915/gem_context.c',
'i915/gem_engine_topology.c',
'i915/gem_scheduler.c',
@@ -21,14 +21,15 @@
* IN THE SOFTWARE.
*/
-#include "igt.h"
-#include "igt_vgem.h"
-
#include <amdgpu.h>
#include <amdgpu_drm.h>
#include <sys/poll.h>
+#include "i915/gem.h"
+#include "igt.h"
+#include "igt_vgem.h"
+
#define GFX_COMPUTE_NOP 0xffff1000
#define SDMA_NOP 0x0
@@ -29,6 +29,7 @@
#include <sys/types.h>
#include <unistd.h>
+#include "i915/gem.h"
#include "igt.h"
#include "igt_device_scan.h"
#include "igt_kmod.h"
@@ -21,6 +21,8 @@
* IN THE SOFTWARE.
*/
#include "config.h"
+
+#include "i915/gem.h"
#include "igt.h"
#include "igt_sysfs.h"
#include <fcntl.h>
@@ -41,7 +41,6 @@
* resulted.
*/
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -50,7 +49,10 @@
#include <errno.h>
#include <sys/stat.h>
#include <sys/time.h>
+
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
#include "intel_bufmgr.h"
static drm_intel_bufmgr *bufmgr;
@@ -25,7 +25,6 @@
*
*/
-#include "igt.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
@@ -37,7 +36,10 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/time.h>
+
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
IGT_TEST_DESCRIPTION("Simulates SNA behaviour using negative self-relocations"
" for STATE_BASE_ADDRESS command packets.");
@@ -22,6 +22,7 @@
*
*/
+#include "i915/gem.h"
#include "igt.h"
#include "igt_x86.h"
@@ -25,10 +25,11 @@
#include <signal.h>
#include <sys/ioctl.h>
+#include "i915/gem.h"
+#include "i915/gem_ring.h"
#include "igt.h"
#include "igt_rand.h"
#include "igt_vgem.h"
-#include "i915/gem_ring.h"
#define LOCAL_EXEC_NO_RELOC (1<<11)
#define PAGE_ALIGN(x) ALIGN(x, 4096)
@@ -26,7 +26,6 @@
*
*/
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -38,6 +37,8 @@
#include <drm.h>
+#include "i915/gem.h"
+#include "igt.h"
#include "intel_bufmgr.h"
IGT_TEST_DESCRIPTION("Test snoop consistency when touching partial"
@@ -21,6 +21,7 @@
* IN THE SOFTWARE.
*/
+#include "i915/gem.h"
#include "igt.h"
static bool has_duplicate(int err)
@@ -25,7 +25,6 @@
*
*/
-#include "igt.h"
#include <pthread.h>
#include <unistd.h>
#include <signal.h>
@@ -40,7 +39,10 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include <sys/syscall.h>
+
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
#define OBJECT_SIZE (256 * 1024)
@@ -35,8 +35,6 @@
* Based on gem_gtt_concurrent_blt.
*/
-#include "igt.h"
-#include "igt_vgem.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -50,6 +48,9 @@
#include <drm.h>
+#include "i915/gem.h"
+#include "igt.h"
+#include "igt_vgem.h"
#include "intel_bufmgr.h"
IGT_TEST_DESCRIPTION("Test of pread/pwrite/mmap behavior when writing to active"
@@ -35,6 +35,7 @@
* This test for a bug where we've failed to plug a scratch pte entry into the
* very last gtt pte.
*/
+#include "i915/gem.h"
#include "igt.h"
IGT_TEST_DESCRIPTION("Test the CS prefetch behaviour on batches.");
@@ -35,7 +35,6 @@
* https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1063252
*/
-#include "igt.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
@@ -50,6 +49,9 @@
#include <drm.h>
+#include "i915/gem.h"
+#include "igt.h"
+
IGT_TEST_DESCRIPTION("Check whether we correctly invalidate the cs tlb.");
#define BATCH_SIZE (1024*1024)
@@ -21,10 +21,11 @@
* IN THE SOFTWARE.
*/
-#include "igt.h"
-#include "igt_gt.h"
+#include "i915/gem.h"
#include "i915/gem_vm.h"
#include "i915_drm.h"
+#include "igt.h"
+#include "igt_gt.h"
static int ctx_create_ioctl(int i915, struct drm_i915_gem_context_create_ext *arg)
{
@@ -25,13 +25,13 @@
*
*/
-#include "igt.h"
-
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <time.h>
+#include "i915/gem.h"
+#include "igt.h"
#include "igt_rand.h"
#include "sw_sync.h"
@@ -22,8 +22,6 @@
*
*/
-#include "igt.h"
-
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
@@ -38,7 +36,9 @@
#include <drm.h>
+#include "i915/gem.h"
#include "i915/gem_context.h"
+#include "igt.h"
#include "sw_sync.h"
#define engine_class(e, n) ((e)->engines[(n)].engine_class)
@@ -24,7 +24,6 @@
* Ben Widawsky <ben@bwidawsk.net>
*
*/
-#include "igt.h"
#include <limits.h>
#include <unistd.h>
#include <signal.h>
@@ -41,6 +40,8 @@
#include <drm.h>
+#include "i915/gem.h"
+#include "igt.h"
#include "igt_dummyload.h"
#include "igt_sysfs.h"
#include "sw_sync.h"
@@ -29,6 +29,7 @@
#include <stdint.h>
#include <unistd.h>
+#include "i915/gem.h"
#include "igt.h"
#include "igt_perf.h"
#include "igt_sysfs.h"
@@ -21,6 +21,7 @@
* IN THE SOFTWARE.
*/
+#include "i915/gem.h"
#include "igt.h"
#include "igt_dummyload.h"
@@ -29,6 +29,7 @@
#include <unistd.h>
#include "drmtest.h" /* gem_quiescent_gpu()! */
+#include "i915/gem.h"
#include "i915/gem_context.h"
#include "i915/gem_engine_topology.h"
#include "i915/gem_ring.h"
@@ -30,6 +30,7 @@
#include <unistd.h>
#include "drmtest.h" /* gem_quiescent_gpu()! */
+#include "i915/gem.h"
#include "i915/gem_context.h"
#include "i915/gem_engine_topology.h"
#include "ioctl_wrappers.h" /* gem_wait()! */
@@ -22,8 +22,6 @@
*
*/
-#include "igt.h"
-
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
@@ -38,7 +36,9 @@
#include <drm.h>
+#include "i915/gem.h"
#include "i915/gem_engine_topology.h"
+#include "igt.h"
#include "igt_rand.h"
#include "igt_vgem.h"
#include "sw_sync.h"
@@ -25,7 +25,6 @@
*
*/
-#include "igt.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -37,6 +36,9 @@
#include <sys/mman.h>
#include <sys/wait.h>
+#include "i915/gem.h"
+#include "igt.h"
+#include "igt.h"
#include "igt_dummyload.h"
#include "igt_perf.h"
#include "igt_sysfs.h"
@@ -25,7 +25,6 @@
*
*/
-#include "igt.h"
#include <limits.h>
#include <unistd.h>
#include <stdlib.h>
@@ -39,7 +38,10 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include <time.h>
+
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
#define LOCAL_I915_EXEC_NO_RELOC (1<<11)
#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12)
@@ -22,8 +22,6 @@
*
*/
-#include "igt.h"
-#include "igt_sysfs.h"
#include <stdio.h>
#include <string.h>
#include <errno.h>
@@ -32,6 +30,10 @@
#include <sys/stat.h>
#include <sys/resource.h>
+#include "i915/gem.h"
+#include "igt.h"
+#include "igt_sysfs.h"
+
IGT_TEST_DESCRIPTION("Fill the Gobal GTT with context objects and VMs\n");
#define NUM_THREADS (2*sysconf(_SC_NPROCESSORS_ONLN))
@@ -41,6 +41,8 @@
#include <drm.h>
+#include "i915/gem.h"
+#include "i915/gem_ring.h"
#include "igt.h"
#include "igt_device.h"
#include "igt_fb.h"
@@ -48,7 +50,6 @@
#include "igt_stats.h"
#include "igt_sysfs.h"
#include "sw_sync.h"
-#include "i915/gem_ring.h"
IGT_TEST_DESCRIPTION("Test that specific ioctls report a wedged GPU (EIO).");
@@ -30,7 +30,6 @@
* Testcase: run a couple of big batches to force the unbind on misalignment code.
*/
-#include "igt.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
@@ -45,6 +44,8 @@
#include <drm.h>
+#include "i915/gem.h"
+#include "igt.h"
IGT_TEST_DESCRIPTION("Run a couple of big batches to force the unbind on"
" misalignment code.");
@@ -30,7 +30,6 @@
* Testcase: run a couple of big batches to force the eviction code.
*/
-#include "igt.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
@@ -42,7 +41,10 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/time.h>
+
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
#include "eviction_common.c"
@@ -27,7 +27,6 @@
/* Exercises the basic execbuffer using object alignments */
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -42,6 +41,8 @@
#include <sched.h>
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
IGT_TEST_DESCRIPTION("Exercises the basic execbuffer using object alignments");
@@ -21,6 +21,7 @@
* IN THE SOFTWARE.
*/
+#include "i915/gem.h"
#include "igt.h"
#define LOCAL_OBJECT_ASYNC (1 << 6)
@@ -22,14 +22,15 @@
*
*/
+#include <sys/ioctl.h>
+#include <sys/signal.h>
+
+#include "i915/gem.h"
+#include "i915/gem_ring.h"
#include "igt.h"
#include "igt_rand.h"
#include "igt_sysfs.h"
#include "igt_vgem.h"
-#include "i915/gem_ring.h"
-
-#include <sys/ioctl.h>
-#include <sys/signal.h>
#define LOCAL_I915_EXEC_NO_RELOC (1<<11)
#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12)
@@ -25,7 +25,6 @@
*
*/
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -34,7 +33,10 @@
#include <errno.h>
#include <sys/stat.h>
#include <sys/time.h>
+
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
#include "intel_bufmgr.h"
/* Testcase: Test whether the kernel rejects relocations with non-gpu domains
@@ -23,10 +23,11 @@
#include <sched.h>
+#include "i915/gem.h"
+#include "i915/gem_ring.h"
#include "igt.h"
#include "igt_gt.h"
#include "igt_perf.h"
-#include "i915/gem_ring.h"
#include "sw_sync.h"
IGT_TEST_DESCRIPTION("Exercise in-kernel load-balancing");
@@ -32,7 +32,6 @@
* Mostly useful to stress-test the error-capture code
*/
-#include "igt.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
@@ -44,7 +43,10 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/time.h>
+
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
IGT_TEST_DESCRIPTION("Run a large nop batch to stress test the error capture"
" code.");
@@ -23,6 +23,7 @@
#include <zlib.h>
+#include "i915/gem.h"
#include "igt.h"
#include "igt_device.h"
#include "igt_rand.h"
@@ -25,7 +25,6 @@
*
*/
-#include "igt.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
@@ -38,7 +37,10 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include <time.h>
+
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
#define LOCAL_I915_EXEC_NO_RELOC (1<<11)
#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12)
@@ -21,16 +21,17 @@
* IN THE SOFTWARE.
*/
+#include <sys/ioctl.h>
+#include <sys/poll.h>
+#include <sys/signal.h>
+
+#include "i915/gem.h"
+#include "i915/gem_ring.h"
#include "igt.h"
#include "igt_syncobj.h"
#include "igt_sysfs.h"
#include "igt_vgem.h"
#include "sw_sync.h"
-#include "i915/gem_ring.h"
-
-#include <sys/ioctl.h>
-#include <sys/poll.h>
-#include <sys/signal.h>
IGT_TEST_DESCRIPTION("Check that execbuf waits for explicit fences");
@@ -23,6 +23,7 @@
#include <time.h>
+#include "i915/gem.h"
#include "igt.h"
#include "igt_x86.h"
@@ -21,6 +21,7 @@
* IN THE SOFTWARE.
*/
+#include "i915/gem.h"
#include "igt.h"
#include "igt_rand.h"
@@ -22,7 +22,6 @@
*
*/
-#include "igt.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
@@ -40,11 +39,13 @@
#include "drm.h"
+#include "igt.h"
#include "igt_sysfs.h"
#include "igt_vgem.h"
#include "igt_dummyload.h"
#include "igt_stats.h"
+#include "i915/gem.h"
#include "i915/gem_ring.h"
#define LOCAL_I915_EXEC_NO_RELOC (1<<11)
@@ -27,7 +27,6 @@
/* Exercises the basic execbuffer using the handle LUT interface */
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -36,7 +35,10 @@
#include <errno.h>
#include <sys/stat.h>
#include <sys/time.h>
+
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
IGT_TEST_DESCRIPTION("Exercises the basic execbuffer using the handle LUT"
" interface.");
@@ -25,11 +25,6 @@
*
*/
-#include "igt.h"
-#include "igt_device.h"
-#include "igt_rand.h"
-#include "igt_sysfs.h"
-
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
@@ -43,7 +38,14 @@
#include <sys/poll.h>
#include <sys/time.h>
#include <time.h>
+
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
+#include "igt_device.h"
+#include "igt_rand.h"
+#include "igt_sysfs.h"
+
#define LOCAL_I915_EXEC_NO_RELOC (1<<11)
#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12)
@@ -29,6 +29,7 @@
#include <pthread.h>
+#include "i915/gem.h"
#include "igt.h"
#include "igt_gt.h"
@@ -25,9 +25,6 @@
*
*/
-#include "igt.h"
-#include "igt_device.h"
-
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
@@ -39,8 +36,11 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/time.h>
-#include "drm.h"
+#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
+#include "igt_device.h"
#define LOCAL_I915_EXEC_VEBOX (4<<0)
#define LOCAL_I915_EXEC_BSD_MASK (3<<13)
@@ -24,6 +24,7 @@
#include <signal.h>
#include <sys/ioctl.h>
+#include "i915/gem.h"
#include "igt.h"
#include "igt_dummyload.h"
#include "sw_sync.h"
@@ -34,12 +34,13 @@
#include <signal.h>
#include <unistd.h>
+#include "i915/gem.h"
+#include "i915/gem_ring.h"
#include "igt.h"
#include "igt_rand.h"
#include "igt_rapl.h"
#include "igt_sysfs.h"
#include "igt_vgem.h"
-#include "i915/gem_ring.h"
#include "sw_sync.h"
#define LO 0
@@ -27,10 +27,12 @@
* Simplest non-NOOP only batch with verification.
*/
+#include <strings.h>
+
+#include "i915/gem.h"
#include "igt.h"
#include "igt_device.h"
#include "igt_gt.h"
-#include <strings.h>
#define LOCAL_I915_EXEC_BSD_SHIFT (13)
#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT)
@@ -30,6 +30,7 @@
#include <fcntl.h>
#include <unistd.h>
+#include "i915/gem.h"
#include "igt.h"
#include "igt_dummyload.h"
#include "igt_gt.h"
@@ -27,6 +27,7 @@
* Pass around a value to write into a scratch buffer between lots of batches
*/
+#include "i915/gem.h"
#include "igt.h"
#include "igt_debugfs.h"
#include "igt_rapl.h"
@@ -30,6 +30,7 @@
#include <inttypes.h>
#include <errno.h>
+#include "i915/gem.h"
#include "igt.h"
IGT_TEST_DESCRIPTION("Test execbuf fence accounting.");
@@ -30,7 +30,6 @@
* workload for the GPGPU pipeline.
*/
-#include "igt.h"
#include <stdbool.h>
#include <unistd.h>
#include <stdlib.h>
@@ -42,7 +41,10 @@
#include <errno.h>
#include <sys/stat.h>
#include <sys/time.h>
+
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
#include "intel_bufmgr.h"
#define WIDTH 64
@@ -25,7 +25,6 @@
*
*/
-#include "igt.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
@@ -40,6 +39,8 @@
#include <sys/wait.h>
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
static const uint32_t canary = 0xdeadbeef;
@@ -33,7 +33,6 @@
* The goal is to simply ensure the basics work.
*/
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -45,6 +44,8 @@
#include <drm.h>
+#include "i915/gem.h"
+#include "igt.h"
IGT_TEST_DESCRIPTION("Test doing many blits with a working set larger than the"
" aperture size.");
@@ -30,7 +30,6 @@
* workload for the Media pipeline.
*/
-#include "igt.h"
#include <stdbool.h>
#include <unistd.h>
#include <stdlib.h>
@@ -42,7 +41,10 @@
#include <errno.h>
#include <sys/stat.h>
#include <sys/time.h>
+
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
#include "intel_bufmgr.h"
IGT_TEST_DESCRIPTION("Basic test for the media_fill() function, a very simple"
@@ -20,7 +20,6 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
-#include "igt.h"
#include <stdbool.h>
#include <unistd.h>
#include <stdlib.h>
@@ -32,7 +31,10 @@
#include <errno.h>
#include <sys/stat.h>
#include <sys/time.h>
+
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
#include "intel_bufmgr.h"
IGT_TEST_DESCRIPTION("A very simple workload for the VME media block.");
@@ -25,7 +25,6 @@
*
*/
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -37,6 +36,8 @@
#include <drm.h>
+#include "i915/gem.h"
+#include "igt.h"
IGT_TEST_DESCRIPTION("Test pwrite/pread consistency when touching partial"
" cachelines.");
@@ -31,7 +31,6 @@
* Writes a counter-value into an always newly allocated target bo (by disabling
* buffer reuse). Decently trashes on tlb inconsistencies, too.
*/
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -40,7 +39,10 @@
#include <errno.h>
#include <sys/stat.h>
#include <sys/time.h>
+
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
#include "intel_bufmgr.h"
IGT_TEST_DESCRIPTION("Test (TLB-)Coherency of pipe_control QW writes.");
@@ -21,7 +21,6 @@
* IN THE SOFTWARE.
*/
-#include "igt.h"
#include <stdbool.h>
#include <unistd.h>
#include <stdlib.h>
@@ -36,8 +35,10 @@
#include <drm.h>
-#include "intel_bufmgr.h"
+#include "i915/gem.h"
+#include "igt.h"
#include "igt_debugfs.h"
+#include "intel_bufmgr.h"
#define WIDTH 512
#define STRIDE (WIDTH*4)
@@ -34,7 +34,6 @@
* ranged-buffer-flush paths in the kernel.
*/
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -46,6 +45,8 @@
#include <drm.h>
+#include "i915/gem.h"
+#include "igt.h"
IGT_TEST_DESCRIPTION("Test pread behavior when getting values out of"
" just-drawn-to buffers.");
@@ -22,7 +22,6 @@
*
*/
-#include "igt.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
@@ -34,7 +33,10 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/time.h>
+
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
IGT_TEST_DESCRIPTION(
"pwrite to a snooped bo then make it uncached and check that the GPU sees the data.");
@@ -26,8 +26,6 @@
* This is a test of performance with multiple readers from the same source.
*/
-#include "igt.h"
-#include "igt_sysfs.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -41,6 +39,9 @@
#include <drm.h>
+#include "i915/gem.h"
+#include "igt.h"
+#include "igt_sysfs.h"
#include "intel_bufmgr.h"
IGT_TEST_DESCRIPTION("Test speed of concurrent reads between engines.");
@@ -29,8 +29,6 @@
* workload for the 3D engine.
*/
-#include "igt.h"
-#include "igt_x86.h"
#include <stdbool.h>
#include <unistd.h>
#include <cairo.h>
@@ -46,6 +44,9 @@
#include <drm.h>
+#include "i915/gem.h"
+#include "igt.h"
+#include "igt_x86.h"
#include "intel_bufmgr.h"
#include "rendercopy_bufmgr.h"
@@ -32,7 +32,6 @@
* the execbuffer interface with a simple render workload.
*/
-#include "igt.h"
#include <stdbool.h>
#include <unistd.h>
#include <stdlib.h>
@@ -47,6 +46,8 @@
#include <drm.h>
+#include "i915/gem.h"
+#include "igt.h"
#include "intel_bufmgr.h"
IGT_TEST_DESCRIPTION("Advanced test for the render_copy() function.");
@@ -35,7 +35,6 @@
#include "config.h"
-#include "igt.h"
#include <stdlib.h>
#include <sys/ioctl.h>
#include <stdio.h>
@@ -48,6 +47,8 @@
#include <drm.h>
+#include "i915/gem.h"
+#include "igt.h"
#include "intel_bufmgr.h"
#define WIDTH 512
@@ -33,7 +33,6 @@
* The goal is to simply ensure the basics work.
*/
-#include "igt.h"
#include <stdlib.h>
#include <sys/ioctl.h>
#include <stdio.h>
@@ -46,6 +45,8 @@
#include <drm.h>
+#include "i915/gem.h"
+#include "igt.h"
#include "intel_bufmgr.h"
#define WIDTH 512
@@ -30,7 +30,6 @@
* Collection of tests targeting request retirement code paths.
*/
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -47,6 +46,8 @@
#include "drm.h"
#include "i915_drm.h"
+#include "i915/gem.h"
+#include "igt.h"
#include "intel_bufmgr.h"
IGT_TEST_DESCRIPTION("Collection of tests targeting request retirement code"
@@ -31,11 +31,12 @@
* catching failure to manage the ring properly near full.
*/
+#include "i915/gem.h"
+#include "i915/gem_ring.h"
#include "igt.h"
#include "igt_device.h"
#include "igt_gt.h"
#include "igt_vgem.h"
-#include "i915/gem_ring.h"
#include <signal.h>
#include <sys/ioctl.h>
@@ -44,7 +44,6 @@
* transitions (i.e. changing stride).
*/
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -54,7 +53,10 @@
#include <sys/stat.h>
#include <sys/time.h>
#include <stdbool.h>
+
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
#include "intel_bufmgr.h"
IGT_TEST_DESCRIPTION("Check for proper synchronization of tiling changes vs."
@@ -27,6 +27,7 @@
* Exercise the shrinker by overallocating GEM objects
*/
+#include "i915/gem.h"
#include "igt.h"
#include "igt_gt.h"
#include "igt_debugfs.h"
@@ -26,6 +26,7 @@
*
*/
+#include "i915/gem.h"
#include "igt.h"
#define EXEC_OBJECT_PINNED (1<<4)
@@ -22,6 +22,7 @@
*
*/
+#include "i915/gem.h"
#include "igt.h"
#define MAX_ERROR 5 /* % */
@@ -25,7 +25,6 @@
*
*/
-#include "igt.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
@@ -36,7 +35,10 @@
#include <errno.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
+
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
#define OBJECT_SIZE 1024*1024
#define CHUNK_SIZE 32
@@ -24,6 +24,7 @@
#include <time.h>
#include <pthread.h>
+#include "i915/gem.h"
#include "igt_debugfs.h"
#include "igt_dummyload.h"
#include "igt_gt.h"
@@ -41,7 +41,6 @@
* resulted.
*/
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -53,6 +52,8 @@
#include <drm.h>
+#include "i915/gem.h"
+#include "igt.h"
IGT_TEST_DESCRIPTION("Test doing many tiled blits, with a working set larger"
" than the aperture size.");
@@ -41,6 +41,7 @@
* resulted.
*/
+#include "i915/gem.h"
#include "igt.h"
#include "igt_x86.h"
@@ -25,7 +25,6 @@
*
*/
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -37,6 +36,8 @@
#include <drm.h>
+#include "i915/gem.h"
+#include "igt.h"
IGT_TEST_DESCRIPTION("Test pwrite/pread consistency when touching partial"
" cachelines.");
@@ -38,7 +38,6 @@
* problem - the race window is too small.
*/
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -48,7 +47,10 @@
#include <sys/stat.h>
#include <sys/time.h>
#include <stdbool.h>
+
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
#include "intel_bufmgr.h"
IGT_TEST_DESCRIPTION("Check for use-after-free in the fence stealing code.");
@@ -32,7 +32,6 @@
* will be the last one to hold a reference on them. Usually libdrm bo caching
* prevents that by keeping another reference.
*/
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -41,7 +40,10 @@
#include <errno.h>
#include <sys/stat.h>
#include <sys/time.h>
+
#include "drm.h"
+#include "i915/gem.h"
+#include "igt.h"
#include "intel_bufmgr.h"
IGT_TEST_DESCRIPTION("Test unreferencing of active buffers.");
@@ -38,7 +38,6 @@
#include <linux/userfaultfd.h>
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -61,6 +60,8 @@
#include "drm.h"
#include "i915_drm.h"
+#include "i915/gem.h"
+#include "igt.h"
#include "intel_bufmgr.h"
#include "eviction_common.c"
@@ -21,9 +21,10 @@
* IN THE SOFTWARE.
*/
+#include "i915/gem.h"
+#include "i915/gem_vm.h"
#include "igt.h"
#include "igt_dummyload.h"
-#include "i915/gem_vm.h"
static int vm_create_ioctl(int i915, struct drm_i915_gem_vm_control *ctl)
{
@@ -27,6 +27,7 @@
#include <sys/poll.h>
+#include "i915/gem.h"
#include "igt.h"
#include "igt_vgem.h"
@@ -25,10 +25,11 @@
*
*/
-#include "igt.h"
-
#include <fcntl.h>
+#include "i915/gem.h"
+#include "igt.h"
+
#define PAGE_SIZE 4096
#define PAGE_ALIGN(x) ALIGN(x, PAGE_SIZE)
@@ -33,7 +33,6 @@
* The goal is to simply ensure the basics work.
*/
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -43,9 +42,11 @@
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/ioctl.h>
-#include "drm.h"
+#include "drm.h"
+#include "i915/gem.h"
#include "i915_reg.h"
+#include "igt.h"
#define WIDTH (512)
#define HEIGHT (512)
@@ -33,7 +33,6 @@
* The goal is to simply ensure the basics work.
*/
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -42,9 +41,11 @@
#include <errno.h>
#include <sys/stat.h>
#include <sys/time.h>
-#include "drm.h"
+#include "drm.h"
+#include "i915/gem.h"
#include "i915_reg.h"
+#include "igt.h"
#define WIDTH 512
#define HEIGHT 512
@@ -33,7 +33,6 @@
* The goal is to simply ensure the basics work.
*/
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -43,9 +42,11 @@
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/ioctl.h>
-#include "drm.h"
+#include "drm.h"
+#include "i915/gem.h"
#include "i915_reg.h"
+#include "igt.h"
#define WIDTH 512
#define HEIGHT 512
@@ -33,7 +33,6 @@
* The goal is to simply ensure the basics work.
*/
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -43,9 +42,11 @@
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/ioctl.h>
-#include "drm.h"
+#include "drm.h"
+#include "i915/gem.h"
#include "i915_reg.h"
+#include "igt.h"
#define WIDTH 512
#define HEIGHT 512
@@ -33,7 +33,6 @@
* The goal is to simply ensure the basics work.
*/
-#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -45,7 +44,9 @@
#include <sys/ioctl.h>
#include "drm.h"
+#include "i915/gem.h"
#include "i915_reg.h"
+#include "igt.h"
#define WIDTH 512
#define HEIGHT 512
@@ -22,7 +22,6 @@
*
*/
-#include "igt.h"
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
@@ -30,6 +29,8 @@
#include <drm.h>
+#include "igt.h"
+#include "i915/gem.h"
#include "sw_sync.h"
#define DERRMR 0x44050
@@ -28,8 +28,9 @@
#include <stdio.h>
#include <stdlib.h>
-#include "igt.h"
+#include "i915/gem.h"
#include "i915/gem_submission.h"
+#include "igt.h"
#include "sw_sync.h"
/* To help craft commands known to be invalid across all engines */
@@ -26,12 +26,13 @@
*
*/
-#include "igt.h"
#include <limits.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include "i915/gem.h"
+#include "igt.h"
#include "igt_sysfs.h"
#include "igt_debugfs.h"
@@ -33,6 +33,7 @@
#include <errno.h>
#include <time.h>
+#include "i915/gem.h"
#include "igt.h"
#include "igt_perf.h"
#include "igt_rapl.h"
@@ -45,6 +45,7 @@
#include <drm.h>
+#include "i915/gem.h"
#include "igt.h"
#include "igt_kmod.h"
#include "igt_sysfs.h"
@@ -36,6 +36,7 @@
#include <time.h>
#include <sys/wait.h>
+#include "i915/gem.h"
#include "igt.h"
#include "igt_dummyload.h"
#include "igt_sysfs.h"
@@ -24,13 +24,16 @@
* Jeff McGee <jeff.mcgee@intel.com>
*/
-#include "igt.h"
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <time.h>
+
#include "i915_drm.h"
+
+#include "i915/gem.h"
+#include "igt.h"
#include "intel_bufmgr.h"
IGT_TEST_DESCRIPTION("Tests slice/subslice/EU power gating functionality.\n");
@@ -32,6 +32,7 @@
#include <unistd.h>
#include "drmtest.h" /* gem_quiescent_gpu()! */
+#include "i915/gem.h"
#include "i915/gem_engine_topology.h"
#include "igt_dummyload.h"
#include "igt_sysfs.h"
@@ -30,14 +30,14 @@
#include <unistd.h>
#include "drmtest.h" /* gem_quiescent_gpu()! */
+#include "i915/gem.h"
#include "i915/gem_engine_topology.h"
+#include "igt_debugfs.h"
#include "igt_dummyload.h"
#include "igt_sysfs.h"
#include "ioctl_wrappers.h" /* igt_require_gem()! */
#include "sw_sync.h"
-#include "igt_debugfs.h"
-
#define ATTR "preempt_timeout_ms"
#define RESET_TIMEOUT 50 /* milliseconds, at least one jiffie for kworker */
@@ -30,13 +30,14 @@
#include <unistd.h>
#include "drmtest.h" /* gem_quiescent_gpu()! */
+#include "i915/gem.h"
#include "i915/gem_engine_topology.h"
#include "i915/gem_mman.h"
#include "igt_dummyload.h"
#include "igt_sysfs.h"
-#include "ioctl_wrappers.h" /* igt_require_gem()! */
#include "intel_chipset.h"
#include "intel_reg.h"
+#include "ioctl_wrappers.h" /* igt_require_gem()! */
#include "sw_sync.h"
#define ATTR "timeslice_duration_ms"
@@ -21,12 +21,13 @@
* IN THE SOFTWARE.
*/
-#include "igt.h"
-
#include <sys/poll.h>
#include <signal.h>
#include <time.h>
+#include "i915/gem.h"
+#include "igt.h"
+
IGT_TEST_DESCRIPTION("Basic check of KMS ABI with busy framebuffers.");
static igt_output_t *
@@ -25,6 +25,7 @@
#include <sched.h>
#include <sys/poll.h>
+#include "i915/gem.h"
#include "igt.h"
#include "igt_rand.h"
#include "igt_stats.h"
@@ -24,6 +24,7 @@
/* This program tests whether the igt_draw library actually works. */
+#include "i915/gem.h"
#include "igt.h"
#define MAX_CONNECTORS 32
@@ -22,13 +22,14 @@
*
*/
-#include "igt.h"
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
+#include "i915/gem.h"
+#include "igt.h"
IGT_TEST_DESCRIPTION("Exercises full ppgtt fence pin_count leak in the "
"kernel.");
@@ -24,12 +24,14 @@
* Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
*/
-#include "igt.h"
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
+#include "i915/gem.h"
+#include "igt.h"
+
IGT_TEST_DESCRIPTION("Test page flips and tiling scenarios");
typedef struct {
@@ -24,15 +24,16 @@
*
*/
-#include "igt.h"
-#include "igt_sysfs.h"
-#include "igt_psr.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <poll.h>
#include <pthread.h>
+#include "i915/gem.h"
+#include "igt.h"
+#include "igt_sysfs.h"
+#include "igt_psr.h"
IGT_TEST_DESCRIPTION("Test the Kernel's frontbuffer tracking mechanism and "
"its related features: FBC, PSR and DRRS");
@@ -38,9 +38,10 @@
#include <poll.h>
#include <math.h>
+#include "i915/gem.h"
+#include "i915/perf.h"
#include "igt.h"
#include "igt_sysfs.h"
-#include "i915/perf.h"
#include "drm.h"
IGT_TEST_DESCRIPTION("Test the i915 perf metrics streaming interface");
@@ -38,6 +38,8 @@
#include <poll.h>
#include <sched.h>
+#include "i915/gem.h"
+#include "i915/gem_ring.h"
#include "igt.h"
#include "igt_core.h"
#include "igt_device.h"
@@ -45,7 +47,6 @@
#include "igt_perf.h"
#include "igt_sysfs.h"
#include "igt_pm.h"
-#include "i915/gem_ring.h"
#include "sw_sync.h"
IGT_TEST_DESCRIPTION("Test the i915 pmu perf interface");
@@ -21,10 +21,11 @@
* IN THE SOFTWARE.
*/
-#include "igt.h"
-
#include <sys/poll.h>
+#include "i915/gem.h"
+#include "igt.h"
+
IGT_TEST_DESCRIPTION("Basic check of polling for prime fences.");
static bool prime_busy(struct pollfd *pfd, bool excl)
@@ -29,6 +29,7 @@
* TODO: need to show the need for prime_sync_end().
*/
+#include "i915/gem.h"
#include "igt.h"
IGT_TEST_DESCRIPTION("Test dma-buf mmap on !llc platforms mostly and provoke"
@@ -21,13 +21,13 @@
* IN THE SOFTWARE.
*/
-#include "igt.h"
-#include "igt_vgem.h"
-
#include <sys/ioctl.h>
#include <sys/poll.h>
#include <time.h>
+#include "i915/gem.h"
+#include "igt.h"
+#include "igt_vgem.h"
#include "intel_batchbuffer.h" /* igt_blitter_src_copy() */
IGT_TEST_DESCRIPTION("Basic check of polling for prime/vgem fences.");
igt_require_gem() is a pecularity of i915/, move it out of the core. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> --- lib/Makefile.sources | 2 + lib/i915/gem.c | 80 +++++++++++++++++++++ lib/i915/gem.h | 30 ++++++++ lib/i915/gem_vm.h | 1 + lib/igt_dummyload.c | 11 +-- lib/igt_gt.c | 3 +- lib/ioctl_wrappers.c | 49 ------------- lib/ioctl_wrappers.h | 1 - lib/meson.build | 1 + tests/amdgpu/amd_prime.c | 7 +- tests/core_hotunplug.c | 1 + tests/debugfs_test.c | 2 + tests/i915/gem_bad_blit.c | 4 +- tests/i915/gem_bad_reloc.c | 4 +- tests/i915/gem_blits.c | 1 + tests/i915/gem_busy.c | 3 +- tests/i915/gem_caching.c | 3 +- tests/i915/gem_close.c | 1 + tests/i915/gem_close_race.c | 4 +- tests/i915/gem_concurrent_all.c | 5 +- tests/i915/gem_cs_prefetch.c | 1 + tests/i915/gem_cs_tlb.c | 4 +- tests/i915/gem_ctx_clone.c | 5 +- tests/i915/gem_ctx_create.c | 4 +- tests/i915/gem_ctx_engines.c | 4 +- tests/i915/gem_ctx_exec.c | 3 +- tests/i915/gem_ctx_freq.c | 1 + tests/i915/gem_ctx_isolation.c | 1 + tests/i915/gem_ctx_persistence.c | 1 + tests/i915/gem_ctx_ringsize.c | 1 + tests/i915/gem_ctx_shared.c | 4 +- tests/i915/gem_ctx_sseu.c | 4 +- tests/i915/gem_ctx_switch.c | 4 +- tests/i915/gem_ctx_thrash.c | 6 +- tests/i915/gem_eio.c | 3 +- tests/i915/gem_evict_alignment.c | 3 +- tests/i915/gem_evict_everything.c | 4 +- tests/i915/gem_exec_alignment.c | 3 +- tests/i915/gem_exec_async.c | 1 + tests/i915/gem_exec_await.c | 9 +-- tests/i915/gem_exec_bad_domains.c | 4 +- tests/i915/gem_exec_balancer.c | 3 +- tests/i915/gem_exec_big.c | 4 +- tests/i915/gem_exec_capture.c | 1 + tests/i915/gem_exec_create.c | 4 +- tests/i915/gem_exec_fence.c | 11 +-- tests/i915/gem_exec_flush.c | 1 + tests/i915/gem_exec_gttfill.c | 1 + tests/i915/gem_exec_latency.c | 3 +- tests/i915/gem_exec_lut_handle.c | 4 +- tests/i915/gem_exec_nop.c | 12 ++-- tests/i915/gem_exec_parallel.c | 1 + tests/i915/gem_exec_params.c | 8 +-- tests/i915/gem_exec_reloc.c | 1 + tests/i915/gem_exec_schedule.c | 3 +- tests/i915/gem_exec_store.c | 4 +- tests/i915/gem_exec_suspend.c | 1 + tests/i915/gem_exec_whisper.c | 1 + tests/i915/gem_fenced_exec_thrash.c | 1 + tests/i915/gem_gpgpu_fill.c | 4 +- tests/i915/gem_gtt_hog.c | 3 +- tests/i915/gem_linear_blits.c | 3 +- tests/i915/gem_media_fill.c | 4 +- tests/i915/gem_media_vme.c | 4 +- tests/i915/gem_partial_pwrite_pread.c | 3 +- tests/i915/gem_pipe_control_store_loop.c | 4 +- tests/i915/gem_ppgtt.c | 5 +- tests/i915/gem_pread_after_blit.c | 3 +- tests/i915/gem_pwrite_snooped.c | 4 +- tests/i915/gem_read_read_speed.c | 5 +- tests/i915/gem_render_copy.c | 5 +- tests/i915/gem_render_copy_redux.c | 3 +- tests/i915/gem_render_linear_blits.c | 3 +- tests/i915/gem_render_tiled_blits.c | 3 +- tests/i915/gem_request_retire.c | 3 +- tests/i915/gem_ringfill.c | 3 +- tests/i915/gem_set_tiling_vs_blt.c | 4 +- tests/i915/gem_shrink.c | 1 + tests/i915/gem_softpin.c | 1 + tests/i915/gem_spin_batch.c | 1 + tests/i915/gem_streaming_writes.c | 4 +- tests/i915/gem_sync.c | 1 + tests/i915/gem_tiled_blits.c | 3 +- tests/i915/gem_tiled_fence_blits.c | 1 + tests/i915/gem_tiled_partial_pwrite_pread.c | 3 +- tests/i915/gem_unfence_active_buffers.c | 4 +- tests/i915/gem_unref_active_buffers.c | 4 +- tests/i915/gem_userptr_blits.c | 3 +- tests/i915/gem_vm_create.c | 3 +- tests/i915/gem_wait.c | 1 + tests/i915/gem_workarounds.c | 5 +- tests/i915/gen3_mixed_blits.c | 5 +- tests/i915/gen3_render_linear_blits.c | 5 +- tests/i915/gen3_render_mixed_blits.c | 5 +- tests/i915/gen3_render_tiledx_blits.c | 5 +- tests/i915/gen3_render_tiledy_blits.c | 3 +- tests/i915/gen7_exec_parse.c | 3 +- tests/i915/gen9_exec_parse.c | 3 +- tests/i915/i915_hangman.c | 3 +- tests/i915/i915_pm_rc6_residency.c | 1 + tests/i915/i915_pm_rpm.c | 1 + tests/i915/i915_pm_rps.c | 1 + tests/i915/i915_pm_sseu.c | 5 +- tests/i915/sysfs_heartbeat_interval.c | 1 + tests/i915/sysfs_preempt_timeout.c | 4 +- tests/i915/sysfs_timeslice_duration.c | 3 +- tests/kms_busy.c | 5 +- tests/kms_cursor_legacy.c | 1 + tests/kms_draw_crc.c | 1 + tests/kms_fence_pin_leak.c | 3 +- tests/kms_flip_tiling.c | 4 +- tests/kms_frontbuffer_tracking.c | 7 +- tests/perf.c | 3 +- tests/perf_pmu.c | 3 +- tests/prime_busy.c | 5 +- tests/prime_mmap_coherency.c | 1 + tests/prime_vgem.c | 6 +- 117 files changed, 365 insertions(+), 170 deletions(-) create mode 100644 lib/i915/gem.c create mode 100644 lib/i915/gem.h