All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: IGT development <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t 2/4] tests: Use igt_display_require
Date: Fri, 5 Oct 2018 10:30:32 +0200	[thread overview]
Message-ID: <20181005083032.GD31561@phenom.ffwll.local> (raw)
In-Reply-To: <20181004190409.GN31561@phenom.ffwll.local>

On Thu, Oct 04, 2018 at 09:04:09PM +0200, Daniel Vetter wrote:
> On Thu, Oct 04, 2018 at 04:06:53PM +0100, Chris Wilson wrote:
> > Quoting Daniel Vetter (2018-10-04 14:21:26)
> > > diff --git a/tests/kms_force_connector_basic.c b/tests/kms_force_connector_basic.c
> > > index e9325dec9305..b8246e669939 100644
> > > --- a/tests/kms_force_connector_basic.c
> > > +++ b/tests/kms_force_connector_basic.c
> > > @@ -217,7 +217,7 @@ int main(int argc, char **argv)
> > >  
> > >                 /* attempt to use the display */
> > >                 kmstest_set_vt_graphics_mode();
> > > -               igt_display_init(&display, drm_fd);
> > > +               igt_display_require(&display, drm_fd);
> > >                 igt_display_commit(&display);
> > >                 igt_display_fini(&display);
> > 
> > Where is the requirement here? I'd buy that this should be an
> > igt_assert() since we did the forcing earlier.
> > 
> > > diff --git a/tests/kms_getfb.c b/tests/kms_getfb.c
> > > index 07ffd79c4613..ca0b01c05e5c 100644
> > > --- a/tests/kms_getfb.c
> > > +++ b/tests/kms_getfb.c
> > > @@ -116,7 +116,7 @@ static uint32_t get_any_prop_id(int fd)
> > >  {
> > >         igt_display_t display;
> > >  
> > > -       igt_display_init(&display, fd);
> > > +       igt_display_require(&display, fd);
> > 
> > Not required, as we describe the requirement of having the property
> > as an output of this function.
> > 
> > >         for (int i = 0; i < display.n_outputs; i++) {
> > >                 igt_output_t *output = &display.outputs[i];
> > >                 if (output->props[IGT_CONNECTOR_DPMS] != 0)
> > > diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
> > > index b34bc66ce2c4..21292bf3a2fe 100644
> > > --- a/tests/perf_pmu.c
> > > +++ b/tests/perf_pmu.c
> > > @@ -811,7 +811,7 @@ event_wait(int gem_fd, const struct intel_execution_engine2 *e)
> > >         igt_skip_on(IS_VALLEYVIEW(devid) || IS_CHERRYVIEW(devid));
> > >  
> > >         kmstest_set_vt_graphics_mode();
> > > -       igt_display_init(&data.display, gem_fd);
> > > +       igt_display_require(&data.display, gem_fd);
> > 
> > We do a search for our requirements in the loop below.
> > 
> > >         /**
> > >          * We will use the display to render event forwarind so need to
> > > diff --git a/tests/pm_backlight.c b/tests/pm_backlight.c
> > > index 32808cdf6ca4..054300f6e2e1 100644
> > > --- a/tests/pm_backlight.c
> > > +++ b/tests/pm_backlight.c
> > > @@ -214,7 +214,7 @@ igt_main
> > >                  * try to enable all.
> > >                  */
> > >                 kmstest_set_vt_graphics_mode();
> > > -               igt_display_init(&display, drm_open_driver(DRIVER_INTEL));
> > > +               igt_display_require(&display, drm_open_driver(DRIVER_INTEL));
> > 
> > The exact requirement of having a connected backlight is spelled out
> > below.
> 
> Answering to all 4, since they boil down to the same I think:
> 
> If I understand this correctly, you want to have only 1 igt_require, at
> the very end, and keeping initializing everything? Even if it's pointless
> to keep on going, because we know that if there's no output, you can't
> possibly have a backlight on an output (as an example)?
> 
> My preferred approach is to bail out as soon as we know we can't
> reasonably proceed. Since that tends to give us the option of more
> abuse-proof apis - if I can remove the igt_display_init, then I think
> that's a good goal.

Another upside of checking early (even if you might not catch the full
conditions all in one go): We waste less time on skipped tests with
pointless setup. E.g. on the gem side we also don't open the drm fd,
initialize the batch manager, set up the batch and everything only to then
realize that we're not running on top of i915.ko. I think this here is
similar.

If you want, I could move them a lot further up in the code so they catch
stuff earlier.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2018-10-05  8:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 13:21 [igt-dev] [PATCH i-g-t 1/4] tests/debugfs: use igt_display_require Daniel Vetter
2018-10-04 13:21 ` [igt-dev] [PATCH i-g-t 2/4] tests: Use igt_display_require Daniel Vetter
2018-10-04 15:06   ` Chris Wilson
2018-10-04 19:04     ` Daniel Vetter
2018-10-05  8:30       ` Daniel Vetter [this message]
2018-10-04 13:21 ` [igt-dev] [PATCH i-g-t 3/4] lib/kms: Drop igt_display_init Daniel Vetter
2018-10-04 13:21 ` [igt-dev] [PATCH i-g-t 4/4] lib/kms: warn if we commit without outputs Daniel Vetter
2018-10-05 15:07   ` Daniel Vetter
2018-10-05 15:40     ` Chris Wilson
2018-10-05 18:48       ` Daniel Vetter
2018-10-12 12:02         ` Arkadiusz Hiler
2018-10-12 12:32           ` Daniel Vetter
2018-10-12 12:57             ` Arkadiusz Hiler
2018-10-17  9:57               ` Arkadiusz Hiler
2018-10-04 14:47 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] tests/debugfs: use igt_display_require Patchwork
2018-10-04 15:03 ` [igt-dev] [PATCH i-g-t 1/4] " Chris Wilson
2018-10-04 19:07 ` [igt-dev] [PATCH i-g-t] " Daniel Vetter
2018-10-04 19:55 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t] tests/debugfs: use igt_display_require (rev2) Patchwork
2018-10-04 23:43 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/4] tests/debugfs: use igt_display_require Patchwork
2018-10-05  3:09 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t] tests/debugfs: use igt_display_require (rev2) Patchwork

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=20181005083032.GD31561@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --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.