[igt-dev] [PATCH i-g-t] lib/igt_kms: only check chamelium's presence in chamelium tests

Martin Peres martin.peres at mupuf.org
Mon Mar 22 06:29:02 UTC 2021


On 22/03/2021 07:26, Kunal Joshi wrote:
> Avoid checking if chamelium is present or not in non chamelium
> tests as its just an overhead.

The point of doing this was to stop having screens in CI and instead 
mostly have chameliums. This means that we need to make sure the 
chamelium exposes all the ports before starting a KMS test, since some 
tests may have left the screens disconnected.

Is that making sense?

> 
> Cc: Petri Latvala <petri.latvala at intel.com>
> Signed-off-by: Kunal Joshi <kunal1.joshi at intel.com>
> ---
>   lib/igt_kms.c | 31 ++++++++++++++++++-------------
>   1 file changed, 18 insertions(+), 13 deletions(-)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 08d429a8..397635d8 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -1958,21 +1958,26 @@ void igt_display_require(igt_display_t *display, int drm_fd)
>   
>   #ifdef HAVE_CHAMELIUM
>   	{
> -		struct chamelium *chamelium;
> -
> -		chamelium = chamelium_init_rpc_only();
> -		if (chamelium) {
> -			igt_abort_on_f(!chamelium_wait_reachable(chamelium, 20),
> -				       "cannot reach the configured chamelium!\n");
> -			igt_abort_on_f(!chamelium_plug_all(chamelium),
> -				       "failed to plug all the chamelium ports!\n");
> -			igt_abort_on_f(!chamelium_wait_all_configured_ports_connected(chamelium, drm_fd),
> -				       "not all configured chamelium ports are connected!\n");
> -			chamelium_deinit_rpc_only(chamelium);
> -		}
> -	}
> +		if (strstr(igt_test_name(), "feature_discovery") != NULL ||
> +		    strstr(igt_test_name(), "cham") != NULL) {
> +
> +			struct chamelium *chamelium;
> +
> +			chamelium = chamelium_init_rpc_only();
> +			if (chamelium) {
> +				igt_abort_on_f(!chamelium_wait_reachable(chamelium, 20),
> +					       "cannot reach the configured chamelium!\n");
> +				igt_abort_on_f(!chamelium_plug_all(chamelium),
> +					       "failed to plug all the chamelium ports!\n");
> +				igt_abort_on_f(!chamelium_wait_all_configured_ports_connected(chamelium, drm_fd),
> +					       "not all configured chamelium ports are connected!\n");
> +				chamelium_deinit_rpc_only(chamelium);
> +			}
> +		}
> +	}
>   #endif
>   
> +
>   	/*
>   	 * With non-contiguous pipes display, crtc mapping is not always same
>   	 * as pipe mapping, In i915 pipe is enum id of i915's crtc object.
> 


More information about the igt-dev mailing list