Re: [PATCH i-g-t 2/4] tests/kms_flip: Disable all pipes before each test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>:
> > > From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> > >
> > > 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@xxxxxxxxxxxxxxx>
> > > ---
> > >  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@xxxxxxxxxxxxxxxxxxxxx
> > > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> > 
> > 
> > 
> > -- 
> > Paulo Zanoni
> 
> -- 
> Ville Syrjälä
> Intel OTC
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux