public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Paulo Zanoni <przanoni@gmail.com>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t 2/4] tests/kms_flip: Disable all pipes before each test
Date: Wed, 11 Nov 2015 19:52:53 +0200	[thread overview]
Message-ID: <20151111175253.GN4437@intel.com> (raw)
In-Reply-To: <20151111174940.GM4437@intel.com>

On Wed, Nov 11, 2015 at 07:49:40PM +0200, Ville Syrjälä wrote:
> On Wed, Nov 11, 2015 at 03:41:16PM -0200, Paulo Zanoni wrote:
> > 2015-11-11 15:32 GMT-02:00  <ville.syrjala@linux.intel.com>:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > >
> > > Currently kms_flip leaks the state of the pipes from one subtest to the
> > > next. Meaning a single pipe test can actually have two or more pipes
> > > actually up and running, and similarly a two pipe test can have three
> > > pipes running.
> > >
> > > This is particularly nasty on IVB since one of the pipes still running
> > > but not actually part of the test maybe have reserved the shared FDI
> > > lanes, thus preventing one of the pipes taking part in the test from
> > > being enabled.
> > >
> > > To avoid such problems explicitly disable all pipes before each
> > > subtests.
> > >
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > ---
> > >  tests/kms_flip.c | 18 ++++++++++++++++++
> > >  1 file changed, 18 insertions(+)
> > >
> > > diff --git a/tests/kms_flip.c b/tests/kms_flip.c
> > > index 649678c..632f264 100644
> > > --- a/tests/kms_flip.c
> > > +++ b/tests/kms_flip.c
> > > @@ -849,6 +849,22 @@ static bool is_hung(int fd)
> > >         return errno == EIO;
> > >  }
> > >
> > > +static void disable_crtcs(void)
> > > +{
> > > +       int n;
> > > +
> > > +       for (n = 0; n < resources->count_crtcs; n++) {
> > > +               drmModeCrtc *crtc = drmModeGetCrtc(drm_fd, resources->crtcs[n]);
> > > +
> > > +               int ret = drmModeSetCrtc(drm_fd, crtc->crtc_id,
> > 
> > You could have used resources->crtcs[n] do avoid the GetCrtc() call.
> 
> I thought we freed those. Maybe not.

Ah misread the whole thing. Yes, there's no point in this id->struct->id
dance I'm doing.

> 
> > 
> > Anyway, you can avoid this new function and just call
> > kmstest_unset_all_crtcs(drm_fd, resources) from igt_kms.h.
> 
> OK. That's nice.
> 
> > 
> > > +                                        0, 0, 0,
> > > +                                        0, 0, 0);
> > > +               igt_assert(ret == 0);
> > > +
> > > +               drmModeFreeCrtc(crtc);
> > > +       }
> > > +}
> > > +
> > >  static int set_mode(struct test_output *o, uint32_t fb, int x, int y)
> > >  {
> > >         int n;
> > > @@ -1425,6 +1441,8 @@ static void run_test_on_crtc_set(struct test_output *o, int *crtc_idxs,
> > >         for (i = 0; i < o->count; i++)
> > >                 kmstest_dump_mode(&o->kmode[i]);
> > >
> > > +       disable_crtcs();
> > > +
> > >         if (set_mode(o, o->fb_ids[0], 0, 0)) {
> > >                 /* We may fail to apply the mode if there are hidden
> > >                  * constraints, such as bandwidth on the third pipe.
> > > --
> > > 2.4.10
> > >
> > > _______________________________________________
> > > Intel-gfx mailing list
> > > Intel-gfx@lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> > 
> > 
> > 
> > -- 
> > Paulo Zanoni
> 
> -- 
> Ville Syrjälä
> Intel OTC
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-11-11 17:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-11 17:32 [PATCH i-g-t 1/4] tests/kms_flip: Use human readable pipe and connector names ville.syrjala
2015-11-11 17:32 ` [PATCH i-g-t 2/4] tests/kms_flip: Disable all pipes before each test ville.syrjala
2015-11-11 17:41   ` Paulo Zanoni
2015-11-11 17:49     ` Ville Syrjälä
2015-11-11 17:52       ` Ville Syrjälä [this message]
2015-11-11 18:50   ` [PATCH i-g-t v2 " ville.syrjala
2015-11-11 17:32 ` [PATCH i-g-t 3/4] tests/kms_flip: Modeset pipes in reverse order ville.syrjala
2015-11-11 17:32 ` [PATCH i-g-t 4/4] tests/kms_flip: Add a note that the test was skipped when modeset fails ville.syrjala

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=20151111175253.GN4437@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=przanoni@gmail.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