From 519003cace0c32aa226005dc7409544e26c243c2 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 3 Oct 2018 20:43:49 +0100 Subject: igt: Check drmModeGetResources() If KMS is not supported on the device, drmModeGetResources() will return NULL, often this is an indication that we should not attempt to run the test. Although it would be preferred to use something like igt_require_display() as the canonical check and assert that drmModeGetResources() did not hit an error, it is not always practical as the tests do not utilize the common igt_display abstraction. Signed-off-by: Chris Wilson Reviewed-by: Arkadiusz Hiler --- tests/kms_invalid_dotclock.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/kms_invalid_dotclock.c') diff --git a/tests/kms_invalid_dotclock.c b/tests/kms_invalid_dotclock.c index 568889a9..8c4c3122 100644 --- a/tests/kms_invalid_dotclock.c +++ b/tests/kms_invalid_dotclock.c @@ -133,8 +133,11 @@ igt_simple_main igt_enable_connectors(data.drm_fd); kmstest_set_vt_graphics_mode(); + igt_display_require(&data.display, data.drm_fd); data.res = drmModeGetResources(data.drm_fd); + igt_assert(data.res); + kmstest_unset_all_crtcs(data.drm_fd, data.res); data.max_dotclock = i915_max_dotclock(&data); -- cgit v1.2.3