From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id CD2866E311 for ; Fri, 12 Jul 2019 08:36:16 +0000 (UTC) From: "Vasilev, Oleg" Date: Fri, 12 Jul 2019 08:36:12 +0000 Message-ID: <3304ffa3cc7ec535c09a69434aec743b909fddd6.camel@intel.com> References: <20190704095604.16589-1-oleg.vasilev@intel.com> <20190704095604.16589-2-oleg.vasilev@intel.com> <20190710163542.GX15868@phenom.ffwll.local> <20190711171903.GP15868@phenom.ffwll.local> In-Reply-To: <20190711171903.GP15868@phenom.ffwll.local> Content-Language: en-US MIME-Version: 1.0 Subject: Re: [igt-dev] [PATCH 2/2] tests/prime_generic: add vendor-agnostic prime tests List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0192980601==" Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: "daniel@ffwll.ch" , "Ser, Simon" Cc: "igt-dev@lists.freedesktop.org" List-ID: --===============0192980601== Content-Language: en-US Content-Type: multipart/signed; micalg=sha-1; protocol="application/x-pkcs7-signature"; boundary="=-JXX7dhyS+XBvcn3KSZfj" --=-JXX7dhyS+XBvcn3KSZfj Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2019-07-11 at 19:19 +0200, Daniel Vetter wrote: > On Thu, Jul 11, 2019 at 03:20:52PM +0000, Ser, Simon wrote: > > On Thu, 2019-07-11 at 14:36 +0200, Daniel Vetter wrote: > > > On Thu, Jul 11, 2019 at 11:09 AM Vasilev, Oleg < > > > oleg.vasilev@intel.com> wrote: > > > > On Wed, 2019-07-10 at 18:35 +0200, Daniel Vetter wrote: > > > > > On Thu, Jul 04, 2019 at 12:56:04PM +0300, Oleg Vasilev wrote: > > > > > > Currently, we have different sets of prime tests: > > > > > > - vgem+i915 > > > > > > - amdgpu+i915 > > > > > > - nv+i915 > > > > > >=20 > > > > > > Those tests use vendor-specific ioctls, therefore, not > > > > > > interchangeable. > > > > > > The idea is to create a set of tests which are expected to > > > > > > work on > > > > > > any > > > > > > prime-compatible driver. It can be run with any combination > > > > > > of > > > > > > exporter+importer, where > > > > > >=20 > > > > > > The first test is simple: > > > > > > 1. Exporter creates a framebuffer and fills it with a plain > > > > > > color > > > > > > 2. Fb is transferred to the importer > > > > > > 3. Importer modesets and computes pipe CRC > > > > > > 4. Importer draws the same color through cairo and compares > > > > > > CRC > > > > > >=20 > > > > > > The initial motivation comes from the need to test prime > > > > > > support in > > > > > > vkms. > > > > > >=20 > > > > > > Cc: Rodrigo Siqueira > > > > > > Cc: Daniel Vetter > > > > > > Signed-off-by: Oleg Vasilev > > > > > > --- > > > > > > tests/meson.build | 1 + > > > > > > tests/prime_generic.c | 238 > > > > > > ++++++++++++++++++++++++++++++++++++++++++ > > > > > > 2 files changed, 239 insertions(+) > > > > > > create mode 100644 tests/prime_generic.c > > > > > >=20 > > > > > > diff --git a/tests/meson.build b/tests/meson.build > > > > > > index 34a74025..1c938e95 100644 > > > > > > --- a/tests/meson.build > > > > > > +++ b/tests/meson.build > > > > > > @@ -76,6 +76,7 @@ test_progs =3D [ > > > > > > 'prime_self_import', > > > > > > 'prime_udl', > > > > > > 'prime_vgem', > > > > > > + 'prime_generic', > > > > > > 'syncobj_basic', > > > > > > 'syncobj_wait', > > > > > > 'template', > > > > > > + > > > > > > +igt_main > > > > > > +{ > > > > > > + igt_fixture { > > > > > > + kmstest_set_vt_graphics_mode(); > > > > > > + } > > > > > > + igt_subtest("crc-vgem-vkms") > > > > > > + run_test_crc(DRIVER_VGEM, DRIVER_VKMS); > > > > > > + igt_subtest("crc-i915-vkms") > > > > > > + run_test_crc(DRIVER_INTEL, DRIVER_VKMS); > > > > > > + igt_subtest("crc-vgem-i915") > > > > > > + run_test_crc(DRIVER_VGEM, DRIVER_INTEL); > > > > > > + igt_subtest("crc-amd-i915") > > > > > > + run_test_crc(DRIVER_AMDGPU, DRIVER_INTEL); > > > > > > + igt_subtest("crc-i915-amd") > > > > > > + run_test_crc(DRIVER_INTEL, DRIVER_AMDGPU); > > > > >=20 > > > > > This isn't any more generic than what we have e.g. in > > > > > prime_vgem > > > > > already. > > > >=20 > > > > Here non-generic part is only those 10 lines of subtests > > > > definitions. > > > > The rest is common code. > > > >=20 > > > > I guess, this separate subtest definitions can document the > > > > device > > > > pairs the test is expected to work + we can blacklist tests > > > > which we > > > > don't have the hardware for. > > >=20 > > > But we already have tests for specific pairs, which can also test > > > specific stuff. In general we don't do tests with -gen9, gen11, > > > -gen8 > > > prefixes either. This here would be a first I'd say. > > >=20 > > > > > The way to do a generic kms testcase is to use DRIVER_ANY > > > > > (yes some > > > > > of the > > > > > earlier conversion unfortunately used stuff like DRIVER_INTEL > > > > > | > > > > > DRIVER_AMDGPU). With that you also don't need your library > > > > > prep > > > > > patch, > > > > > because no need for a DRIVER_VKMS. > > > >=20 > > > > But how can we open two different devices with DRIVER_ANY? If I > > > > put > > > >=20 > > > > fd =3D drm_open_driver(DRIVER_ANY) > > > > fd2 =3D drm_open_driver(DRIVER_ANY) > > > >=20 > > > > I get the same device opened two times, do I? > > >=20 > > > One of them would be DRIVER_VGEM. And I think we already make > > > sure > > > that you don't accidentally get vgem for DRIVER_ANY. Otherwise I > > > guess > > > we'd need a DRIVER_ANY_BUT_VGEM. Well really what we want is > > > DRIVER_ANY_KMS here, which would also exclude vgem. So if it > > > doesn't > > > work already, small patch needed in lib/, but DRIVER_VKMS also > > > needs > > > that. And I really don't want more DRIVER_FOO defines for a plain > > > old > > > kms-only driver. kms is supposed to be a shared cross-driver > > > standard, > > > if we can't even write shared testcases it's just epic fail :-) > > >=20 > > > > > Imo best to start out by converting prime_vgem.c for this, > > > > > and adding > > > > > for > > > > > the i915 specific tests (but _only_ for those) a specific "is > > > > > this > > > > > i915" > > > > > check, so we skip those tests. And replace DRIVER_INTEL by > > > > > DRIVER_ANY. > > > > > Well, anything except vgem :-) > > > >=20 > > > > If I am not mistaken, all tests in prime_vgem are intel- > > > > specific :D > > > >=20 > > > > Some ideas can be taken from it, but anyway, it probably needs > > > > a deep > > > > rewrite. > > > >=20 > > > > And prime_vgem use only vgem as an exporter device. Here we can > > > > use any > > > > device. Sure, some tests would eventually use vgem-specific > > > > features, > > > > but some could remain more generic. > > >=20 > > > Maybe I wasn't all that clear then, I think what we want to test > > > in a > > > generic prime test is vgem+DRIVER_ANY_KMS. Then drivers can test > > > the > > > render side using DRIVER_FOO+vgem. This way you only need to have > > > 1 > > > generic kms test, plus N tests for all the rendering drivers. > > > Instead > > > of M x N testcases like you're proposing here. vgem is just the > > > abstraction layer/mocking layer we use to separate these two > > > worlds. > > > And of course for specific sharing you can still do that, e.g. to > > > test > > > dma engine compatibility between amdgpu and i915, or nouveau and > > > i915. > > > But those tests don't need to involve kms. > > >=20 > > > And yeah prime_vgem might need to be split into prime_i915_vgem > > > and > > > prime_kms_vgem. But all the display related testcases should be > > > possible to extract into such a prime_kms_vgem framework. > >=20 > > One could also want to test drmPrimeHandleToFD and > > drmPrimeFDToHandle > > between e.g. amdgpu and i915. I guess it's using a different code > > path > > than gem. >=20 > Yeah, but only if you also do some i915 or amdgpu specific command > submission. Otherwise if it's all cpu-only, then you wont hit any > additional path than what you can test with vgem already. Kinda my > point > really, there's no room really for a "generic" i915+amdgpu prime > test. As > soon as you look at that combo, it's all about specifics. > -Daniel Ok, now I got the point, thanks for the explanation.=20 I will send an updated patch. Oleg --=-JXX7dhyS+XBvcn3KSZfj Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Disposition: attachment; filename="smime.p7s" Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIKaDCCBOsw ggPToAMCAQICEFLpAsoR6ESdlGU4L6MaMLswDQYJKoZIhvcNAQEFBQAwbzELMAkGA1UEBhMCU0Ux FDASBgNVBAoTC0FkZFRydXN0IEF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f-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KaWd0LWRldiBt YWlsaW5nIGxpc3QKaWd0LWRldkBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9pZ3QtZGV2 --===============0192980601==--