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_flip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/kms_flip.c') diff --git a/tests/kms_flip.c b/tests/kms_flip.c index 44a82053..f28272dd 100644 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -1355,7 +1355,7 @@ static int run_test(int duration, int flags) igt_require(igt_setup_runtime_pm()); resources = drmModeGetResources(drm_fd); - igt_assert(resources); + igt_require(resources); /* Count output configurations to scale test runtime. */ for (i = 0; i < resources->count_connectors; i++) { @@ -1412,7 +1412,7 @@ static int run_pair(int duration, int flags) igt_require((flags & TEST_HANG) == 0 || !is_wedged(drm_fd)); resources = drmModeGetResources(drm_fd); - igt_assert(resources); + igt_require(resources); /* Find a pair of connected displays */ for (i = 0; i < resources->count_connectors; i++) { -- cgit v1.2.3