[igt-dev] [PATCH i-g-t v3 1/4] test: i915_pm_rpm: init devid in setup_envirnoment

Anshuman Gupta anshuman.gupta at intel.com
Wed May 18 16:54:51 UTC 2022


Refactor out devid initialization out of init_mode_set_data().
Initialize it in setup_environment().

Reviewed-by: Ashutosh Dixit <ashutosh.dixit at intel.com>
Signed-off-by: Anshuman Gupta <anshuman.gupta at intel.com>
---
 tests/i915/i915_pm_rpm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c
index 461730e8a5..2cc89eef2a 100644
--- a/tests/i915/i915_pm_rpm.c
+++ b/tests/i915/i915_pm_rpm.c
@@ -409,7 +409,6 @@ static void init_mode_set_data(struct mode_set_data *data)
 	}
 
 	igt_display_require(&data->display, drm_fd);
-	data->devid = intel_get_drm_devid(drm_fd);
 	init_modeset_cached_params(&ms_data);
 }
 
@@ -797,6 +796,8 @@ static bool setup_environment(bool display_disabled)
 	debugfs = igt_debugfs_dir(drm_fd);
 	igt_require(debugfs != -1);
 
+	ms_data.devid = intel_get_drm_devid(drm_fd);
+
 	if (!display_disabled)
 		init_mode_set_data(&ms_data);
 
-- 
2.26.2



More information about the igt-dev mailing list