[igt-dev] [PATCH i-g-t] igt/kms_addfb_basic: require display

Daniel Vetter daniel at ffwll.ch
Thu Jun 28 11:54:52 UTC 2018


On Thu, Jun 28, 2018 at 12:19:57PM +0200, Maarten Lankhorst wrote:
> Op 28-06-18 om 11:56 schreef Jani Nikula:
> > Running the tests with i915.disable_display=1 leads to IGT errors. Skip
> > tests that need display.
> >
> > References: http://patchwork.freedesktop.org/patch/msgid/20180608124057.6889-1-jani.nikula@intel.com
> > Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> > Cc: Daniel Vetter <daniel at ffwll.ch>
> > Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > Signed-off-by: Jani Nikula <jani.nikula at intel.com>
> >
> > ---
> >
> > What's the best paradigm for this? There's loads of random and cargo
> > culted igt_requires for this stuff, with various checks on pipes > 0
> > etc.
> > ---
> igt_display_require_output() is the easiest check to find if an output
> is connected, should be approximately same as display enabled. :)

Unfortunately not quite. I think we do want to run these tests here on
headless systems which have a display block, but no outputs connected.
Just for better test coverage and all that.

I think what we want is a new

igt_require_display(int fd)
{
	igt_display_t display;
	igt_display_init(&display, fd);
	igt_require(display->n_pipes > 0, "drm driver without display
	hardware\n");
}

gtkdoc plus wiring it up needed too ofc.

We could also patch up igt_display_init() to check for this (and probably
should, not sure about that), but a very simply igt_require helper that
only takes the fd seems useful to me for all the low-level tests like
kms_addfb_basic here which don't want/need a full igt_display_t
initialized.
-Daniel

> 
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> 
> >  tests/kms_addfb_basic.c | 12 ++++++++++--
> >  1 file changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/kms_addfb_basic.c b/tests/kms_addfb_basic.c
> > index 7d8852f02003..e7d3c0e298a3 100644
> > --- a/tests/kms_addfb_basic.c
> > +++ b/tests/kms_addfb_basic.c
> > @@ -543,9 +543,15 @@ int fd;
> >  
> >  igt_main
> >  {
> > -	igt_fixture
> > +	igt_display_t display;
> > +
> > +	igt_fixture {
> >  		fd = drm_open_driver_master(DRIVER_ANY);
> >  
> > +		igt_display_init(&display, fd);
> > +		igt_display_require_output(&display);
> > +	}
> > +
> >  	invalid_tests(fd);
> >  
> >  	pitch_tests(fd);
> > @@ -560,6 +566,8 @@ igt_main
> >  
> >  	prop_tests(fd);
> >  
> > -	igt_fixture
> > +	igt_fixture {
> > +		igt_display_fini(&display);
> >  		close(fd);
> > +	}
> >  }
> 
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the igt-dev mailing list