All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] lib: Handle chamelium failures gracefully
Date: Wed, 11 Nov 2020 09:52:10 +0200	[thread overview]
Message-ID: <20201111075210.GA7444@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20201109151658.387207-1-chris@chris-wilson.co.uk>

On Mon, Nov 09, 2020 at 03:16:58PM +0000, Chris Wilson wrote:
> Don't cause CI to abort a run if an _unrelated_ fixture checks for a
> display and chamelium is dead.

If there's a chamelium configured and it's dead, we do want to abort
though.

What's an unrelated fixture in this context?


-- 
Petri Latvala



> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  lib/igt_kms.c | 54 +++++++++++++++++++++++++++++++++++----------------
>  1 file changed, 37 insertions(+), 17 deletions(-)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index e5d8e82c9..65b36c338 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -1922,6 +1922,40 @@ __get_crtc_mask_for_pipe(drmModeRes *resources, igt_pipe_t *pipe)
>  	return (1 << offset);
>  }
>  
> +static bool chamelium_ok(int drm_fd)
> +{
> +	bool ok = true;
> +#ifdef HAVE_CHAMELIUM
> +	struct chamelium *chamelium;
> +
> +	chamelium = chamelium_init_rpc_only();
> +	if (chamelium) {
> +		ok = false;
> +
> +		if (!chamelium_wait_reachable(chamelium, 20)) {
> +			igt_debug("cannot reach the configured chamelium!\n");
> +			goto out;
> +		}
> +
> +		if (!chamelium_plug_all(chamelium)) {
> +			igt_debug("failed to plug all the chamelium ports!\n");
> +			goto out;
> +		}
> +
> +		if (!chamelium_wait_all_configured_ports_connected(chamelium, drm_fd)) {
> +			igt_debug("not all configured chamelium ports are connected!\n");
> +			goto out;
> +		}
> +
> +		ok = true;
> +out:
> +		chamelium_deinit_rpc_only(chamelium);
> +	}
> +#endif
> +
> +	return ok;
> +}
> +
>  /**
>   * igt_display_require:
>   * @display: a pointer to an #igt_display_t structure
> @@ -1944,6 +1978,9 @@ void igt_display_require(igt_display_t *display, int drm_fd)
>  
>  	LOG_INDENT(display, "init");
>  
> +	if (!chamelium_ok(drm_fd))
> +		goto out;
> +
>  	display->drm_fd = drm_fd;
>  	is_i915_dev = is_i915_device(drm_fd);
>  
> @@ -1953,23 +1990,6 @@ void igt_display_require(igt_display_t *display, int drm_fd)
>  	if (!resources)
>  		goto out;
>  
> -#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);
> -		}
> -	}
> -#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.
> -- 
> 2.29.2
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2020-11-11  7:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09 15:16 [igt-dev] [PATCH i-g-t] lib: Handle chamelium failures gracefully Chris Wilson
2020-11-10 11:26 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2020-11-11  7:52 ` Petri Latvala [this message]
2020-11-11  9:56   ` [igt-dev] [PATCH i-g-t] " Chris Wilson
2020-11-11 10:29     ` Petri Latvala
2020-11-11 10:38       ` Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201111075210.GA7444@platvala-desk.ger.corp.intel.com \
    --to=petri.latvala@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.