[igt-dev] [PATCH i-g-t v3 4/4] tests/kms_frontbuffer_tracking: Remove redundant modesets during subtest start.

Paulo Zanoni paulo.r.zanoni at intel.com
Thu Apr 5 16:31:02 UTC 2018


Em Qua, 2018-03-21 às 12:47 -0700, Paulo Zanoni escreveu:
> Em Qui, 2018-03-01 às 16:33 +0100, Maarten Lankhorst escreveu:
> > Hey,
> > 
> > Op 27-02-18 om 09:52 schreef Maarten Lankhorst:
> > > CRC capturing enables the display, then disables it again. With
> > > igt_display we can use igt_display_reset to restore the original
> > > state,
> > > without committing it to the hw.
> > > 
> > > All subtests first set their own state anyway, so we can save up
> > > on
> > > the number of commits.
> > 
> > I patched igt_kms to report the number of modesets..
> > 
> > Without this patch running ./kms_frontbuffer_tracking on a 2 output
> > system (f2-snb-2600, forced VGA-1 enabled):
> > Performed 382 modesets
> > 
> > With this patch on a 2 output system:
> > Performed 23 modesets
> > 
> > On geminilake this means we save a lot of time, so could someone
> > review this series?
> 
> Is there an analysis on how reducing the amount of modesets will
> *not*
> invalidade the purpose of the tests? The modesets are there for a
> reason.

Ping?

> 
> > 
> > Also for comparison, single output enabled, fbc-1p-rte:
> > Unpatched:
> > Performed 4 modesets
> > 
> > Patched:
> > Performed 2 modesets
> > 
> > Hack below:
> > 
> > ---8<---
> > diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> > index 2d57369fe558..dfefe1f887ec 100644
> > --- a/lib/igt_kms.c
> > +++ b/lib/igt_kms.c
> > @@ -2154,6 +2154,8 @@ void igt_display_fini(igt_display_t *display)
> >  {
> >  	int i;
> >  
> > +	igt_info("Performed %u modesets\n", display->modesets);
> > +
> >  	for (i = 0; i < display->n_pipes; i++)
> >  		igt_pipe_fini(&display->pipes[i]);
> >  
> > @@ -3196,8 +3198,23 @@ static int do_display_commit(igt_display_t
> > *display,
> >  	igt_display_refresh(display);
> >  
> >  	if (s == COMMIT_ATOMIC) {
> > -		ret = igt_atomic_commit(display,
> > DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> > +		ret = igt_atomic_commit(display, 0, NULL);
> > +
> > +		if (ret == -EINVAL) {
> > +			ret = igt_atomic_commit(display,
> > DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> > +			if (!ret)
> > +				display->modesets++;
> > +		}
> > +
> >  	} else {
> > +		ret = igt_atomic_commit(display,
> > DRM_MODE_ATOMIC_TEST_ONLY, NULL);
> > +		if (ret == -EINVAL) {
> > +			ret = igt_atomic_commit(display,
> > DRM_MODE_ATOMIC_TEST_ONLY | DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> > +			if (!ret)
> > +				display->modesets++;
> > +			ret = 0;
> > +		}
> > +
> >  		for_each_pipe(display, pipe) {
> >  			igt_pipe_t *pipe_obj = &display-
> > > pipes[pipe];
> > 
> >  
> > diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> > index f27e22088ce2..718ea8ce0497 100644
> > --- a/lib/igt_kms.h
> > +++ b/lib/igt_kms.h
> > @@ -357,6 +357,7 @@ struct igt_display {
> >  	bool has_cursor_plane;
> >  	bool is_atomic;
> >  	bool first_commit;
> > +	int modesets;
> >  };
> >  
> >  void igt_display_init(igt_display_t *display, int drm_fd);
> > 
> > _______________________________________________
> > igt-dev mailing list
> > igt-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/igt-dev
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev


More information about the igt-dev mailing list