public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ander Conselvan De Oliveira <conselvan2@gmail.com>
To: Vivek Kasireddy <vivek.kasireddy@intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: Thomas Wood <thomas.wood@intel.com>
Subject: Re: [PATCH i-g-t v2] lib/igt_kms: Introduce get_first_connected_output macro
Date: Mon, 23 Nov 2015 15:49:20 +0200	[thread overview]
Message-ID: <1448286560.2849.19.camel@gmail.com> (raw)
In-Reply-To: <1448074610-8661-1-git-send-email-vivek.kasireddy@intel.com>

On Fri, 2015-11-20 at 18:56 -0800, Vivek Kasireddy wrote:
> In some cases, we just need one valid (connected) output to perform
> a test. This macro can help in these situations by not having to
> put the test code inside a for loop that iterates over all the outputs.
> 
> v2: Added a brief documentation for this macro.
> 
> Suggested-by: Matt Roper <matthew.d.roper at intel.com>
> Cc: Thomas Wood <thomas.wood@intel.com>
> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
> ---
>  lib/igt_kms.h | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 965c47c..a0bb066 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -279,6 +279,18 @@ void igt_wait_for_vblank(int drm_fd, enum pipe pipe);
>  	for (int i__ = 0; (plane) = &(display)->pipes[(pipe)].planes[i__], \
>  		     i__ < (display)->pipes[(pipe)].n_planes; i__++)
>  
> +/**
> + * get_first_connected_output:
> + * @display: Initialized igt_display_t type object
> + * @output: igt_output_t type object
> + *
> + * Returns: First valid (connected) output.
> + */
> +#define get_first_connected_output(display, output)		\
> +	for (int i__ = 0;  i__ < (display)->n_outputs; i__++)	\
> +		if ((output = &(display)->outputs[i__]), output->valid) \
> +			break
> +

Is it possible that there is no valid output?

Ander
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-11-23 13:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29  2:09 [PATCH] lib/igt_kms: Introduce get_first_connected_output to retrieve a valid output Vivek Kasireddy
2015-10-29 11:05 ` Thomas Wood
2015-11-05  1:34   ` [PATCH] igt/igt_kms: Introduce get_first_connected_output (v2) Vivek Kasireddy
2015-11-13 15:59     ` Thomas Wood
2015-11-14  3:08       ` Vivek Kasireddy
2015-11-16 13:30         ` Thomas Wood
2015-11-21  2:56           ` [PATCH i-g-t v2] lib/igt_kms: Introduce get_first_connected_output macro Vivek Kasireddy
2015-11-23 13:49             ` Ander Conselvan De Oliveira [this message]
2015-11-24 12:20               ` Daniel Vetter
2015-11-24 13:03             ` Ville Syrjälä
2015-11-21  2:58           ` [PATCH i-g-t] tests/kms_rotation_crc: Use " Vivek Kasireddy

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=1448286560.2849.19.camel@gmail.com \
    --to=conselvan2@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=thomas.wood@intel.com \
    --cc=vivek.kasireddy@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox