From: Daniel Vetter <daniel@ffwll.ch>
To: Ander Conselvan De Oliveira <conselvan2@gmail.com>
Cc: intel-gfx@lists.freedesktop.org,
Vivek Kasireddy <vivek.kasireddy@intel.com>,
Thomas Wood <thomas.wood@intel.com>
Subject: Re: [PATCH i-g-t v2] lib/igt_kms: Introduce get_first_connected_output macro
Date: Tue, 24 Nov 2015 13:20:26 +0100 [thread overview]
Message-ID: <20151124122026.GP17050@phenom.ffwll.local> (raw)
In-Reply-To: <1448286560.2849.19.camel@gmail.com>
On Mon, Nov 23, 2015 at 03:49:20PM +0200, Ander Conselvan De Oliveira wrote:
> 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?
>
We also need to check at least crtc restrictions, otherwise bsw will fall
over mightly. Or well anything with MIPI DSI encoders.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-11-24 12:20 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
2015-11-24 12:20 ` Daniel Vetter [this message]
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=20151124122026.GP17050@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=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