[igt-dev] [PATCH i-g-t v5 2/2] tests: Check and skip unhandled tests that needs display

José Roberto de Souza jose.souza at intel.com
Thu Sep 13 23:40:18 UTC 2018


'lib: Require drmModeResources()' take care of all tests that calls
igt_display_init(), here handling other tests that needs display and
do not call it.

v2:
- Not skipping all tests in debugfs_test, perf_pmu and perf_pmu,
now skiping only the required subtests

v3:
- Renamed igt_require_display to igt_display_required, to keep naming
consistent
- Added igt_display_available()
- Checking if display is available by quering a modeset capability
instead of drmModeGetResources()
- Not skiping read_all_entries tests when display is disabled

v4:
- Using 'lib: Require drmModeResources()', so all tests already
handled by that patch had the igt_display_require() call removed.

v5:
- Replacing igt_display_require() calls to igt_require() over the
return of drmModeGetResources() when possible

Cc: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula at intel.com>
Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
Signed-off-by: José Roberto de Souza <jose.souza at intel.com>
---
 lib/igt_kms.c                     | 30 +++++++++++++-
 lib/igt_kms.h                     |  2 +
 tests/debugfs_test.c              | 14 +++++--
 tests/kms_3d.c                    |  3 +-
 tests/kms_addfb_basic.c           |  4 +-
 tests/kms_draw_crc.c              |  1 +
 tests/kms_fbcon_fbt.c             |  1 +
 tests/kms_force_connector_basic.c |  2 +-
 tests/kms_getfb.c                 |  4 +-
 tests/kms_hdmi_inject.c           |  1 +
 tests/kms_setmode.c               |  2 +-
 tests/kms_sysfs_edid_timing.c     |  4 ++
 tests/kms_tv_load_detect.c        |  2 +-
 tests/perf_pmu.c                  | 12 +++---
 tests/pm_lpsp.c                   |  1 +
 tests/pm_rpm.c                    | 69 ++++++++++++++++++++++++-------
 tests/prime_vgem.c                |  2 +
 tests/testdisplay.c               | 23 ++++-------
 18 files changed, 128 insertions(+), 49 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index c20cf1eb..2bc92c81 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2018,6 +2018,34 @@ int igt_display_get_n_pipes(igt_display_t *display)
 	return display->n_pipes;
 }
 
+/**
+ * igt_display_require:
+ * @drm_fd: a drm file descriptor
+ *
+ * Checks if driver supports modeset and have display enabled.
+ */
+void igt_display_require(int fd)
+{
+	bool available = igt_display_available(fd);
+	igt_require_f(available, "drm driver do not support modeset\n");
+}
+
+/**
+ * igt_display_available:
+ * @drm_fd: a drm file descriptor
+ *
+ * Return true if driver supports modeset and have display enabled.
+ */
+bool igt_display_available(int fd)
+{
+	uint64_t cap;
+
+	/* Check if driver support modeset by checking one of the modeset
+	 * specific capabilities, in case of error it is not supported.
+	 */
+	return !drmGetCap(fd, DRM_CAP_DUMB_BUFFER, &cap);
+}
+
 /**
  * igt_display_require_output:
  * @display: A pointer to an #igt_display_t structure
@@ -3895,7 +3923,7 @@ void igt_enable_connectors(void)
 	drm_fd = drm_open_driver(DRIVER_ANY);
 
 	res = drmModeGetResources(drm_fd);
-	igt_assert(res != NULL);
+	igt_require(res != NULL);
 
 	for (int i = 0; i < res->count_connectors; i++) {
 		drmModeConnector *c;
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 3862efa2..feafeda9 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -388,6 +388,8 @@ void igt_display_commit_atomic(igt_display_t *display, uint32_t flags, void *use
 int  igt_display_try_commit2(igt_display_t *display, enum igt_commit_style s);
 int  igt_display_drop_events(igt_display_t *display);
 int  igt_display_get_n_pipes(igt_display_t *display);
+void igt_display_require(int fd);
+bool igt_display_available(int fd);
 void igt_display_require_output(igt_display_t *display);
 void igt_display_require_output_on_pipe(igt_display_t *display, enum pipe pipe);
 
diff --git a/tests/debugfs_test.c b/tests/debugfs_test.c
index 2e87e442..e443699e 100644
--- a/tests/debugfs_test.c
+++ b/tests/debugfs_test.c
@@ -102,7 +102,10 @@ igt_main
 		debugfs = igt_debugfs_dir(fd);
 
 		kmstest_set_vt_graphics_mode();
-		igt_display_init(&display, fd);
+		if (igt_display_available(fd))
+			igt_display_init(&display, fd);
+		else
+			display.n_pipes = display.n_outputs = 0;
 	}
 
 	igt_subtest("read_all_entries") {
@@ -131,8 +134,9 @@ igt_main
 			}
 		}
 
-		igt_display_commit2(&display, display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
-
+		if (display.n_pipes)
+			igt_display_commit2(&display, display.is_atomic ?
+					    COMMIT_ATOMIC : COMMIT_LEGACY);
 		read_and_discard_sysfs_entries(debugfs, 0);
 	}
 
@@ -147,7 +151,9 @@ igt_main
 			for_each_plane_on_pipe(&display, pipe, plane)
 				igt_plane_set_fb(plane, NULL);
 
-		igt_display_commit2(&display, display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
+		if (display.n_pipes)
+			igt_display_commit2(&display, display.is_atomic ?
+					    COMMIT_ATOMIC : COMMIT_LEGACY);
 
 		read_and_discard_sysfs_entries(debugfs, 0);
 	}
diff --git a/tests/kms_3d.c b/tests/kms_3d.c
index bfc981ee..ef21a745 100644
--- a/tests/kms_3d.c
+++ b/tests/kms_3d.c
@@ -36,10 +36,9 @@ igt_simple_main
 	int mode_count, connector_id;
 
 	drm_fd = drm_open_driver_master(DRIVER_INTEL);
+	igt_require(drmSetClientCap(drm_fd, DRM_CLIENT_CAP_STEREO_3D, 1) >= 0);
 	res = drmModeGetResources(drm_fd);
 
-	igt_assert(drmSetClientCap(drm_fd, DRM_CLIENT_CAP_STEREO_3D, 1) >= 0);
-
 	/* find an hdmi connector */
 	for (int i = 0; i < res->count_connectors; i++) {
 
diff --git a/tests/kms_addfb_basic.c b/tests/kms_addfb_basic.c
index ce48d24f..5d3f9b85 100644
--- a/tests/kms_addfb_basic.c
+++ b/tests/kms_addfb_basic.c
@@ -671,8 +671,10 @@ int fd;
 
 igt_main
 {
-	igt_fixture
+	igt_fixture {
 		fd = drm_open_driver_master(DRIVER_ANY);
+		igt_display_require(fd);
+	}
 
 	invalid_tests(fd);
 
diff --git a/tests/kms_draw_crc.c b/tests/kms_draw_crc.c
index 86dcf392..ea131705 100644
--- a/tests/kms_draw_crc.c
+++ b/tests/kms_draw_crc.c
@@ -253,6 +253,7 @@ static void setup_environment(void)
 	igt_require(drm_fd >= 0);
 
 	drm_res = drmModeGetResources(drm_fd);
+	igt_require(drm_res);
 	igt_assert(drm_res->count_connectors <= MAX_CONNECTORS);
 
 	for (i = 0; i < drm_res->count_connectors; i++)
diff --git a/tests/kms_fbcon_fbt.c b/tests/kms_fbcon_fbt.c
index 138eda9b..9f9c30d2 100644
--- a/tests/kms_fbcon_fbt.c
+++ b/tests/kms_fbcon_fbt.c
@@ -63,6 +63,7 @@ static void setup_drm(struct drm_info *drm)
 	drm->debugfs_fd = igt_debugfs_dir(drm->fd);
 
 	drm->res = drmModeGetResources(drm->fd);
+	igt_require(drm->res);
 	igt_assert(drm->res->count_connectors <= MAX_CONNECTORS);
 
 	for (i = 0; i < drm->res->count_connectors; i++)
diff --git a/tests/kms_force_connector_basic.c b/tests/kms_force_connector_basic.c
index 89431232..5b6f707f 100644
--- a/tests/kms_force_connector_basic.c
+++ b/tests/kms_force_connector_basic.c
@@ -90,7 +90,7 @@ int main(int argc, char **argv)
 
 		drm_fd = drm_open_driver_master(DRIVER_INTEL);
 		res = drmModeGetResources(drm_fd);
-		igt_assert(res);
+		igt_require(res);
 
 		/* find the vga connector */
 		for (int i = 0; i < res->count_connectors; i++) {
diff --git a/tests/kms_getfb.c b/tests/kms_getfb.c
index 81d796a4..67088883 100644
--- a/tests/kms_getfb.c
+++ b/tests/kms_getfb.c
@@ -198,8 +198,10 @@ igt_main
 {
 	int fd;
 
-	igt_fixture
+	igt_fixture {
 		fd = drm_open_driver_master(DRIVER_ANY);
+		igt_display_require(fd);
+	}
 
 	igt_subtest_group
 		test_handle_input(fd);
diff --git a/tests/kms_hdmi_inject.c b/tests/kms_hdmi_inject.c
index 22570a4b..c3e9746e 100644
--- a/tests/kms_hdmi_inject.c
+++ b/tests/kms_hdmi_inject.c
@@ -255,6 +255,7 @@ igt_main
 	igt_fixture {
 		drm_fd = drm_open_driver_master(DRIVER_INTEL);
 		res = drmModeGetResources(drm_fd);
+		igt_require(res);
 
 		connector = get_connector(drm_fd, res);
 		igt_require(connector);
diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
index 47d04fb5..68149604 100644
--- a/tests/kms_setmode.c
+++ b/tests/kms_setmode.c
@@ -858,7 +858,7 @@ int main(int argc, char **argv)
 			kmstest_set_vt_graphics_mode();
 
 		drm_resources = drmModeGetResources(drm_fd);
-		igt_assert(drm_resources);
+		igt_require(drm_resources);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(tests); i++) {
diff --git a/tests/kms_sysfs_edid_timing.c b/tests/kms_sysfs_edid_timing.c
index 12013881..7ea458a7 100644
--- a/tests/kms_sysfs_edid_timing.c
+++ b/tests/kms_sysfs_edid_timing.c
@@ -41,6 +41,10 @@ igt_simple_main
 {
 	DIR *dirp;
 	struct dirent *de;
+	int drm_fd;
+
+	drm_fd = drm_open_driver_master(DRIVER_ANY);
+	close(drm_fd);
 
 	dirp = opendir("/sys/class/drm");
 	igt_assert(dirp != NULL);
diff --git a/tests/kms_tv_load_detect.c b/tests/kms_tv_load_detect.c
index 5684b267..56fdcb5f 100644
--- a/tests/kms_tv_load_detect.c
+++ b/tests/kms_tv_load_detect.c
@@ -38,7 +38,7 @@ int main(int argc, char **argv)
 	igt_fixture {
 		drm_fd = drm_open_driver_master(DRIVER_INTEL);
 		res = drmModeGetResources(drm_fd);
-		igt_assert(res);
+		igt_require(res);
 
 		/* find the TV connector */
 		for (int i = 0; i < res->count_connectors; i++) {
diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index 6ab2595b..f53b06ac 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -1398,12 +1398,12 @@ test_rc6(int gem_fd, unsigned int flags)
 		drmModeRes *res;
 
 		res = drmModeGetResources(gem_fd);
-		igt_assert(res);
-
-		/* force all connectors off */
-		kmstest_set_vt_graphics_mode();
-		kmstest_unset_all_crtcs(gem_fd, res);
-		drmModeFreeResources(res);
+		if (res) {
+			/* force all connectors off */
+			kmstest_set_vt_graphics_mode();
+			kmstest_unset_all_crtcs(gem_fd, res);
+			drmModeFreeResources(res);
+		}
 
 		igt_require(igt_setup_runtime_pm());
 		igt_require(igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_SUSPENDED));
diff --git a/tests/pm_lpsp.c b/tests/pm_lpsp.c
index a741cb78..b319dbe9 100644
--- a/tests/pm_lpsp.c
+++ b/tests/pm_lpsp.c
@@ -199,6 +199,7 @@ igt_main
 		devid = intel_get_drm_devid(drm_fd);
 
 		drm_res = drmModeGetResources(drm_fd);
+		igt_require(drm_res);
 		igt_assert(drm_res->count_connectors <= MAX_CONNECTORS);
 
 		for (i = 0; i < drm_res->count_connectors; i++)
diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c
index c24fd95b..ef7f3128 100644
--- a/tests/pm_rpm.c
+++ b/tests/pm_rpm.c
@@ -222,6 +222,9 @@ static void disable_all_screens_dpms(struct mode_set_data *data)
 {
 	int i;
 
+	if (!data->res)
+		return;
+
 	for (i = 0; i < data->res->count_connectors; i++) {
 		drmModeConnectorPtr c = data->connectors[i];
 
@@ -231,6 +234,9 @@ static void disable_all_screens_dpms(struct mode_set_data *data)
 
 static void disable_all_screens(struct mode_set_data *data)
 {
+	if (!data->res)
+		return;
+
 	kmstest_unset_all_crtcs(drm_fd, data->res);
 }
 
@@ -329,6 +335,8 @@ static bool enable_one_screen_with_type(struct mode_set_data *data,
 {
 	struct modeset_params *params = NULL;
 
+	igt_display_require(drm_fd);
+
 	switch (type) {
 	case SCREEN_TYPE_ANY:
 		params = default_mode_params;
@@ -388,8 +396,11 @@ static void init_mode_set_data(struct mode_set_data *data)
 {
 	int i;
 
+	data->devid = intel_get_drm_devid(drm_fd);
+
 	data->res = drmModeGetResources(drm_fd);
-	igt_assert(data->res);
+	if (!data->res)
+		return;
 	igt_assert(data->res->count_connectors <= MAX_CONNECTORS);
 
 	for (i = 0; i < data->res->count_connectors; i++) {
@@ -398,8 +409,6 @@ static void init_mode_set_data(struct mode_set_data *data)
 		data->edids[i] = get_connector_edid(data->connectors[i], i);
 	}
 
-	data->devid = intel_get_drm_devid(drm_fd);
-
 	kmstest_set_vt_graphics_mode();
 
 	init_modeset_cached_params(&ms_data);
@@ -409,11 +418,15 @@ static void fini_mode_set_data(struct mode_set_data *data)
 {
 	int i;
 
+	if (!data->res)
+		return;
+
 	for (i = 0; i < data->res->count_connectors; i++) {
 		drmModeFreeConnector(data->connectors[i]);
 		drmModeFreePropertyBlob(data->edids[i]);
 	}
 	drmModeFreeResources(data->res);
+	data->res = NULL;
 }
 
 static void get_drm_info(struct compare_data *data)
@@ -574,6 +587,9 @@ static int count_drm_valid_edids(struct mode_set_data *data)
 {
 	int i, ret = 0;
 
+	if (!data->res)
+		return ret;
+
 	for (i = 0; i < data->res->count_connectors; i++)
 		if (data->edids[i] && edid_is_valid(data->edids[i]->data))
 			ret++;
@@ -637,6 +653,9 @@ static int count_vga_outputs(struct mode_set_data *data)
 {
 	int i, count = 0;
 
+	if (!data->res)
+		return count;
+
 	for (i = 0; i < data->res->count_connectors; i++)
 		if (data->connectors[i]->connector_type ==
 		    DRM_MODE_CONNECTOR_VGA)
@@ -730,7 +749,8 @@ static bool setup_environment(void)
 	igt_info("Runtime PM support: %d\n", has_runtime_pm);
 	igt_info("PC8 residency support: %d\n", has_pc8);
 	igt_require(has_runtime_pm);
-	igt_require(dmc_loaded());
+	if (ms_data.res)
+		igt_require(dmc_loaded());
 
 out:
 	disable_all_screens(&ms_data);
@@ -773,6 +793,9 @@ static void pc8_residency_subtest(void)
 		     "Machine is not reaching PC8+ states, please check its "
 		     "configuration.\n");
 
+	if (!ms_data.res)
+		return;
+
 	/* Make sure PC8+ residencies stop! */
 	enable_one_screen(&ms_data);
 	igt_assert_f(!pc8_plus_residency_changed(10),
@@ -783,6 +806,8 @@ static void modeset_subtest(enum screen_type type, int rounds, int wait_flags)
 {
 	int i;
 
+	igt_display_require(drm_fd);
+
 	if (wait_flags & WAIT_PC8_RES)
 		igt_require(has_pc8);
 
@@ -864,6 +889,7 @@ static void i2c_subtest_check_environment(void)
 /* Try to use raw I2C, which also needs interrupts. */
 static void i2c_subtest(void)
 {
+	igt_display_require(drm_fd);
 	i2c_subtest_check_environment();
 
 	enable_one_screen_and_wait(&ms_data);
@@ -967,7 +993,8 @@ static void gem_mmap_subtest(bool gtt_mmap)
 	uint8_t *gem_buf;
 
 	/* Create, map and set data while the device is active. */
-	enable_one_screen_and_wait(&ms_data);
+	if (ms_data.res)
+		enable_one_screen_and_wait(&ms_data);
 
 	handle = gem_create(drm_fd, buf_size);
 
@@ -998,7 +1025,8 @@ static void gem_mmap_subtest(bool gtt_mmap)
 	igt_assert(wait_for_suspended());
 
 	/* Now resume and see if it's still there. */
-	enable_one_screen_and_wait(&ms_data);
+	if (ms_data.res)
+		enable_one_screen_and_wait(&ms_data);
 	for (i = 0; i < buf_size; i++)
 		igt_assert(gem_buf[i] == (~i & 0xFF));
 
@@ -1027,7 +1055,8 @@ static void gem_mmap_subtest(bool gtt_mmap)
 	igt_assert(wait_for_suspended());
 
 	/* Resume and check if it's still there. */
-	enable_one_screen_and_wait(&ms_data);
+	if (ms_data.res)
+		enable_one_screen_and_wait(&ms_data);
 	for (i = 0; i < buf_size; i++)
 		igt_assert(gem_buf[i] == (i & 0xFF));
 
@@ -1050,7 +1079,8 @@ static void gem_pread_subtest(void)
 	memset(read_buf, 0, buf_size);
 
 	/* Create and set data while the device is active. */
-	enable_one_screen_and_wait(&ms_data);
+	if (ms_data.res)
+		enable_one_screen_and_wait(&ms_data);
 
 	handle = gem_create(drm_fd, buf_size);
 
@@ -1080,7 +1110,8 @@ static void gem_pread_subtest(void)
 	igt_assert(wait_for_suspended());
 
 	/* Now resume and see if it's still there. */
-	enable_one_screen_and_wait(&ms_data);
+	if (ms_data.res)
+		enable_one_screen_and_wait(&ms_data);
 
 	memset(read_buf, 0, buf_size);
 	gem_read(drm_fd, handle, 0, read_buf, buf_size);
@@ -1187,7 +1218,8 @@ static void gem_execbuf_subtest(void)
 	uint32_t color;
 
 	/* Create and set data while the device is active. */
-	enable_one_screen_and_wait(&ms_data);
+	if (ms_data.res)
+		enable_one_screen_and_wait(&ms_data);
 
 	handle = gem_create(drm_fd, dst_size);
 
@@ -1219,7 +1251,8 @@ static void gem_execbuf_subtest(void)
 	}
 
 	/* Now resume and check for it again. */
-	enable_one_screen_and_wait(&ms_data);
+	if (ms_data.res)
+		enable_one_screen_and_wait(&ms_data);
 
 	memset(cpu_buf, 0, dst_size);
 	gem_read(drm_fd, handle, 0, cpu_buf, dst_size);
@@ -1388,8 +1421,10 @@ static void pci_d3_state_subtest(void)
 	disable_all_screens_and_wait(&ms_data);
 	igt_assert(igt_wait(device_in_pci_d3(), 2000, 100));
 
-	enable_one_screen_and_wait(&ms_data);
-	igt_assert(!device_in_pci_d3());
+	if (ms_data.res) {
+		enable_one_screen_and_wait(&ms_data);
+		igt_assert(!device_in_pci_d3());
+	}
 }
 
 static void __attribute__((noreturn)) stay_subtest(void)
@@ -1453,7 +1488,8 @@ static void system_suspend_modeset_subtest(void)
 	igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE);
 	igt_assert(wait_for_suspended());
 
-	enable_one_screen_and_wait(&ms_data);
+	if (ms_data.res)
+		enable_one_screen_and_wait(&ms_data);
 	disable_all_screens_and_wait(&ms_data);
 }
 
@@ -1461,6 +1497,8 @@ static void system_suspend_modeset_subtest(void)
  * produced WARNs on this case. */
 static void dpms_mode_unset_subtest(enum screen_type type)
 {
+	igt_display_require(drm_fd);
+
 	disable_all_screens_and_wait(&ms_data);
 
 	igt_require(enable_one_screen_with_type(&ms_data, type));
@@ -1783,7 +1821,8 @@ static void pm_test_tiling(void)
 			igt_assert(tiling_modes[i] == ti);
 		}
 
-		enable_one_screen_and_wait(&ms_data);
+		if (ms_data.res)
+			enable_one_screen_and_wait(&ms_data);
 
 		for (j = 0, k = 1 << off_bit;
 		     k <= gtt_obj_max_size; k <<= 1, j++) {
diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c
index b821fbb8..399e4ebe 100644
--- a/tests/prime_vgem.c
+++ b/tests/prime_vgem.c
@@ -747,6 +747,8 @@ static void test_flip(int i915, int vgem, unsigned hang)
 	struct vgem_bo bo[2];
 	uint32_t fb_id[2], handle[2], crtc_id;
 
+	igt_display_require(i915);
+
 	signal(SIGHUP, sighandler);
 
 	for (int i = 0; i < 2; i++) {
diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index 0ff98a2b..8702f356 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -112,17 +112,10 @@ struct connector {
 	int pipe;
 };
 
-static void dump_connectors_fd(int drmfd)
+static void dump_connectors_fd(int drmfd, drmModeRes *mode_resources)
 {
 	int i, j;
 
-	drmModeRes *mode_resources = drmModeGetResources(drmfd);
-
-	if (!mode_resources) {
-		igt_warn("drmModeGetResources failed: %s\n", strerror(errno));
-		return;
-	}
-
 	igt_info("Connectors:\n");
 	igt_info("id\tencoder\tstatus\t\ttype\tsize (mm)\tmodes\n");
 	for (i = 0; i < mode_resources->count_connectors; i++) {
@@ -154,10 +147,9 @@ static void dump_connectors_fd(int drmfd)
 	drmModeFreeResources(mode_resources);
 }
 
-static void dump_crtcs_fd(int drmfd)
+static void dump_crtcs_fd(int drmfd, drmModeRes *mode_resources)
 {
 	int i;
-	drmModeRes *mode_resources = drmModeGetResources(drmfd);
 
 	igt_info("CRTCs:\n");
 	igt_info("id\tfb\tpos\tsize\n");
@@ -181,8 +173,10 @@ static void dump_crtcs_fd(int drmfd)
 
 static void dump_info(void)
 {
-	dump_connectors_fd(drm_fd);
-	dump_crtcs_fd(drm_fd);
+	drmModeRes *resources = drmModeGetResources(drm_fd);
+	igt_require(resources);
+	dump_connectors_fd(drm_fd, resources);
+	dump_crtcs_fd(drm_fd, resources);
 }
 
 static void connector_find_preferred_mode(uint32_t connector_id,
@@ -454,10 +448,7 @@ int update_display(bool probe)
 	int c;
 
 	resources = drmModeGetResources(drm_fd);
-	if (!resources) {
-		igt_warn("drmModeGetResources failed: %s\n", strerror(errno));
-		return 0;
-	}
+	igt_require(resources);
 
 	connectors = calloc(resources->count_connectors,
 			    sizeof(struct connector));
-- 
2.19.0



More information about the igt-dev mailing list