summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2014-03-22 21:07:37 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-03-22 21:07:37 +0100
commite49ceb869056255b8b6b94720b2279f6de88c893 (patch)
treecd146872fc8d5fe8f693890e0abc424ac2698255
parent924115bfcd5beae84f2e2d6b266c619659185475 (diff)
lib: unnecessary header removal for drmtest.h, part 1
Brought a few missing headers to light in ioctl_wrappers.h, too. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--benchmarks/intel_upload_blit_large.c1
-rw-r--r--benchmarks/intel_upload_blit_large_gtt.c1
-rw-r--r--benchmarks/intel_upload_blit_large_map.c1
-rw-r--r--benchmarks/intel_upload_blit_small.c1
-rw-r--r--demos/intel_sprite_on.c7
-rw-r--r--lib/drmtest.c1
-rw-r--r--lib/drmtest.h7
-rw-r--r--lib/igt_debugfs.c1
-rw-r--r--lib/igt_kms.c1
-rw-r--r--lib/ioctl_wrappers.h5
-rw-r--r--lib/rendercopy_gen7.c1
-rw-r--r--tests/core_get_client_auth.c2
-rw-r--r--tests/drm_vma_limiter.c3
-rw-r--r--tests/drm_vma_limiter_cached.c3
-rw-r--r--tests/drm_vma_limiter_cpu.c3
-rw-r--r--tests/drm_vma_limiter_gtt.c3
-rw-r--r--tests/drv_suspend.c2
-rw-r--r--tests/gem_bad_address.c3
-rw-r--r--tests/gem_bad_batch.c3
-rw-r--r--tests/gem_bad_blit.c3
-rw-r--r--tests/gem_bad_length.c2
-rw-r--r--tests/gem_basic.c2
-rw-r--r--tests/gem_caching.c3
-rw-r--r--tests/gem_close_race.c3
-rw-r--r--tests/gem_concurrent_blit.c3
-rw-r--r--tests/gem_cpu_reloc.c3
-rw-r--r--tests/gem_cs_prefetch.c3
-rw-r--r--tests/gem_cs_tlb.c2
-rw-r--r--tests/gem_ctx_bad_destroy.c2
-rw-r--r--tests/gem_ctx_bad_exec.c2
-rw-r--r--tests/gem_ctx_basic.c3
-rw-r--r--tests/gem_ctx_create.c2
-rw-r--r--tests/gem_ctx_exec.c2
-rw-r--r--tests/gem_double_irq_loop.c3
-rw-r--r--tests/gem_dummy_reloc_loop.c3
-rw-r--r--tests/gem_evict_alignment.c3
-rw-r--r--tests/gem_evict_everything.c3
-rw-r--r--tests/gem_exec_bad_domains.c3
-rw-r--r--tests/gem_exec_big.c2
-rw-r--r--tests/gem_exec_blt.c2
-rw-r--r--tests/gem_exec_faulting_reloc.c2
-rw-r--r--tests/gem_exec_lut_handle.c2
-rw-r--r--tests/gem_exec_nop.c2
-rw-r--r--tests/gem_fd_exhaustion.c1
-rw-r--r--tests/gem_fence_thrash.c2
-rw-r--r--tests/gem_fenced_exec_thrash.c3
-rw-r--r--tests/gem_flink.c2
-rw-r--r--tests/gem_flink_race.c2
-rw-r--r--tests/gem_gtt_cpu_tlb.c2
-rw-r--r--tests/gem_gtt_hog.c3
-rw-r--r--tests/gem_gtt_speed.c2
-rw-r--r--tests/gem_hang.c3
-rw-r--r--tests/gem_hangcheck_forcewake.c3
-rw-r--r--tests/gem_largeobject.c2
-rw-r--r--tests/gem_linear_blits.c3
-rw-r--r--tests/gem_lut_handle.c2
-rw-r--r--tests/gem_madvise.c2
-rw-r--r--tests/gem_media_fill.c3
-rw-r--r--tests/gem_mmap.c2
-rw-r--r--tests/gem_mmap_gtt.c2
-rw-r--r--tests/gem_mmap_offset_exhaustion.c2
-rw-r--r--tests/gem_non_secure_batch.c3
-rw-r--r--tests/gem_partial_pwrite_pread.c3
-rw-r--r--tests/gem_persistent_relocs.c3
-rw-r--r--tests/gem_pin.c2
-rw-r--r--tests/gem_pipe_control_store_loop.c3
-rw-r--r--tests/gem_pread.c2
-rw-r--r--tests/gem_pread_after_blit.c3
-rw-r--r--tests/gem_pwrite.c2
-rw-r--r--tests/gem_pwrite_pread.c3
-rw-r--r--tests/gem_readwrite.c2
-rw-r--r--tests/gem_reg_read.c2
-rw-r--r--tests/gem_reloc_overflow.c3
-rw-r--r--tests/gem_reloc_vs_gpu.c3
-rw-r--r--tests/gem_render_copy.c3
-rw-r--r--tests/gem_render_linear_blits.c4
-rw-r--r--tests/gem_render_tiled_blits.c3
-rw-r--r--tests/gem_reset_stats.c3
-rw-r--r--tests/gem_ring_sync_copy.c3
-rw-r--r--tests/gem_ring_sync_loop.c3
-rw-r--r--tests/gem_ringfill.c3
-rw-r--r--tests/gem_seqno_wrap.c3
-rw-r--r--tests/gem_set_tiling_vs_blt.c3
-rw-r--r--tests/gem_set_tiling_vs_gtt.c3
-rw-r--r--tests/gem_set_tiling_vs_pwrite.c2
-rw-r--r--tests/gem_storedw_batches_loop.c3
-rw-r--r--tests/gem_storedw_loop_blt.c3
-rw-r--r--tests/gem_storedw_loop_bsd.c3
-rw-r--r--tests/gem_storedw_loop_render.c3
-rw-r--r--tests/gem_storedw_loop_vebox.c3
-rw-r--r--tests/gem_stress.c3
-rw-r--r--tests/gem_threaded_access_tiled.c2
-rw-r--r--tests/gem_tiled_blits.c3
-rw-r--r--tests/gem_tiled_fence_blits.c3
-rw-r--r--tests/gem_tiled_partial_pwrite_pread.c3
-rw-r--r--tests/gem_tiled_pread.c3
-rw-r--r--tests/gem_tiled_pread_pwrite.c2
-rw-r--r--tests/gem_tiled_swapping.c2
-rw-r--r--tests/gem_tiling_max_stride.c3
-rw-r--r--tests/gem_unfence_active_buffers.c3
-rw-r--r--tests/gem_unref_active_buffers.c3
-rw-r--r--tests/gem_vmap_blits.c2
-rw-r--r--tests/gem_wait_render_timeout.c3
-rw-r--r--tests/gem_write_read_ring_switch.c3
-rw-r--r--tests/gen3_mixed_blits.c3
-rw-r--r--tests/gen3_render_linear_blits.c3
-rw-r--r--tests/gen3_render_mixed_blits.c3
-rw-r--r--tests/gen3_render_tiledx_blits.c3
-rw-r--r--tests/gen3_render_tiledy_blits.c3
-rw-r--r--tests/gen7_forcewake_mt.c3
-rw-r--r--tests/kms_addfb.c2
-rw-r--r--tests/kms_fbc_crc.c4
-rw-r--r--tests/kms_flip.c6
-rw-r--r--tests/kms_render.c5
-rw-r--r--tests/pm_lpsp.c2
-rw-r--r--tests/pm_pc8.c3
-rw-r--r--tests/pm_rps.c3
-rw-r--r--tests/prime_nv_api.c1
-rw-r--r--tests/prime_nv_pcopy.c3
-rw-r--r--tests/prime_nv_test.c3
-rw-r--r--tests/prime_self_import.c2
-rw-r--r--tests/prime_udl.c3
-rw-r--r--tests/testdisplay.c2
-rw-r--r--tools/intel_perf_counters.c1
124 files changed, 208 insertions, 120 deletions
diff --git a/benchmarks/intel_upload_blit_large.c b/benchmarks/intel_upload_blit_large.c
index 4d1b66f2..b44433f9 100644
--- a/benchmarks/intel_upload_blit_large.c
+++ b/benchmarks/intel_upload_blit_large.c
@@ -59,6 +59,7 @@
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
#define OBJECT_WIDTH 1280
#define OBJECT_HEIGHT 720
diff --git a/benchmarks/intel_upload_blit_large_gtt.c b/benchmarks/intel_upload_blit_large_gtt.c
index 6f864cbd..49107102 100644
--- a/benchmarks/intel_upload_blit_large_gtt.c
+++ b/benchmarks/intel_upload_blit_large_gtt.c
@@ -59,6 +59,7 @@
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
#define OBJECT_WIDTH 1280
#define OBJECT_HEIGHT 720
diff --git a/benchmarks/intel_upload_blit_large_map.c b/benchmarks/intel_upload_blit_large_map.c
index 97b825dd..93433fc9 100644
--- a/benchmarks/intel_upload_blit_large_map.c
+++ b/benchmarks/intel_upload_blit_large_map.c
@@ -62,6 +62,7 @@
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
#define OBJECT_WIDTH 1280
#define OBJECT_HEIGHT 720
diff --git a/benchmarks/intel_upload_blit_small.c b/benchmarks/intel_upload_blit_small.c
index 3fd095f3..e2f804bb 100644
--- a/benchmarks/intel_upload_blit_small.c
+++ b/benchmarks/intel_upload_blit_small.c
@@ -55,6 +55,7 @@
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
/* Happens to be 128k, the size of the VBOs used by i965's Mesa driver. */
#define OBJECT_WIDTH 256
diff --git a/demos/intel_sprite_on.c b/demos/intel_sprite_on.c
index 98c0af91..fb375f4f 100644
--- a/demos/intel_sprite_on.c
+++ b/demos/intel_sprite_on.c
@@ -47,10 +47,9 @@
#include "drmtest.h"
#include "igt_kms.h"
-#if defined(DRM_IOCTL_MODE_ADDFB2) && defined(DRM_I915_SET_SPRITE_COLORKEY)
-#define TEST_PLANES 1
-#include "drm_fourcc.h"
-#endif
+#include <drm_fourcc.h>
+
+#include "ioctl_wrappers.h"
/*
* Mode setting with the kernel interfaces is a bit of a chore.
diff --git a/lib/drmtest.c b/lib/drmtest.c
index 112f0497..c6f7bdeb 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -56,6 +56,7 @@
#include "../version.h"
#include "config.h"
#include "intel_reg.h"
+#include "ioctl_wrappers.h"
/* This file contains a bunch of wrapper functions to directly use gem ioctls.
* Mostly useful to write kernel tests. */
diff --git a/lib/drmtest.h b/lib/drmtest.h
index d048ee09..4c55068e 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -33,18 +33,11 @@
#include <unistd.h>
#include <errno.h>
#include <stdbool.h>
-#include <setjmp.h>
#include <sys/mman.h>
#include "xf86drm.h"
#include "xf86drmMode.h"
-#include "i915_drm.h"
#include "intel_batchbuffer.h"
-#include "intel_chipset.h"
-#include "intel_gpu_tools.h"
-
-#include "ioctl_wrappers.h"
-#include "igt_core.h"
#ifdef ANDROID
#ifndef HAVE_MMAP64
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 05036fc0..f467ce0f 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -22,6 +22,7 @@
*
*/
+#include <inttypes.h>
#include <sys/stat.h>
#include <sys/mount.h>
#include <errno.h>
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index ac27d7ae..88ee83be 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -34,6 +34,7 @@
#include "drmtest.h"
#include "igt_kms.h"
+#include "ioctl_wrappers.h"
/* helpers to create nice-looking framebuffers */
static int create_bo_for_fb(int fd, int width, int height, int bpp,
diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
index 6e3eb0f2..8ca21814 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -30,6 +30,11 @@
#ifndef IOCTL_WRAPPERS_H
#define IOCTL_WRAPPERS_H
+#include <stdint.h>
+#include <stdbool.h>
+#include <intel_bufmgr.h>
+#include <i915_drm.h>
+
/* libdrm interfacing */
drm_intel_bo * gem_handle_to_libdrm_bo(drm_intel_bufmgr *bufmgr, int fd,
const char *name, uint32_t handle);
diff --git a/lib/rendercopy_gen7.c b/lib/rendercopy_gen7.c
index 05e68293..75e05716 100644
--- a/lib/rendercopy_gen7.c
+++ b/lib/rendercopy_gen7.c
@@ -16,6 +16,7 @@
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
#include "rendercopy.h"
#include "gen7_render.h"
#include "intel_reg.h"
diff --git a/tests/core_get_client_auth.c b/tests/core_get_client_auth.c
index 566a6580..eef97e02 100644
--- a/tests/core_get_client_auth.c
+++ b/tests/core_get_client_auth.c
@@ -40,7 +40,7 @@
# include <sys/syscall.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
/* Checks whether the thread id is the current thread */
diff --git a/tests/drm_vma_limiter.c b/tests/drm_vma_limiter.c
index b38037ad..f14ced8c 100644
--- a/tests/drm_vma_limiter.c
+++ b/tests/drm_vma_limiter.c
@@ -33,11 +33,12 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
static drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
diff --git a/tests/drm_vma_limiter_cached.c b/tests/drm_vma_limiter_cached.c
index 3a78436d..7c40541c 100644
--- a/tests/drm_vma_limiter_cached.c
+++ b/tests/drm_vma_limiter_cached.c
@@ -33,11 +33,12 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
static drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
diff --git a/tests/drm_vma_limiter_cpu.c b/tests/drm_vma_limiter_cpu.c
index 77a50b1d..4da46737 100644
--- a/tests/drm_vma_limiter_cpu.c
+++ b/tests/drm_vma_limiter_cpu.c
@@ -33,11 +33,12 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
static drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
diff --git a/tests/drm_vma_limiter_gtt.c b/tests/drm_vma_limiter_gtt.c
index 5104b0da..283bf6b4 100644
--- a/tests/drm_vma_limiter_gtt.c
+++ b/tests/drm_vma_limiter_gtt.c
@@ -33,11 +33,12 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
static drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
diff --git a/tests/drv_suspend.c b/tests/drv_suspend.c
index ff8a348b..ed393af4 100644
--- a/tests/drv_suspend.c
+++ b/tests/drv_suspend.c
@@ -35,7 +35,7 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "igt_debugfs.h"
diff --git a/tests/gem_bad_address.c b/tests/gem_bad_address.c
index 6e5f0254..58819357 100644
--- a/tests/gem_bad_address.c
+++ b/tests/gem_bad_address.c
@@ -35,9 +35,10 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
+#include "intel_chipset.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
diff --git a/tests/gem_bad_batch.c b/tests/gem_bad_batch.c
index abeda881..5bb08b44 100644
--- a/tests/gem_bad_batch.c
+++ b/tests/gem_bad_batch.c
@@ -35,10 +35,11 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
+#include "intel_chipset.h"
#include "intel_gpu_tools.h"
static drm_intel_bufmgr *bufmgr;
diff --git a/tests/gem_bad_blit.c b/tests/gem_bad_blit.c
index c518b4fd..ec414eaf 100644
--- a/tests/gem_bad_blit.c
+++ b/tests/gem_bad_blit.c
@@ -50,10 +50,11 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
+#include "intel_chipset.h"
#include "intel_gpu_tools.h"
static drm_intel_bufmgr *bufmgr;
diff --git a/tests/gem_bad_length.c b/tests/gem_bad_length.c
index ae48d552..4b93cdeb 100644
--- a/tests/gem_bad_length.c
+++ b/tests/gem_bad_length.c
@@ -35,7 +35,7 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
/*
diff --git a/tests/gem_basic.c b/tests/gem_basic.c
index 5d8f8406..71d29ae7 100644
--- a/tests/gem_basic.c
+++ b/tests/gem_basic.c
@@ -35,7 +35,7 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
static void
diff --git a/tests/gem_caching.c b/tests/gem_caching.c
index d788891b..da6f2d8f 100644
--- a/tests/gem_caching.c
+++ b/tests/gem_caching.c
@@ -35,11 +35,12 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
/*
* Testcase: snoop consistency when touching partial cachelines
diff --git a/tests/gem_close_race.c b/tests/gem_close_race.c
index 2087fed6..e46e2c15 100644
--- a/tests/gem_close_race.c
+++ b/tests/gem_close_race.c
@@ -38,8 +38,9 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
+#include "intel_chipset.h"
#define OBJECT_SIZE 1024*1024*4
diff --git a/tests/gem_concurrent_blit.c b/tests/gem_concurrent_blit.c
index 254bc4c2..29f42c7d 100644
--- a/tests/gem_concurrent_blit.c
+++ b/tests/gem_concurrent_blit.c
@@ -45,11 +45,12 @@
#include <sys/time.h>
#include <sys/wait.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
static void
prw_set_bo(drm_intel_bo *bo, uint32_t val, int width, int height)
diff --git a/tests/gem_cpu_reloc.c b/tests/gem_cpu_reloc.c
index 6e1f8886..77d9109e 100644
--- a/tests/gem_cpu_reloc.c
+++ b/tests/gem_cpu_reloc.c
@@ -54,11 +54,12 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
static uint32_t use_blt;
diff --git a/tests/gem_cs_prefetch.c b/tests/gem_cs_prefetch.c
index 9ff65732..842e4276 100644
--- a/tests/gem_cs_prefetch.c
+++ b/tests/gem_cs_prefetch.c
@@ -44,11 +44,12 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
static drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
diff --git a/tests/gem_cs_tlb.c b/tests/gem_cs_tlb.c
index 6f1fd5b5..7d5c99dc 100644
--- a/tests/gem_cs_tlb.c
+++ b/tests/gem_cs_tlb.c
@@ -47,7 +47,7 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_gpu_tools.h"
diff --git a/tests/gem_ctx_bad_destroy.c b/tests/gem_ctx_bad_destroy.c
index 3fcc946e..092f3422 100644
--- a/tests/gem_ctx_bad_destroy.c
+++ b/tests/gem_ctx_bad_destroy.c
@@ -31,7 +31,7 @@
#include <stdio.h>
#include <string.h>
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
struct local_drm_i915_context_destroy {
diff --git a/tests/gem_ctx_bad_exec.c b/tests/gem_ctx_bad_exec.c
index 834b5fe3..f0bb0fc9 100644
--- a/tests/gem_ctx_bad_exec.c
+++ b/tests/gem_ctx_bad_exec.c
@@ -42,7 +42,7 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
/* Copied from gem_exec_nop.c */
diff --git a/tests/gem_ctx_basic.c b/tests/gem_ctx_basic.c
index 4340000e..3dbef2bd 100644
--- a/tests/gem_ctx_basic.c
+++ b/tests/gem_ctx_basic.c
@@ -41,11 +41,12 @@
#include <sys/time.h>
#include <getopt.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
/* options */
int num_contexts = 10;
diff --git a/tests/gem_ctx_create.c b/tests/gem_ctx_create.c
index d7a45387..f32c2287 100644
--- a/tests/gem_ctx_create.c
+++ b/tests/gem_ctx_create.c
@@ -27,7 +27,7 @@
#include <stdio.h>
#include <string.h>
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
struct local_drm_i915_gem_context_create {
diff --git a/tests/gem_ctx_exec.c b/tests/gem_ctx_exec.c
index 8a20181b..3afa7652 100644
--- a/tests/gem_ctx_exec.c
+++ b/tests/gem_ctx_exec.c
@@ -41,7 +41,7 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
struct local_drm_i915_gem_context_destroy {
diff --git a/tests/gem_double_irq_loop.c b/tests/gem_double_irq_loop.c
index 47784add..f5c76296 100644
--- a/tests/gem_double_irq_loop.c
+++ b/tests/gem_double_irq_loop.c
@@ -34,12 +34,13 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
#include "i830_reg.h"
+#include "intel_chipset.h"
static drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
diff --git a/tests/gem_dummy_reloc_loop.c b/tests/gem_dummy_reloc_loop.c
index 955de96f..7c9da637 100644
--- a/tests/gem_dummy_reloc_loop.c
+++ b/tests/gem_dummy_reloc_loop.c
@@ -34,12 +34,13 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
#include "i830_reg.h"
+#include "intel_chipset.h"
#define LOCAL_I915_EXEC_VEBOX (4<<0)
diff --git a/tests/gem_evict_alignment.c b/tests/gem_evict_alignment.c
index c478f18e..46da5ba1 100644
--- a/tests/gem_evict_alignment.c
+++ b/tests/gem_evict_alignment.c
@@ -42,8 +42,9 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
+#include "intel_chipset.h"
#define HEIGHT 256
#define WIDTH 1024
diff --git a/tests/gem_evict_everything.c b/tests/gem_evict_everything.c
index ad33c0ae..c595302e 100644
--- a/tests/gem_evict_everything.c
+++ b/tests/gem_evict_everything.c
@@ -42,8 +42,9 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
+#include "intel_chipset.h"
#include "eviction_common.c"
diff --git a/tests/gem_exec_bad_domains.c b/tests/gem_exec_bad_domains.c
index e0e13de5..0000e9ed 100644
--- a/tests/gem_exec_bad_domains.c
+++ b/tests/gem_exec_bad_domains.c
@@ -34,11 +34,12 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
/* Testcase: Test whether the kernel rejects relocations with non-gpu domains
*
diff --git a/tests/gem_exec_big.c b/tests/gem_exec_big.c
index 4be8559f..70753164 100644
--- a/tests/gem_exec_big.c
+++ b/tests/gem_exec_big.c
@@ -44,7 +44,7 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#define BATCH_SIZE (1024*1024)
diff --git a/tests/gem_exec_blt.c b/tests/gem_exec_blt.c
index bac11f10..6c3ea37d 100644
--- a/tests/gem_exec_blt.c
+++ b/tests/gem_exec_blt.c
@@ -37,7 +37,7 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_chipset.h"
#include "intel_gpu_tools.h"
diff --git a/tests/gem_exec_faulting_reloc.c b/tests/gem_exec_faulting_reloc.c
index d5ca18cf..51e5b6ed 100644
--- a/tests/gem_exec_faulting_reloc.c
+++ b/tests/gem_exec_faulting_reloc.c
@@ -37,7 +37,7 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_chipset.h"
#include "intel_gpu_tools.h"
diff --git a/tests/gem_exec_lut_handle.c b/tests/gem_exec_lut_handle.c
index c27e4d58..d0e21264 100644
--- a/tests/gem_exec_lut_handle.c
+++ b/tests/gem_exec_lut_handle.c
@@ -36,7 +36,7 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#define BATCH_SIZE (1024*1024)
diff --git a/tests/gem_exec_nop.c b/tests/gem_exec_nop.c
index 868f010e..28ec66b3 100644
--- a/tests/gem_exec_nop.c
+++ b/tests/gem_exec_nop.c
@@ -37,7 +37,7 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_gpu_tools.h"
diff --git a/tests/gem_fd_exhaustion.c b/tests/gem_fd_exhaustion.c
index afaa1007..7d865d42 100644
--- a/tests/gem_fd_exhaustion.c
+++ b/tests/gem_fd_exhaustion.c
@@ -32,6 +32,7 @@
#include <fcntl.h>
#include <limits.h>
#include "drmtest.h"
+#include "ioctl_wrappers.h"
#define FD_ARR_SZ 100
diff --git a/tests/gem_fence_thrash.c b/tests/gem_fence_thrash.c
index 86ee5bec..9c1ff1c5 100644
--- a/tests/gem_fence_thrash.c
+++ b/tests/gem_fence_thrash.c
@@ -41,7 +41,7 @@
#include <sys/ioctl.h>
#include <pthread.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#define OBJECT_SIZE (128*1024) /* restricted to 1MiB alignment on i915 fences */
diff --git a/tests/gem_fenced_exec_thrash.c b/tests/gem_fenced_exec_thrash.c
index 6b3608e0..cd53cafc 100644
--- a/tests/gem_fenced_exec_thrash.c
+++ b/tests/gem_fenced_exec_thrash.c
@@ -34,9 +34,10 @@
#include <fcntl.h>
#include <inttypes.h>
#include <drm.h>
-#include <i915_drm.h>
+#include "ioctl_wrappers.h"
#include "drmtest.h"
+#include "intel_chipset.h"
#include "intel_gpu_tools.h"
#define WIDTH 1024
diff --git a/tests/gem_flink.c b/tests/gem_flink.c
index 4b3b7c2f..339f7f1d 100644
--- a/tests/gem_flink.c
+++ b/tests/gem_flink.c
@@ -34,7 +34,7 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
static void
diff --git a/tests/gem_flink_race.c b/tests/gem_flink_race.c
index 195ec151..26c71cec 100644
--- a/tests/gem_flink_race.c
+++ b/tests/gem_flink_race.c
@@ -33,7 +33,7 @@
#include <pthread.h>
#include "drmtest.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "intel_bufmgr.h"
#include "igt_debugfs.h"
diff --git a/tests/gem_gtt_cpu_tlb.c b/tests/gem_gtt_cpu_tlb.c
index d6640258..c087a379 100644
--- a/tests/gem_gtt_cpu_tlb.c
+++ b/tests/gem_gtt_cpu_tlb.c
@@ -40,7 +40,7 @@
#include <sys/time.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_gpu_tools.h"
diff --git a/tests/gem_gtt_hog.c b/tests/gem_gtt_hog.c
index c7206dca..7fd22bd0 100644
--- a/tests/gem_gtt_hog.c
+++ b/tests/gem_gtt_hog.c
@@ -39,8 +39,9 @@
#include <sys/wait.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
+#include "intel_chipset.h"
static const uint32_t canary = 0xdeadbeef;
diff --git a/tests/gem_gtt_speed.c b/tests/gem_gtt_speed.c
index 2f70276f..6ebe275e 100644
--- a/tests/gem_gtt_speed.c
+++ b/tests/gem_gtt_speed.c
@@ -38,7 +38,7 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#define OBJECT_SIZE 16384
diff --git a/tests/gem_hang.c b/tests/gem_hang.c
index a675eaed..5b1f5dc8 100644
--- a/tests/gem_hang.c
+++ b/tests/gem_hang.c
@@ -35,9 +35,10 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
+#include "intel_chipset.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
diff --git a/tests/gem_hangcheck_forcewake.c b/tests/gem_hangcheck_forcewake.c
index cd51d6ca..d1bf000e 100644
--- a/tests/gem_hangcheck_forcewake.c
+++ b/tests/gem_hangcheck_forcewake.c
@@ -34,11 +34,12 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
/*
* Testcase: Provoke the hangcheck timer on an otherwise idle system
diff --git a/tests/gem_largeobject.c b/tests/gem_largeobject.c
index 5f0bb558..c01045e5 100644
--- a/tests/gem_largeobject.c
+++ b/tests/gem_largeobject.c
@@ -34,7 +34,7 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
/* Should take 64 pages to store the page pointers on 64 bit */
diff --git a/tests/gem_linear_blits.c b/tests/gem_linear_blits.c
index e76de02a..a7e398fb 100644
--- a/tests/gem_linear_blits.c
+++ b/tests/gem_linear_blits.c
@@ -42,7 +42,8 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
+#include "intel_chipset.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
diff --git a/tests/gem_lut_handle.c b/tests/gem_lut_handle.c
index 10fa22bd..e682ccf7 100644
--- a/tests/gem_lut_handle.c
+++ b/tests/gem_lut_handle.c
@@ -36,7 +36,7 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#define BATCH_SIZE (1024*1024)
diff --git a/tests/gem_madvise.c b/tests/gem_madvise.c
index 17e59754..04a82aa3 100644
--- a/tests/gem_madvise.c
+++ b/tests/gem_madvise.c
@@ -36,7 +36,7 @@
#include <signal.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#define OBJECT_SIZE (1024*1024)
diff --git a/tests/gem_media_fill.c b/tests/gem_media_fill.c
index 220f8629..68bbdf23 100644
--- a/tests/gem_media_fill.c
+++ b/tests/gem_media_fill.c
@@ -43,11 +43,12 @@
#include <sys/time.h>
#include <getopt.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
#define WIDTH 64
#define STRIDE (WIDTH)
diff --git a/tests/gem_mmap.c b/tests/gem_mmap.c
index 4c5be8fa..a1b00fa5 100644
--- a/tests/gem_mmap.c
+++ b/tests/gem_mmap.c
@@ -35,7 +35,7 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#define OBJECT_SIZE 16384
diff --git a/tests/gem_mmap_gtt.c b/tests/gem_mmap_gtt.c
index 5f9e6382..7ba5e39c 100644
--- a/tests/gem_mmap_gtt.c
+++ b/tests/gem_mmap_gtt.c
@@ -36,7 +36,7 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "igt_debugfs.h"
diff --git a/tests/gem_mmap_offset_exhaustion.c b/tests/gem_mmap_offset_exhaustion.c
index 670ca466..d5939ecb 100644
--- a/tests/gem_mmap_offset_exhaustion.c
+++ b/tests/gem_mmap_offset_exhaustion.c
@@ -35,7 +35,7 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#define OBJECT_SIZE (1024*1024)
diff --git a/tests/gem_non_secure_batch.c b/tests/gem_non_secure_batch.c
index 101b9dcf..1d96222d 100644
--- a/tests/gem_non_secure_batch.c
+++ b/tests/gem_non_secure_batch.c
@@ -34,10 +34,11 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
+#include "intel_chipset.h"
#include "intel_gpu_tools.h"
#include "i830_reg.h"
diff --git a/tests/gem_partial_pwrite_pread.c b/tests/gem_partial_pwrite_pread.c
index 0f4c9aed..c2465373 100644
--- a/tests/gem_partial_pwrite_pread.c
+++ b/tests/gem_partial_pwrite_pread.c
@@ -34,8 +34,9 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
+#include "intel_chipset.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
diff --git a/tests/gem_persistent_relocs.c b/tests/gem_persistent_relocs.c
index 50d8e0e3..1a705fad 100644
--- a/tests/gem_persistent_relocs.c
+++ b/tests/gem_persistent_relocs.c
@@ -37,9 +37,10 @@
#include <signal.h>
#include <sys/wait.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
+#include "intel_chipset.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
#include "igt_debugfs.h"
diff --git a/tests/gem_pin.c b/tests/gem_pin.c
index 860e5652..e57ddcc4 100644
--- a/tests/gem_pin.c
+++ b/tests/gem_pin.c
@@ -36,7 +36,7 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_chipset.h"
#include "intel_gpu_tools.h"
diff --git a/tests/gem_pipe_control_store_loop.c b/tests/gem_pipe_control_store_loop.c
index f4c03bad..41bfc1b0 100644
--- a/tests/gem_pipe_control_store_loop.c
+++ b/tests/gem_pipe_control_store_loop.c
@@ -40,10 +40,11 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
+#include "intel_chipset.h"
#include "intel_gpu_tools.h"
static drm_intel_bufmgr *bufmgr;
diff --git a/tests/gem_pread.c b/tests/gem_pread.c
index d1baf541..5f8246b4 100644
--- a/tests/gem_pread.c
+++ b/tests/gem_pread.c
@@ -37,7 +37,7 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#define OBJECT_SIZE 16384
diff --git a/tests/gem_pread_after_blit.c b/tests/gem_pread_after_blit.c
index eb8fd3a4..f263286c 100644
--- a/tests/gem_pread_after_blit.c
+++ b/tests/gem_pread_after_blit.c
@@ -43,8 +43,9 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
+#include "intel_chipset.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
diff --git a/tests/gem_pwrite.c b/tests/gem_pwrite.c
index d04535b9..4d47f6f2 100644
--- a/tests/gem_pwrite.c
+++ b/tests/gem_pwrite.c
@@ -37,7 +37,7 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#define OBJECT_SIZE 16384
diff --git a/tests/gem_pwrite_pread.c b/tests/gem_pwrite_pread.c
index db939b6e..c3314e48 100644
--- a/tests/gem_pwrite_pread.c
+++ b/tests/gem_pwrite_pread.c
@@ -37,8 +37,9 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
+#include "intel_chipset.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
diff --git a/tests/gem_readwrite.c b/tests/gem_readwrite.c
index 149254a2..5260fb96 100644
--- a/tests/gem_readwrite.c
+++ b/tests/gem_readwrite.c
@@ -35,7 +35,7 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#define OBJECT_SIZE 16384
diff --git a/tests/gem_reg_read.c b/tests/gem_reg_read.c
index a88c6a46..19f1351b 100644
--- a/tests/gem_reg_read.c
+++ b/tests/gem_reg_read.c
@@ -27,7 +27,7 @@
#include <stdio.h>
#include <string.h>
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
struct local_drm_i915_reg_read {
diff --git a/tests/gem_reloc_overflow.c b/tests/gem_reloc_overflow.c
index fa7baab5..98b7dd4a 100644
--- a/tests/gem_reloc_overflow.c
+++ b/tests/gem_reloc_overflow.c
@@ -43,7 +43,8 @@
#include <sys/time.h>
#include <sys/types.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
+#include "intel_chipset.h"
#include "drmtest.h"
#include "intel_gpu_tools.h"
diff --git a/tests/gem_reloc_vs_gpu.c b/tests/gem_reloc_vs_gpu.c
index 34e81a20..07c79b33 100644
--- a/tests/gem_reloc_vs_gpu.c
+++ b/tests/gem_reloc_vs_gpu.c
@@ -37,10 +37,11 @@
#include <signal.h>
#include <sys/wait.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
+#include "intel_chipset.h"
#include "intel_gpu_tools.h"
#include "igt_debugfs.h"
diff --git a/tests/gem_render_copy.c b/tests/gem_render_copy.c
index ad48bfc2..54f971d1 100644
--- a/tests/gem_render_copy.c
+++ b/tests/gem_render_copy.c
@@ -43,11 +43,12 @@
#include <sys/time.h>
#include <getopt.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
#define WIDTH 512
#define STRIDE (WIDTH*4)
diff --git a/tests/gem_render_linear_blits.c b/tests/gem_render_linear_blits.c
index 92c5bf6a..ac2b29b0 100644
--- a/tests/gem_render_linear_blits.c
+++ b/tests/gem_render_linear_blits.c
@@ -48,11 +48,13 @@
#include <sys/time.h>
#include <getopt.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
+
#define WIDTH 512
#define STRIDE (WIDTH*4)
#define HEIGHT 512
diff --git a/tests/gem_render_tiled_blits.c b/tests/gem_render_tiled_blits.c
index 5233b231..8481e51d 100644
--- a/tests/gem_render_tiled_blits.c
+++ b/tests/gem_render_tiled_blits.c
@@ -44,11 +44,12 @@
#include <sys/time.h>
#include <getopt.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
#define WIDTH 512
#define STRIDE (WIDTH*4)
diff --git a/tests/gem_reset_stats.c b/tests/gem_reset_stats.c
index 8ac93a89..90befd70 100644
--- a/tests/gem_reset_stats.c
+++ b/tests/gem_reset_stats.c
@@ -40,10 +40,11 @@
#include <time.h>
#include <signal.h>
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "igt_debugfs.h"
#include "intel_bufmgr.h"
+#include "intel_chipset.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
diff --git a/tests/gem_ring_sync_copy.c b/tests/gem_ring_sync_copy.c
index b8b1454c..768d02d0 100644
--- a/tests/gem_ring_sync_copy.c
+++ b/tests/gem_ring_sync_copy.c
@@ -50,9 +50,10 @@
#include <stdlib.h>
#include <stdbool.h>
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_batchbuffer.h"
+#include "intel_chipset.h"
#define WIDTH 512
#define HEIGHT 512
diff --git a/tests/gem_ring_sync_loop.c b/tests/gem_ring_sync_loop.c
index 95fcd305..5010d356 100644
--- a/tests/gem_ring_sync_loop.c
+++ b/tests/gem_ring_sync_loop.c
@@ -34,12 +34,13 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
#include "i830_reg.h"
+#include "intel_chipset.h"
static drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
diff --git a/tests/gem_ringfill.c b/tests/gem_ringfill.c
index ef98701c..716ff569 100644
--- a/tests/gem_ringfill.c
+++ b/tests/gem_ringfill.c
@@ -42,9 +42,10 @@
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
+#include "intel_chipset.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
diff --git a/tests/gem_seqno_wrap.c b/tests/gem_seqno_wrap.c
index f9740324..19c0201e 100644
--- a/tests/gem_seqno_wrap.c
+++ b/tests/gem_seqno_wrap.c
@@ -42,12 +42,13 @@
#include <getopt.h>
#include <signal.h>
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "igt_core.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
static int devid;
static int card_index = 0;
diff --git a/tests/gem_set_tiling_vs_blt.c b/tests/gem_set_tiling_vs_blt.c
index 7335da87..1ad0e5c1 100644
--- a/tests/gem_set_tiling_vs_blt.c
+++ b/tests/gem_set_tiling_vs_blt.c
@@ -54,10 +54,11 @@
#include <sys/time.h>
#include <stdbool.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
+#include "intel_chipset.h"
#include "intel_gpu_tools.h"
static drm_intel_bufmgr *bufmgr;
diff --git a/tests/gem_set_tiling_vs_gtt.c b/tests/gem_set_tiling_vs_gtt.c
index 5dc90aea..abe09639 100644
--- a/tests/gem_set_tiling_vs_gtt.c
+++ b/tests/gem_set_tiling_vs_gtt.c
@@ -35,9 +35,10 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
#define OBJECT_SIZE (1024*1024)
#define TEST_STRIDE (1024*4)
diff --git a/tests/gem_set_tiling_vs_pwrite.c b/tests/gem_set_tiling_vs_pwrite.c
index 4ef37201..d07ebafc 100644
--- a/tests/gem_set_tiling_vs_pwrite.c
+++ b/tests/gem_set_tiling_vs_pwrite.c
@@ -35,7 +35,7 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_gpu_tools.h"
diff --git a/tests/gem_storedw_batches_loop.c b/tests/gem_storedw_batches_loop.c
index 85d6f6c0..f07085c4 100644
--- a/tests/gem_storedw_batches_loop.c
+++ b/tests/gem_storedw_batches_loop.c
@@ -35,9 +35,10 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
+#include "intel_chipset.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
diff --git a/tests/gem_storedw_loop_blt.c b/tests/gem_storedw_loop_blt.c
index d08f5b0d..b242b292 100644
--- a/tests/gem_storedw_loop_blt.c
+++ b/tests/gem_storedw_loop_blt.c
@@ -35,11 +35,12 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
static drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
diff --git a/tests/gem_storedw_loop_bsd.c b/tests/gem_storedw_loop_bsd.c
index 079b139f..482e276b 100644
--- a/tests/gem_storedw_loop_bsd.c
+++ b/tests/gem_storedw_loop_bsd.c
@@ -35,11 +35,12 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
static drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
diff --git a/tests/gem_storedw_loop_render.c b/tests/gem_storedw_loop_render.c
index 2dc16b10..7cbc0a80 100644
--- a/tests/gem_storedw_loop_render.c
+++ b/tests/gem_storedw_loop_render.c
@@ -35,11 +35,12 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
static drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
diff --git a/tests/gem_storedw_loop_vebox.c b/tests/gem_storedw_loop_vebox.c
index aa1987ac..872d4b2a 100644
--- a/tests/gem_storedw_loop_vebox.c
+++ b/tests/gem_storedw_loop_vebox.c
@@ -34,11 +34,12 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
#define LOCAL_I915_EXEC_VEBOX (4<<0)
diff --git a/tests/gem_stress.c b/tests/gem_stress.c
index 3a94fb1a..d6434bcc 100644
--- a/tests/gem_stress.c
+++ b/tests/gem_stress.c
@@ -60,11 +60,12 @@
#include <sys/time.h>
#include <getopt.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
#define CMD_POLY_STIPPLE_OFFSET 0x7906
diff --git a/tests/gem_threaded_access_tiled.c b/tests/gem_threaded_access_tiled.c
index cf07daf4..3752a1f6 100644
--- a/tests/gem_threaded_access_tiled.c
+++ b/tests/gem_threaded_access_tiled.c
@@ -31,7 +31,7 @@
#include <pthread.h>
#include "drmtest.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "intel_bufmgr.h"
/* Testcase: check parallel access to tiled memory
diff --git a/tests/gem_tiled_blits.c b/tests/gem_tiled_blits.c
index e21fc789..00b69554 100644
--- a/tests/gem_tiled_blits.c
+++ b/tests/gem_tiled_blits.c
@@ -50,10 +50,11 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
+#include "intel_chipset.h"
#include "intel_gpu_tools.h"
static drm_intel_bufmgr *bufmgr;
diff --git a/tests/gem_tiled_fence_blits.c b/tests/gem_tiled_fence_blits.c
index b33be58c..3dfcf003 100644
--- a/tests/gem_tiled_fence_blits.c
+++ b/tests/gem_tiled_fence_blits.c
@@ -50,11 +50,12 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
static drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
diff --git a/tests/gem_tiled_partial_pwrite_pread.c b/tests/gem_tiled_partial_pwrite_pread.c
index bcae6e9e..322cca9d 100644
--- a/tests/gem_tiled_partial_pwrite_pread.c
+++ b/tests/gem_tiled_partial_pwrite_pread.c
@@ -34,9 +34,10 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
+#include "intel_chipset.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
diff --git a/tests/gem_tiled_pread.c b/tests/gem_tiled_pread.c
index 0592b8c0..6f104a6c 100644
--- a/tests/gem_tiled_pread.c
+++ b/tests/gem_tiled_pread.c
@@ -45,9 +45,10 @@
#include <sys/time.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
#define WIDTH 512
#define HEIGHT 512
diff --git a/tests/gem_tiled_pread_pwrite.c b/tests/gem_tiled_pread_pwrite.c
index 09d3ea4c..06c32fcc 100644
--- a/tests/gem_tiled_pread_pwrite.c
+++ b/tests/gem_tiled_pread_pwrite.c
@@ -54,7 +54,7 @@
#include <sys/time.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_gpu_tools.h"
diff --git a/tests/gem_tiled_swapping.c b/tests/gem_tiled_swapping.c
index e8fcc7ef..28d21d45 100644
--- a/tests/gem_tiled_swapping.c
+++ b/tests/gem_tiled_swapping.c
@@ -54,7 +54,7 @@
#include <sys/time.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_gpu_tools.h"
diff --git a/tests/gem_tiling_max_stride.c b/tests/gem_tiling_max_stride.c
index e4b58dcb..ded965ae 100644
--- a/tests/gem_tiling_max_stride.c
+++ b/tests/gem_tiling_max_stride.c
@@ -36,9 +36,10 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
static void do_test_invalid_tiling(int fd, uint32_t handle, int tiling, int stride)
{
diff --git a/tests/gem_unfence_active_buffers.c b/tests/gem_unfence_active_buffers.c
index b79b124a..9ccabe9f 100644
--- a/tests/gem_unfence_active_buffers.c
+++ b/tests/gem_unfence_active_buffers.c
@@ -48,11 +48,12 @@
#include <sys/time.h>
#include <stdbool.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
static drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
diff --git a/tests/gem_unref_active_buffers.c b/tests/gem_unref_active_buffers.c
index 1e9e2146..89067057 100644
--- a/tests/gem_unref_active_buffers.c
+++ b/tests/gem_unref_active_buffers.c
@@ -41,11 +41,12 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
static drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
diff --git a/tests/gem_vmap_blits.c b/tests/gem_vmap_blits.c
index 48297afc..4fb2a215 100644
--- a/tests/gem_vmap_blits.c
+++ b/tests/gem_vmap_blits.c
@@ -44,7 +44,7 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
diff --git a/tests/gem_wait_render_timeout.c b/tests/gem_wait_render_timeout.c
index 07481049..d4c12fee 100644
--- a/tests/gem_wait_render_timeout.c
+++ b/tests/gem_wait_render_timeout.c
@@ -38,11 +38,12 @@
#include <sys/time.h>
#include <getopt.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
#define MSEC_PER_SEC 1000L
#define USEC_PER_MSEC 1000L
diff --git a/tests/gem_write_read_ring_switch.c b/tests/gem_write_read_ring_switch.c
index 524d6fb0..cd235c95 100644
--- a/tests/gem_write_read_ring_switch.c
+++ b/tests/gem_write_read_ring_switch.c
@@ -34,10 +34,11 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
+#include "intel_chipset.h"
#include "intel_gpu_tools.h"
#include "i830_reg.h"
diff --git a/tests/gen3_mixed_blits.c b/tests/gen3_mixed_blits.c
index 17ccf202..64041a0e 100644
--- a/tests/gen3_mixed_blits.c
+++ b/tests/gen3_mixed_blits.c
@@ -43,9 +43,10 @@
#include <sys/time.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
#include "i915_reg.h"
#include "i915_3d.h"
diff --git a/tests/gen3_render_linear_blits.c b/tests/gen3_render_linear_blits.c
index 129b5068..eed3ba5e 100644
--- a/tests/gen3_render_linear_blits.c
+++ b/tests/gen3_render_linear_blits.c
@@ -42,9 +42,10 @@
#include <sys/stat.h>
#include <sys/time.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
#include "i915_reg.h"
#include "i915_3d.h"
diff --git a/tests/gen3_render_mixed_blits.c b/tests/gen3_render_mixed_blits.c
index d60e7261..ac5452a8 100644
--- a/tests/gen3_render_mixed_blits.c
+++ b/tests/gen3_render_mixed_blits.c
@@ -43,9 +43,10 @@
#include <sys/time.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
#include "i915_reg.h"
#include "i915_3d.h"
diff --git a/tests/gen3_render_tiledx_blits.c b/tests/gen3_render_tiledx_blits.c
index 427a5c71..1b2a00c5 100644
--- a/tests/gen3_render_tiledx_blits.c
+++ b/tests/gen3_render_tiledx_blits.c
@@ -43,9 +43,10 @@
#include <sys/time.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
#include "i915_reg.h"
#include "i915_3d.h"
diff --git a/tests/gen3_render_tiledy_blits.c b/tests/gen3_render_tiledy_blits.c
index a82f994f..80305413 100644
--- a/tests/gen3_render_tiledy_blits.c
+++ b/tests/gen3_render_tiledy_blits.c
@@ -43,9 +43,10 @@
#include <sys/time.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
#include "i915_reg.h"
#include "i915_3d.h"
diff --git a/tests/gen7_forcewake_mt.c b/tests/gen7_forcewake_mt.c
index db5dd3e0..03eb6e92 100644
--- a/tests/gen7_forcewake_mt.c
+++ b/tests/gen7_forcewake_mt.c
@@ -35,10 +35,11 @@
#include <string.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "i915_pciids.h"
#include "drmtest.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
#define FORCEWAKE_MT 0xa188
diff --git a/tests/kms_addfb.c b/tests/kms_addfb.c
index 3f727cc0..349e7fb9 100644
--- a/tests/kms_addfb.c
+++ b/tests/kms_addfb.c
@@ -35,7 +35,7 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "drm_fourcc.h"
diff --git a/tests/kms_fbc_crc.c b/tests/kms_fbc_crc.c
index 07a572d2..db595c72 100644
--- a/tests/kms_fbc_crc.c
+++ b/tests/kms_fbc_crc.c
@@ -27,12 +27,14 @@
#include <stdio.h>
#include <string.h>
-#include "drm_fourcc.h"
+#include <drm_fourcc.h>
#include "drmtest.h"
#include "igt_debugfs.h"
#include "igt_kms.h"
+#include "intel_chipset.h"
#include "intel_batchbuffer.h"
+#include "ioctl_wrappers.h"
enum test_mode {
TEST_PAGE_FLIP,
diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 70d67e57..d5292e89 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -35,10 +35,12 @@
#include <sys/time.h>
#include <sys/ioctl.h>
#include <linux/kd.h>
+#include <time.h>
+#include <pthread.h>
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
-#include "testdisplay.h"
+#include "intel_chipset.h"
#include "intel_batchbuffer.h"
#include "igt_kms.h"
diff --git a/tests/kms_render.c b/tests/kms_render.c
index e661753e..7bff958b 100644
--- a/tests/kms_render.c
+++ b/tests/kms_render.c
@@ -30,13 +30,16 @@
#include <unistd.h>
#include <sys/time.h>
-#include "drm_fourcc.h"
+#include <drm_fourcc.h>
+
#include "drmtest.h"
#include "testdisplay.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
#include "igt_kms.h"
+#include "ioctl_wrappers.h"
drmModeRes *resources;
int drm_fd;
diff --git a/tests/pm_lpsp.c b/tests/pm_lpsp.c
index ede91495..1dc7a73f 100644
--- a/tests/pm_lpsp.c
+++ b/tests/pm_lpsp.c
@@ -31,6 +31,8 @@
#include "drmtest.h"
#include "igt_kms.h"
+#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
/* We know that if we don't enable audio runtime PM, snd_hda_intel will never
* release its power well refcount, and we'll never reach the LPSP sate. OTOH
diff --git a/tests/pm_pc8.c b/tests/pm_pc8.c
index c672e809..5a1e7470 100644
--- a/tests/pm_pc8.c
+++ b/tests/pm_pc8.c
@@ -44,7 +44,8 @@
#include "drmtest.h"
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
-#include "i915_drm.h"
+#include "intel_chipset.h"
+#include "ioctl_wrappers.h"
#include "igt_kms.h"
#include "igt_debugfs.h"
diff --git a/tests/pm_rps.c b/tests/pm_rps.c
index 038987c0..e6ab3790 100644
--- a/tests/pm_rps.c
+++ b/tests/pm_rps.c
@@ -34,11 +34,14 @@
#include <getopt.h>
#include <fcntl.h>
#include <signal.h>
+
#include "drmtest.h"
#include "intel_gpu_tools.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
+#include "intel_chipset.h"
#include "igt_debugfs.h"
+#include "ioctl_wrappers.h"
static int drm_fd;
diff --git a/tests/prime_nv_api.c b/tests/prime_nv_api.c
index e2448bef..c510c1cf 100644
--- a/tests/prime_nv_api.c
+++ b/tests/prime_nv_api.c
@@ -19,6 +19,7 @@
#include "intel_gpu_tools.h"
#include "intel_batchbuffer.h"
#include "drmtest.h"
+#include "intel_chipset.h"
#define BO_SIZE (256*1024)
diff --git a/tests/prime_nv_pcopy.c b/tests/prime_nv_pcopy.c
index fd2018ba..3f3814af 100644
--- a/tests/prime_nv_pcopy.c
+++ b/tests/prime_nv_pcopy.c
@@ -23,11 +23,12 @@
#include <sys/ioctl.h>
#include <errno.h>
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "intel_bufmgr.h"
#include "nouveau.h"
#include "intel_gpu_tools.h"
#include "intel_batchbuffer.h"
+#include "intel_chipset.h"
#include "drmtest.h"
static int intel_fd = -1, nouveau_fd = -1;
diff --git a/tests/prime_nv_test.c b/tests/prime_nv_test.c
index 640515b4..ee54e7a6 100644
--- a/tests/prime_nv_test.c
+++ b/tests/prime_nv_test.c
@@ -22,11 +22,12 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "intel_bufmgr.h"
#include "nouveau.h"
#include "intel_gpu_tools.h"
#include "intel_batchbuffer.h"
+#include "intel_chipset.h"
#include "drmtest.h"
int intel_fd = -1, nouveau_fd = -1;
diff --git a/tests/prime_self_import.c b/tests/prime_self_import.c
index 2566af98..efdd24f6 100644
--- a/tests/prime_self_import.c
+++ b/tests/prime_self_import.c
@@ -44,7 +44,7 @@
#include <pthread.h>
#include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "igt_debugfs.h"
diff --git a/tests/prime_udl.c b/tests/prime_udl.c
index d8530851..892a9527 100644
--- a/tests/prime_udl.c
+++ b/tests/prime_udl.c
@@ -25,11 +25,12 @@
#include "xf86drm.h"
#include "xf86drmMode.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "intel_bufmgr.h"
#include "intel_gpu_tools.h"
#include "intel_batchbuffer.h"
#include "drmtest.h"
+#include "intel_chipset.h"
int intel_fd = -1, udl_fd = -1;
drm_intel_bufmgr *bufmgr;
diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index d0cd5123..b70287ec 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -62,7 +62,7 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
#include "drmtest.h"
#include "testdisplay.h"
#include "igt_kms.h"
diff --git a/tools/intel_perf_counters.c b/tools/intel_perf_counters.c
index 23d9ed3a..c31111e6 100644
--- a/tools/intel_perf_counters.c
+++ b/tools/intel_perf_counters.c
@@ -48,6 +48,7 @@
#include "intel_gpu_tools.h"
#include "intel_bufmgr.h"
#include "intel_batchbuffer.h"
+#include "intel_chipset.h"
#define GEN5_COUNTER_COUNT 29