[PATCH i-g-t v2 3/3] tests/core_getversion: test all drm devices

Kamil Konieczny kamil.konieczny at linux.intel.com
Thu Mar 14 16:45:42 UTC 2024


Hi Mauro,
On 2024-03-13 at 15:00:50 +0100, Mauro Carvalho Chehab wrote:
> On Wed, 21 Feb 2024 11:29:29 +0100
> Kamil Konieczny <kamil.konieczny at linux.intel.com> wrote:
> 
> > Create multigpu subtest and check all drm devices.
> > 
> > v2: add define for number of max tested cards (Helen)
> > 
> > Cc: Helen Koike <helen.koike at collabora.com>
> > Signed-off-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
> > ---
> >  tests/core_getversion.c | 21 +++++++++++++++++++++
> >  1 file changed, 21 insertions(+)
> > 
> > diff --git a/tests/core_getversion.c b/tests/core_getversion.c
> > index 8b95e2ce4..1311e8dc5 100644
> > --- a/tests/core_getversion.c
> > +++ b/tests/core_getversion.c
> > @@ -40,11 +40,17 @@
> >   *
> >   * SUBTEST: basic
> >   * Description: Tests GET_VERSION ioctl of the first device.
> > + *
> > + * SUBTEST: multigpu
> > + * Description: Tests GET_VERSION ioctl for all drm devices.
> >   */
> >  
> >  IGT_TEST_DESCRIPTION("Tests the DRM_IOCTL_GET_VERSION ioctl and libdrm's "
> >  		     "drmGetVersion() interface to it.");
> >  
> > +/* constant same as in drmtest.c */
> > +#define MAX_DRM_CARDS 16
> > +
> 
> I would prefer to have MAX_DRM_CARDS defined into a header file
> probably at lib/drmtest.h, where __drm_open_driver_another() is
> declared.
> 
> Either way,
> 
> Reviewed-by: Mauro Carvalho Chehab <mchehab at kernel.org>
> 

Good point, I will merge first two patches and prepare
change for drmtest.h/c

Regards,
Kamil

> >  static void check(int fd, char *dst, int len)
> >  {
> >  	drmVersionPtr v;
> > @@ -78,6 +84,21 @@ igt_main
> >  		igt_info("0: %s\n", info);
> >  	}
> >  
> > +	igt_describe("Check GET_VERSION ioctl for all drm devices.");
> > +	igt_subtest("multigpu") {
> > +		int fd2;
> > +
> > +		for (int i = 0; i < MAX_DRM_CARDS; ++i) {
> > +			fd2 = __drm_open_driver_another(i, DRIVER_ANY);
> > +			if (fd2 == -1)
> > +				break;
> > +
> > +			check(fd2, info, sizeof(info));
> > +			igt_info("%d: %s\n", i, info);
> > +			drm_close_driver(fd2);
> > +		}
> > +	}
> > +
> >  	igt_fixture
> >  		drm_close_driver(fd);
> >  }


More information about the igt-dev mailing list