[igt-dev] [i-g-t V2 4/5] tests/kms_force_connector_basic: Set the param only if driver supports

Bhanuprakash Modem bhanuprakash.modem at intel.com
Fri Mar 31 13:45:55 UTC 2023


Set/Clear the param "load_detect_test" only if driver supports.

V2: - Set the param if driver supports
    - Fix the commit message

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 tests/kms_force_connector_basic.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/kms_force_connector_basic.c b/tests/kms_force_connector_basic.c
index 4ff1efe3b..35e8153c8 100644
--- a/tests/kms_force_connector_basic.c
+++ b/tests/kms_force_connector_basic.c
@@ -36,6 +36,7 @@ static void reset_connectors(void)
 	drmModeRes *res;
 	drmModeConnector *connector = NULL;
 	int drm_fd;
+	char *param;
 
 	drm_fd = drm_open_driver_master(DRIVER_ANY);
 	res = drmModeGetResources(drm_fd);
@@ -53,7 +54,11 @@ static void reset_connectors(void)
 		drmModeFreeConnector(connector);
 	}
 
-	igt_set_module_param_int(drm_fd, "load_detect_test", 0);
+	param = __igt_params_get(drm_fd, "load_detect_test");
+	if (param) {
+		igt_set_module_param_int(drm_fd, "load_detect_test", 0);
+		free(param);
+	}
 
 	close(drm_fd);
 }
-- 
2.40.0



More information about the igt-dev mailing list