[PATCH i-g-t] lib: add a single include header

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add a header that includes all the headers for the library. This allows
reorganisation of the library without affecting programs using it and
also simplifies the headers that need to be included to use the library.

Signed-off-by: Thomas Wood <thomas.wood@xxxxxxxxx>
---
 lib/igt.h                              | 49 ++++++++++++++++++++++++++++++++++
 tests/core_get_client_auth.c           |  3 +--
 tests/core_getclient.c                 |  2 +-
 tests/core_getstats.c                  |  3 +--
 tests/core_getversion.c                |  2 +-
 tests/drm_auth.c                       |  4 +--
 tests/drm_import_export.c              |  3 +--
 tests/drm_read.c                       |  4 +--
 tests/drm_vma_limiter.c                |  6 +----
 tests/drm_vma_limiter_cached.c         |  6 +----
 tests/drm_vma_limiter_cpu.c            |  6 +----
 tests/drm_vma_limiter_gtt.c            |  6 +----
 tests/drv_getparams_basic.c            |  3 +--
 tests/drv_hangman.c                    |  6 +----
 tests/drv_suspend.c                    |  5 +---
 tests/eviction_common.c                |  3 +--
 tests/gem_alive.c                      |  2 +-
 tests/gem_bad_address.c                |  6 +----
 tests/gem_bad_batch.c                  |  6 +----
 tests/gem_bad_blit.c                   |  6 +----
 tests/gem_bad_length.c                 |  3 +--
 tests/gem_bad_reloc.c                  |  5 +---
 tests/gem_basic.c                      |  3 +--
 tests/gem_caching.c                    |  7 +----
 tests/gem_close_race.c                 |  4 +--
 tests/gem_concurrent_all.c             |  9 +------
 tests/gem_cpu_reloc.c                  |  7 +----
 tests/gem_cs_prefetch.c                |  7 +----
 tests/gem_cs_tlb.c                     |  5 +---
 tests/gem_ctx_bad_destroy.c            |  3 +--
 tests/gem_ctx_bad_exec.c               |  3 +--
 tests/gem_ctx_basic.c                  |  6 +----
 tests/gem_ctx_create.c                 |  3 +--
 tests/gem_ctx_exec.c                   |  5 +---
 tests/gem_ctx_param_basic.c            |  4 +--
 tests/gem_ctx_thrash.c                 |  5 +---
 tests/gem_double_irq_loop.c            |  6 +----
 tests/gem_dummy_reloc_loop.c           |  6 +----
 tests/gem_eio.c                        |  6 +----
 tests/gem_evict_alignment.c            |  6 +----
 tests/gem_evict_everything.c           |  5 +---
 tests/gem_exec_alignment.c             |  4 +--
 tests/gem_exec_bad_domains.c           |  6 +----
 tests/gem_exec_big.c                   |  5 +---
 tests/gem_exec_blt.c                   |  5 +---
 tests/gem_exec_faulting_reloc.c        |  6 +----
 tests/gem_exec_lut_handle.c            |  4 +--
 tests/gem_exec_nop.c                   |  5 +---
 tests/gem_exec_params.c                |  6 +----
 tests/gem_exec_parse.c                 |  4 +--
 tests/gem_fd_exhaustion.c              |  4 +--
 tests/gem_fence_thrash.c               |  3 +--
 tests/gem_fence_upload.c               |  3 +--
 tests/gem_fenced_exec_thrash.c         |  6 +----
 tests/gem_flink_basic.c                |  3 +--
 tests/gem_flink_race.c                 |  4 +--
 tests/gem_gpgpu_fill.c                 |  6 +----
 tests/gem_gtt_cpu_tlb.c                |  4 +--
 tests/gem_gtt_hog.c                    |  4 +--
 tests/gem_gtt_speed.c                  |  3 +--
 tests/gem_hang.c                       |  6 +----
 tests/gem_hangcheck_forcewake.c        |  6 +----
 tests/gem_largeobject.c                |  3 +--
 tests/gem_linear_blits.c               |  6 +----
 tests/gem_lut_handle.c                 |  3 +--
 tests/gem_madvise.c                    |  3 +--
 tests/gem_media_fill.c                 |  6 +----
 tests/gem_mmap.c                       |  4 +--
 tests/gem_mmap_gtt.c                   |  5 +---
 tests/gem_mmap_offset_exhaustion.c     |  3 +--
 tests/gem_mmap_wc.c                    |  4 +--
 tests/gem_multi_bsd_sync_loop.c        |  6 +----
 tests/gem_non_secure_batch.c           |  6 +----
 tests/gem_partial_pwrite_pread.c       |  6 +----
 tests/gem_persistent_relocs.c          |  7 +----
 tests/gem_pin.c                        |  6 +----
 tests/gem_pipe_control_store_loop.c    |  6 +----
 tests/gem_ppgtt.c                      |  7 +----
 tests/gem_pread.c                      |  3 +--
 tests/gem_pread_after_blit.c           |  7 +----
 tests/gem_pwrite.c                     |  4 +--
 tests/gem_pwrite_pread.c               |  6 +----
 tests/gem_pwrite_snooped.c             |  5 +---
 tests/gem_read_read_speed.c            |  9 +------
 tests/gem_readwrite.c                  |  3 +--
 tests/gem_reg_read.c                   |  3 +--
 tests/gem_reloc_overflow.c             |  5 +---
 tests/gem_reloc_vs_gpu.c               |  8 +-----
 tests/gem_render_copy.c                |  7 +----
 tests/gem_render_copy_redux.c          |  7 +----
 tests/gem_render_linear_blits.c        |  7 +----
 tests/gem_render_tiled_blits.c         |  7 +----
 tests/gem_reset_stats.c                |  7 +----
 tests/gem_ring_sync_copy.c             |  5 +---
 tests/gem_ring_sync_loop.c             |  6 +----
 tests/gem_ringfill.c                   |  6 +----
 tests/gem_seqno_wrap.c                 |  9 +------
 tests/gem_set_tiling_vs_blt.c          |  6 +----
 tests/gem_set_tiling_vs_gtt.c          |  5 +---
 tests/gem_set_tiling_vs_pwrite.c       |  4 +--
 tests/gem_storedw_batches_loop.c       |  6 +----
 tests/gem_storedw_loop.c               |  6 +----
 tests/gem_storedw_loop_blt.c           |  6 +----
 tests/gem_storedw_loop_bsd.c           |  6 +----
 tests/gem_storedw_loop_render.c        |  6 +----
 tests/gem_storedw_loop_vebox.c         |  6 +----
 tests/gem_streaming_writes.c           |  6 +----
 tests/gem_stress.c                     |  7 +----
 tests/gem_threaded_access_tiled.c      |  3 +--
 tests/gem_tiled_blits.c                |  6 +----
 tests/gem_tiled_fence_blits.c          |  7 +----
 tests/gem_tiled_partial_pwrite_pread.c |  6 +----
 tests/gem_tiled_pread_basic.c          |  5 +---
 tests/gem_tiled_pread_pwrite.c         |  5 +---
 tests/gem_tiled_swapping.c             |  6 +----
 tests/gem_tiled_wb.c                   |  5 +---
 tests/gem_tiled_wc.c                   |  5 +---
 tests/gem_tiling_max_stride.c          |  5 +---
 tests/gem_unfence_active_buffers.c     |  6 +----
 tests/gem_unref_active_buffers.c       |  6 +----
 tests/gem_userptr_blits.c              |  5 +---
 tests/gem_wait.c                       |  7 +----
 tests/gem_workarounds.c                |  7 +----
 tests/gem_write_read_ring_switch.c     |  6 +----
 tests/gen3_mixed_blits.c               |  6 +----
 tests/gen3_render_linear_blits.c       |  6 +----
 tests/gen3_render_mixed_blits.c        |  6 +----
 tests/gen3_render_tiledx_blits.c       |  6 +----
 tests/gen3_render_tiledy_blits.c       |  6 +----
 tests/gen7_forcewake_mt.c              |  6 +----
 tests/kms_3d.c                         |  4 +--
 tests/kms_addfb_basic.c                |  4 +--
 tests/kms_crtc_background_color.c      |  5 +---
 tests/kms_cursor_crc.c                 |  6 +----
 tests/kms_draw_crc.c                   |  7 +----
 tests/kms_fbc_crc.c                    |  8 +-----
 tests/kms_fbcon_fbt.c                  |  6 +----
 tests/kms_fence_pin_leak.c             |  7 +----
 tests/kms_flip.c                       |  8 +-----
 tests/kms_flip_event_leak.c            |  7 +----
 tests/kms_flip_tiling.c                |  6 +----
 tests/kms_force_connector.c            |  4 +--
 tests/kms_frontbuffer_tracking.c       |  8 +-----
 tests/kms_legacy_colorkey.c            |  4 +--
 tests/kms_mmio_vs_cs_flip.c            |  6 +----
 tests/kms_panel_fitting.c              |  7 +----
 tests/kms_pipe_b_c_ivb.c               |  4 +--
 tests/kms_pipe_crc_basic.c             |  6 +----
 tests/kms_plane.c                      |  5 +---
 tests/kms_plane_scaling.c              |  7 +----
 tests/kms_psr_sink_crc.c               |  8 +-----
 tests/kms_pwrite_crc.c                 |  7 +----
 tests/kms_render.c                     |  7 +----
 tests/kms_rotation_crc.c               |  6 +----
 tests/kms_setmode.c                    |  5 +---
 tests/kms_sink_crc_basic.c             |  4 +--
 tests/kms_universal_plane.c            |  5 +---
 tests/kms_vblank.c                     |  9 +------
 tests/pm_backlight.c                   |  2 +-
 tests/pm_lpsp.c                        |  5 +---
 tests/pm_rc6_residency.c               |  3 +--
 tests/pm_rpm.c                         |  9 +------
 tests/pm_rps.c                         |  7 +----
 tests/pm_sseu.c                        |  8 +-----
 tests/prime_nv_api.c                   |  5 +---
 tests/prime_nv_pcopy.c                 |  6 +----
 tests/prime_nv_test.c                  |  6 +----
 tests/prime_self_import.c              |  4 +--
 tests/prime_udl.c                      |  6 +----
 tests/template.c                       |  2 +-
 tests/testdisplay.c                    |  5 +---
 tests/testdisplay_hotplug.c            |  2 +-
 172 files changed, 220 insertions(+), 741 deletions(-)
 create mode 100644 lib/igt.h

diff --git a/lib/igt.h b/lib/igt.h
new file mode 100644
index 0000000..9cac417
--- /dev/null
+++ b/lib/igt.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright © 2015 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 IGT_H
+#define IGT_H
+
+#include "drmtest.h"
+#include "i915_3d.h"
+#include "i915_pciids.h"
+#include "igt_aux.h"
+#include "igt_core.h"
+#include "igt_core.h"
+#include "igt_debugfs.h"
+#include "igt_draw.h"
+#include "igt_fb.h"
+#include "igt_gt.h"
+#include "igt_kms.h"
+#include "igt_stats.h"
+#include "instdone.h"
+#include "intel_batchbuffer.h"
+#include "intel_chipset.h"
+#include "intel_io.h"
+#include "ioctl_wrappers.h"
+#include "media_fill.h"
+#include "media_spin.h"
+#include "rendercopy.h"
+#include "version.h"
+
+#endif /* IGT_H */
diff --git a/tests/core_get_client_auth.c b/tests/core_get_client_auth.c
index bbfdddf..7301ca0 100644
--- a/tests/core_get_client_auth.c
+++ b/tests/core_get_client_auth.c
@@ -33,6 +33,7 @@
  */
 
 #define _GNU_SOURCE
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -44,8 +45,6 @@
 #endif
 
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 
 /* Checks whether the thread id is the current thread */
 static bool
diff --git a/tests/core_getclient.c b/tests/core_getclient.c
index 7598e0f..aae00ea 100644
--- a/tests/core_getclient.c
+++ b/tests/core_getclient.c
@@ -25,12 +25,12 @@
  *
  */
 
+#include "igt.h"
 #include <limits.h>
 #include <sys/ioctl.h>
 #include <stdlib.h>
 #include <errno.h>
 
-#include "drmtest.h"
 
 IGT_TEST_DESCRIPTION("Tests the DRM_IOCTL_GET_CLIENT ioctl.");
 
diff --git a/tests/core_getstats.c b/tests/core_getstats.c
index 52a2d20..3db6b09 100644
--- a/tests/core_getstats.c
+++ b/tests/core_getstats.c
@@ -25,14 +25,13 @@
  *
  */
 
+#include "igt.h"
 #include <limits.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>
 
 #include <drm.h>
 
-#include "igt_core.h"
-#include "drmtest.h"
 
 /**
  * Checks DRM_IOCTL_GET_STATS.
diff --git a/tests/core_getversion.c b/tests/core_getversion.c
index 30132e4..1c0f824 100644
--- a/tests/core_getversion.c
+++ b/tests/core_getversion.c
@@ -25,9 +25,9 @@
  *
  */
 
+#include "igt.h"
 #include <string.h>
 #include <sys/ioctl.h>
-#include "drmtest.h"
 
 IGT_TEST_DESCRIPTION("Tests the DRM_IOCTL_GET_VERSION ioctl and libdrm's "
 		     "drmGetVersion() interface to it.");
diff --git a/tests/drm_auth.c b/tests/drm_auth.c
index 3a97d68..e936666 100644
--- a/tests/drm_auth.c
+++ b/tests/drm_auth.c
@@ -25,6 +25,7 @@
  * Testcase: drmGetMagic() and drmAuthMagic()
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -39,9 +40,6 @@
 #include <sys/time.h>
 #include <sys/poll.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Call drmGetMagic() and drmAuthMagic() and see if it behaves.");
 
diff --git a/tests/drm_import_export.c b/tests/drm_import_export.c
index e24e0df..41c4746 100644
--- a/tests/drm_import_export.c
+++ b/tests/drm_import_export.c
@@ -25,6 +25,7 @@
  */
 
 #define _GNU_SOURCE
+#include "igt.h"
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -40,8 +41,6 @@
 #include <unistd.h>
 #include <sys/syscall.h>
 
-#include "igt_core.h"
-#include "drmtest.h"
 
 int fd;
 drm_intel_bufmgr *bufmgr;
diff --git a/tests/drm_read.c b/tests/drm_read.c
index 334f26a..b808bed 100644
--- a/tests/drm_read.c
+++ b/tests/drm_read.c
@@ -29,6 +29,7 @@
  * Testcase: boundary testing of read(drm_fd)
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -43,9 +44,6 @@
 #include <sys/time.h>
 #include <sys/poll.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Call read(drm) and see if it behaves.");
 
diff --git a/tests/drm_vma_limiter.c b/tests/drm_vma_limiter.c
index bb7102f..ce3d364 100644
--- a/tests/drm_vma_limiter.c
+++ b/tests/drm_vma_limiter.c
@@ -24,6 +24,7 @@
  *    Daniel Vetter <daniel.vetter@xxxxxxxx>
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -33,12 +34,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.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 74d0c1a..d460872 100644
--- a/tests/drm_vma_limiter_cached.c
+++ b/tests/drm_vma_limiter_cached.c
@@ -24,6 +24,7 @@
  *    Daniel Vetter <daniel.vetter@xxxxxxxx>
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -33,12 +34,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.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 e17a679..f2a7843 100644
--- a/tests/drm_vma_limiter_cpu.c
+++ b/tests/drm_vma_limiter_cpu.c
@@ -24,6 +24,7 @@
  *    Daniel Vetter <daniel.vetter@xxxxxxxx>
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -33,12 +34,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.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 303e86d..d7e8619 100644
--- a/tests/drm_vma_limiter_gtt.c
+++ b/tests/drm_vma_limiter_gtt.c
@@ -24,6 +24,7 @@
  *    Daniel Vetter <daniel.vetter@xxxxxxxx>
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -33,12 +34,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 static drm_intel_bufmgr *bufmgr;
 struct intel_batchbuffer *batch;
diff --git a/tests/drv_getparams_basic.c b/tests/drv_getparams_basic.c
index 5a5c8bb..39120dd 100644
--- a/tests/drv_getparams_basic.c
+++ b/tests/drv_getparams_basic.c
@@ -25,12 +25,11 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <errno.h>
 #include <xf86drm.h>
 #include <i915_drm.h>
-#include "drmtest.h"
-#include "intel_chipset.h"
 #include "intel_bufmgr.h"
 
 IGT_TEST_DESCRIPTION("Tests the export of parameters via DRM_IOCTL_I915_GETPARAM\n");
diff --git a/tests/drv_hangman.c b/tests/drv_hangman.c
index d93bef3..97ccd7f 100644
--- a/tests/drv_hangman.c
+++ b/tests/drv_hangman.c
@@ -26,16 +26,12 @@
  *
  */
 
+#include "igt.h"
 #include <limits.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 
-#include "intel_chipset.h"
-#include "drmtest.h"
-#include "igt_aux.h"
-#include "igt_gt.h"
-#include "ioctl_wrappers.h"
 
 #ifndef I915_PARAM_CMD_PARSER_VERSION
 #define I915_PARAM_CMD_PARSER_VERSION       28
diff --git a/tests/drv_suspend.c b/tests/drv_suspend.c
index d67a794..795fed1 100644
--- a/tests/drv_suspend.c
+++ b/tests/drv_suspend.c
@@ -26,6 +26,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -38,10 +39,6 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "igt_gt.h"
-#include "igt_aux.h"
 
 #define OBJECT_SIZE (16*1024*1024)
 
diff --git a/tests/eviction_common.c b/tests/eviction_common.c
index 91c5acf..5b36fb8 100644
--- a/tests/eviction_common.c
+++ b/tests/eviction_common.c
@@ -27,10 +27,9 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 
-#include "drmtest.h"
-#include "igt_aux.h"
 
 struct igt_eviction_test_ops
 {
diff --git a/tests/gem_alive.c b/tests/gem_alive.c
index 390a54f..c94e3dc 100644
--- a/tests/gem_alive.c
+++ b/tests/gem_alive.c
@@ -1,3 +1,4 @@
+#include "igt.h"
 #include <sys/ioctl.h>
 #include <fcntl.h>
 #include <errno.h>
@@ -5,7 +6,6 @@
 #include <signal.h>
 #include <i915_drm.h>
 
-#include "drmtest.h"
 
 int main(void)
 {
diff --git a/tests/gem_bad_address.c b/tests/gem_bad_address.c
index 4a4a570..b777fa9 100644
--- a/tests/gem_bad_address.c
+++ b/tests/gem_bad_address.c
@@ -26,6 +26,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -35,12 +36,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_chipset.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
 
 static drm_intel_bufmgr *bufmgr;
 struct intel_batchbuffer *batch;
diff --git a/tests/gem_bad_batch.c b/tests/gem_bad_batch.c
index e3de3b6..d93ccad 100644
--- a/tests/gem_bad_batch.c
+++ b/tests/gem_bad_batch.c
@@ -26,6 +26,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -35,12 +36,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_chipset.h"
-#include "intel_io.h"
 
 static drm_intel_bufmgr *bufmgr;
 struct intel_batchbuffer *batch;
diff --git a/tests/gem_bad_blit.c b/tests/gem_bad_blit.c
index f981d35..b952155 100644
--- a/tests/gem_bad_blit.c
+++ b/tests/gem_bad_blit.c
@@ -41,6 +41,7 @@
  * resulted.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -50,12 +51,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_chipset.h"
-#include "intel_io.h"
 
 static drm_intel_bufmgr *bufmgr;
 struct intel_batchbuffer *batch;
diff --git a/tests/gem_bad_length.c b/tests/gem_bad_length.c
index 29b3925..c85b349 100644
--- a/tests/gem_bad_length.c
+++ b/tests/gem_bad_length.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -35,8 +36,6 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 
 IGT_TEST_DESCRIPTION("Test minimal bo_create and batchbuffer exec.");
 
diff --git a/tests/gem_bad_reloc.c b/tests/gem_bad_reloc.c
index 36d8c09..563571e 100644
--- a/tests/gem_bad_reloc.c
+++ b/tests/gem_bad_reloc.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -37,10 +38,6 @@
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Simulates SNA behaviour using negative self-relocations"
 		     " for STATE_BASE_ADDRESS command packets.");
diff --git a/tests/gem_basic.c b/tests/gem_basic.c
index f79b066..553088d 100644
--- a/tests/gem_basic.c
+++ b/tests/gem_basic.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -35,8 +36,6 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 
 static void
 test_bad_close(int fd)
diff --git a/tests/gem_caching.c b/tests/gem_caching.c
index 2fad0ec..2f1efec 100644
--- a/tests/gem_caching.c
+++ b/tests/gem_caching.c
@@ -26,6 +26,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -37,13 +38,7 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Test snoop consistency when touching partial"
 		     " cachelines.");
diff --git a/tests/gem_close_race.c b/tests/gem_close_race.c
index f89b3b6..4d2b396 100644
--- a/tests/gem_close_race.c
+++ b/tests/gem_close_race.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <pthread.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -38,9 +39,6 @@
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_chipset.h"
 
 #define OBJECT_SIZE (256 * 1024)
 
diff --git a/tests/gem_concurrent_all.c b/tests/gem_concurrent_all.c
index 3a7ab7f..dc0761e 100644
--- a/tests/gem_concurrent_all.c
+++ b/tests/gem_concurrent_all.c
@@ -35,6 +35,7 @@
  * Based on gem_gtt_concurrent_blt.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -47,15 +48,7 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "igt_aux.h"
-#include "igt_core.h"
-#include "igt_gt.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Test of pread/pwrite/mmap behavior when writing to active"
 		     " buffers.");
diff --git a/tests/gem_cpu_reloc.c b/tests/gem_cpu_reloc.c
index 45449ff..9dcd508 100644
--- a/tests/gem_cpu_reloc.c
+++ b/tests/gem_cpu_reloc.c
@@ -45,6 +45,7 @@
  * GPU will hang.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -56,13 +57,7 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Test the relocations through the CPU domain.");
 
diff --git a/tests/gem_cs_prefetch.c b/tests/gem_cs_prefetch.c
index ac3da6d..ea7882a 100644
--- a/tests/gem_cs_prefetch.c
+++ b/tests/gem_cs_prefetch.c
@@ -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 "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -46,13 +47,7 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Test the CS prefetch behaviour on batches.");
 
diff --git a/tests/gem_cs_tlb.c b/tests/gem_cs_tlb.c
index 62f446c..e436dd4 100644
--- a/tests/gem_cs_tlb.c
+++ b/tests/gem_cs_tlb.c
@@ -35,6 +35,7 @@
  * https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1063252
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -49,10 +50,6 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_io.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Check whether we correctly invalidate the cs tlb.");
 
diff --git a/tests/gem_ctx_bad_destroy.c b/tests/gem_ctx_bad_destroy.c
index ee89763..c1f6bd8 100644
--- a/tests/gem_ctx_bad_destroy.c
+++ b/tests/gem_ctx_bad_destroy.c
@@ -29,12 +29,11 @@
  * Negative test cases for destroy contexts
   */
 
+#include "igt.h"
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 
 IGT_TEST_DESCRIPTION("Negative test cases for destroy contexts.");
 
diff --git a/tests/gem_ctx_bad_exec.c b/tests/gem_ctx_bad_exec.c
index 36afd7d..2dd601d 100644
--- a/tests/gem_ctx_bad_exec.c
+++ b/tests/gem_ctx_bad_exec.c
@@ -30,6 +30,7 @@
  *  test we can't submit contexts to unsupported rings
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -42,8 +43,6 @@
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 
 IGT_TEST_DESCRIPTION("Test that context cannot be submitted to unsupported"
 		     " rings.");
diff --git a/tests/gem_ctx_basic.c b/tests/gem_ctx_basic.c
index 9aad7f8..967a3a7 100644
--- a/tests/gem_ctx_basic.c
+++ b/tests/gem_ctx_basic.c
@@ -29,6 +29,7 @@
  * This test is useful for finding memory and refcount leaks.
  */
 
+#include "igt.h"
 #include <pthread.h>
 #include <stdlib.h>
 #include <sys/ioctl.h>
@@ -40,12 +41,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Basic test for memory and refcount leaks.");
 
diff --git a/tests/gem_ctx_create.c b/tests/gem_ctx_create.c
index 046c974..4b60450 100644
--- a/tests/gem_ctx_create.c
+++ b/tests/gem_ctx_create.c
@@ -25,12 +25,11 @@
  *
  */
 
+#include "igt.h"
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 
 int ret, fd;
 struct drm_i915_gem_context_create create;
diff --git a/tests/gem_ctx_exec.c b/tests/gem_ctx_exec.c
index 3df939c..1277095 100644
--- a/tests/gem_ctx_exec.c
+++ b/tests/gem_ctx_exec.c
@@ -29,6 +29,7 @@
  * This test covers basic context switch functionality
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -43,10 +44,6 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "igt_aux.h"
-#include "igt_gt.h"
 
 IGT_TEST_DESCRIPTION("Test basic context switch functionality.");
 
diff --git a/tests/gem_ctx_param_basic.c b/tests/gem_ctx_param_basic.c
index 430a53b..ac5f038 100644
--- a/tests/gem_ctx_param_basic.c
+++ b/tests/gem_ctx_param_basic.c
@@ -24,12 +24,10 @@
  *    Daniel Vetter <daniel.vetter@xxxxxxxx>
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <sys/ioctl.h>
 #include <stdio.h>
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Basic test for context set/get param input validation.");
 
diff --git a/tests/gem_ctx_thrash.c b/tests/gem_ctx_thrash.c
index b4818f4..8e742ed 100644
--- a/tests/gem_ctx_thrash.c
+++ b/tests/gem_ctx_thrash.c
@@ -22,6 +22,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
@@ -30,10 +31,6 @@
 #include <sys/stat.h>
 #include <sys/resource.h>
 
-#include "ioctl_wrappers.h"
-#include "igt_aux.h"
-#include "intel_chipset.h"
-#include "drmtest.h"
 
 IGT_TEST_DESCRIPTION("Fill the Gobal GTT with context objects and VMs\n");
 
diff --git a/tests/gem_double_irq_loop.c b/tests/gem_double_irq_loop.c
index a43fd1a..fa4a9aa 100644
--- a/tests/gem_double_irq_loop.c
+++ b/tests/gem_double_irq_loop.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -34,13 +35,8 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.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 5e0a10a..21bf4bf 100644
--- a/tests/gem_dummy_reloc_loop.c
+++ b/tests/gem_dummy_reloc_loop.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -34,13 +35,8 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
 #include "i830_reg.h"
-#include "intel_chipset.h"
 
 #define LOCAL_I915_EXEC_VEBOX (4<<0)
 #define LOCAL_I915_EXEC_BSD_RING1 (1<<13)
diff --git a/tests/gem_eio.c b/tests/gem_eio.c
index 998766c..7b7815e 100644
--- a/tests/gem_eio.c
+++ b/tests/gem_eio.c
@@ -27,6 +27,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -38,11 +39,6 @@
 
 #include <drm.h>
 
-#include "drmtest.h"
-#include "ioctl_wrappers.h"
-#include "igt_core.h"
-#include "igt_aux.h"
-#include "igt_gt.h"
 
 IGT_TEST_DESCRIPTION("Test that specific ioctls report a wedged GPU (EIO).");
 
diff --git a/tests/gem_evict_alignment.c b/tests/gem_evict_alignment.c
index 02cbb3a..10f7902 100644
--- a/tests/gem_evict_alignment.c
+++ b/tests/gem_evict_alignment.c
@@ -30,6 +30,7 @@
  * 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>
@@ -44,11 +45,6 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_chipset.h"
-#include "igt_aux.h"
-#include "igt_gt.h"
 
 IGT_TEST_DESCRIPTION("Run a couple of big batches to force the unbind on"
 		     " misalignment code.");
diff --git a/tests/gem_evict_everything.c b/tests/gem_evict_everything.c
index 54acc2b..a7c3bf4 100644
--- a/tests/gem_evict_everything.c
+++ b/tests/gem_evict_everything.c
@@ -30,6 +30,7 @@
  * 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,10 +43,6 @@
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_chipset.h"
-#include "igt_gt.h"
 
 #include "eviction_common.c"
 
diff --git a/tests/gem_exec_alignment.c b/tests/gem_exec_alignment.c
index e5b8b73..21c3219 100644
--- a/tests/gem_exec_alignment.c
+++ b/tests/gem_exec_alignment.c
@@ -27,6 +27,7 @@
 
 /* Exercises the basic execbuffer using object alignments */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -36,9 +37,6 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "igt_debugfs.h"
-#include "drmtest.h"
 
 IGT_TEST_DESCRIPTION("Exercises the basic execbuffer using object alignments");
 
diff --git a/tests/gem_exec_bad_domains.c b/tests/gem_exec_bad_domains.c
index 69e9189..2fa205f 100644
--- a/tests/gem_exec_bad_domains.c
+++ b/tests/gem_exec_bad_domains.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -34,12 +35,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.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 171fd81..a7280aa 100644
--- a/tests/gem_exec_big.c
+++ b/tests/gem_exec_big.c
@@ -32,6 +32,7 @@
  * Mostly useful to stress-test the error-capture code
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -44,10 +45,6 @@
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "intel_chipset.h"
-#include "drmtest.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Run a large nop batch to stress test the error capture"
 		     " code.");
diff --git a/tests/gem_exec_blt.c b/tests/gem_exec_blt.c
index 151e448..765282b 100644
--- a/tests/gem_exec_blt.c
+++ b/tests/gem_exec_blt.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -37,10 +38,6 @@
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_chipset.h"
-#include "intel_io.h"
 
 #define OBJECT_SIZE 16384
 
diff --git a/tests/gem_exec_faulting_reloc.c b/tests/gem_exec_faulting_reloc.c
index 8b780a6..d538a2b 100644
--- a/tests/gem_exec_faulting_reloc.c
+++ b/tests/gem_exec_faulting_reloc.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -37,11 +38,6 @@
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_chipset.h"
-#include "intel_io.h"
-#include "igt_debugfs.h"
 
 /* Testcase: Submit patches with relocations in memory that will fault
  *
diff --git a/tests/gem_exec_lut_handle.c b/tests/gem_exec_lut_handle.c
index 6522443..52cc392 100644
--- a/tests/gem_exec_lut_handle.c
+++ b/tests/gem_exec_lut_handle.c
@@ -27,6 +27,7 @@
 
 /* Exercises the basic execbuffer using the handle LUT interface */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -36,9 +37,6 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "igt_debugfs.h"
-#include "drmtest.h"
 
 IGT_TEST_DESCRIPTION("Exercises the basic execbuffer using the handle LUT"
 		     " interface.");
diff --git a/tests/gem_exec_nop.c b/tests/gem_exec_nop.c
index c8fff2b..2eacd12 100644
--- a/tests/gem_exec_nop.c
+++ b/tests/gem_exec_nop.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -38,10 +39,6 @@
 #include <sys/time.h>
 #include <time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_io.h"
-#include "igt_stats.h"
 
 #define LOCAL_I915_EXEC_NO_RELOC (1<<11)
 #define LOCAL_I915_EXEC_HANDLE_LUT (1<<12)
diff --git a/tests/gem_exec_params.c b/tests/gem_exec_params.c
index b33a740..8dee362 100644
--- a/tests/gem_exec_params.c
+++ b/tests/gem_exec_params.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -38,11 +39,6 @@
 #include <sys/time.h>
 #include "drm.h"
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
-#include "igt_aux.h"
 
 #define LOCAL_I915_EXEC_VEBOX (4<<0)
 #define LOCAL_I915_EXEC_BSD_MASK (3<<13)
diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c
index 6105f49..0871fc9 100644
--- a/tests/gem_exec_parse.c
+++ b/tests/gem_exec_parse.c
@@ -22,6 +22,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdint.h>
 #include <stdio.h>
@@ -29,9 +30,6 @@
 
 #include <drm.h>
 
-#include "drmtest.h"
-#include "ioctl_wrappers.h"
-#include "intel_chipset.h"
 
 #ifndef I915_PARAM_CMD_PARSER_VERSION
 #define I915_PARAM_CMD_PARSER_VERSION       28
diff --git a/tests/gem_fd_exhaustion.c b/tests/gem_fd_exhaustion.c
index 8ba631f..b768c72 100644
--- a/tests/gem_fd_exhaustion.c
+++ b/tests/gem_fd_exhaustion.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/resource.h>
@@ -32,9 +33,6 @@
 #include <fcntl.h>
 #include <limits.h>
 
-#include "drmtest.h"
-#include "ioctl_wrappers.h"
-#include "igt_aux.h"
 
 
 #define FD_ARR_SZ 100
diff --git a/tests/gem_fence_thrash.c b/tests/gem_fence_thrash.c
index f9ec91e..46613b5 100644
--- a/tests/gem_fence_thrash.c
+++ b/tests/gem_fence_thrash.c
@@ -30,6 +30,7 @@
 #include "config.h"
 #endif
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -41,8 +42,6 @@
 #include <sys/ioctl.h>
 #include <pthread.h>
 #include "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_fence_upload.c b/tests/gem_fence_upload.c
index 9595bc8..9735b23 100644
--- a/tests/gem_fence_upload.c
+++ b/tests/gem_fence_upload.c
@@ -29,6 +29,7 @@
 #include "config.h"
 #endif
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -40,8 +41,6 @@
 #include <pthread.h>
 #include "drm.h"
 #include "i915_drm.h"
-#include "drmtest.h"
-#include "ioctl_wrappers.h"
 
 #define OBJECT_SIZE (1024*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 81cdff8..786e856 100644
--- a/tests/gem_fenced_exec_thrash.c
+++ b/tests/gem_fenced_exec_thrash.c
@@ -27,6 +27,7 @@
 
 #define _GNU_SOURCE
 
+#include "igt.h"
 #include <stdlib.h>
 #include <sys/ioctl.h>
 #include <stdio.h>
@@ -37,11 +38,6 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_chipset.h"
-#include "intel_io.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Test execbuf fence accounting.");
 
diff --git a/tests/gem_flink_basic.c b/tests/gem_flink_basic.c
index 91444e8..84d3101 100644
--- a/tests/gem_flink_basic.c
+++ b/tests/gem_flink_basic.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -34,8 +35,6 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 
 static void
 test_flink(int fd)
diff --git a/tests/gem_flink_race.c b/tests/gem_flink_race.c
index 889cb1b..766c24a 100644
--- a/tests/gem_flink_race.c
+++ b/tests/gem_flink_race.c
@@ -25,6 +25,7 @@
  */
 
 #define _GNU_SOURCE
+#include "igt.h"
 #include <sys/ioctl.h>
 #include <stdlib.h>
 #include <string.h>
@@ -33,10 +34,7 @@
 #include <pthread.h>
 #include <errno.h>
 
-#include "drmtest.h"
-#include "ioctl_wrappers.h"
 #include "intel_bufmgr.h"
-#include "igt_debugfs.h"
 
 IGT_TEST_DESCRIPTION("Check for flink/open vs. gem close races.");
 
diff --git a/tests/gem_gpgpu_fill.c b/tests/gem_gpgpu_fill.c
index df0d7c8..9a84f28 100644
--- a/tests/gem_gpgpu_fill.c
+++ b/tests/gem_gpgpu_fill.c
@@ -30,6 +30,7 @@
  * workload for the GPGPU pipeline.
  */
 
+#include "igt.h"
 #include <stdbool.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -42,12 +43,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 #define WIDTH 64
 #define HEIGHT 64
diff --git a/tests/gem_gtt_cpu_tlb.c b/tests/gem_gtt_cpu_tlb.c
index a019061..0808f6c 100644
--- a/tests/gem_gtt_cpu_tlb.c
+++ b/tests/gem_gtt_cpu_tlb.c
@@ -30,6 +30,7 @@
  * This test checks whether gtt tlbs for cpu access are correctly invalidated.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -40,9 +41,6 @@
 #include <sys/time.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_io.h"
 
 IGT_TEST_DESCRIPTION("Check whether gtt tlbs for cpu access are correctly"
 		     " invalidated.");
diff --git a/tests/gem_gtt_hog.c b/tests/gem_gtt_hog.c
index 39dfa48..6be6f24 100644
--- a/tests/gem_gtt_hog.c
+++ b/tests/gem_gtt_hog.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -39,9 +40,6 @@
 #include <sys/wait.h>
 
 #include "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 d5e745e..5eb639f 100644
--- a/tests/gem_gtt_speed.c
+++ b/tests/gem_gtt_speed.c
@@ -26,6 +26,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -38,8 +39,6 @@
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include "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 8767615..d406709 100644
--- a/tests/gem_hang.c
+++ b/tests/gem_hang.c
@@ -26,6 +26,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -35,12 +36,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_chipset.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
 
 static drm_intel_bufmgr *bufmgr;
 struct intel_batchbuffer *batch;
diff --git a/tests/gem_hangcheck_forcewake.c b/tests/gem_hangcheck_forcewake.c
index f274fab..70d3f99 100644
--- a/tests/gem_hangcheck_forcewake.c
+++ b/tests/gem_hangcheck_forcewake.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -34,12 +35,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Provoke the hangcheck timer on an otherwise idle"
 		     " system.");
diff --git a/tests/gem_largeobject.c b/tests/gem_largeobject.c
index 0f929f8..1960307 100644
--- a/tests/gem_largeobject.c
+++ b/tests/gem_largeobject.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -34,8 +35,6 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 
 /* Should take 64 pages to store the page pointers on 64 bit */
 #define OBJ_SIZE (128 * 1024 * 1024)
diff --git a/tests/gem_linear_blits.c b/tests/gem_linear_blits.c
index e5d2141..06be78a 100644
--- a/tests/gem_linear_blits.c
+++ b/tests/gem_linear_blits.c
@@ -33,6 +33,7 @@
  * The goal is to simply ensure the basics work.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -44,11 +45,6 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "intel_chipset.h"
-#include "drmtest.h"
-#include "intel_io.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Test doing many blits with a working set larger than the"
 		     " aperture size.");
diff --git a/tests/gem_lut_handle.c b/tests/gem_lut_handle.c
index 7fc72f1..9aa6f59 100644
--- a/tests/gem_lut_handle.c
+++ b/tests/gem_lut_handle.c
@@ -27,6 +27,7 @@
 
 /* Exercises the basic execbuffer using the handle LUT interface */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -36,8 +37,6 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 
 IGT_TEST_DESCRIPTION("Exercises the basic execbuffer using the handle LUT"
 		     " interface.");
diff --git a/tests/gem_madvise.c b/tests/gem_madvise.c
index 58ab629..1b03b27 100644
--- a/tests/gem_madvise.c
+++ b/tests/gem_madvise.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -36,8 +37,6 @@
 #include <signal.h>
 
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 
 IGT_TEST_DESCRIPTION("Checks that the kernel reports EFAULT when trying to use"
 		     " purged bo.");
diff --git a/tests/gem_media_fill.c b/tests/gem_media_fill.c
index ade56f2..d187bdb 100644
--- a/tests/gem_media_fill.c
+++ b/tests/gem_media_fill.c
@@ -30,6 +30,7 @@
  * workload for the Media pipeline.
  */
 
+#include "igt.h"
 #include <stdbool.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -42,12 +43,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Basic test for the media_fill() function, a very simple"
 		     " workload for the Media pipeline.");
diff --git a/tests/gem_mmap.c b/tests/gem_mmap.c
index 5952983..c06a80b 100644
--- a/tests/gem_mmap.c
+++ b/tests/gem_mmap.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -35,9 +36,6 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "igt_aux.h"
-#include "drmtest.h"
 
 #define OBJECT_SIZE 16384
 #define PAGE_SIZE 4096
diff --git a/tests/gem_mmap_gtt.c b/tests/gem_mmap_gtt.c
index 644b30c..b5f9d12 100644
--- a/tests/gem_mmap_gtt.c
+++ b/tests/gem_mmap_gtt.c
@@ -26,6 +26,7 @@
  */
 
 #define _GNU_SOURCE
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -37,10 +38,6 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "igt_debugfs.h"
-#include "igt_aux.h"
 
 #ifndef PAGE_SIZE
 #define PAGE_SIZE 4096
diff --git a/tests/gem_mmap_offset_exhaustion.c b/tests/gem_mmap_offset_exhaustion.c
index b031050..eae77d8 100644
--- a/tests/gem_mmap_offset_exhaustion.c
+++ b/tests/gem_mmap_offset_exhaustion.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -35,8 +36,6 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 
 IGT_TEST_DESCRIPTION("Checks whether the kernel handles mmap offset exhaustion"
 		     " correctly.");
diff --git a/tests/gem_mmap_wc.c b/tests/gem_mmap_wc.c
index 0a5326e..f46c045 100644
--- a/tests/gem_mmap_wc.c
+++ b/tests/gem_mmap_wc.c
@@ -26,6 +26,7 @@
  */
 
 #define _GNU_SOURCE
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -37,9 +38,6 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "igt_debugfs.h"
 
 struct local_i915_gem_mmap_v2 {
 	uint32_t handle;
diff --git a/tests/gem_multi_bsd_sync_loop.c b/tests/gem_multi_bsd_sync_loop.c
index 0766eb6..1d36bef 100644
--- a/tests/gem_multi_bsd_sync_loop.c
+++ b/tests/gem_multi_bsd_sync_loop.c
@@ -26,6 +26,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -35,13 +36,8 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
 #include "i830_reg.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Basic check of ring<->ring sync using a dummy reloc.");
 
diff --git a/tests/gem_non_secure_batch.c b/tests/gem_non_secure_batch.c
index d00ce45..afa8ce0 100644
--- a/tests/gem_non_secure_batch.c
+++ b/tests/gem_non_secure_batch.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -34,12 +35,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_chipset.h"
-#include "intel_io.h"
 #include "i830_reg.h"
 
 IGT_TEST_DESCRIPTION("Basic check of non-secure batches.");
diff --git a/tests/gem_partial_pwrite_pread.c b/tests/gem_partial_pwrite_pread.c
index 0be749c..5722a0b 100644
--- a/tests/gem_partial_pwrite_pread.c
+++ b/tests/gem_partial_pwrite_pread.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -36,11 +37,6 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_chipset.h"
-#include "intel_io.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Test pwrite/pread consistency when touching partial"
 		     " cachelines.");
diff --git a/tests/gem_persistent_relocs.c b/tests/gem_persistent_relocs.c
index d57e172..547fd82 100644
--- a/tests/gem_persistent_relocs.c
+++ b/tests/gem_persistent_relocs.c
@@ -26,6 +26,7 @@
  */
 
 #define _GNU_SOURCE
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -39,12 +40,6 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_chipset.h"
-#include "intel_io.h"
-#include "igt_debugfs.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Test persistent relocations as used by uxa/libva.");
 
diff --git a/tests/gem_pin.c b/tests/gem_pin.c
index b35496e..743e299 100644
--- a/tests/gem_pin.c
+++ b/tests/gem_pin.c
@@ -27,6 +27,7 @@
 
 /* Exercises pinning of small bo */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -38,11 +39,6 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_chipset.h"
-#include "intel_io.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Exercises pinning of small buffer objects.");
 
diff --git a/tests/gem_pipe_control_store_loop.c b/tests/gem_pipe_control_store_loop.c
index 86ee405..83e3779 100644
--- a/tests/gem_pipe_control_store_loop.c
+++ b/tests/gem_pipe_control_store_loop.c
@@ -31,6 +31,7 @@
  * 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,12 +41,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_chipset.h"
-#include "intel_io.h"
 
 IGT_TEST_DESCRIPTION("Test (TLB-)Coherency of pipe_control QW writes.");
 
diff --git a/tests/gem_ppgtt.c b/tests/gem_ppgtt.c
index d1e484a..4f6df06 100644
--- a/tests/gem_ppgtt.c
+++ b/tests/gem_ppgtt.c
@@ -21,6 +21,7 @@
  * IN THE SOFTWARE.
  */
 
+#include "igt.h"
 #include <stdbool.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -35,13 +36,7 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
-#include "igt_aux.h"
 
 #define WIDTH 512
 #define STRIDE (WIDTH*4)
diff --git a/tests/gem_pread.c b/tests/gem_pread.c
index 3ec5fb1..2675362 100644
--- a/tests/gem_pread.c
+++ b/tests/gem_pread.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -37,8 +38,6 @@
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include "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 8ed4310..c5422dd 100644
--- a/tests/gem_pread_after_blit.c
+++ b/tests/gem_pread_after_blit.c
@@ -34,6 +34,7 @@
  * ranged-buffer-flush paths in the kernel.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -45,12 +46,6 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_chipset.h"
-#include "intel_io.h"
-#include "igt_aux.h"
-#include "igt_gt.h"
 
 IGT_TEST_DESCRIPTION("Test pread behavior when getting values out of"
 		     " just-drawn-to buffers.");
diff --git a/tests/gem_pwrite.c b/tests/gem_pwrite.c
index 1d867e7..5c11f99 100644
--- a/tests/gem_pwrite.c
+++ b/tests/gem_pwrite.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -37,9 +38,6 @@
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "igt_aux.h"
 
 #define OBJECT_SIZE 16384
 
diff --git a/tests/gem_pwrite_pread.c b/tests/gem_pwrite_pread.c
index 88c2070..ae11905 100644
--- a/tests/gem_pwrite_pread.c
+++ b/tests/gem_pwrite_pread.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -37,12 +38,7 @@
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_chipset.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
 
 #define OBJECT_SIZE 16384
 
diff --git a/tests/gem_pwrite_snooped.c b/tests/gem_pwrite_snooped.c
index 890c61d..d3f6223 100644
--- a/tests/gem_pwrite_snooped.c
+++ b/tests/gem_pwrite_snooped.c
@@ -22,6 +22,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -34,10 +35,6 @@
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "intel_chipset.h"
-#include "drmtest.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION(
    "pwrite to a snooped bo then make it uncached and check that the GPU sees the data.");
diff --git a/tests/gem_read_read_speed.c b/tests/gem_read_read_speed.c
index e60f193..18b3cad 100644
--- a/tests/gem_read_read_speed.c
+++ b/tests/gem_read_read_speed.c
@@ -26,6 +26,7 @@
  * This is a test of performance with multiple readers from the same source.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -39,15 +40,7 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "igt_aux.h"
-#include "igt_core.h"
-#include "igt_gt.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Test speed of concurrent reads between engines.");
 
diff --git a/tests/gem_readwrite.c b/tests/gem_readwrite.c
index a8a7105..eaae047 100644
--- a/tests/gem_readwrite.c
+++ b/tests/gem_readwrite.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -35,8 +36,6 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include "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 28ecdf5..03617d3 100644
--- a/tests/gem_reg_read.c
+++ b/tests/gem_reg_read.c
@@ -25,14 +25,13 @@
  *
  */
 
+#include "igt.h"
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
 #include <sys/utsname.h>
 #include <time.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 
 static bool is_x86_64;
 static bool has_proper_timestamp;
diff --git a/tests/gem_reloc_overflow.c b/tests/gem_reloc_overflow.c
index ea59171..71e3cef 100644
--- a/tests/gem_reloc_overflow.c
+++ b/tests/gem_reloc_overflow.c
@@ -28,6 +28,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
@@ -43,10 +44,6 @@
 #include <sys/time.h>
 #include <sys/types.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "intel_chipset.h"
-#include "drmtest.h"
-#include "intel_io.h"
 
 IGT_TEST_DESCRIPTION("Check that kernel relocation overflows are caught.");
 
diff --git a/tests/gem_reloc_vs_gpu.c b/tests/gem_reloc_vs_gpu.c
index 47fbe75..65f46c3 100644
--- a/tests/gem_reloc_vs_gpu.c
+++ b/tests/gem_reloc_vs_gpu.c
@@ -26,6 +26,7 @@
  */
 
 #define _GNU_SOURCE
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -39,13 +40,6 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_chipset.h"
-#include "intel_io.h"
-#include "igt_debugfs.h"
-#include "igt_aux.h"
-#include "igt_gt.h"
 
 IGT_TEST_DESCRIPTION("Test kernel relocations vs. gpu races.");
 
diff --git a/tests/gem_render_copy.c b/tests/gem_render_copy.c
index ee37f8a..a031b05 100644
--- a/tests/gem_render_copy.c
+++ b/tests/gem_render_copy.c
@@ -29,6 +29,7 @@
  * workload for the 3D engine.
  */
 
+#include "igt.h"
 #include <stdbool.h>
 #include <unistd.h>
 #include <cairo.h>
@@ -44,13 +45,7 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Basic test for the render_copy() function.");
 
diff --git a/tests/gem_render_copy_redux.c b/tests/gem_render_copy_redux.c
index 43d4c5a..966270f 100644
--- a/tests/gem_render_copy_redux.c
+++ b/tests/gem_render_copy_redux.c
@@ -32,6 +32,7 @@
  * the execbuffer interface with a simple render workload.
  */
 
+#include "igt.h"
 #include <stdbool.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -46,13 +47,7 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Advanced test for the render_copy() function.");
 
diff --git a/tests/gem_render_linear_blits.c b/tests/gem_render_linear_blits.c
index f83c6d4..6436796 100644
--- a/tests/gem_render_linear_blits.c
+++ b/tests/gem_render_linear_blits.c
@@ -37,6 +37,7 @@
 #include "config.h"
 #endif
 
+#include "igt.h"
 #include <stdlib.h>
 #include <sys/ioctl.h>
 #include <stdio.h>
@@ -49,13 +50,7 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
-#include "igt_aux.h"
 
 #define WIDTH 512
 #define STRIDE (WIDTH*4)
diff --git a/tests/gem_render_tiled_blits.c b/tests/gem_render_tiled_blits.c
index f669270..c820a69 100644
--- a/tests/gem_render_tiled_blits.c
+++ b/tests/gem_render_tiled_blits.c
@@ -33,6 +33,7 @@
  * The goal is to simply ensure the basics work.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <sys/ioctl.h>
 #include <stdio.h>
@@ -45,13 +46,7 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
-#include "igt_aux.h"
 
 #define WIDTH 512
 #define STRIDE (WIDTH*4)
diff --git a/tests/gem_reset_stats.c b/tests/gem_reset_stats.c
index 2bb4291..c2992c9 100644
--- a/tests/gem_reset_stats.c
+++ b/tests/gem_reset_stats.c
@@ -26,6 +26,7 @@
  */
 
 #define _GNU_SOURCE
+#include "igt.h"
 #include <stdbool.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -40,12 +41,6 @@
 #include <time.h>
 #include <signal.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "igt_gt.h"
-#include "intel_chipset.h"
-#include "intel_io.h"
-#include "igt_aux.h"
 
 #define RS_NO_ERROR      0
 #define RS_BATCH_ACTIVE  (1 << 0)
diff --git a/tests/gem_ring_sync_copy.c b/tests/gem_ring_sync_copy.c
index 13af198..e1e7c69 100644
--- a/tests/gem_ring_sync_copy.c
+++ b/tests/gem_ring_sync_copy.c
@@ -47,13 +47,10 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdbool.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_batchbuffer.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Ensure inter-ring dependencies are respected.");
 
diff --git a/tests/gem_ring_sync_loop.c b/tests/gem_ring_sync_loop.c
index 4b88530..4580060 100644
--- a/tests/gem_ring_sync_loop.c
+++ b/tests/gem_ring_sync_loop.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -34,13 +35,8 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
 #include "i830_reg.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Basic check of ring<->ring sync using a dummy reloc.");
 
diff --git a/tests/gem_ringfill.c b/tests/gem_ringfill.c
index ee4720d..cb46e7a 100644
--- a/tests/gem_ringfill.c
+++ b/tests/gem_ringfill.c
@@ -31,6 +31,7 @@
  * catching failure to manage the ring properly near full.
  */
 
+#include "igt.h"
 #include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -43,11 +44,6 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_chipset.h"
-#include "intel_io.h"
-#include "igt_aux.h"
 
 struct bo {
 	const char *ring;
diff --git a/tests/gem_seqno_wrap.c b/tests/gem_seqno_wrap.c
index d7d56ed..0cf3d58 100644
--- a/tests/gem_seqno_wrap.c
+++ b/tests/gem_seqno_wrap.c
@@ -30,6 +30,7 @@
  * boundary.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
@@ -41,15 +42,7 @@
 #include <signal.h>
 #include <errno.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "igt_core.h"
-#include "igt_aux.h"
-#include "igt_debugfs.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Runs blitcopy -> rendercopy with multiple buffers over"
 		     " wrap boundary.");
diff --git a/tests/gem_set_tiling_vs_blt.c b/tests/gem_set_tiling_vs_blt.c
index 956308a..6ce5a14 100644
--- a/tests/gem_set_tiling_vs_blt.c
+++ b/tests/gem_set_tiling_vs_blt.c
@@ -44,6 +44,7 @@
  * transitions (i.e. changing stride).
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -54,12 +55,7 @@
 #include <sys/time.h>
 #include <stdbool.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_chipset.h"
-#include "intel_io.h"
 
 IGT_TEST_DESCRIPTION("Check for proper synchronization of tiling changes vs."
 		     " tiled gpu access.");
diff --git a/tests/gem_set_tiling_vs_gtt.c b/tests/gem_set_tiling_vs_gtt.c
index 006f50a..4a3cba6 100644
--- a/tests/gem_set_tiling_vs_gtt.c
+++ b/tests/gem_set_tiling_vs_gtt.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -35,10 +36,6 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Check set_tiling vs gtt mmap coherency.");
 
diff --git a/tests/gem_set_tiling_vs_pwrite.c b/tests/gem_set_tiling_vs_pwrite.c
index a4bdc64..4d20835 100644
--- a/tests/gem_set_tiling_vs_pwrite.c
+++ b/tests/gem_set_tiling_vs_pwrite.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -35,9 +36,6 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_io.h"
 
 IGT_TEST_DESCRIPTION("Check set_tiling vs pwrite coherency.");
 
diff --git a/tests/gem_storedw_batches_loop.c b/tests/gem_storedw_batches_loop.c
index de55359..5233541 100644
--- a/tests/gem_storedw_batches_loop.c
+++ b/tests/gem_storedw_batches_loop.c
@@ -26,6 +26,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -35,12 +36,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_chipset.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
 
 static drm_intel_bufmgr *bufmgr;
 static drm_intel_bo *target_bo;
diff --git a/tests/gem_storedw_loop.c b/tests/gem_storedw_loop.c
index e4ed35d..ee2f518 100644
--- a/tests/gem_storedw_loop.c
+++ b/tests/gem_storedw_loop.c
@@ -26,6 +26,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -35,12 +36,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Basic CS check using MI_STORE_DATA_IMM.");
 
diff --git a/tests/gem_storedw_loop_blt.c b/tests/gem_storedw_loop_blt.c
index 44e46a8..e463a27 100644
--- a/tests/gem_storedw_loop_blt.c
+++ b/tests/gem_storedw_loop_blt.c
@@ -26,6 +26,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -35,12 +36,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Basic blitter MI check using MI_STORE_DATA_IMM.");
 
diff --git a/tests/gem_storedw_loop_bsd.c b/tests/gem_storedw_loop_bsd.c
index e534c16..c9deb81 100644
--- a/tests/gem_storedw_loop_bsd.c
+++ b/tests/gem_storedw_loop_bsd.c
@@ -26,6 +26,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -35,12 +36,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Basic bsd MI check using MI_STORE_DATA_IMM.");
 
diff --git a/tests/gem_storedw_loop_render.c b/tests/gem_storedw_loop_render.c
index 48fb6d4..6d7a1fb 100644
--- a/tests/gem_storedw_loop_render.c
+++ b/tests/gem_storedw_loop_render.c
@@ -26,6 +26,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -35,12 +36,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Basic render MI check using MI_STORE_DATA_IMM.");
 
diff --git a/tests/gem_storedw_loop_vebox.c b/tests/gem_storedw_loop_vebox.c
index 8643dd3..3fec02c 100644
--- a/tests/gem_storedw_loop_vebox.c
+++ b/tests/gem_storedw_loop_vebox.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -34,12 +35,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Basic vebox MI check using MI_STORE_DATA_IMM.");
 
diff --git a/tests/gem_streaming_writes.c b/tests/gem_streaming_writes.c
index 5d49e6f..119f8b2 100644
--- a/tests/gem_streaming_writes.c
+++ b/tests/gem_streaming_writes.c
@@ -26,6 +26,7 @@
  */
 
 #define _GNU_SOURCE
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -37,11 +38,6 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "igt_debugfs.h"
-#include "igt_aux.h"
-#include "intel_chipset.h"
 
 #define OBJECT_SIZE 1024*1024
 #define CHUNK_SIZE 32
diff --git a/tests/gem_stress.c b/tests/gem_stress.c
index 472263d..becb991 100644
--- a/tests/gem_stress.c
+++ b/tests/gem_stress.c
@@ -49,6 +49,7 @@
  * In short: designed for maximum evilness.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <sys/ioctl.h>
 #include <stdio.h>
@@ -61,13 +62,7 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("General gem coherency test.");
 
diff --git a/tests/gem_threaded_access_tiled.c b/tests/gem_threaded_access_tiled.c
index 16a50ad..d6a4840 100644
--- a/tests/gem_threaded_access_tiled.c
+++ b/tests/gem_threaded_access_tiled.c
@@ -24,14 +24,13 @@
  *    Mika Kuoppala <mika.kuoppala@xxxxxxxxx>
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <string.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <pthread.h>
 
-#include "drmtest.h"
-#include "ioctl_wrappers.h"
 #include "intel_bufmgr.h"
 
 IGT_TEST_DESCRIPTION("Check parallel access to tiled memory.");
diff --git a/tests/gem_tiled_blits.c b/tests/gem_tiled_blits.c
index 3fceb81..eb93f8d 100644
--- a/tests/gem_tiled_blits.c
+++ b/tests/gem_tiled_blits.c
@@ -41,6 +41,7 @@
  * resulted.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -52,11 +53,6 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_chipset.h"
-#include "intel_io.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Test doing many tiled blits, with a working set larger"
 		     " than the aperture size.");
diff --git a/tests/gem_tiled_fence_blits.c b/tests/gem_tiled_fence_blits.c
index 5dd5bbe..b35a960 100644
--- a/tests/gem_tiled_fence_blits.c
+++ b/tests/gem_tiled_fence_blits.c
@@ -41,6 +41,7 @@
  * resulted.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -52,13 +53,7 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
-#include "igt_aux.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 8dea82e..16d16c8 100644
--- a/tests/gem_tiled_partial_pwrite_pread.c
+++ b/tests/gem_tiled_partial_pwrite_pread.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -36,11 +37,6 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_chipset.h"
-#include "intel_io.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Test pwrite/pread consistency when touching partial"
 		     " cachelines.");
diff --git a/tests/gem_tiled_pread_basic.c b/tests/gem_tiled_pread_basic.c
index fdc5173..4292e11 100644
--- a/tests/gem_tiled_pread_basic.c
+++ b/tests/gem_tiled_pread_basic.c
@@ -35,6 +35,7 @@
  * other systems.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -45,10 +46,6 @@
 #include <sys/time.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 
 IGT_TEST_DESCRIPTION("Test pread behavior on tiled objects with respect to the"
diff --git a/tests/gem_tiled_pread_pwrite.c b/tests/gem_tiled_pread_pwrite.c
index 3d8fdc9..66a87b2 100644
--- a/tests/gem_tiled_pread_pwrite.c
+++ b/tests/gem_tiled_pread_pwrite.c
@@ -44,6 +44,7 @@
  * Note that this test will use swap in an effort to test all of ram.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -56,10 +57,6 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_io.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Test swizzling by testing pwrite does the inverse of"
 		     " pread.");
diff --git a/tests/gem_tiled_swapping.c b/tests/gem_tiled_swapping.c
index 072bf9a..22593ed 100644
--- a/tests/gem_tiled_swapping.c
+++ b/tests/gem_tiled_swapping.c
@@ -44,6 +44,7 @@
  * This test obviously needs swap present (and exits if none is detected).
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -57,11 +58,6 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_io.h"
-#include "igt_aux.h"
-#include "igt_debugfs.h"
 
 IGT_TEST_DESCRIPTION("Exercise swizzle code for swapping.");
 
diff --git a/tests/gem_tiled_wb.c b/tests/gem_tiled_wb.c
index b6efd6e..ea1e7a1 100644
--- a/tests/gem_tiled_wb.c
+++ b/tests/gem_tiled_wb.c
@@ -32,6 +32,7 @@
  * to userspace, and that userspace has to respect the swizzle.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -42,10 +43,6 @@
 #include <sys/time.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("This is a test of write-combining mmap's behavior on"
 		     " tiled objects with respect to the reported swizzling"
diff --git a/tests/gem_tiled_wc.c b/tests/gem_tiled_wc.c
index b0f7a65..8c1e9be 100644
--- a/tests/gem_tiled_wc.c
+++ b/tests/gem_tiled_wc.c
@@ -32,6 +32,7 @@
  * to userspace, and that userspace has to respect the swizzle.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -42,10 +43,6 @@
 #include <sys/time.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 #define WIDTH 512
 #define HEIGHT 512
diff --git a/tests/gem_tiling_max_stride.c b/tests/gem_tiling_max_stride.c
index fce1ac7..9ab5341 100644
--- a/tests/gem_tiling_max_stride.c
+++ b/tests/gem_tiling_max_stride.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -36,10 +37,6 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Check that max fence stride works.");
 
diff --git a/tests/gem_unfence_active_buffers.c b/tests/gem_unfence_active_buffers.c
index 125568e..d169253 100644
--- a/tests/gem_unfence_active_buffers.c
+++ b/tests/gem_unfence_active_buffers.c
@@ -38,6 +38,7 @@
  * problem - the race window is too small.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -48,12 +49,7 @@
 #include <sys/time.h>
 #include <stdbool.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Check for use-after-free in the fence stealing code.");
 
diff --git a/tests/gem_unref_active_buffers.c b/tests/gem_unref_active_buffers.c
index 8c8efaa..6478257 100644
--- a/tests/gem_unref_active_buffers.c
+++ b/tests/gem_unref_active_buffers.c
@@ -32,6 +32,7 @@
  * 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,12 +42,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Test unreferencing of active buffers.");
 
diff --git a/tests/gem_userptr_blits.c b/tests/gem_userptr_blits.c
index 1f2cc96..448a0ea 100644
--- a/tests/gem_userptr_blits.c
+++ b/tests/gem_userptr_blits.c
@@ -36,6 +36,7 @@
  * The goal is to simply ensure the basics work.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -52,11 +53,7 @@
 #include "drm.h"
 #include "i915_drm.h"
 
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_chipset.h"
-#include "ioctl_wrappers.h"
 
 #include "eviction_common.c"
 
diff --git a/tests/gem_wait.c b/tests/gem_wait.c
index a785b16..32d05f8 100644
--- a/tests/gem_wait.c
+++ b/tests/gem_wait.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdio.h>
 #include <time.h>
 #include <stdlib.h>
@@ -39,13 +40,7 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
-#include "igt_aux.h"
 
 #define MSEC_PER_SEC	1000L
 #define USEC_PER_MSEC	1000L
diff --git a/tests/gem_workarounds.c b/tests/gem_workarounds.c
index f1da3ef..3759c23 100644
--- a/tests/gem_workarounds.c
+++ b/tests/gem_workarounds.c
@@ -26,6 +26,7 @@
  */
 
 #define _GNU_SOURCE
+#include "igt.h"
 #include <stdbool.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -40,12 +41,6 @@
 #include <time.h>
 #include <signal.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "igt_gt.h"
-#include "igt_aux.h"
-#include "intel_chipset.h"
-#include "intel_io.h"
 
 enum operation {
 	GPU_RESET = 0x01,
diff --git a/tests/gem_write_read_ring_switch.c b/tests/gem_write_read_ring_switch.c
index da579da..5bc3dac 100644
--- a/tests/gem_write_read_ring_switch.c
+++ b/tests/gem_write_read_ring_switch.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -36,12 +37,7 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_chipset.h"
-#include "intel_io.h"
 #include "i830_reg.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Check read/write syncpoints when switching rings.");
 
diff --git a/tests/gen3_mixed_blits.c b/tests/gen3_mixed_blits.c
index 6203982..309a643 100644
--- a/tests/gen3_mixed_blits.c
+++ b/tests/gen3_mixed_blits.c
@@ -33,6 +33,7 @@
  * The goal is to simply ensure the basics work.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -43,13 +44,8 @@
 #include <sys/time.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 #include "i915_reg.h"
-#include "i915_3d.h"
 
 #define WIDTH (512)
 #define HEIGHT (512)
diff --git a/tests/gen3_render_linear_blits.c b/tests/gen3_render_linear_blits.c
index 5ed4c82..4d864c2 100644
--- a/tests/gen3_render_linear_blits.c
+++ b/tests/gen3_render_linear_blits.c
@@ -33,6 +33,7 @@
  * The goal is to simply ensure the basics work.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -42,13 +43,8 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 #include "i915_reg.h"
-#include "i915_3d.h"
 
 #define WIDTH 512
 #define HEIGHT 512
diff --git a/tests/gen3_render_mixed_blits.c b/tests/gen3_render_mixed_blits.c
index 5e5e417..1fcea1a 100644
--- a/tests/gen3_render_mixed_blits.c
+++ b/tests/gen3_render_mixed_blits.c
@@ -33,6 +33,7 @@
  * The goal is to simply ensure the basics work.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -43,13 +44,8 @@
 #include <sys/time.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 #include "i915_reg.h"
-#include "i915_3d.h"
 
 #define WIDTH 512
 #define HEIGHT 512
diff --git a/tests/gen3_render_tiledx_blits.c b/tests/gen3_render_tiledx_blits.c
index 4f309f7..e72149b 100644
--- a/tests/gen3_render_tiledx_blits.c
+++ b/tests/gen3_render_tiledx_blits.c
@@ -33,6 +33,7 @@
  * The goal is to simply ensure the basics work.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -43,13 +44,8 @@
 #include <sys/time.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 #include "i915_reg.h"
-#include "i915_3d.h"
 
 #define WIDTH 512
 #define HEIGHT 512
diff --git a/tests/gen3_render_tiledy_blits.c b/tests/gen3_render_tiledy_blits.c
index 57ed984..f0a07f4 100644
--- a/tests/gen3_render_tiledy_blits.c
+++ b/tests/gen3_render_tiledy_blits.c
@@ -33,6 +33,7 @@
  * The goal is to simply ensure the basics work.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -43,13 +44,8 @@
 #include <sys/time.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 #include "i915_reg.h"
-#include "i915_3d.h"
 
 #define WIDTH 512
 #define HEIGHT 512
diff --git a/tests/gen7_forcewake_mt.c b/tests/gen7_forcewake_mt.c
index 7873078..754c843 100644
--- a/tests/gen7_forcewake_mt.c
+++ b/tests/gen7_forcewake_mt.c
@@ -30,16 +30,12 @@
  *
  */
 
+#include "igt.h"
 #include <sys/types.h>
 #include <pthread.h>
 #include <string.h>
 
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "i915_pciids.h"
-#include "drmtest.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Exercise a suspect workaround required for"
 		     " FORCEWAKE_MT.");
diff --git a/tests/kms_3d.c b/tests/kms_3d.c
index 76f0b25..73b1f3e 100644
--- a/tests/kms_3d.c
+++ b/tests/kms_3d.c
@@ -22,9 +22,7 @@
  *
  */
 
-#include "igt_core.h"
-#include "igt_kms.h"
-#include "drmtest.h"
+#include "igt.h"
 
 IGT_TEST_DESCRIPTION("Tests 3D mode setting.");
 
diff --git a/tests/kms_addfb_basic.c b/tests/kms_addfb_basic.c
index f10e12b..38af334 100644
--- a/tests/kms_addfb_basic.c
+++ b/tests/kms_addfb_basic.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -35,10 +36,7 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "drm_fourcc.h"
-#include "intel_chipset.h"
 
 uint32_t gem_bo;
 uint32_t gem_bo_small;
diff --git a/tests/kms_crtc_background_color.c b/tests/kms_crtc_background_color.c
index ec66e78..b09f55c 100644
--- a/tests/kms_crtc_background_color.c
+++ b/tests/kms_crtc_background_color.c
@@ -22,12 +22,9 @@
  *
  */
 
+#include "igt.h"
 #include <math.h>
 
-#include "drmtest.h"
-#include "igt_debugfs.h"
-#include "igt_kms.h"
-#include "igt_core.h"
 
 IGT_TEST_DESCRIPTION("Test crtc background color feature");
 
diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index 98a91d9..1317fcc 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -22,17 +22,13 @@
  *
  */
 
+#include "igt.h"
 #include <errno.h>
 #include <limits.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 
-#include "drmtest.h"
-#include "igt_debugfs.h"
-#include "igt_kms.h"
-#include "intel_chipset.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION(
    "Use the display CRC support to validate cursor plane functionality. "
diff --git a/tests/kms_draw_crc.c b/tests/kms_draw_crc.c
index 9c73077..ba67c59 100644
--- a/tests/kms_draw_crc.c
+++ b/tests/kms_draw_crc.c
@@ -24,12 +24,7 @@
 
 /* This program tests whether the igt_draw library actually works. */
 
-#include "drmtest.h"
-#include "igt_aux.h"
-#include "igt_draw.h"
-#include "igt_debugfs.h"
-#include "igt_fb.h"
-#include "igt_kms.h"
+#include "igt.h"
 
 #define MAX_CONNECTORS 32
 
diff --git a/tests/kms_fbc_crc.c b/tests/kms_fbc_crc.c
index 73b5170..7b4a667 100644
--- a/tests/kms_fbc_crc.c
+++ b/tests/kms_fbc_crc.c
@@ -22,18 +22,12 @@
  *
  */
 
+#include "igt.h"
 #include <errno.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 
-#include "drmtest.h"
-#include "igt_aux.h"
-#include "igt_debugfs.h"
-#include "igt_kms.h"
-#include "intel_chipset.h"
-#include "intel_batchbuffer.h"
-#include "ioctl_wrappers.h"
 
 IGT_TEST_DESCRIPTION(
    "Performs various write operations to the scanout buffer while FBC is "
diff --git a/tests/kms_fbcon_fbt.c b/tests/kms_fbcon_fbt.c
index 7a49470..4970c89 100644
--- a/tests/kms_fbcon_fbt.c
+++ b/tests/kms_fbcon_fbt.c
@@ -24,15 +24,11 @@
  *
  */
 
+#include "igt.h"
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 
-#include "drmtest.h"
-#include "igt_aux.h"
-#include "igt_debugfs.h"
-#include "igt_draw.h"
-#include "igt_kms.h"
 
 IGT_TEST_DESCRIPTION("Test the relationship between fbcon and the frontbuffer "
 		     "tracking infrastructure.");
diff --git a/tests/kms_fence_pin_leak.c b/tests/kms_fence_pin_leak.c
index 4d3d37a..b9d600e 100644
--- a/tests/kms_fence_pin_leak.c
+++ b/tests/kms_fence_pin_leak.c
@@ -22,18 +22,13 @@
  *
  */
 
+#include "igt.h"
 #include <errno.h>
 #include <limits.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 
-#include "drmtest.h"
-#include "igt_debugfs.h"
-#include "igt_kms.h"
-#include "ioctl_wrappers.h"
-#include "intel_chipset.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Exercises full ppgtt fence pin_count leak in the "
 		     "kernel.");
diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 9a6e2d8..93c4fbd 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -25,6 +25,7 @@
 #include "config.h"
 #endif
 
+#include "igt.h"
 #include <cairo.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -42,13 +43,6 @@
 #include <time.h>
 #include <pthread.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "intel_chipset.h"
-#include "intel_batchbuffer.h"
-#include "igt_kms.h"
-#include "igt_aux.h"
-#include "igt_gt.h"
 
 #define TEST_DPMS		(1 << 0)
 #define TEST_WITH_DUMMY_BCS	(1 << 1)
diff --git a/tests/kms_flip_event_leak.c b/tests/kms_flip_event_leak.c
index 4e9f58a..6b619f0 100644
--- a/tests/kms_flip_event_leak.c
+++ b/tests/kms_flip_event_leak.c
@@ -22,17 +22,12 @@
  *
  */
 
+#include "igt.h"
 #include <errno.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 
-#include "drmtest.h"
-#include "igt_debugfs.h"
-#include "igt_kms.h"
-#include "intel_chipset.h"
-#include "intel_batchbuffer.h"
-#include "ioctl_wrappers.h"
 
 typedef struct {
 	int drm_fd;
diff --git a/tests/kms_flip_tiling.c b/tests/kms_flip_tiling.c
index c7fd4de..2e27794 100644
--- a/tests/kms_flip_tiling.c
+++ b/tests/kms_flip_tiling.c
@@ -24,16 +24,12 @@
  *   Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@xxxxxxxxx>
  */
 
+#include "igt.h"
 #include <errno.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 
-#include "drmtest.h"
-#include "igt_debugfs.h"
-#include "igt_kms.h"
-#include "ioctl_wrappers.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Test page flips and tiling scenarios");
 
diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c
index 42aaa7f..86d2d7f 100644
--- a/tests/kms_force_connector.c
+++ b/tests/kms_force_connector.c
@@ -22,9 +22,7 @@
  *
  */
 
-#include "igt_core.h"
-#include "igt_kms.h"
-#include "drmtest.h"
+#include "igt.h"
 
 IGT_TEST_DESCRIPTION("Check the debugfs force connector/edid features work"
 		     " correctly.");
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 137ff40..8f2fdbb 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -24,19 +24,13 @@
  *
  */
 
+#include "igt.h"
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <poll.h>
 #include <pthread.h>
 
-#include "drmtest.h"
-#include "igt_aux.h"
-#include "igt_draw.h"
-#include "igt_kms.h"
-#include "igt_debugfs.h"
-#include "intel_chipset.h"
-#include "ioctl_wrappers.h"
 
 IGT_TEST_DESCRIPTION("Test the Kernel's frontbuffer tracking mechanism and "
 		     "its related features: FBC and PSR");
diff --git a/tests/kms_legacy_colorkey.c b/tests/kms_legacy_colorkey.c
index a2fd85c..0c24cfc 100644
--- a/tests/kms_legacy_colorkey.c
+++ b/tests/kms_legacy_colorkey.c
@@ -21,11 +21,9 @@
  * IN THE SOFTWARE.
  */
 
+#include "igt.h"
 #include <errno.h>
 
-#include "drmtest.h"
-#include "igt_kms.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Check that the legacy set colorkey ioctl only works on sprite planes.");
 
diff --git a/tests/kms_mmio_vs_cs_flip.c b/tests/kms_mmio_vs_cs_flip.c
index 9e81dc1..dcaaa15 100644
--- a/tests/kms_mmio_vs_cs_flip.c
+++ b/tests/kms_mmio_vs_cs_flip.c
@@ -21,17 +21,13 @@
  * IN THE SOFTWARE.
  */
 
+#include "igt.h"
 #include <errno.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <time.h>
 
-#include "drmtest.h"
-#include "igt_debugfs.h"
-#include "igt_kms.h"
-#include "intel_chipset.h"
-#include "ioctl_wrappers.h"
 
 typedef struct {
 	int drm_fd;
diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c
index 2d079b4..a42a897 100644
--- a/tests/kms_panel_fitting.c
+++ b/tests/kms_panel_fitting.c
@@ -22,14 +22,9 @@
  *
  */
 
+#include "igt.h"
 #include <math.h>
 
-#include "drmtest.h"
-#include "igt_debugfs.h"
-#include "igt_kms.h"
-#include "igt_core.h"
-#include "intel_chipset.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Test display panel fitting");
 
diff --git a/tests/kms_pipe_b_c_ivb.c b/tests/kms_pipe_b_c_ivb.c
index b6e234c..f66e9c4 100644
--- a/tests/kms_pipe_b_c_ivb.c
+++ b/tests/kms_pipe_b_c_ivb.c
@@ -24,9 +24,7 @@
  *   Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@xxxxxxxxx>
  */
 
-#include "drmtest.h"
-#include "igt_kms.h"
-#include "intel_chipset.h"
+#include "igt.h"
 
 IGT_TEST_DESCRIPTION(
 "Exercise the FDI lane bifurcation code for IVB in the kernel by setting"
diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
index 2b69f68..33c83f0 100644
--- a/tests/kms_pipe_crc_basic.c
+++ b/tests/kms_pipe_crc_basic.c
@@ -22,16 +22,12 @@
  *
  */
 
+#include "igt.h"
 #include <errno.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 
-#include "drmtest.h"
-#include "igt_gt.h"
-#include "igt_kms.h"
-#include "igt_aux.h"
-#include "ioctl_wrappers.h"
 
 typedef struct {
 	int drm_fd;
diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 741d0b4..a6f4020 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -24,15 +24,12 @@
  *   Damien Lespiau <damien.lespiau@xxxxxxxxx>
  */
 
+#include "igt.h"
 #include <errno.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 
-#include "drmtest.h"
-#include "igt_debugfs.h"
-#include "igt_kms.h"
-#include "igt_aux.h"
 
 typedef struct {
 	float red;
diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index 00db5cb..61e2dbb 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -22,14 +22,9 @@
  *
  */
 
+#include "igt.h"
 #include <math.h>
 
-#include "drmtest.h"
-#include "igt_debugfs.h"
-#include "igt_kms.h"
-#include "igt_core.h"
-#include "intel_chipset.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION("Test display plane scaling");
 
diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
index 1823a68..676dae1 100644
--- a/tests/kms_psr_sink_crc.c
+++ b/tests/kms_psr_sink_crc.c
@@ -22,19 +22,13 @@
  *
  */
 
+#include "igt.h"
 #include <errno.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_chipset.h"
-#include "igt_debugfs.h"
-#include "igt_kms.h"
-#include "igt_aux.h"
 
 bool running_with_psr_disabled;
 
diff --git a/tests/kms_pwrite_crc.c b/tests/kms_pwrite_crc.c
index 990866f..a4fd579 100644
--- a/tests/kms_pwrite_crc.c
+++ b/tests/kms_pwrite_crc.c
@@ -22,18 +22,13 @@
  *
  */
 
+#include "igt.h"
 #include <errno.h>
 #include <limits.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 
-#include "drmtest.h"
-#include "igt_debugfs.h"
-#include "igt_kms.h"
-#include "intel_chipset.h"
-#include "ioctl_wrappers.h"
-#include "igt_aux.h"
 
 IGT_TEST_DESCRIPTION(
    "Use the display CRC support to validate pwrite to an already uncached future scanout buffer.");
diff --git a/tests/kms_render.c b/tests/kms_render.c
index 1759eaa..8fefcf2 100644
--- a/tests/kms_render.c
+++ b/tests/kms_render.c
@@ -24,19 +24,14 @@
 #include "config.h"
 #endif
 
+#include "igt.h"
 #include <cairo.h>
 #include <errno.h>
 #include <stdint.h>
 #include <unistd.h>
 #include <sys/time.h>
 
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
-#include "igt_kms.h"
-#include "ioctl_wrappers.h"
 
 drmModeRes *resources;
 int drm_fd;
diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 3fd77c4..00a65c1 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -22,13 +22,9 @@
  *
  */
 
+#include "igt.h"
 #include <math.h>
 
-#include "drmtest.h"
-#include "igt_debugfs.h"
-#include "igt_kms.h"
-#include "igt_core.h"
-#include "intel_chipset.h"
 
 typedef struct {
 	int gfx_fd;
diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
index 2c0fe45..feafc06 100644
--- a/tests/kms_setmode.c
+++ b/tests/kms_setmode.c
@@ -24,6 +24,7 @@
 #include "config.h"
 #endif
 
+#include "igt.h"
 #include <cairo.h>
 #include <errno.h>
 #include <stdint.h>
@@ -31,11 +32,7 @@
 #include <string.h>
 #include <sys/time.h>
 
-#include "drmtest.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "igt_kms.h"
 
 #define MAX_CONNECTORS  10
 #define MAX_CRTCS       3
diff --git a/tests/kms_sink_crc_basic.c b/tests/kms_sink_crc_basic.c
index e460404..b480a99 100644
--- a/tests/kms_sink_crc_basic.c
+++ b/tests/kms_sink_crc_basic.c
@@ -22,6 +22,7 @@
  *
  */
 
+#include "igt.h"
 #include <errno.h>
 #include <limits.h>
 #include <stdbool.h>
@@ -30,9 +31,6 @@
 
 #include "drm_fourcc.h"
 
-#include "drmtest.h"
-#include "igt_debugfs.h"
-#include "igt_kms.h"
 
 #define CRC_BLACK "000000000000"
 
diff --git a/tests/kms_universal_plane.c b/tests/kms_universal_plane.c
index 635cc79..481c601 100644
--- a/tests/kms_universal_plane.c
+++ b/tests/kms_universal_plane.c
@@ -21,15 +21,12 @@
  * IN THE SOFTWARE.
  */
 
+#include "igt.h"
 #include <errno.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 
-#include "drmtest.h"
-#include "igt_debugfs.h"
-#include "igt_kms.h"
-#include "intel_chipset.h"
 
 typedef struct {
 	int drm_fd;
diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
index 6946177..853cbdf 100644
--- a/tests/kms_vblank.c
+++ b/tests/kms_vblank.c
@@ -26,6 +26,7 @@
  * This is a test of performance of drmWaitVblank.
  */
 
+#include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -39,15 +40,7 @@
 
 #include <drm.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "igt_aux.h"
-#include "igt_core.h"
-#include "igt_gt.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
 
 IGT_TEST_DESCRIPTION("Test speed of WaitVblank.");
 
diff --git a/tests/pm_backlight.c b/tests/pm_backlight.c
index cff2694..bc1d417 100644
--- a/tests/pm_backlight.c
+++ b/tests/pm_backlight.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <limits.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -34,7 +35,6 @@
 #include <unistd.h>
 #include <time.h>
 
-#include "igt_core.h"
 
 #define TOLERANCE 5 /* percent */
 #define BACKLIGHT_PATH "/sys/class/backlight/intel_backlight"
diff --git a/tests/pm_lpsp.c b/tests/pm_lpsp.c
index 3ed4c78..43444d8 100644
--- a/tests/pm_lpsp.c
+++ b/tests/pm_lpsp.c
@@ -24,15 +24,12 @@
  *
  */
 
+#include "igt.h"
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
 
-#include "drmtest.h"
-#include "igt_kms.h"
-#include "intel_io.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_rc6_residency.c b/tests/pm_rc6_residency.c
index 9203d2f..7909162 100644
--- a/tests/pm_rc6_residency.c
+++ b/tests/pm_rc6_residency.c
@@ -26,14 +26,13 @@
  */
 
 #define _GNU_SOURCE
+#include "igt.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <errno.h>
 
-#include "drmtest.h"
-#include "intel_chipset.h"
 
 #define SLEEP_DURATION 3000 // in milliseconds
 #define CODE_TIME 50 // in microseconfs
diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c
index 7ae5806..a3ffe58 100644
--- a/tests/pm_rpm.c
+++ b/tests/pm_rpm.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "igt.h"
 #include <stdio.h>
 #include <stdint.h>
 #include <stdbool.h>
@@ -42,14 +43,6 @@
 
 #include <drm.h>
 
-#include "drmtest.h"
-#include "intel_batchbuffer.h"
-#include "intel_io.h"
-#include "intel_chipset.h"
-#include "ioctl_wrappers.h"
-#include "igt_aux.h"
-#include "igt_kms.h"
-#include "igt_gt.h"
 
 #define MSR_PC8_RES	0x630
 #define MSR_PC9_RES	0x631
diff --git a/tests/pm_rps.c b/tests/pm_rps.c
index 697a154..ccc6718 100644
--- a/tests/pm_rps.c
+++ b/tests/pm_rps.c
@@ -27,6 +27,7 @@
  */
 
 #define _GNU_SOURCE
+#include "igt.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -37,13 +38,7 @@
 #include <time.h>
 #include <sys/wait.h>
 
-#include "drmtest.h"
-#include "intel_io.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_chipset.h"
-#include "igt_gt.h"
-#include "ioctl_wrappers.h"
 
 static int drm_fd;
 
diff --git a/tests/pm_sseu.c b/tests/pm_sseu.c
index 320371f..ca8bda3 100644
--- a/tests/pm_sseu.c
+++ b/tests/pm_sseu.c
@@ -24,20 +24,14 @@
  *    Jeff McGee <jeff.mcgee@xxxxxxxxx>
  */
 
+#include "igt.h"
 #include <fcntl.h>
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
 #include <time.h>
-#include "drmtest.h"
 #include "i915_drm.h"
-#include "intel_io.h"
 #include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_chipset.h"
-#include "ioctl_wrappers.h"
-#include "igt_debugfs.h"
-#include "media_spin.h"
 
 IGT_TEST_DESCRIPTION("Tests slice/subslice/EU power gating functionality.\n");
 
diff --git a/tests/prime_nv_api.c b/tests/prime_nv_api.c
index 2776091..054a1ec 100644
--- a/tests/prime_nv_api.c
+++ b/tests/prime_nv_api.c
@@ -8,6 +8,7 @@
    test4 - export handle twice from intel, import into nouveau twice, check handle is the same
 */
 
+#include "igt.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -16,10 +17,6 @@
 
 #include "intel_bufmgr.h"
 #include "nouveau.h"
-#include "intel_io.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 e02835e..b5ceabf 100644
--- a/tests/prime_nv_pcopy.c
+++ b/tests/prime_nv_pcopy.c
@@ -14,6 +14,7 @@
 */
 
 
+#include "igt.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -23,13 +24,8 @@
 #include <sys/ioctl.h>
 #include <errno.h>
 
-#include "ioctl_wrappers.h"
 #include "intel_bufmgr.h"
 #include "nouveau.h"
-#include "intel_io.h"
-#include "intel_batchbuffer.h"
-#include "intel_chipset.h"
-#include "drmtest.h"
 
 static int intel_fd = -1, nouveau_fd = -1;
 static drm_intel_bufmgr *bufmgr;
diff --git a/tests/prime_nv_test.c b/tests/prime_nv_test.c
index dc9287c..b4714dc 100644
--- a/tests/prime_nv_test.c
+++ b/tests/prime_nv_test.c
@@ -14,6 +14,7 @@
 */
 
 
+#include "igt.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -22,13 +23,8 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 
-#include "ioctl_wrappers.h"
 #include "intel_bufmgr.h"
 #include "nouveau.h"
-#include "intel_io.h"
-#include "intel_batchbuffer.h"
-#include "intel_chipset.h"
-#include "drmtest.h"
 
 int intel_fd = -1, nouveau_fd = -1;
 drm_intel_bufmgr *bufmgr;
diff --git a/tests/prime_self_import.c b/tests/prime_self_import.c
index f114ad0..27dddf2 100644
--- a/tests/prime_self_import.c
+++ b/tests/prime_self_import.c
@@ -32,6 +32,7 @@
  */
 
 #define _GNU_SOURCE
+#include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -44,9 +45,6 @@
 #include <pthread.h>
 
 #include "drm.h"
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
-#include "igt_debugfs.h"
 
 IGT_TEST_DESCRIPTION("Check whether prime import/export works on the same"
 		     " device.");
diff --git a/tests/prime_udl.c b/tests/prime_udl.c
index b742f1c..59f478f 100644
--- a/tests/prime_udl.c
+++ b/tests/prime_udl.c
@@ -14,6 +14,7 @@
 */
 
    
+#include "igt.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -26,12 +27,7 @@
 #include "xf86drm.h"
 #include <xf86drmMode.h>
 
-#include "ioctl_wrappers.h"
 #include "intel_bufmgr.h"
-#include "intel_io.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/template.c b/tests/template.c
index 4b5794b..9d7ea18 100644
--- a/tests/template.c
+++ b/tests/template.c
@@ -24,7 +24,7 @@
  *
  */
 
-#include "drmtest.h"
+#include "igt.h"
 
 IGT_TEST_DESCRIPTION("Template test.");
 
diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index 9068a95..0994d51 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -49,6 +49,7 @@
 #include "config.h"
 #endif
 
+#include "igt.h"
 #include <cairo.h>
 #include <errno.h>
 #include <getopt.h>
@@ -64,11 +65,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#include "ioctl_wrappers.h"
-#include "drmtest.h"
 #include "testdisplay.h"
-#include "igt_kms.h"
-#include "igt_core.h"
 
 #include <stdlib.h>
 #include <signal.h>
diff --git a/tests/testdisplay_hotplug.c b/tests/testdisplay_hotplug.c
index 0010a43..9d11399 100644
--- a/tests/testdisplay_hotplug.c
+++ b/tests/testdisplay_hotplug.c
@@ -21,6 +21,7 @@
  * IN THE SOFTWARE.
  */
 
+#include "igt.h"
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -32,7 +33,6 @@
 #include "config.h"
 #endif
 
-#include "igt_core.h"
 
 #if HAVE_UDEV
 #include <libudev.h>
-- 
2.4.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux