All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vasilev, Oleg" <oleg.vasilev@intel.com>
To: "daniel@ffwll.ch" <daniel@ffwll.ch>, "Ser, Simon" <simon.ser@intel.com>
Cc: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH 2/2] tests/prime_generic: add vendor-agnostic prime tests
Date: Fri, 12 Jul 2019 08:36:12 +0000	[thread overview]
Message-ID: <3304ffa3cc7ec535c09a69434aec743b909fddd6.camel@intel.com> (raw)
In-Reply-To: <20190711171903.GP15868@phenom.ffwll.local>


[-- Attachment #1.1: Type: text/plain, Size: 7370 bytes --]

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
> > > > > > 
> > > > > > 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
> > > > > > 
> > > > > > 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
> > > > > > 
> > > > > > The initial motivation comes from the need to test prime
> > > > > > support in
> > > > > > vkms.
> > > > > > 
> > > > > > Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> > > > > > Cc: Daniel Vetter <daniel@ffwll.ch>
> > > > > > Signed-off-by: Oleg Vasilev <oleg.vasilev@intel.com>
> > > > > > ---
> > > > > >  tests/meson.build     |   1 +
> > > > > >  tests/prime_generic.c | 238
> > > > > > ++++++++++++++++++++++++++++++++++++++++++
> > > > > >  2 files changed, 239 insertions(+)
> > > > > >  create mode 100644 tests/prime_generic.c
> > > > > > 
> > > > > > 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 = [
> > > > > >     '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);
> > > > > 
> > > > > This isn't any more generic than what we have e.g. in
> > > > > prime_vgem
> > > > > already.
> > > > 
> > > > Here non-generic part is only those 10 lines of subtests
> > > > definitions.
> > > > The rest is common code.
> > > > 
> > > > 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.
> > > 
> > > 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.
> > > 
> > > > > 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.
> > > > 
> > > > But how can we open two different devices with DRIVER_ANY? If I
> > > > put
> > > > 
> > > > fd = drm_open_driver(DRIVER_ANY)
> > > > fd2 = drm_open_driver(DRIVER_ANY)
> > > > 
> > > > I get the same device opened two times, do I?
> > > 
> > > 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 :-)
> > > 
> > > > > 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 :-)
> > > > 
> > > > If I am not mistaken, all tests in prime_vgem are intel-
> > > > specific :D
> > > > 
> > > > Some ideas can be taken from it, but anyway, it probably needs
> > > > a deep
> > > > rewrite.
> > > > 
> > > > 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.
> > > 
> > > 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.
> > > 
> > > 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.
> > 
> > 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.
> 
> 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. 
I will send an updated patch.

Oleg

[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3261 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-07-12  8:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-04  9:56 [igt-dev] [PATCH 1/2] lib: prepare helpers for generic prime test Oleg Vasilev
2019-07-04  9:56 ` [igt-dev] [PATCH 2/2] tests/prime_generic: add vendor-agnostic prime tests Oleg Vasilev
2019-07-09 13:48   ` Rodrigo Siqueira
2019-07-10 16:35   ` Daniel Vetter
2019-07-11  9:09     ` Vasilev, Oleg
2019-07-11 12:36       ` Daniel Vetter
2019-07-11 15:20         ` Ser, Simon
2019-07-11 17:19           ` Daniel Vetter
2019-07-12  8:36             ` Vasilev, Oleg [this message]
2019-07-12 10:24             ` Ser, Simon
2019-07-04 10:26 ` [igt-dev] [PATCH 1/2] lib: prepare helpers for generic prime test Ser, Simon
2019-07-04 10:31 ` [igt-dev] ✗ GitLab.Pipeline: warning for series starting with [1/2] " Patchwork
2019-07-04 10:57 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2019-07-05 10:53 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork
2019-07-05 12:07 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-07-12 14:16 [igt-dev] [PATCH 1/2] lib: expose fb_init Oleg Vasilev
2019-07-12 14:16 ` [igt-dev] [PATCH 2/2] tests/prime_generic: add vendor-agnostic prime tests Oleg Vasilev
2019-07-12 14:20   ` Chris Wilson
2019-07-31  9:45   ` Vasilev, Oleg
2019-08-02 14:38   ` Daniel Vetter
2019-08-16 10:07   ` Ser, Simon
2019-08-16 10:13     ` Chris Wilson
2019-08-16 10:35       ` Ser, Simon
2019-08-16 14:21     ` Vasilev, Oleg
2019-08-16 14:33       ` Ser, Simon
2019-08-16 14:39         ` Ser, Simon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3304ffa3cc7ec535c09a69434aec743b909fddd6.camel@intel.com \
    --to=oleg.vasilev@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=simon.ser@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.