From: Daniel Vetter <daniel@ffwll.ch> To: Chris Wilson <chris@chris-wilson.co.uk> Cc: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Subject: Re: [igt-dev] [PATCH i-g-t 2/5] igt/prime_vgem: Skip flip if no display Date: Mon, 1 Oct 2018 10:49:07 +0200 [thread overview] Message-ID: <20181001084907.GB11082@phenom.ffwll.local> (raw) In-Reply-To: <20180914201310.19527-2-chris@chris-wilson.co.uk> On Fri, Sep 14, 2018 at 09:13:07PM +0100, Chris Wilson wrote: > We try flipping a vgem surface onto a i915 scanout. However, if there > is no display we want to disable the kms interface, including the addfb > ioctl. On such systems the call to kms_addfb will naturally fail and the > test cannot be run. > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> > --- > tests/prime_vgem.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c > index b821fbb8c..a76d3797b 100644 > --- a/tests/prime_vgem.c > +++ b/tests/prime_vgem.c > @@ -762,10 +762,13 @@ static void test_flip(int i915, int vgem, unsigned hang) > igt_assert(handle[i]); > close(fd); > > - do_or_die(__kms_addfb(i915, handle[i], > - bo[i].width, bo[i].height, bo[i].pitch, > - DRM_FORMAT_XRGB8888, I915_TILING_NONE, NULL, > - LOCAL_DRM_MODE_FB_MODIFIERS, &fb_id[i])); > + /* May skip if i915 has no displays */ > + igt_require(__kms_addfb(i915, handle[i], > + bo[i].width, bo[i].height, bo[i].pitch, > + DRM_FORMAT_XRGB8888, > + I915_TILING_NONE, NULL, > + LOCAL_DRM_MODE_FB_MODIFIERS, > + &fb_id[i]) == 0); Hm, both here and in patch 1 I feel like this is super late to check for requirements. I think for these low-level tests a kms_require_display which checks for n_pipes > 0 && n_outputs > 0 would be good. Then we can sprinkle these early (and keep the do_or_die here), plus it won't need a comment about why we have the check since it's obvious from the name. -Daniel > igt_assert(fb_id[i]); > } > > -- > 2.19.0 > > _______________________________________________ > igt-dev mailing list > igt-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/igt-dev -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
WARNING: multiple messages have this Message-ID (diff)
From: Daniel Vetter <daniel@ffwll.ch> To: Chris Wilson <chris@chris-wilson.co.uk> Cc: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Subject: Re: [igt-dev] [PATCH i-g-t 2/5] igt/prime_vgem: Skip flip if no display Date: Mon, 1 Oct 2018 10:49:07 +0200 [thread overview] Message-ID: <20181001084907.GB11082@phenom.ffwll.local> (raw) In-Reply-To: <20180914201310.19527-2-chris@chris-wilson.co.uk> On Fri, Sep 14, 2018 at 09:13:07PM +0100, Chris Wilson wrote: > We try flipping a vgem surface onto a i915 scanout. However, if there > is no display we want to disable the kms interface, including the addfb > ioctl. On such systems the call to kms_addfb will naturally fail and the > test cannot be run. > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> > --- > tests/prime_vgem.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c > index b821fbb8c..a76d3797b 100644 > --- a/tests/prime_vgem.c > +++ b/tests/prime_vgem.c > @@ -762,10 +762,13 @@ static void test_flip(int i915, int vgem, unsigned hang) > igt_assert(handle[i]); > close(fd); > > - do_or_die(__kms_addfb(i915, handle[i], > - bo[i].width, bo[i].height, bo[i].pitch, > - DRM_FORMAT_XRGB8888, I915_TILING_NONE, NULL, > - LOCAL_DRM_MODE_FB_MODIFIERS, &fb_id[i])); > + /* May skip if i915 has no displays */ > + igt_require(__kms_addfb(i915, handle[i], > + bo[i].width, bo[i].height, bo[i].pitch, > + DRM_FORMAT_XRGB8888, > + I915_TILING_NONE, NULL, > + LOCAL_DRM_MODE_FB_MODIFIERS, > + &fb_id[i]) == 0); Hm, both here and in patch 1 I feel like this is super late to check for requirements. I think for these low-level tests a kms_require_display which checks for n_pipes > 0 && n_outputs > 0 would be good. Then we can sprinkle these early (and keep the do_or_die here), plus it won't need a comment about why we have the check since it's obvious from the name. -Daniel > igt_assert(fb_id[i]); > } > > -- > 2.19.0 > > _______________________________________________ > igt-dev mailing list > igt-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/igt-dev -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-10-01 8:49 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-09-14 20:13 [PATCH i-g-t 1/5] igt/kms_getfb: Check the iface exists before use Chris Wilson 2018-09-14 20:13 ` [igt-dev] " Chris Wilson 2018-09-14 20:13 ` [PATCH i-g-t 2/5] igt/prime_vgem: Skip flip if no display Chris Wilson 2018-09-14 20:13 ` [Intel-gfx] " Chris Wilson 2018-10-01 8:49 ` Daniel Vetter [this message] 2018-10-01 8:49 ` [igt-dev] " Daniel Vetter 2018-10-01 9:57 ` Chris Wilson 2018-10-01 9:57 ` Chris Wilson 2018-09-14 20:13 ` [PATCH i-g-t 3/5] lib: Report if kms is enabled on the display Chris Wilson 2018-09-14 20:13 ` [igt-dev] " Chris Wilson 2018-10-01 8:46 ` Daniel Vetter 2018-10-01 8:46 ` [Intel-gfx] " Daniel Vetter 2018-09-14 20:13 ` [PATCH i-g-t 4/5] lib/kms: Skip no-op display updates Chris Wilson 2018-09-14 20:13 ` [igt-dev] " Chris Wilson 2018-10-01 8:47 ` Daniel Vetter 2018-10-01 8:47 ` Daniel Vetter 2018-09-14 20:13 ` [PATCH i-g-t 5/5] igt: Require a display (KMS enabled) for KMS tests Chris Wilson 2018-09-14 20:13 ` [igt-dev] " Chris Wilson 2018-09-14 20:48 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/5] igt/kms_getfb: Check the iface exists before use Patchwork 2018-09-15 1:16 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork 2018-09-28 10:19 [PATCH i-g-t 1/5] " Chris Wilson 2018-09-28 10:19 ` [igt-dev] [PATCH i-g-t 2/5] igt/prime_vgem: Skip flip if no display Chris Wilson
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=20181001084907.GB11082@phenom.ffwll.local \ --to=daniel@ffwll.ch \ --cc=chris@chris-wilson.co.uk \ --cc=igt-dev@lists.freedesktop.org \ --cc=intel-gfx@lists.freedesktop.org \ /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: linkBe 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.