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

Kamil Konieczny kamil.konieczny at linux.intel.com
Tue Apr 4 14:51:24 UTC 2023


On 2023-03-31 at 19:15:55 +0530, Bhanuprakash Modem wrote:
> 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>

Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.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