[igt-dev] [PATCH i-g-t 2/3] test: i915_pm_rpm: conditional initialization of igt_display_t

Anshuman Gupta anshuman.gupta at intel.com
Thu Apr 21 17:02:44 UTC 2022


Initialize igt_display_t display only in case of there are
valid drm kms resources.

Signed-off-by: Anshuman Gupta <anshuman.gupta at intel.com>
---
 tests/i915/i915_pm_rpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c
index 2cc89eef2..7a0176b2f 100644
--- a/tests/i915/i915_pm_rpm.c
+++ b/tests/i915/i915_pm_rpm.c
@@ -406,9 +406,9 @@ static void init_mode_set_data(struct mode_set_data *data)
 		}
 
 		kmstest_set_vt_graphics_mode();
+		igt_display_require(&data->display, drm_fd);
 	}
 
-	igt_display_require(&data->display, drm_fd);
 	init_modeset_cached_params(&ms_data);
 }
 
-- 
2.26.2



More information about the igt-dev mailing list