[Intel-gfx] [PATCH 2/5] convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocci

Micah Fedke micah.fedke at collabora.co.uk
Fri Jul 31 13:11:08 PDT 2015


---
 benchmarks/gem_userptr_benchmark.c       |  2 +-
 benchmarks/intel_upload_blit_large.c     |  2 +-
 benchmarks/intel_upload_blit_large_gtt.c |  2 +-
 benchmarks/intel_upload_blit_large_map.c |  2 +-
 benchmarks/intel_upload_blit_small.c     |  2 +-
 debugger/eudb.c                          |  2 +-
 lib/igt_gt.c                             |  2 +-
 lib/igt_kms.c                            |  2 +-
 tests/core_get_client_auth.c             |  6 ++---
 tests/core_getclient.c                   |  2 +-
 tests/core_getstats.c                    |  2 +-
 tests/core_getversion.c                  |  2 +-
 tests/drm_import_export.c                |  4 ++--
 tests/drm_read.c                         |  2 +-
 tests/drm_vma_limiter.c                  |  2 +-
 tests/drm_vma_limiter_cached.c           |  2 +-
 tests/drm_vma_limiter_cpu.c              |  2 +-
 tests/drm_vma_limiter_gtt.c              |  2 +-
 tests/drv_getparams.c                    |  2 +-
 tests/drv_hangman.c                      |  4 ++--
 tests/drv_suspend.c                      |  2 +-
 tests/eviction_common.c                  |  2 +-
 tests/gem_alive.c                        |  2 +-
 tests/gem_bad_address.c                  |  2 +-
 tests/gem_bad_batch.c                    |  2 +-
 tests/gem_bad_blit.c                     |  2 +-
 tests/gem_bad_length.c                   |  2 +-
 tests/gem_bad_reloc.c                    |  2 +-
 tests/gem_basic.c                        |  2 +-
 tests/gem_caching.c                      |  2 +-
 tests/gem_concurrent_blit.c              |  4 ++--
 tests/gem_cpu_reloc.c                    |  2 +-
 tests/gem_cs_prefetch.c                  |  2 +-
 tests/gem_cs_tlb.c                       |  2 +-
 tests/gem_ctx_bad_destroy.c              |  2 +-
 tests/gem_ctx_bad_exec.c                 |  2 +-
 tests/gem_ctx_basic.c                    |  4 ++--
 tests/gem_ctx_create.c                   |  2 +-
 tests/gem_ctx_exec.c                     |  2 +-
 tests/gem_ctx_param_basic.c              |  2 +-
 tests/gem_ctx_thrash.c                   |  4 ++--
 tests/gem_double_irq_loop.c              |  2 +-
 tests/gem_dummy_reloc_loop.c             |  4 ++--
 tests/gem_evict_alignment.c              |  2 +-
 tests/gem_evict_everything.c             |  2 +-
 tests/gem_exec_bad_domains.c             |  2 +-
 tests/gem_exec_big.c                     |  2 +-
 tests/gem_exec_blt.c                     |  2 +-
 tests/gem_exec_faulting_reloc.c          |  2 +-
 tests/gem_exec_lut_handle.c              |  2 +-
 tests/gem_exec_nop.c                     |  2 +-
 tests/gem_exec_params.c                  |  2 +-
 tests/gem_exec_parse.c                   |  2 +-
 tests/gem_fd_exhaustion.c                |  2 +-
 tests/gem_fence_thrash.c                 |  2 +-
 tests/gem_fence_upload.c                 |  8 +++----
 tests/gem_fenced_exec_thrash.c           |  2 +-
 tests/gem_flink.c                        |  6 ++---
 tests/gem_flink_race.c                   |  6 ++---
 tests/gem_gpgpu_fill.c                   |  2 +-
 tests/gem_gtt_cpu_tlb.c                  |  2 +-
 tests/gem_gtt_hog.c                      |  4 ++--
 tests/gem_gtt_speed.c                    |  2 +-
 tests/gem_hang.c                         |  2 +-
 tests/gem_hangcheck_forcewake.c          |  2 +-
 tests/gem_largeobject.c                  |  2 +-
 tests/gem_linear_blits.c                 |  2 +-
 tests/gem_lut_handle.c                   |  2 +-
 tests/gem_madvise.c                      |  8 +++----
 tests/gem_media_fill.c                   |  2 +-
 tests/gem_mmap.c                         |  2 +-
 tests/gem_mmap_gtt.c                     |  4 ++--
 tests/gem_mmap_offset_exhaustion.c       |  2 +-
 tests/gem_mmap_wc.c                      |  2 +-
 tests/gem_multi_bsd_sync_loop.c          |  4 ++--
 tests/gem_non_secure_batch.c             |  2 +-
 tests/gem_partial_pwrite_pread.c         |  2 +-
 tests/gem_persistent_relocs.c            |  2 +-
 tests/gem_pin.c                          |  2 +-
 tests/gem_pipe_control_store_loop.c      |  2 +-
 tests/gem_ppgtt.c                        |  4 ++--
 tests/gem_pread.c                        |  2 +-
 tests/gem_pread_after_blit.c             |  2 +-
 tests/gem_pwrite.c                       |  2 +-
 tests/gem_pwrite_pread.c                 |  2 +-
 tests/gem_readwrite.c                    |  2 +-
 tests/gem_reg_read.c                     |  2 +-
 tests/gem_reloc_overflow.c               |  2 +-
 tests/gem_reloc_vs_gpu.c                 |  4 ++--
 tests/gem_render_copy.c                  |  2 +-
 tests/gem_render_copy_redux.c            |  2 +-
 tests/gem_render_linear_blits.c          |  2 +-
 tests/gem_render_tiled_blits.c           |  2 +-
 tests/gem_reset_stats.c                  | 40 ++++++++++++++++----------------
 tests/gem_ring_sync_copy.c               |  2 +-
 tests/gem_ring_sync_loop.c               |  2 +-
 tests/gem_ringfill.c                     |  2 +-
 tests/gem_seqno_wrap.c                   |  2 +-
 tests/gem_set_tiling_vs_blt.c            |  2 +-
 tests/gem_set_tiling_vs_gtt.c            |  2 +-
 tests/gem_set_tiling_vs_pwrite.c         |  2 +-
 tests/gem_storedw_batches_loop.c         |  2 +-
 tests/gem_storedw_loop_blt.c             |  2 +-
 tests/gem_storedw_loop_bsd.c             |  2 +-
 tests/gem_storedw_loop_render.c          |  2 +-
 tests/gem_storedw_loop_vebox.c           |  2 +-
 tests/gem_stress.c                       |  2 +-
 tests/gem_threaded_access_tiled.c        |  2 +-
 tests/gem_tiled_blits.c                  |  2 +-
 tests/gem_tiled_fence_blits.c            |  2 +-
 tests/gem_tiled_partial_pwrite_pread.c   |  2 +-
 tests/gem_tiled_pread.c                  |  2 +-
 tests/gem_tiled_pread_pwrite.c           |  2 +-
 tests/gem_tiled_swapping.c               |  2 +-
 tests/gem_tiled_wb.c                     |  2 +-
 tests/gem_tiled_wc.c                     |  2 +-
 tests/gem_tiling_max_stride.c            |  2 +-
 tests/gem_unfence_active_buffers.c       |  2 +-
 tests/gem_unref_active_buffers.c         |  2 +-
 tests/gem_userptr_blits.c                |  6 ++---
 tests/gem_wait.c                         |  2 +-
 tests/gem_workarounds.c                  |  2 +-
 tests/gem_write_read_ring_switch.c       |  2 +-
 tests/gen3_mixed_blits.c                 |  2 +-
 tests/gen3_render_linear_blits.c         |  2 +-
 tests/gen3_render_mixed_blits.c          |  2 +-
 tests/gen3_render_tiledx_blits.c         |  2 +-
 tests/gen3_render_tiledy_blits.c         |  2 +-
 tests/gen7_forcewake_mt.c                |  2 +-
 tests/kms_3d.c                           |  2 +-
 tests/kms_addfb.c                        |  2 +-
 tests/kms_cursor_crc.c                   |  2 +-
 tests/kms_fbc_crc.c                      |  2 +-
 tests/kms_fence_pin_leak.c               |  2 +-
 tests/kms_flip.c                         |  2 +-
 tests/kms_flip_event_leak.c              |  4 ++--
 tests/kms_flip_tiling.c                  |  2 +-
 tests/kms_force_connector.c              |  2 +-
 tests/kms_mmio_vs_cs_flip.c              |  2 +-
 tests/kms_pipe_crc_basic.c               |  2 +-
 tests/kms_plane.c                        |  2 +-
 tests/kms_psr_sink_crc.c                 |  2 +-
 tests/kms_pwrite_crc.c                   |  2 +-
 tests/kms_render.c                       |  2 +-
 tests/kms_rotation_crc.c                 |  2 +-
 tests/kms_setmode.c                      |  2 +-
 tests/kms_sink_crc_basic.c               |  2 +-
 tests/kms_universal_plane.c              |  2 +-
 tests/pm_lpsp.c                          |  2 +-
 tests/pm_rc6_residency.c                 |  4 ++--
 tests/pm_rpm.c                           |  2 +-
 tests/pm_rps.c                           |  6 ++---
 tests/prime_self_import.c                | 28 +++++++++++-----------
 tests/template.c                         |  2 +-
 tests/testdisplay.c                      |  2 +-
 tools/intel_display_poller.c             |  2 +-
 tools/intel_gpu_frequency.c              |  2 +-
 tools/intel_l3_parity.c                  |  2 +-
 tools/intel_perf_counters.c              |  2 +-
 159 files changed, 220 insertions(+), 220 deletions(-)

diff --git a/benchmarks/gem_userptr_benchmark.c b/benchmarks/gem_userptr_benchmark.c
index 4d7442b..821acda 100644
--- a/benchmarks/gem_userptr_benchmark.c
+++ b/benchmarks/gem_userptr_benchmark.c
@@ -470,7 +470,7 @@ int main(int argc, char **argv)
 
 	igt_subtest_init(argc, argv);
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	igt_assert(fd >= 0);
 
 	ret = has_userptr(fd);
diff --git a/benchmarks/intel_upload_blit_large.c b/benchmarks/intel_upload_blit_large.c
index 689f9c4..1984bfd 100644
--- a/benchmarks/intel_upload_blit_large.c
+++ b/benchmarks/intel_upload_blit_large.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
 	struct intel_batchbuffer *batch;
 	int i;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 	drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/benchmarks/intel_upload_blit_large_gtt.c b/benchmarks/intel_upload_blit_large_gtt.c
index 601496d..d62a01e 100644
--- a/benchmarks/intel_upload_blit_large_gtt.c
+++ b/benchmarks/intel_upload_blit_large_gtt.c
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
 	struct intel_batchbuffer *batch;
 	int i;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 	drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/benchmarks/intel_upload_blit_large_map.c b/benchmarks/intel_upload_blit_large_map.c
index d916737..03bf760 100644
--- a/benchmarks/intel_upload_blit_large_map.c
+++ b/benchmarks/intel_upload_blit_large_map.c
@@ -125,7 +125,7 @@ int main(int argc, char **argv)
 	struct intel_batchbuffer *batch;
 	int i;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 	drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/benchmarks/intel_upload_blit_small.c b/benchmarks/intel_upload_blit_small.c
index b9640a4..ac557a4 100644
--- a/benchmarks/intel_upload_blit_small.c
+++ b/benchmarks/intel_upload_blit_small.c
@@ -135,7 +135,7 @@ int main(int argc, char **argv)
 	struct intel_batchbuffer *batch;
 	int i;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 	drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/debugger/eudb.c b/debugger/eudb.c
index 0e810db..679cdef 100644
--- a/debugger/eudb.c
+++ b/debugger/eudb.c
@@ -553,7 +553,7 @@ int main(int argc, char* argv[]) {
 	 */
 	if (!clear_waits) {
 		int dh_handle;
-		drm_fd = drm_open_any();
+		drm_fd = drm_open_driver(DRIVER_INTEL);
 		bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096);
 
 		setup_hw_bits();
diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index 84aa5d3..6bd66b2 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -185,7 +185,7 @@ int igt_fork_hang_helper(void)
 	if (igt_only_list_subtests())
 		return 1;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	if (fd == -1)
 		return 0;
 
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 9c131f0..7e956b4 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1807,7 +1807,7 @@ void igt_enable_connectors(void)
 	drmModeConnector *c;
 	int drm_fd;
 
-	drm_fd = drm_open_any();
+	drm_fd = drm_open_driver(DRIVER_INTEL);
 
 	res = drmModeGetResources(drm_fd);
 
diff --git a/tests/core_get_client_auth.c b/tests/core_get_client_auth.c
index bbfdddf..92313f9 100644
--- a/tests/core_get_client_auth.c
+++ b/tests/core_get_client_auth.c
@@ -84,7 +84,7 @@ igt_main
 {
 	/* root (which we run igt as) should always be authenticated */
 	igt_subtest("simple") {
-		int fd = drm_open_any();
+		int fd = drm_open_driver(DRIVER_INTEL);
 
 		igt_assert(check_auth(fd) == true);
 
@@ -92,8 +92,8 @@ igt_main
 	}
 
 	igt_subtest("master-drop") {
-		int fd = drm_open_any();
-		int fd2 = drm_open_any();
+		int fd = drm_open_driver(DRIVER_INTEL);
+		int fd2 = drm_open_driver(DRIVER_INTEL);
 
 		igt_assert(check_auth(fd2) == true);
 
diff --git a/tests/core_getclient.c b/tests/core_getclient.c
index 7598e0f..d82e349 100644
--- a/tests/core_getclient.c
+++ b/tests/core_getclient.c
@@ -39,7 +39,7 @@ igt_simple_main
 	int fd, ret;
 	drm_client_t client;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	/* Look for client index 0.  This should exist whether we're operating
 	 * on an otherwise unused drm device, or the X Server is running on
diff --git a/tests/core_getstats.c b/tests/core_getstats.c
index 52a2d20..cdab0e5 100644
--- a/tests/core_getstats.c
+++ b/tests/core_getstats.c
@@ -48,7 +48,7 @@ igt_simple_main
 	int fd, ret;
 	drm_stats_t stats;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	ret = ioctl(fd, DRM_IOCTL_GET_STATS, &stats);
 	igt_assert(ret == 0);
diff --git a/tests/core_getversion.c b/tests/core_getversion.c
index 30132e4..f994315 100644
--- a/tests/core_getversion.c
+++ b/tests/core_getversion.c
@@ -37,7 +37,7 @@ igt_simple_main
 	int fd;
 	drmVersionPtr v;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	v = drmGetVersion(fd);
 	igt_assert(strlen(v->name) != 0);
 	igt_assert(strlen(v->date) != 0);
diff --git a/tests/drm_import_export.c b/tests/drm_import_export.c
index 57b13dd..ef08a83 100644
--- a/tests/drm_import_export.c
+++ b/tests/drm_import_export.c
@@ -138,14 +138,14 @@ pthread_t test_thread_id4;
 
 igt_main {
 	igt_fixture {
-		fd1 = drm_open_any();
+		fd1 = drm_open_driver(DRIVER_INTEL);
 		igt_assert(fd1 >= 0);
 		bufmgr1 = drm_intel_bufmgr_gem_init(fd1, 8 *1024);
 		igt_assert(bufmgr1);
 
 		drm_intel_bufmgr_gem_enable_reuse(bufmgr1);
 
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 		igt_assert(fd >= 0);
 		bufmgr = drm_intel_bufmgr_gem_init(fd, 8 *1024);
 		igt_assert(bufmgr);
diff --git a/tests/drm_read.c b/tests/drm_read.c
index 334f26a..fdaf126 100644
--- a/tests/drm_read.c
+++ b/tests/drm_read.c
@@ -202,7 +202,7 @@ igt_main
 	siginterrupt(SIGALRM, 1);
 
 	igt_fixture {
-		fd = drm_open_any_master();
+		fd = drm_open_driver_master(DRIVER_INTEL);
 		igt_require(pipe0_enabled(fd));
 	}
 
diff --git a/tests/drm_vma_limiter.c b/tests/drm_vma_limiter.c
index bb7102f..f8f088e 100644
--- a/tests/drm_vma_limiter.c
+++ b/tests/drm_vma_limiter.c
@@ -64,7 +64,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 	drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/tests/drm_vma_limiter_cached.c b/tests/drm_vma_limiter_cached.c
index 74d0c1a..f07927a 100644
--- a/tests/drm_vma_limiter_cached.c
+++ b/tests/drm_vma_limiter_cached.c
@@ -63,7 +63,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 	drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/tests/drm_vma_limiter_cpu.c b/tests/drm_vma_limiter_cpu.c
index e17a679..29c90d6 100644
--- a/tests/drm_vma_limiter_cpu.c
+++ b/tests/drm_vma_limiter_cpu.c
@@ -63,7 +63,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 	drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/tests/drm_vma_limiter_gtt.c b/tests/drm_vma_limiter_gtt.c
index 303e86d..36b593a 100644
--- a/tests/drm_vma_limiter_gtt.c
+++ b/tests/drm_vma_limiter_gtt.c
@@ -64,7 +64,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 	drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/tests/drv_getparams.c b/tests/drv_getparams.c
index f383662..8ac164c 100644
--- a/tests/drv_getparams.c
+++ b/tests/drv_getparams.c
@@ -41,7 +41,7 @@ int devid;
 static void
 init(void)
 {
-	drm_fd = drm_open_any();
+	drm_fd = drm_open_driver(DRIVER_INTEL);
 	devid = intel_get_drm_devid(drm_fd);
 }
 
diff --git a/tests/drv_hangman.c b/tests/drv_hangman.c
index d93bef3..416413b 100644
--- a/tests/drv_hangman.c
+++ b/tests/drv_hangman.c
@@ -224,7 +224,7 @@ static void test_error_state_basic(void)
 	clear_error_state();
 	assert_error_state_clear();
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	submit_batch(fd, I915_EXEC_RENDER, true);
 	close(fd);
 
@@ -376,7 +376,7 @@ static void test_error_state_capture(unsigned ring_id,
 
 	clear_error_state();
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	gen = intel_gen(intel_get_drm_devid(fd));
 	cmd_parser = uses_cmd_parser(fd, gen);
 
diff --git a/tests/drv_suspend.c b/tests/drv_suspend.c
index d67a794..cbc3a6d 100644
--- a/tests/drv_suspend.c
+++ b/tests/drv_suspend.c
@@ -182,7 +182,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 	igt_subtest("fence-restore-tiled2untiled")
 		test_fence_restore(fd, true, false);
diff --git a/tests/eviction_common.c b/tests/eviction_common.c
index 82cdaeb..4ff4dc7 100644
--- a/tests/eviction_common.c
+++ b/tests/eviction_common.c
@@ -208,7 +208,7 @@ static int forking_evictions(int fd, struct igt_eviction_test_ops *ops,
 		igt_permute_array(bo, bo_count, exchange_uint32_t);
 
 		if (flags & FORKING_EVICTIONS_DUP_DRMFD) {
-			realfd = drm_open_any();
+			realfd = drm_open_driver(DRIVER_INTEL);
 
 			/* We can overwrite the bo array since we're forked. */
 			for (l = 0; l < bo_count; l++) {
diff --git a/tests/gem_alive.c b/tests/gem_alive.c
index 390a54f..c491f2d 100644
--- a/tests/gem_alive.c
+++ b/tests/gem_alive.c
@@ -14,7 +14,7 @@ int main(void)
 
 	signal(SIGALRM, SIG_IGN);
 
-	fd = __drm_open_any();
+	fd = __drm_open_driver(DRIVER_INTEL);
 	if (fd < 0)
 		return IGT_EXIT_SKIP;
 
diff --git a/tests/gem_bad_address.c b/tests/gem_bad_address.c
index 4a4a570..c295267 100644
--- a/tests/gem_bad_address.c
+++ b/tests/gem_bad_address.c
@@ -64,7 +64,7 @@ igt_simple_main
 {
 	int fd;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 	drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/tests/gem_bad_batch.c b/tests/gem_bad_batch.c
index e3de3b6..6ab31e9 100644
--- a/tests/gem_bad_batch.c
+++ b/tests/gem_bad_batch.c
@@ -60,7 +60,7 @@ igt_simple_main
 {
 	int fd;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 	drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/tests/gem_bad_blit.c b/tests/gem_bad_blit.c
index 366b182..7a704d9 100644
--- a/tests/gem_bad_blit.c
+++ b/tests/gem_bad_blit.c
@@ -100,7 +100,7 @@ igt_simple_main
 	drm_intel_bo *src;
 	int fd;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 	drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/tests/gem_bad_length.c b/tests/gem_bad_length.c
index 29b3925..8d85e36 100644
--- a/tests/gem_bad_length.c
+++ b/tests/gem_bad_length.c
@@ -124,7 +124,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	create0(fd);
 
diff --git a/tests/gem_bad_reloc.c b/tests/gem_bad_reloc.c
index 36d8c09..0d66393 100644
--- a/tests/gem_bad_reloc.c
+++ b/tests/gem_bad_reloc.c
@@ -208,7 +208,7 @@ int fd;
 igt_main
 {
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 	}
 
 	igt_subtest("negative-reloc")
diff --git a/tests/gem_basic.c b/tests/gem_basic.c
index f79b066..aa3580a 100644
--- a/tests/gem_basic.c
+++ b/tests/gem_basic.c
@@ -80,7 +80,7 @@ int fd;
 igt_main
 {
 	igt_fixture
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 	igt_subtest("bad-close")
 		test_bad_close(fd);
diff --git a/tests/gem_caching.c b/tests/gem_caching.c
index 2fad0ec..301d6f5 100644
--- a/tests/gem_caching.c
+++ b/tests/gem_caching.c
@@ -119,7 +119,7 @@ igt_main
 	igt_fixture {
 		srandom(0xdeadbeef);
 
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		gem_require_caching(fd);
 
diff --git a/tests/gem_concurrent_blit.c b/tests/gem_concurrent_blit.c
index e1693ba..dd78b24 100644
--- a/tests/gem_concurrent_blit.c
+++ b/tests/gem_concurrent_blit.c
@@ -637,7 +637,7 @@ static void run_forked(const struct access_mode *mode,
 		drm_intel_bufmgr *bufmgr;
 
 		/* recreate process local variables */
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 		bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 		drm_intel_bufmgr_gem_enable_reuse(bufmgr);
 
@@ -833,7 +833,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 		devid = intel_get_drm_devid(fd);
 		gen = intel_gen(devid);
 		rendercopy = igt_get_render_copyfunc(devid);
diff --git a/tests/gem_cpu_reloc.c b/tests/gem_cpu_reloc.c
index c67907a..88f3bdf 100644
--- a/tests/gem_cpu_reloc.c
+++ b/tests/gem_cpu_reloc.c
@@ -168,7 +168,7 @@ igt_simple_main
 	uint32_t *handles;
 	int fd, i, count;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	noop = intel_get_drm_devid(fd);
 
 	use_blt = 0;
diff --git a/tests/gem_cs_prefetch.c b/tests/gem_cs_prefetch.c
index 8a912ef..7e979a7 100644
--- a/tests/gem_cs_prefetch.c
+++ b/tests/gem_cs_prefetch.c
@@ -103,7 +103,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 	igt_assert(bufmgr);
diff --git a/tests/gem_cs_tlb.c b/tests/gem_cs_tlb.c
index 3df4f37..e09d480 100644
--- a/tests/gem_cs_tlb.c
+++ b/tests/gem_cs_tlb.c
@@ -157,7 +157,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		/* This test is very sensitive to residual gtt_mm noise from previous
 		 * tests. Try to quiet thing down first. */
diff --git a/tests/gem_ctx_bad_destroy.c b/tests/gem_ctx_bad_destroy.c
index ee89763..a6cd6e3 100644
--- a/tests/gem_ctx_bad_destroy.c
+++ b/tests/gem_ctx_bad_destroy.c
@@ -44,7 +44,7 @@ int fd;
 igt_main
 {
 	igt_fixture {
-		fd = drm_open_any_render();
+		fd = drm_open_driver_render(DRIVER_INTEL);
 
 		ctx_id = gem_context_create(fd);
 		/* Make sure a proper destroy works first */
diff --git a/tests/gem_ctx_bad_exec.c b/tests/gem_ctx_bad_exec.c
index 36afd7d..dacecf8 100644
--- a/tests/gem_ctx_bad_exec.c
+++ b/tests/gem_ctx_bad_exec.c
@@ -93,7 +93,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		fd = drm_open_any_render();
+		fd = drm_open_driver_render(DRIVER_INTEL);
 
 		ctx_id = gem_context_create(fd);
 
diff --git a/tests/gem_ctx_basic.c b/tests/gem_ctx_basic.c
index 9e9d925..05c491e 100644
--- a/tests/gem_ctx_basic.c
+++ b/tests/gem_ctx_basic.c
@@ -81,7 +81,7 @@ static void *work(void *arg)
 	int i;
 
 	if (multiple_fds)
-		td_fd = fd = drm_open_any_render();
+		td_fd = fd = drm_open_driver_render(DRIVER_INTEL);
 	else
 		td_fd = fd;
 
@@ -147,7 +147,7 @@ int main(int argc, char *argv[])
 	igt_simple_init_parse_opts(&argc, argv, "i:c:n:mu", NULL, NULL,
 				   opt_handler);
 
-	fd = drm_open_any_render();
+	fd = drm_open_driver_render(DRIVER_INTEL);
 	devid = intel_get_drm_devid(fd);
 
 	if (igt_run_in_simulation()) {
diff --git a/tests/gem_ctx_create.c b/tests/gem_ctx_create.c
index 046c974..58cabc8 100644
--- a/tests/gem_ctx_create.c
+++ b/tests/gem_ctx_create.c
@@ -38,7 +38,7 @@ struct drm_i915_gem_context_create create;
 igt_main
 {
 	igt_fixture
-		fd = drm_open_any_render();
+		fd = drm_open_driver_render(DRIVER_INTEL);
 
 	igt_subtest("basic") {
 		create.ctx_id = rand();
diff --git a/tests/gem_ctx_exec.c b/tests/gem_ctx_exec.c
index 43b38a2..1df0f7c 100644
--- a/tests/gem_ctx_exec.c
+++ b/tests/gem_ctx_exec.c
@@ -163,7 +163,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		fd = drm_open_any_render();
+		fd = drm_open_driver_render(DRIVER_INTEL);
 
 		handle = gem_create(fd, 4096);
 
diff --git a/tests/gem_ctx_param_basic.c b/tests/gem_ctx_param_basic.c
index b44b37c..8868e3a 100644
--- a/tests/gem_ctx_param_basic.c
+++ b/tests/gem_ctx_param_basic.c
@@ -53,7 +53,7 @@ igt_main
 	memset(&ctx_param, 0, sizeof(ctx_param));
 
 	igt_fixture {
-		fd = drm_open_any_render();
+		fd = drm_open_driver_render(DRIVER_INTEL);
 		ctx = gem_context_create(fd);
 	}
 
diff --git a/tests/gem_ctx_thrash.c b/tests/gem_ctx_thrash.c
index b4818f4..775f68e 100644
--- a/tests/gem_ctx_thrash.c
+++ b/tests/gem_ctx_thrash.c
@@ -149,7 +149,7 @@ processes(void)
 
 	igt_skip_on_simulation();
 
-	fd = drm_open_any_render();
+	fd = drm_open_driver_render(DRIVER_INTEL);
 	devid = intel_get_drm_devid(fd);
 	aperture = gem_aperture_size(fd);
 
@@ -251,7 +251,7 @@ threads(void)
 
 	igt_skip_on_simulation();
 
-	fd = drm_open_any_render();
+	fd = drm_open_driver_render(DRIVER_INTEL);
 	devid = intel_get_drm_devid(fd);
 	aperture = gem_aperture_size(fd);
 
diff --git a/tests/gem_double_irq_loop.c b/tests/gem_double_irq_loop.c
index a43fd1a..ea7a8b3 100644
--- a/tests/gem_double_irq_loop.c
+++ b/tests/gem_double_irq_loop.c
@@ -99,7 +99,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	devid = intel_get_drm_devid(fd);
 	igt_require_f(HAS_BLT_RING(devid),
 		      "not (yet) implemented for pre-snb\n");
diff --git a/tests/gem_dummy_reloc_loop.c b/tests/gem_dummy_reloc_loop.c
index 5e0a10a..76f7262 100644
--- a/tests/gem_dummy_reloc_loop.c
+++ b/tests/gem_dummy_reloc_loop.c
@@ -182,7 +182,7 @@ igt_main
 
 	igt_fixture {
 		int i;
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 		devid = intel_get_drm_devid(fd);
 		num_rings = gem_get_num_rings(fd);
 		/* Not yet implemented on pre-snb. */
@@ -206,7 +206,7 @@ igt_main
 
 			for (i = 0; i < NUM_FD; i++) {
 				sprintf(buffer_name, "Target buffer %d\n", i);
-				mfd[i] = drm_open_any();
+				mfd[i] = drm_open_driver(DRIVER_INTEL);
 				mbufmgr[i] = drm_intel_bufmgr_gem_init(mfd[i], 4096);
 				igt_assert_f(mbufmgr[i],
 					     "fail to initialize buf manager "
diff --git a/tests/gem_evict_alignment.c b/tests/gem_evict_alignment.c
index 02cbb3a..ba0445c 100644
--- a/tests/gem_evict_alignment.c
+++ b/tests/gem_evict_alignment.c
@@ -196,7 +196,7 @@ igt_main
 	int size, count;
 
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 	}
 
 	igt_subtest("minor-normal") {
diff --git a/tests/gem_evict_everything.c b/tests/gem_evict_everything.c
index 15ab382..76ded23 100644
--- a/tests/gem_evict_everything.c
+++ b/tests/gem_evict_everything.c
@@ -187,7 +187,7 @@ igt_main
 	fd = -1;
 
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		size = 1024 * 1024;
 		count = 3*gem_aperture_size(fd) / size / 4;
diff --git a/tests/gem_exec_bad_domains.c b/tests/gem_exec_bad_domains.c
index 69e9189..ab66c43 100644
--- a/tests/gem_exec_bad_domains.c
+++ b/tests/gem_exec_bad_domains.c
@@ -156,7 +156,7 @@ drm_intel_bo *tmp;
 igt_main
 {
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 		drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/tests/gem_exec_big.c b/tests/gem_exec_big.c
index 15337e6..31a6186 100644
--- a/tests/gem_exec_big.c
+++ b/tests/gem_exec_big.c
@@ -166,7 +166,7 @@ igt_simple_main
 	unsigned batch_size;
 	int max;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	max = 3 * gem_aperture_size(fd) / 4;
 
 	intel_require_memory(1, max, CHECK_RAM);
diff --git a/tests/gem_exec_blt.c b/tests/gem_exec_blt.c
index b3c1ca6..290e064 100644
--- a/tests/gem_exec_blt.c
+++ b/tests/gem_exec_blt.c
@@ -196,7 +196,7 @@ static void run(int object_size, bool dumb)
 	int fd, len, count;
 	int ring;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	if (dumb)
 		handle = dumb_create(fd);
 	else
diff --git a/tests/gem_exec_faulting_reloc.c b/tests/gem_exec_faulting_reloc.c
index 8b780a6..cd829ea 100644
--- a/tests/gem_exec_faulting_reloc.c
+++ b/tests/gem_exec_faulting_reloc.c
@@ -175,7 +175,7 @@ static void run(int object_size)
 	int fd, len;
 	int ring;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	devid = intel_get_drm_devid(fd);
 	handle = gem_create(fd, 4096);
 	src = gem_create(fd, object_size);
diff --git a/tests/gem_exec_lut_handle.c b/tests/gem_exec_lut_handle.c
index c2d490f..7538ff9 100644
--- a/tests/gem_exec_lut_handle.c
+++ b/tests/gem_exec_lut_handle.c
@@ -130,7 +130,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	for (n = 0; n < MAX_NUM_EXEC; n++) {
 		gem_exec[n].handle = gem_create(fd, 4096);
diff --git a/tests/gem_exec_nop.c b/tests/gem_exec_nop.c
index e0709e9..415649c 100644
--- a/tests/gem_exec_nop.c
+++ b/tests/gem_exec_nop.c
@@ -112,7 +112,7 @@ int fd;
 igt_main
 {
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		handle = gem_create(fd, 4096);
 		gem_write(fd, handle, 0, batch, sizeof(batch));
diff --git a/tests/gem_exec_params.c b/tests/gem_exec_params.c
index 54f0dc3..ddd6cb3 100644
--- a/tests/gem_exec_params.c
+++ b/tests/gem_exec_params.c
@@ -58,7 +58,7 @@ int fd;
 igt_main
 {
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		devid = intel_get_drm_devid(fd);
 
diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c
index fff166a..2a9b415 100644
--- a/tests/gem_exec_parse.c
+++ b/tests/gem_exec_parse.c
@@ -301,7 +301,7 @@ igt_main
                 drm_i915_getparam_t gp;
 		int rc;
 
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		gp.param = I915_PARAM_CMD_PARSER_VERSION;
 		gp.value = &parser_version;
diff --git a/tests/gem_fd_exhaustion.c b/tests/gem_fd_exhaustion.c
index 8ba631f..73520e2 100644
--- a/tests/gem_fd_exhaustion.c
+++ b/tests/gem_fd_exhaustion.c
@@ -56,7 +56,7 @@ igt_simple_main
 	rlim.rlim_max = nofile_rlim;
 	igt_assert(setrlimit(RLIMIT_NOFILE, &rlim) == 0);
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	igt_assert(open("/dev/null", O_RDONLY) >= 0);
 
diff --git a/tests/gem_fence_thrash.c b/tests/gem_fence_thrash.c
index 6447e13..5268782 100644
--- a/tests/gem_fence_thrash.c
+++ b/tests/gem_fence_thrash.c
@@ -166,7 +166,7 @@ static int run_test(int threads_per_fence, void *f, int tiling,
 	pthread_t *threads;
 	int n, num_fences, num_threads;
 
-	t.fd = drm_open_any();
+	t.fd = drm_open_driver(DRIVER_INTEL);
 	t.tiling = tiling;
 	t.num_surfaces = surfaces_per_thread;
 
diff --git a/tests/gem_fence_upload.c b/tests/gem_fence_upload.c
index 9595bc8..7c46881 100644
--- a/tests/gem_fence_upload.c
+++ b/tests/gem_fence_upload.c
@@ -57,7 +57,7 @@ static void performance(void)
 	int fd, num_fences;
 	double linear[2], tiled[2];
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	num_fences = gem_available_fences(fd);
 	igt_require(num_fences > 0);
@@ -162,7 +162,7 @@ static void thread_performance(unsigned mask)
 	int fd, num_fences;
 	double linear[2], tiled[2];
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	num_fences = gem_available_fences(fd);
 	igt_require(num_fences > 0);
@@ -289,7 +289,7 @@ static void thread_contention(void)
 	int fd, num_fences;
 	double linear[2], tiled[2];
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	num_fences = gem_available_fences(fd);
 	igt_require(num_fences > 0);
@@ -344,7 +344,7 @@ static void wc_contention(void)
 	int fd, num_fences;
 	double linear[2], tiled[2];
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	gem_require_mmap_wc(fd);
 
 	num_fences = gem_available_fences(fd);
diff --git a/tests/gem_fenced_exec_thrash.c b/tests/gem_fenced_exec_thrash.c
index 75f251c..bdcfa99 100644
--- a/tests/gem_fenced_exec_thrash.c
+++ b/tests/gem_fenced_exec_thrash.c
@@ -225,7 +225,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 		num_fences = gem_available_fences(fd);
 		igt_assert(num_fences > 4);
 		devid = intel_get_drm_devid(fd);
diff --git a/tests/gem_flink.c b/tests/gem_flink.c
index 91444e8..a03639b 100644
--- a/tests/gem_flink.c
+++ b/tests/gem_flink.c
@@ -124,7 +124,7 @@ test_flink_lifetime(int fd)
 
 	igt_info("Testing flink lifetime.\n");
 
-	fd2 = drm_open_any();
+	fd2 = drm_open_driver(DRIVER_INTEL);
 
 	memset(&create, 0, sizeof(create));
 	create.size = 16 * 1024;
@@ -141,7 +141,7 @@ test_flink_lifetime(int fd)
 	igt_assert(open_struct.handle != 0);
 
 	close(fd2);
-	fd2 = drm_open_any();
+	fd2 = drm_open_driver(DRIVER_INTEL);
 
 	open_struct.name = flink.name;
 	ret = ioctl(fd2, DRM_IOCTL_GEM_OPEN, &open_struct);
@@ -154,7 +154,7 @@ int fd;
 igt_main
 {
 	igt_fixture
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 	igt_subtest("basic")
 		test_flink(fd);
diff --git a/tests/gem_flink_race.c b/tests/gem_flink_race.c
index 6ef15f3..0139f01 100644
--- a/tests/gem_flink_race.c
+++ b/tests/gem_flink_race.c
@@ -102,7 +102,7 @@ static void test_flink_name(void)
 
 	threads = calloc(num_threads, sizeof(pthread_t));
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	for (i = 0; i < num_threads; i++) {
 		r = pthread_create(&threads[i], NULL,
@@ -163,7 +163,7 @@ static void test_flink_close(void)
 
 	/* Allocate exit handler fds in here so that we dont screw
 	 * up the counts */
-	fake = drm_open_any();
+	fake = drm_open_driver(DRIVER_INTEL);
 
 	obj_count = get_object_count();
 
@@ -171,7 +171,7 @@ static void test_flink_close(void)
 
 	threads = calloc(num_threads, sizeof(pthread_t));
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	for (i = 0; i < num_threads; i++) {
 		r = pthread_create(&threads[i], NULL,
diff --git a/tests/gem_gpgpu_fill.c b/tests/gem_gpgpu_fill.c
index df0d7c8..9374a31 100644
--- a/tests/gem_gpgpu_fill.c
+++ b/tests/gem_gpgpu_fill.c
@@ -104,7 +104,7 @@ igt_simple_main
 	igt_fillfunc_t gpgpu_fill = NULL;
 	int i, j;
 
-	data.drm_fd = drm_open_any_render();
+	data.drm_fd = drm_open_driver_render(DRIVER_INTEL);
 	data.devid = intel_get_drm_devid(data.drm_fd);
 
 	data.bufmgr = drm_intel_bufmgr_gem_init(data.drm_fd, 4096);
diff --git a/tests/gem_gtt_cpu_tlb.c b/tests/gem_gtt_cpu_tlb.c
index a019061..87c4e1e 100644
--- a/tests/gem_gtt_cpu_tlb.c
+++ b/tests/gem_gtt_cpu_tlb.c
@@ -79,7 +79,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	handle = gem_create(fd, OBJ_SIZE);
 
diff --git a/tests/gem_gtt_hog.c b/tests/gem_gtt_hog.c
index 39dfa48..bbe56fa 100644
--- a/tests/gem_gtt_hog.c
+++ b/tests/gem_gtt_hog.c
@@ -159,12 +159,12 @@ igt_simple_main
 	data_t data = {};
 
 	/* check for an intel gpu before goint nuts. */
-	int fd = drm_open_any();
+	int fd = drm_open_driver(DRIVER_INTEL);
 	close(fd);
 
 	igt_skip_on_simulation();
 
-	data.fd = drm_open_any();
+	data.fd = drm_open_driver(DRIVER_INTEL);
 	data.devid = intel_get_drm_devid(data.fd);
 	data.intel_gen = intel_gen(data.devid);
 
diff --git a/tests/gem_gtt_speed.c b/tests/gem_gtt_speed.c
index d5e745e..5fe0b41 100644
--- a/tests/gem_gtt_speed.c
+++ b/tests/gem_gtt_speed.c
@@ -72,7 +72,7 @@ int main(int argc, char **argv)
 
 	buf = malloc(size);
 	memset(buf, 0, size);
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	handle = gem_create(fd, size);
 	igt_assert(handle);
diff --git a/tests/gem_hang.c b/tests/gem_hang.c
index 8767615..8b77562 100644
--- a/tests/gem_hang.c
+++ b/tests/gem_hang.c
@@ -80,7 +80,7 @@ int main(int argc, char **argv)
 
 	bad_pipe = atoi(argv[1]);
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 	drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/tests/gem_hangcheck_forcewake.c b/tests/gem_hangcheck_forcewake.c
index f274fab..d7fd595 100644
--- a/tests/gem_hangcheck_forcewake.c
+++ b/tests/gem_hangcheck_forcewake.c
@@ -72,7 +72,7 @@ igt_simple_main
 
 	memset(blob, 'A', sizeof(blob));
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 	drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/tests/gem_largeobject.c b/tests/gem_largeobject.c
index 0f929f8..5a8a3e2 100644
--- a/tests/gem_largeobject.c
+++ b/tests/gem_largeobject.c
@@ -79,7 +79,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	test_large_object(fd);
 }
diff --git a/tests/gem_linear_blits.c b/tests/gem_linear_blits.c
index 0be13eb..dcf3332 100644
--- a/tests/gem_linear_blits.c
+++ b/tests/gem_linear_blits.c
@@ -258,7 +258,7 @@ int main(int argc, char **argv)
 	igt_subtest_init(argc, argv);
 
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 	}
 
 	igt_subtest("basic")
diff --git a/tests/gem_lut_handle.c b/tests/gem_lut_handle.c
index 7fc72f1..f40c522 100644
--- a/tests/gem_lut_handle.c
+++ b/tests/gem_lut_handle.c
@@ -181,7 +181,7 @@ igt_simple_main
 	uint32_t handle;
 	int fd, i;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	handle = gem_create(fd, 4096);
 	gem_write(fd, handle, 0, batch, sizeof(batch));
diff --git a/tests/gem_madvise.c b/tests/gem_madvise.c
index 58ab629..45dc44d 100644
--- a/tests/gem_madvise.c
+++ b/tests/gem_madvise.c
@@ -58,7 +58,7 @@ static void sigtrap(int sig)
 static void
 dontneed_before_mmap(void)
 {
-	int fd = drm_open_any();
+	int fd = drm_open_driver(DRIVER_INTEL);
 	uint32_t handle;
 	char *ptr;
 
@@ -73,7 +73,7 @@ dontneed_before_mmap(void)
 static void
 dontneed_after_mmap(void)
 {
-	int fd = drm_open_any();
+	int fd = drm_open_driver(DRIVER_INTEL);
 	uint32_t handle;
 	char *ptr;
 
@@ -100,7 +100,7 @@ dontneed_after_mmap(void)
 static void
 dontneed_before_pwrite(void)
 {
-	int fd = drm_open_any();
+	int fd = drm_open_driver(DRIVER_INTEL);
 	uint32_t buf[] = { MI_BATCH_BUFFER_END, 0 };
 	struct drm_i915_gem_pwrite gem_pwrite;
 
@@ -120,7 +120,7 @@ dontneed_before_pwrite(void)
 static void
 dontneed_before_exec(void)
 {
-	int fd = drm_open_any();
+	int fd = drm_open_driver(DRIVER_INTEL);
 	struct drm_i915_gem_execbuffer2 execbuf;
 	struct drm_i915_gem_exec_object2 exec;
 	uint32_t buf[] = { MI_BATCH_BUFFER_END, 0 };
diff --git a/tests/gem_media_fill.c b/tests/gem_media_fill.c
index ade56f2..e0e4d06 100644
--- a/tests/gem_media_fill.c
+++ b/tests/gem_media_fill.c
@@ -107,7 +107,7 @@ igt_simple_main
 	igt_fillfunc_t media_fill = NULL;
 	int i, j;
 
-	data.drm_fd = drm_open_any_render();
+	data.drm_fd = drm_open_driver_render(DRIVER_INTEL);
 	data.devid = intel_get_drm_devid(data.drm_fd);
 
 	data.bufmgr = drm_intel_bufmgr_gem_init(data.drm_fd, 4096);
diff --git a/tests/gem_mmap.c b/tests/gem_mmap.c
index bbc5c4c..53d0f9c 100644
--- a/tests/gem_mmap.c
+++ b/tests/gem_mmap.c
@@ -51,7 +51,7 @@ igt_main
 	int ret;
 
 	igt_fixture
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 	igt_subtest("bad-object") {
 		memset(&arg, 0, sizeof(arg));
diff --git a/tests/gem_mmap_gtt.c b/tests/gem_mmap_gtt.c
index 55c66a2..a86674e 100644
--- a/tests/gem_mmap_gtt.c
+++ b/tests/gem_mmap_gtt.c
@@ -84,7 +84,7 @@ test_access(int fd)
 	handle = gem_create(fd, OBJECT_SIZE);
 	igt_assert(handle);
 
-	fd2 = drm_open_any();
+	fd2 = drm_open_driver(DRIVER_INTEL);
 
 	/* Check that fd1 can mmap. */
 	mmap_arg.handle = handle;
@@ -363,7 +363,7 @@ igt_main
 		OBJECT_SIZE = 1 * 1024 * 1024;
 
 	igt_fixture
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 	igt_subtest("access")
 		test_access(fd);
diff --git a/tests/gem_mmap_offset_exhaustion.c b/tests/gem_mmap_offset_exhaustion.c
index b031050..e9ae0d0 100644
--- a/tests/gem_mmap_offset_exhaustion.c
+++ b/tests/gem_mmap_offset_exhaustion.c
@@ -82,7 +82,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	/* we have 32bit of address space, so try to fit one MB more
 	 * than that. */
diff --git a/tests/gem_mmap_wc.c b/tests/gem_mmap_wc.c
index 73a97d5..f2a4a59 100644
--- a/tests/gem_mmap_wc.c
+++ b/tests/gem_mmap_wc.c
@@ -427,7 +427,7 @@ igt_main
 		OBJECT_SIZE = 1 * 1024 * 1024;
 
 	igt_fixture
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 	igt_subtest("invalid-flags")
 		test_invalid_flags(fd);
diff --git a/tests/gem_multi_bsd_sync_loop.c b/tests/gem_multi_bsd_sync_loop.c
index 0766eb6..c7abbcd 100644
--- a/tests/gem_multi_bsd_sync_loop.c
+++ b/tests/gem_multi_bsd_sync_loop.c
@@ -110,7 +110,7 @@ igt_simple_main
 	int devid;
 	int i;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	devid = intel_get_drm_devid(fd);
 	gem_require_ring(fd, I915_EXEC_BLT);
 
@@ -131,7 +131,7 @@ igt_simple_main
 
 		for (i = 0; i < NUM_FD; i++) {
 			sprintf(buffer_name, "Target buffer %d\n", i);
-			mfd[i] = drm_open_any();
+			mfd[i] = drm_open_driver(DRIVER_INTEL);
 			mbufmgr[i] = drm_intel_bufmgr_gem_init(mfd[i], 4096);
 			igt_assert_f(mbufmgr[i],
 				     "fail to initialize buf manager for drm_fd %d\n",
diff --git a/tests/gem_non_secure_batch.c b/tests/gem_non_secure_batch.c
index d00ce45..6cee9e4 100644
--- a/tests/gem_non_secure_batch.c
+++ b/tests/gem_non_secure_batch.c
@@ -82,7 +82,7 @@ igt_simple_main
 	int fd;
 	int devid;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	devid = intel_get_drm_devid(fd);
 
 	if (HAS_BSD_RING(devid))
diff --git a/tests/gem_partial_pwrite_pread.c b/tests/gem_partial_pwrite_pread.c
index 0be749c..2c1d65d 100644
--- a/tests/gem_partial_pwrite_pread.c
+++ b/tests/gem_partial_pwrite_pread.c
@@ -262,7 +262,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 		//drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/tests/gem_persistent_relocs.c b/tests/gem_persistent_relocs.c
index a6ae386..c5516cc 100644
--- a/tests/gem_persistent_relocs.c
+++ b/tests/gem_persistent_relocs.c
@@ -327,7 +327,7 @@ igt_main
 	memset(blob, 'A', sizeof(blob));
 
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 		/* disable reuse, otherwise the test fails */
diff --git a/tests/gem_pin.c b/tests/gem_pin.c
index b35496e..ea3b303 100644
--- a/tests/gem_pin.c
+++ b/tests/gem_pin.c
@@ -212,7 +212,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	igt_require(test_can_pin(fd));
 
diff --git a/tests/gem_pipe_control_store_loop.c b/tests/gem_pipe_control_store_loop.c
index 86ee405..66afe7d 100644
--- a/tests/gem_pipe_control_store_loop.c
+++ b/tests/gem_pipe_control_store_loop.c
@@ -164,7 +164,7 @@ int fd;
 igt_main
 {
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 		devid = intel_get_drm_devid(fd);
 
 		bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
diff --git a/tests/gem_ppgtt.c b/tests/gem_ppgtt.c
index 5bf773c..b9892d0 100644
--- a/tests/gem_ppgtt.c
+++ b/tests/gem_ppgtt.c
@@ -89,7 +89,7 @@ static void fork_rcs_copy(int target, dri_bo **dst, int count, unsigned flags)
 	int devid;
 
 	for (int child = 0; child < count; child++) {
-		int fd = drm_open_any();
+		int fd = drm_open_driver(DRIVER_INTEL);
 		drm_intel_bufmgr *bufmgr;
 
 		devid = intel_get_drm_devid(fd);
@@ -153,7 +153,7 @@ static void fork_bcs_copy(int target, dri_bo **dst, int count)
 
 	for (int child = 0; child < count; child++) {
 		drm_intel_bufmgr *bufmgr;
-		int fd = drm_open_any();
+		int fd = drm_open_driver(DRIVER_INTEL);
 
 		devid = intel_get_drm_devid(fd);
 
diff --git a/tests/gem_pread.c b/tests/gem_pread.c
index cc83948..199ce49 100644
--- a/tests/gem_pread.c
+++ b/tests/gem_pread.c
@@ -102,7 +102,7 @@ int main(int argc, char **argv)
 	object_size = (object_size + 3) & -4;
 
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		dst = gem_create(fd, object_size);
 		src = malloc(object_size);
diff --git a/tests/gem_pread_after_blit.c b/tests/gem_pread_after_blit.c
index 8ed4310..2181937 100644
--- a/tests/gem_pread_after_blit.c
+++ b/tests/gem_pread_after_blit.c
@@ -216,7 +216,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 		drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/tests/gem_pwrite.c b/tests/gem_pwrite.c
index 6378b0a..4e0845d 100644
--- a/tests/gem_pwrite.c
+++ b/tests/gem_pwrite.c
@@ -110,7 +110,7 @@ int main(int argc, char **argv)
 	object_size = (object_size + 3) & -4;
 
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		dst = gem_create(fd, object_size);
 		src = malloc(object_size);
diff --git a/tests/gem_pwrite_pread.c b/tests/gem_pwrite_pread.c
index 88c2070..41e9d6e 100644
--- a/tests/gem_pwrite_pread.c
+++ b/tests/gem_pwrite_pread.c
@@ -275,7 +275,7 @@ int main(int argc, char **argv)
 	igt_fixture {
 		uint32_t devid;
 
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		dst = gem_create(fd, object_size);
 		src = gem_create(fd, object_size);
diff --git a/tests/gem_readwrite.c b/tests/gem_readwrite.c
index a8a7105..cecef0d 100644
--- a/tests/gem_readwrite.c
+++ b/tests/gem_readwrite.c
@@ -85,7 +85,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		handle = gem_create(fd, OBJECT_SIZE);
 	}
diff --git a/tests/gem_reg_read.c b/tests/gem_reg_read.c
index d3e68d9..84f2c8b 100644
--- a/tests/gem_reg_read.c
+++ b/tests/gem_reg_read.c
@@ -55,7 +55,7 @@ igt_simple_main
 	struct local_drm_i915_reg_read reg_read;
 	int fd, ret;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	reg_read.offset = 0x2358;
 	ret = drmIoctl(fd, REG_READ_IOCTL, &reg_read);
diff --git a/tests/gem_reloc_overflow.c b/tests/gem_reloc_overflow.c
index ea59171..ca8752c 100644
--- a/tests/gem_reloc_overflow.c
+++ b/tests/gem_reloc_overflow.c
@@ -329,7 +329,7 @@ igt_main
 		int ring;
 		uint32_t batch_data [2] = { MI_NOOP, MI_BATCH_BUFFER_END };
 
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		devid = intel_get_drm_devid(fd);
 
diff --git a/tests/gem_reloc_vs_gpu.c b/tests/gem_reloc_vs_gpu.c
index 47fbe75..07cfb8a 100644
--- a/tests/gem_reloc_vs_gpu.c
+++ b/tests/gem_reloc_vs_gpu.c
@@ -279,7 +279,7 @@ static void do_forked_test(int fd, unsigned flags)
 
 	igt_fork(i, num_threads * 4) {
 		/* re-create process local data */
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 		bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 		batch = intel_batchbuffer_alloc(bufmgr, devid);
 
@@ -307,7 +307,7 @@ igt_main
 	memset(blob, 'A', sizeof(blob));
 
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 		bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 		/* disable reuse, otherwise the test fails */
 		//drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/tests/gem_render_copy.c b/tests/gem_render_copy.c
index df1ac88..38f7cd1 100644
--- a/tests/gem_render_copy.c
+++ b/tests/gem_render_copy.c
@@ -144,7 +144,7 @@ int main(int argc, char **argv)
 	igt_simple_init_parse_opts(&argc, argv, "da", NULL, NULL, opt_handler);
 
 	igt_fixture {
-		data.drm_fd = drm_open_any_render();
+		data.drm_fd = drm_open_driver_render(DRIVER_INTEL);
 		data.devid = intel_get_drm_devid(data.drm_fd);
 
 		data.bufmgr = drm_intel_bufmgr_gem_init(data.drm_fd, 4096);
diff --git a/tests/gem_render_copy_redux.c b/tests/gem_render_copy_redux.c
index 43d4c5a..bcf5f28 100644
--- a/tests/gem_render_copy_redux.c
+++ b/tests/gem_render_copy_redux.c
@@ -75,7 +75,7 @@ typedef struct {
 
 static void data_init(data_t *data)
 {
-	data->fd = drm_open_any();
+	data->fd = drm_open_driver(DRIVER_INTEL);
 	data->devid = intel_get_drm_devid(data->fd);
 
 	data->bufmgr = drm_intel_bufmgr_gem_init(data->fd, 4096);
diff --git a/tests/gem_render_linear_blits.c b/tests/gem_render_linear_blits.c
index f83c6d4..e3b66ba 100644
--- a/tests/gem_render_linear_blits.c
+++ b/tests/gem_render_linear_blits.c
@@ -192,7 +192,7 @@ igt_main
 	int count=0;
 
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 	}
 
 	igt_subtest("basic") {
diff --git a/tests/gem_render_tiled_blits.c b/tests/gem_render_tiled_blits.c
index f669270..b7f2fdb 100644
--- a/tests/gem_render_tiled_blits.c
+++ b/tests/gem_render_tiled_blits.c
@@ -205,7 +205,7 @@ igt_main
 	int count = 0;
 
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 	}
 
 	igt_subtest("basic") {
diff --git a/tests/gem_reset_stats.c b/tests/gem_reset_stats.c
index 0e9db10..a59c258 100644
--- a/tests/gem_reset_stats.c
+++ b/tests/gem_reset_stats.c
@@ -89,7 +89,7 @@ static const struct target_ring {
 
 static void check_context(const struct target_ring *ring)
 {
-	int fd = drm_open_any();
+	int fd = drm_open_driver(DRIVER_INTEL);
 
 	gem_context_destroy(fd,
 			    gem_context_create(fd));
@@ -346,7 +346,7 @@ static void test_rs(int num_fds, int hang_index, int rs_assumed_no_hang)
 	igt_assert_lt(hang_index, MAX_FD);
 
 	for (i = 0; i < num_fds; i++) {
-		fd[i] = drm_open_any();
+		fd[i] = drm_open_driver(DRIVER_INTEL);
 		igt_assert(fd[i]);
 	}
 
@@ -400,7 +400,7 @@ static void test_rs_ctx(int num_fds, int num_ctx, int hang_index,
 	test_rs(num_fds, -1, RS_NO_ERROR);
 
 	for (i = 0; i < num_fds; i++) {
-		fd[i] = drm_open_any();
+		fd[i] = drm_open_driver(DRIVER_INTEL);
 		igt_assert(fd[i]);
 		assert_reset_status(fd[i], 0, RS_NO_ERROR);
 
@@ -474,9 +474,9 @@ static void test_ban(void)
 	int active_count = 0, pending_count = 0;
 	struct local_drm_i915_reset_stats rs_bad, rs_good;
 
-	fd_bad = drm_open_any();
+	fd_bad = drm_open_driver(DRIVER_INTEL);
 
-	fd_good = drm_open_any();
+	fd_good = drm_open_driver(DRIVER_INTEL);
 
 	assert_reset_status(fd_bad, 0, RS_NO_ERROR);
 	assert_reset_status(fd_good, 0, RS_NO_ERROR);
@@ -561,7 +561,7 @@ static void test_ban_ctx(void)
 	int active_count = 0, pending_count = 0;
 	struct local_drm_i915_reset_stats rs_bad, rs_good;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	assert_reset_status(fd, 0, RS_NO_ERROR);
 
@@ -652,8 +652,8 @@ static void test_unrelated_ctx(void)
 	int fd1,fd2;
 	int ctx_guilty, ctx_unrelated;
 
-	fd1 = drm_open_any();
-	fd2 = drm_open_any();
+	fd1 = drm_open_driver(DRIVER_INTEL);
+	fd2 = drm_open_driver(DRIVER_INTEL);
 	assert_reset_status(fd1, 0, RS_NO_ERROR);
 	assert_reset_status(fd2, 0, RS_NO_ERROR);
 	ctx_guilty = gem_context_create(fd1);
@@ -700,7 +700,7 @@ static void test_close_pending_ctx(void)
 	int fd, h;
 	uint32_t ctx;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	ctx = gem_context_create(fd);
 
 	assert_reset_status(fd, ctx, RS_NO_ERROR);
@@ -718,7 +718,7 @@ static void test_close_pending(void)
 {
 	int fd, h;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	assert_reset_status(fd, 0, RS_NO_ERROR);
 
@@ -780,7 +780,7 @@ static void test_close_pending_fork(const bool reverse)
 	int pid;
 	int fd, h;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	assert_reset_status(fd, 0, RS_NO_ERROR);
 
@@ -795,7 +795,7 @@ static void test_close_pending_fork(const bool reverse)
 	 */
 	pid = fork();
 	if (pid == 0) {
-		const int fd2 = drm_open_any();
+		const int fd2 = drm_open_driver(DRIVER_INTEL);
 		igt_assert_lte(0, fd2);
 
 		/* The crucial component is that we schedule the same noop batch
@@ -819,7 +819,7 @@ static void test_close_pending_fork(const bool reverse)
 	close(fd);
 
 	/* Then we just wait on hang to happen */
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	h = exec_valid(fd, 0);
 	igt_assert_lte(0, h);
@@ -834,7 +834,7 @@ static void test_reset_count(const bool create_ctx)
 	int fd, h, ctx;
 	long c1, c2;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	if (create_ctx)
 		ctx = gem_context_create(fd);
 	else
@@ -944,7 +944,7 @@ static void test_params_ctx(void)
 {
 	int fd, ctx;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	ctx = gem_context_create(fd);
 
 	_test_param(fd, ctx);
@@ -956,7 +956,7 @@ static void test_params(void)
 {
 	int fd;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	_test_param(fd, 0);
 
@@ -969,7 +969,7 @@ static void defer_hangcheck(int ring_num)
 	int fd, count_start, count_end;
 	int seconds = 30;
 	const struct target_ring *next_ring;
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	do {
 		next_ring = &rings[(++ring_num) % NUM_RINGS];
@@ -1043,7 +1043,7 @@ static void check_gpu_ok(void)
 
 	igt_assert(flags == 0);
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	gem_quiescent_gpu(fd);
 	close(fd);
 }
@@ -1059,7 +1059,7 @@ igt_main
 		int fd;
 
 		bool has_reset_stats;
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 		devid = intel_get_drm_devid(fd);
 
 		has_reset_stats = gem_has_reset_stats(fd);
@@ -1080,7 +1080,7 @@ igt_main
 		name = current_ring->name;
 
 		igt_fixture {
-			int fd = drm_open_any();
+			int fd = drm_open_driver(DRIVER_INTEL);
 			gem_require_ring(fd, current_ring->exec);
 			close(fd);
 		}
diff --git a/tests/gem_ring_sync_copy.c b/tests/gem_ring_sync_copy.c
index f5ffddc..05122a5 100644
--- a/tests/gem_ring_sync_copy.c
+++ b/tests/gem_ring_sync_copy.c
@@ -335,7 +335,7 @@ igt_main
 	};
 
 	igt_fixture {
-		data.drm_fd = drm_open_any_render();
+		data.drm_fd = drm_open_driver_render(DRIVER_INTEL);
 		data.devid = intel_get_drm_devid(data.drm_fd);
 
 		data.n_buffers_load = 1000;
diff --git a/tests/gem_ring_sync_loop.c b/tests/gem_ring_sync_loop.c
index 4b88530..88e63f6 100644
--- a/tests/gem_ring_sync_loop.c
+++ b/tests/gem_ring_sync_loop.c
@@ -98,7 +98,7 @@ igt_simple_main
 	int fd;
 	int devid;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	devid = intel_get_drm_devid(fd);
 	gem_require_ring(fd, I915_EXEC_BLT);
 
diff --git a/tests/gem_ringfill.c b/tests/gem_ringfill.c
index 85b01ea..100e205 100644
--- a/tests/gem_ringfill.c
+++ b/tests/gem_ringfill.c
@@ -202,7 +202,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 		drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/tests/gem_seqno_wrap.c b/tests/gem_seqno_wrap.c
index 43da450..73c4e6d 100644
--- a/tests/gem_seqno_wrap.c
+++ b/tests/gem_seqno_wrap.c
@@ -186,7 +186,7 @@ static void run_sync_test(int num_buffers, bool verify)
 	unsigned int *p_dst1, *p_dst2;
 	struct igt_buf *s_src, *s_dst;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	gem_quiescent_gpu(fd);
 
diff --git a/tests/gem_set_tiling_vs_blt.c b/tests/gem_set_tiling_vs_blt.c
index 956308a..41174fc 100644
--- a/tests/gem_set_tiling_vs_blt.c
+++ b/tests/gem_set_tiling_vs_blt.c
@@ -235,7 +235,7 @@ igt_main
 		for (i = 0; i < 1024*256; i++)
 			data[i] = i;
 
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 		drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/tests/gem_set_tiling_vs_gtt.c b/tests/gem_set_tiling_vs_gtt.c
index 006f50a..d8b04b2 100644
--- a/tests/gem_set_tiling_vs_gtt.c
+++ b/tests/gem_set_tiling_vs_gtt.c
@@ -61,7 +61,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	if (IS_GEN2(intel_get_drm_devid(fd)))
 		tile_height = 16;
diff --git a/tests/gem_set_tiling_vs_pwrite.c b/tests/gem_set_tiling_vs_pwrite.c
index a4bdc64..e218179 100644
--- a/tests/gem_set_tiling_vs_pwrite.c
+++ b/tests/gem_set_tiling_vs_pwrite.c
@@ -58,7 +58,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	for (i = 0; i < OBJECT_SIZE/4; i++)
 		data[i] = i;
diff --git a/tests/gem_storedw_batches_loop.c b/tests/gem_storedw_batches_loop.c
index dcc11a5..f24eb9b 100644
--- a/tests/gem_storedw_batches_loop.c
+++ b/tests/gem_storedw_batches_loop.c
@@ -137,7 +137,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 		devid = intel_get_drm_devid(fd);
 
 		has_ppgtt = gem_uses_aliasing_ppgtt(fd);
diff --git a/tests/gem_storedw_loop_blt.c b/tests/gem_storedw_loop_blt.c
index 44e46a8..eb34e2e 100644
--- a/tests/gem_storedw_loop_blt.c
+++ b/tests/gem_storedw_loop_blt.c
@@ -117,7 +117,7 @@ igt_simple_main
 	int fd;
 	int devid;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	devid = intel_get_drm_devid(fd);
 
 	has_ppgtt = gem_uses_aliasing_ppgtt(fd);
diff --git a/tests/gem_storedw_loop_bsd.c b/tests/gem_storedw_loop_bsd.c
index e534c16..fb1b3be 100644
--- a/tests/gem_storedw_loop_bsd.c
+++ b/tests/gem_storedw_loop_bsd.c
@@ -117,7 +117,7 @@ igt_simple_main
 	int fd;
 	int devid;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	devid = intel_get_drm_devid(fd);
 
 	has_ppgtt = gem_uses_aliasing_ppgtt(fd);
diff --git a/tests/gem_storedw_loop_render.c b/tests/gem_storedw_loop_render.c
index 48fb6d4..8ca680f 100644
--- a/tests/gem_storedw_loop_render.c
+++ b/tests/gem_storedw_loop_render.c
@@ -117,7 +117,7 @@ igt_simple_main
 	int fd;
 	int devid;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	devid = intel_get_drm_devid(fd);
 
 	has_ppgtt = gem_uses_aliasing_ppgtt(fd);
diff --git a/tests/gem_storedw_loop_vebox.c b/tests/gem_storedw_loop_vebox.c
index 8643dd3..566e6b6 100644
--- a/tests/gem_storedw_loop_vebox.c
+++ b/tests/gem_storedw_loop_vebox.c
@@ -101,7 +101,7 @@ igt_simple_main
 {
 	int fd;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	igt_require(gem_has_vebox(fd));
 	igt_require(gem_uses_aliasing_ppgtt(fd));
diff --git a/tests/gem_stress.c b/tests/gem_stress.c
index 804684f..a100e8f 100644
--- a/tests/gem_stress.c
+++ b/tests/gem_stress.c
@@ -857,7 +857,7 @@ int main(int argc, char **argv)
 	igt_simple_init_parse_opts(&argc, argv,"ds:g:c:t:rbuxmo:fp:",
 				   long_options, NULL, parse_options);
 
-	drm_fd = drm_open_any();
+	drm_fd = drm_open_driver(DRIVER_INTEL);
 	devid = intel_get_drm_devid(drm_fd);
 
 	/* start our little helper early before too may allocations occur */
diff --git a/tests/gem_threaded_access_tiled.c b/tests/gem_threaded_access_tiled.c
index 16a50ad..9a449df 100644
--- a/tests/gem_threaded_access_tiled.c
+++ b/tests/gem_threaded_access_tiled.c
@@ -98,7 +98,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	igt_assert(fd >= 0);
 
 	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
diff --git a/tests/gem_tiled_blits.c b/tests/gem_tiled_blits.c
index 3fceb81..d828ebd 100644
--- a/tests/gem_tiled_blits.c
+++ b/tests/gem_tiled_blits.c
@@ -203,7 +203,7 @@ int main(int argc, char **argv)
 	igt_subtest_init(argc, argv);
 
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 		drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/tests/gem_tiled_fence_blits.c b/tests/gem_tiled_fence_blits.c
index c852207..c3e2acb 100644
--- a/tests/gem_tiled_fence_blits.c
+++ b/tests/gem_tiled_fence_blits.c
@@ -111,7 +111,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
 	if (count > intel_get_total_ram_mb() * 9 / 10) {
 		count = intel_get_total_ram_mb() * 9 / 10;
diff --git a/tests/gem_tiled_partial_pwrite_pread.c b/tests/gem_tiled_partial_pwrite_pread.c
index 8dea82e..26ffc4e 100644
--- a/tests/gem_tiled_partial_pwrite_pread.c
+++ b/tests/gem_tiled_partial_pwrite_pread.c
@@ -262,7 +262,7 @@ igt_main
 	srandom(0xdeadbeef);
 
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 		//drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/tests/gem_tiled_pread.c b/tests/gem_tiled_pread.c
index fdc5173..d3d8751 100644
--- a/tests/gem_tiled_pread.c
+++ b/tests/gem_tiled_pread.c
@@ -120,7 +120,7 @@ igt_simple_main
 	uint32_t handle;
 	uint32_t devid;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	handle = create_bo(fd);
 	gem_get_tiling(fd, handle, &tiling, &swizzle);
diff --git a/tests/gem_tiled_pread_pwrite.c b/tests/gem_tiled_pread_pwrite.c
index 3d8fdc9..48c0af0 100644
--- a/tests/gem_tiled_pread_pwrite.c
+++ b/tests/gem_tiled_pread_pwrite.c
@@ -110,7 +110,7 @@ igt_simple_main
 	uint32_t handle, handle_target;
 	int count;
 	
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	count = SLOW_QUICK(intel_get_total_ram_mb() * 9 / 10, 8) ;
 
 	for (i = 0; i < count/2; i++) {
diff --git a/tests/gem_tiled_swapping.c b/tests/gem_tiled_swapping.c
index 2361dfc..56a052d 100644
--- a/tests/gem_tiled_swapping.c
+++ b/tests/gem_tiled_swapping.c
@@ -190,7 +190,7 @@ igt_main
 
 		intel_purge_vm_caches();
 
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		check_memory_layout();
 
diff --git a/tests/gem_tiled_wb.c b/tests/gem_tiled_wb.c
index b6efd6e..f2e8e83 100644
--- a/tests/gem_tiled_wb.c
+++ b/tests/gem_tiled_wb.c
@@ -140,7 +140,7 @@ igt_simple_main
 	uint32_t tiling, swizzle;
 	uint32_t handle;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	handle = create_bo(fd);
 	get_tiling(fd, handle, &tiling, &swizzle);
diff --git a/tests/gem_tiled_wc.c b/tests/gem_tiled_wc.c
index b0f7a65..1a9a641 100644
--- a/tests/gem_tiled_wc.c
+++ b/tests/gem_tiled_wc.c
@@ -135,7 +135,7 @@ igt_simple_main
 	uint32_t tiling, swizzle;
 	uint32_t handle;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	gem_require_mmap_wc(fd);
 
 	handle = create_bo(fd);
diff --git a/tests/gem_tiling_max_stride.c b/tests/gem_tiling_max_stride.c
index fce1ac7..5764628 100644
--- a/tests/gem_tiling_max_stride.c
+++ b/tests/gem_tiling_max_stride.c
@@ -71,7 +71,7 @@ igt_simple_main
 	int tile_width = 512;
 	int tile_height = 8;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	devid = intel_get_drm_devid(fd);
 
diff --git a/tests/gem_unfence_active_buffers.c b/tests/gem_unfence_active_buffers.c
index 125568e..9b2cd5f 100644
--- a/tests/gem_unfence_active_buffers.c
+++ b/tests/gem_unfence_active_buffers.c
@@ -77,7 +77,7 @@ igt_simple_main
 	for (i = 0; i < 1024*256; i++)
 		data[i] = i;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 	drm_intel_bufmgr_gem_enable_reuse(bufmgr);
diff --git a/tests/gem_unref_active_buffers.c b/tests/gem_unref_active_buffers.c
index 8c8efaa..acf97b2 100644
--- a/tests/gem_unref_active_buffers.c
+++ b/tests/gem_unref_active_buffers.c
@@ -60,7 +60,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
 	igt_assert(bufmgr);
diff --git a/tests/gem_userptr_blits.c b/tests/gem_userptr_blits.c
index 961a5af..4c8f278 100644
--- a/tests/gem_userptr_blits.c
+++ b/tests/gem_userptr_blits.c
@@ -779,7 +779,7 @@ static int test_dmabuf(void)
 	int dma_buf_fd = -1;
 	int ret;
 
-	fd1 = drm_open_any();
+	fd1 = drm_open_driver(DRIVER_INTEL);
 
 	handle = create_userptr_bo(fd1, sizeof(linear));
 	memset(get_handle_ptr(handle), counter, sizeof(linear));
@@ -795,7 +795,7 @@ static int test_dmabuf(void)
 		igt_assert_lte(0, dma_buf_fd);
 	}
 
-	fd2 = drm_open_any();
+	fd2 = drm_open_driver(DRIVER_INTEL);
 	handle_import = prime_fd_to_handle(fd2, dma_buf_fd);
 	check_bo(fd1, handle, 1, fd2, handle_import);
 
@@ -1315,7 +1315,7 @@ int main(int argc, char **argv)
 	igt_fixture {
 		int ret;
 
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 		igt_assert(fd >= 0);
 
 		ret = has_userptr(fd);
diff --git a/tests/gem_wait.c b/tests/gem_wait.c
index 67317dd..0d85229 100644
--- a/tests/gem_wait.c
+++ b/tests/gem_wait.c
@@ -262,7 +262,7 @@ int drm_fd;
 igt_main
 {
 	igt_fixture
-		drm_fd = drm_open_any();
+		drm_fd = drm_open_driver(DRIVER_INTEL);
 
 	igt_subtest("render_timeout")
 		render_timeout(drm_fd);
diff --git a/tests/gem_workarounds.c b/tests/gem_workarounds.c
index f1da3ef..729489b 100644
--- a/tests/gem_workarounds.c
+++ b/tests/gem_workarounds.c
@@ -188,7 +188,7 @@ igt_main
 		char *line = NULL;
 		size_t line_size;
 
-		drm_fd = drm_open_any();
+		drm_fd = drm_open_driver(DRIVER_INTEL);
 
 		bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096);
 		devid = intel_get_drm_devid(drm_fd);
diff --git a/tests/gem_write_read_ring_switch.c b/tests/gem_write_read_ring_switch.c
index da579da..80e70a8 100644
--- a/tests/gem_write_read_ring_switch.c
+++ b/tests/gem_write_read_ring_switch.c
@@ -156,7 +156,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 
 		/* Test requires MI_FLUSH_DW and MI_COND_BATCH_BUFFER_END */
 		igt_require(intel_gen(intel_get_drm_devid(fd)) >= 6);
diff --git a/tests/gen3_mixed_blits.c b/tests/gen3_mixed_blits.c
index 6203982..aa8d394 100644
--- a/tests/gen3_mixed_blits.c
+++ b/tests/gen3_mixed_blits.c
@@ -465,7 +465,7 @@ int main(int argc, char **argv)
 
 	igt_simple_init(argc, argv);
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	igt_require(IS_GEN3(intel_get_drm_devid(fd)));
 
diff --git a/tests/gen3_render_linear_blits.c b/tests/gen3_render_linear_blits.c
index 5ed4c82..a449e3d 100644
--- a/tests/gen3_render_linear_blits.c
+++ b/tests/gen3_render_linear_blits.c
@@ -333,7 +333,7 @@ int main(int argc, char **argv)
 
 	igt_simple_init(argc, argv);
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	igt_require(IS_GEN3(intel_get_drm_devid(fd)));
 
diff --git a/tests/gen3_render_mixed_blits.c b/tests/gen3_render_mixed_blits.c
index 5e5e417..070c9fd 100644
--- a/tests/gen3_render_mixed_blits.c
+++ b/tests/gen3_render_mixed_blits.c
@@ -353,7 +353,7 @@ int main(int argc, char **argv)
 
 	igt_simple_init(argc, argv);
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	igt_require(IS_GEN3(intel_get_drm_devid(fd)));
 
diff --git a/tests/gen3_render_tiledx_blits.c b/tests/gen3_render_tiledx_blits.c
index 4f309f7..6c4afa6 100644
--- a/tests/gen3_render_tiledx_blits.c
+++ b/tests/gen3_render_tiledx_blits.c
@@ -340,7 +340,7 @@ int main(int argc, char **argv)
 
 	igt_simple_init(argc, argv);
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	igt_require(IS_GEN3(intel_get_drm_devid(fd)));
 
diff --git a/tests/gen3_render_tiledy_blits.c b/tests/gen3_render_tiledy_blits.c
index 57ed984..4be241f 100644
--- a/tests/gen3_render_tiledy_blits.c
+++ b/tests/gen3_render_tiledy_blits.c
@@ -340,7 +340,7 @@ int main(int argc, char **argv)
 
 	igt_simple_init(argc, argv);
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	igt_require(IS_GEN3(intel_get_drm_devid(fd)));
 
diff --git a/tests/gen7_forcewake_mt.c b/tests/gen7_forcewake_mt.c
index 8337847..4e8bfc3 100644
--- a/tests/gen7_forcewake_mt.c
+++ b/tests/gen7_forcewake_mt.c
@@ -130,7 +130,7 @@ igt_simple_main
 	struct thread t[16];
 	int i;
 
-	t[0].fd = drm_open_any();
+	t[0].fd = drm_open_driver(DRIVER_INTEL);
 	t[0].mmio = igfx_get_mmio();
 
 	for (i = 2; i < 16; i++) {
diff --git a/tests/kms_3d.c b/tests/kms_3d.c
index fdc05b1..2b1c2cb 100644
--- a/tests/kms_3d.c
+++ b/tests/kms_3d.c
@@ -37,7 +37,7 @@ igt_simple_main
 	size_t length;
 	int mode_count, connector_id;
 
-	drm_fd = drm_open_any_master();
+	drm_fd = drm_open_driver_master(DRIVER_INTEL);
 	res = drmModeGetResources(drm_fd);
 
 	igt_assert(drmSetClientCap(drm_fd, DRM_CLIENT_CAP_STEREO_3D, 1) >= 0);
diff --git a/tests/kms_addfb.c b/tests/kms_addfb.c
index 28afdf0..15e7ff9 100644
--- a/tests/kms_addfb.c
+++ b/tests/kms_addfb.c
@@ -355,7 +355,7 @@ int gen;
 igt_main
 {
 	igt_fixture {
-		fd = drm_open_any_master();
+		fd = drm_open_driver_master(DRIVER_INTEL);
 		gen = intel_gen(intel_get_drm_devid(fd));
 	}
 
diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index fca8248..2e9610b 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -522,7 +522,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		data.drm_fd = drm_open_any_master();
+		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
 
 		data.devid = intel_get_drm_devid(data.drm_fd);
 
diff --git a/tests/kms_fbc_crc.c b/tests/kms_fbc_crc.c
index b6de218..67333d8 100644
--- a/tests/kms_fbc_crc.c
+++ b/tests/kms_fbc_crc.c
@@ -503,7 +503,7 @@ igt_main
 		char buf[64];
 		FILE *status;
 
-		data.drm_fd = drm_open_any_master();
+		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
 		kmstest_set_vt_graphics_mode();
 
 		data.devid = intel_get_drm_devid(data.drm_fd);
diff --git a/tests/kms_fence_pin_leak.c b/tests/kms_fence_pin_leak.c
index 4d3d37a..424439d 100644
--- a/tests/kms_fence_pin_leak.c
+++ b/tests/kms_fence_pin_leak.c
@@ -215,7 +215,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	data.drm_fd = drm_open_any_master();
+	data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
 
 	data.devid = intel_get_drm_devid(data.drm_fd);
 
diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 25c9243..4d8d0c0 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -1700,7 +1700,7 @@ int main(int argc, char **argv)
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		drm_fd = drm_open_any_master();
+		drm_fd = drm_open_driver_master(DRIVER_INTEL);
 
 		igt_enable_connectors();
 
diff --git a/tests/kms_flip_event_leak.c b/tests/kms_flip_event_leak.c
index 4e9f58a..2c9f9bc 100644
--- a/tests/kms_flip_event_leak.c
+++ b/tests/kms_flip_event_leak.c
@@ -73,7 +73,7 @@ static bool test(data_t *data, enum pipe pipe, igt_output_t *output)
 	igt_plane_set_fb(primary, &fb[0]);
 	igt_display_commit2(&data->display, COMMIT_LEGACY);
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	ret = drmDropMaster(data->drm_fd);
 	igt_assert_eq(ret, 0);
@@ -114,7 +114,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	data.drm_fd = drm_open_any_master();
+	data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
 	kmstest_set_vt_graphics_mode();
 
 	igt_display_init(&data.display, data.drm_fd);
diff --git a/tests/kms_flip_tiling.c b/tests/kms_flip_tiling.c
index 3181260..01e5520 100644
--- a/tests/kms_flip_tiling.c
+++ b/tests/kms_flip_tiling.c
@@ -133,7 +133,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		data.drm_fd = drm_open_any_master();
+		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
 		data.gen = intel_gen(intel_get_drm_devid(data.drm_fd));
 
 		kmstest_set_vt_graphics_mode();
diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c
index 42aaa7f..53a9055 100644
--- a/tests/kms_force_connector.c
+++ b/tests/kms_force_connector.c
@@ -42,7 +42,7 @@ igt_main
 	int start_n_modes;
 
 	igt_fixture {
-		drm_fd = drm_open_any_master();
+		drm_fd = drm_open_driver_master(DRIVER_INTEL);
 		res = drmModeGetResources(drm_fd);
 
 		/* find the vga connector */
diff --git a/tests/kms_mmio_vs_cs_flip.c b/tests/kms_mmio_vs_cs_flip.c
index b24c7f4..a9a376d 100644
--- a/tests/kms_mmio_vs_cs_flip.c
+++ b/tests/kms_mmio_vs_cs_flip.c
@@ -517,7 +517,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		data.drm_fd = drm_open_any_master();
+		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
 
 		kmstest_set_vt_graphics_mode();
 
diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
index bbedd58..fc4ad46 100644
--- a/tests/kms_pipe_crc_basic.c
+++ b/tests/kms_pipe_crc_basic.c
@@ -226,7 +226,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		data.drm_fd = drm_open_any_master();
+		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
 
 		igt_enable_connectors();
 
diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index ffd31e0..ae4f917 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -410,7 +410,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		data.drm_fd = drm_open_any_master();
+		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
 
 		kmstest_set_vt_graphics_mode();
 
diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
index ba6fb1d..a8b1061 100644
--- a/tests/kms_psr_sink_crc.c
+++ b/tests/kms_psr_sink_crc.c
@@ -511,7 +511,7 @@ int main(int argc, char *argv[])
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		data.drm_fd = drm_open_any_master();
+		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
 		kmstest_set_vt_graphics_mode();
 		data.devid = intel_get_drm_devid(data.drm_fd);
 
diff --git a/tests/kms_pwrite_crc.c b/tests/kms_pwrite_crc.c
index a8e40ef..1497200 100644
--- a/tests/kms_pwrite_crc.c
+++ b/tests/kms_pwrite_crc.c
@@ -193,7 +193,7 @@ igt_simple_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		data.drm_fd = drm_open_any_master();
+		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
 
 		data.devid = intel_get_drm_devid(data.drm_fd);
 
diff --git a/tests/kms_render.c b/tests/kms_render.c
index 1759eaa..3c98783 100644
--- a/tests/kms_render.c
+++ b/tests/kms_render.c
@@ -237,7 +237,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		drm_fd = drm_open_any_master();
+		drm_fd = drm_open_driver_master(DRIVER_INTEL);
 
 		bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096);
 		devid = intel_get_drm_devid(drm_fd);
diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index a57692e..88726ce 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -229,7 +229,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		data.gfx_fd = drm_open_any_master();
+		data.gfx_fd = drm_open_driver_master(DRIVER_INTEL);
 
 		kmstest_set_vt_graphics_mode();
 
diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
index 5520dcc..75fe4b2 100644
--- a/tests/kms_setmode.c
+++ b/tests/kms_setmode.c
@@ -710,7 +710,7 @@ int main(int argc, char **argv)
 		     "only one of -d and -t is accepted\n");
 
 	igt_fixture {
-		drm_fd = drm_open_any_master();
+		drm_fd = drm_open_driver_master(DRIVER_INTEL);
 		if (!dry_run)
 			kmstest_set_vt_graphics_mode();
 
diff --git a/tests/kms_sink_crc_basic.c b/tests/kms_sink_crc_basic.c
index d2cc7ed..dc997b3 100644
--- a/tests/kms_sink_crc_basic.c
+++ b/tests/kms_sink_crc_basic.c
@@ -171,7 +171,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	data.drm_fd = drm_open_any_master();
+	data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
 
 	kmstest_set_vt_graphics_mode();
 	igt_display_init(&data.display, data.drm_fd);
diff --git a/tests/kms_universal_plane.c b/tests/kms_universal_plane.c
index 39dd0aa..5b253c6 100644
--- a/tests/kms_universal_plane.c
+++ b/tests/kms_universal_plane.c
@@ -666,7 +666,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		data.drm_fd = drm_open_any_master();
+		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
 
 		kmstest_set_vt_graphics_mode();
 
diff --git a/tests/pm_lpsp.c b/tests/pm_lpsp.c
index 50b3dd9..7a81002 100644
--- a/tests/pm_lpsp.c
+++ b/tests/pm_lpsp.c
@@ -226,7 +226,7 @@ igt_main
 	igt_fixture {
 		int i;
 
-		drm_fd = drm_open_any_master();
+		drm_fd = drm_open_driver_master(DRIVER_INTEL);
 		igt_require(drm_fd >= 0);
 
 		devid = intel_get_drm_devid(drm_fd);
diff --git a/tests/pm_rc6_residency.c b/tests/pm_rc6_residency.c
index a945b47..35fac51 100644
--- a/tests/pm_rc6_residency.c
+++ b/tests/pm_rc6_residency.c
@@ -139,9 +139,9 @@ igt_main
 
 	igt_skip_on_simulation();
 
-	/* Use drm_open_any to verify device existence */
+	/* Use drm_open_driver to verify device existence */
 	igt_fixture {
-		fd = drm_open_any();
+		fd = drm_open_driver(DRIVER_INTEL);
 		devid = intel_get_drm_devid(fd);
 		close(fd);
 
diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c
index 91df93a..654103f 100644
--- a/tests/pm_rpm.c
+++ b/tests/pm_rpm.c
@@ -724,7 +724,7 @@ static void setup_non_graphics_runtime_pm(void)
 
 static void setup_environment(void)
 {
-	drm_fd = drm_open_any_master();
+	drm_fd = drm_open_driver_master(DRIVER_INTEL);
 
 	init_mode_set_data(&ms_data);
 
diff --git a/tests/pm_rps.c b/tests/pm_rps.c
index 6289e1b..16c246b 100644
--- a/tests/pm_rps.c
+++ b/tests/pm_rps.c
@@ -570,7 +570,7 @@ static void blocking(void)
 	int pre_freqs[NUMFREQ];
 	int post_freqs[NUMFREQ];
 
-	int fd = drm_open_any();
+	int fd = drm_open_driver(DRIVER_INTEL);
 	igt_assert_lte(0, fd);
 
 	/*
@@ -625,8 +625,8 @@ igt_main
 		struct junk *junk = stuff;
 		int ret;
 
-		/* Use drm_open_any to verify device existence */
-		drm_fd = drm_open_any();
+		/* Use drm_open_driver to verify device existence */
+		drm_fd = drm_open_driver(DRIVER_INTEL);
 
 		do {
 			int val = -1;
diff --git a/tests/prime_self_import.c b/tests/prime_self_import.c
index 20eb115..f9493fd 100644
--- a/tests/prime_self_import.c
+++ b/tests/prime_self_import.c
@@ -90,8 +90,8 @@ static void test_with_fd_dup(void)
 
 	counter = 0;
 
-	fd1 = drm_open_any();
-	fd2 = drm_open_any();
+	fd1 = drm_open_driver(DRIVER_INTEL);
+	fd2 = drm_open_driver(DRIVER_INTEL);
 
 	handle = gem_create(fd1, BO_SIZE);
 
@@ -118,8 +118,8 @@ static void test_with_two_bos(void)
 
 	counter = 0;
 
-	fd1 = drm_open_any();
-	fd2 = drm_open_any();
+	fd1 = drm_open_driver(DRIVER_INTEL);
+	fd2 = drm_open_driver(DRIVER_INTEL);
 
 	handle1 = gem_create(fd1, BO_SIZE);
 	handle2 = gem_create(fd1, BO_SIZE);
@@ -149,8 +149,8 @@ static void test_with_one_bo_two_files(void)
 	uint32_t handle_import, handle_open, handle_orig, flink_name;
 	int dma_buf_fd1, dma_buf_fd2;
 
-	fd1 = drm_open_any();
-	fd2 = drm_open_any();
+	fd1 = drm_open_driver(DRIVER_INTEL);
+	fd2 = drm_open_driver(DRIVER_INTEL);
 
 	handle_orig = gem_create(fd1, BO_SIZE);
 	dma_buf_fd1 = prime_handle_to_fd(fd1, handle_orig);
@@ -176,8 +176,8 @@ static void test_with_one_bo(void)
 	uint32_t handle, handle_import1, handle_import2, handle_selfimport;
 	int dma_buf_fd;
 
-	fd1 = drm_open_any();
-	fd2 = drm_open_any();
+	fd1 = drm_open_driver(DRIVER_INTEL);
+	fd2 = drm_open_driver(DRIVER_INTEL);
 
 	handle = gem_create(fd1, BO_SIZE);
 
@@ -260,7 +260,7 @@ static void test_reimport_close_race(void)
 
 	/* Allocate exit handler fds in here so that we dont screw
 	 * up the counts */
-	fake = drm_open_any();
+	fake = drm_open_driver(DRIVER_INTEL);
 
 	obj_count = get_object_count();
 
@@ -268,7 +268,7 @@ static void test_reimport_close_race(void)
 
 	threads = calloc(num_threads, sizeof(pthread_t));
 
-	fds[0] = drm_open_any();
+	fds[0] = drm_open_driver(DRIVER_INTEL);
 
 	handle = gem_create(fds[0], BO_SIZE);
 
@@ -350,11 +350,11 @@ static void test_export_close_race(void)
 
 	/* Allocate exit handler fds in here so that we dont screw
 	 * up the counts */
-	fake = drm_open_any();
+	fake = drm_open_driver(DRIVER_INTEL);
 
 	obj_count = get_object_count();
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 	for (i = 0; i < num_threads; i++) {
 		r = pthread_create(&threads[i], NULL,
@@ -391,7 +391,7 @@ static void test_llseek_size(void)
 
 	counter = 0;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 
 	for (i = 0; i < 10; i++) {
@@ -418,7 +418,7 @@ static void test_llseek_bad(void)
 
 	counter = 0;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 
 
 	handle = gem_create(fd, BO_SIZE);
diff --git a/tests/template.c b/tests/template.c
index 24fd850..b52eece 100644
--- a/tests/template.c
+++ b/tests/template.c
@@ -59,7 +59,7 @@ int drm_fd;
 igt_main
 {
 	igt_fixture {
-		drm_fd = drm_open_any();
+		drm_fd = drm_open_driver(DRIVER_INTEL);
 		igt_require(drm_fd >= 0);
 
 		/* Set up other interesting stuff shared by all tests. */
diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index f864940..7d4569c 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -744,7 +744,7 @@ int main(int argc, char **argv)
 	    specified_mode_num == -1 && !test_stereo_modes)
 		test_all_modes = 1;
 
-	drm_fd = drm_open_any();
+	drm_fd = drm_open_driver(DRIVER_INTEL);
 
 	if (test_stereo_modes &&
 	    drmSetClientCap(drm_fd, DRM_CLIENT_CAP_STEREO_3D, 1) < 0) {
diff --git a/tools/intel_display_poller.c b/tools/intel_display_poller.c
index 2eab6c4..bad7413 100644
--- a/tools/intel_display_poller.c
+++ b/tools/intel_display_poller.c
@@ -1210,7 +1210,7 @@ int main(int argc, char *argv[])
 		}
 	}
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	devid = intel_get_drm_devid(fd);
 	close(fd);
 
diff --git a/tools/intel_gpu_frequency.c b/tools/intel_gpu_frequency.c
index c5359c0..5ae47e7 100644
--- a/tools/intel_gpu_frequency.c
+++ b/tools/intel_gpu_frequency.c
@@ -308,7 +308,7 @@ int main(int argc, char *argv[])
 	bool write, fail, targets[MAX+1] = {false};
 	int i, try = 1, set_freq[MAX+1] = {0};
 
-	devid = intel_get_drm_devid(drm_open_any());
+	devid = intel_get_drm_devid(drm_open_driver(DRIVER_INTEL));
 	device = drm_get_card();
 
 	write = parse(argc, argv, targets, ARRAY_SIZE(targets), set_freq);
diff --git a/tools/intel_l3_parity.c b/tools/intel_l3_parity.c
index a4b7d73..4810f7a 100644
--- a/tools/intel_l3_parity.c
+++ b/tools/intel_l3_parity.c
@@ -189,7 +189,7 @@ int main(int argc, char *argv[])
 	int row = 0, bank = 0, sbank = 0;
 	int fd[REAL_MAX_SLICES] = {0}, ret, i;
 	int action = '0';
-	int drm_fd = drm_open_any();
+	int drm_fd = drm_open_driver(DRIVER_INTEL);
 	int daemonize = 0;
 	devid = intel_get_drm_devid(drm_fd);
 
diff --git a/tools/intel_perf_counters.c b/tools/intel_perf_counters.c
index 739f926..04a6aba 100644
--- a/tools/intel_perf_counters.c
+++ b/tools/intel_perf_counters.c
@@ -454,7 +454,7 @@ main(int argc, char **argv)
 	int fd;
 	int l;
 
-	fd = drm_open_any();
+	fd = drm_open_driver(DRIVER_INTEL);
 	devid = intel_get_drm_devid(fd);
 
 	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
-- 
2.1.4



More information about the Intel-gfx mailing list