public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] igt/kms_vblank: Exercise some EINVAL
@ 2018-09-04 18:51 Chris Wilson
  2018-09-04 19:21 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Chris Wilson @ 2018-09-04 18:51 UTC (permalink / raw)
  To: igt-dev

Feed some impossible garbage into drmWaitVblank and expect the kernel to
report EINVAL.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 tests/kms_vblank.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
index b3cd2d93c..3e7aff3fe 100644
--- a/tests/kms_vblank.c
+++ b/tests/kms_vblank.c
@@ -455,6 +455,48 @@ static void run_subtests_for_pipe(data_t *data)
 	}
 }
 
+static void invalid_subtest(data_t *data, int fd)
+{
+	union drm_wait_vblank vbl;
+	unsigned long invalid_flags;
+
+	igt_display_require_output_on_pipe(&data->display, 0);
+
+	/* First check all is well with a simple query */
+	memset(&vbl, 0, sizeof(vbl));
+	vbl.request.type = DRM_VBLANK_RELATIVE;
+	igt_assert_eq(wait_vblank(fd, &vbl), 0);
+
+	invalid_flags = ~(_DRM_VBLANK_TYPES_MASK |
+			  _DRM_VBLANK_FLAGS_MASK |
+			  _DRM_VBLANK_HIGH_CRTC_MASK);
+
+	/* pick some interesting invalid permutations */
+	memset(&vbl, 0, sizeof(vbl));
+	vbl.request.type = _DRM_VBLANK_RELATIVE | invalid_flags;
+	igt_assert_eq(wait_vblank(fd, &vbl), -EINVAL);
+	for (int bit = 0; bit < 32; bit++) {
+		int err;
+
+		if (~invalid_flags & (1 << bit))
+			continue;
+
+		memset(&vbl, 0, sizeof(vbl));
+		vbl.request.type = _DRM_VBLANK_RELATIVE | (1 << bit);
+		err = wait_vblank(fd, &vbl);
+		igt_assert_f(err == -EINVAL,
+			     "vblank wait with invalid request.type bit %d [0x%08x] did not report -EINVAL, got %d\n",
+			     bit, 1 << bit, err);
+	}
+
+	/* check the maximum pipe, nobody should have that many pipes! */
+	memset(&vbl, 0, sizeof(vbl));
+	vbl.request.type = _DRM_VBLANK_RELATIVE;
+	vbl.request.type |= _DRM_VBLANK_SECONDARY;
+	vbl.request.type |= _DRM_VBLANK_FLAGS_MASK;
+	igt_assert_eq(wait_vblank(fd, &vbl), -EINVAL);
+}
+
 igt_main
 {
 	int fd;
@@ -469,6 +511,9 @@ igt_main
 		igt_display_require_output(&data.display);
 	}
 
+	igt_subtest("invalid")
+		invalid_subtest(&data, fd);
+
 	igt_subtest("crtc-id")
 		crtc_id_subtest(&data, fd);
 
-- 
2.19.0.rc1

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for igt/kms_vblank: Exercise some EINVAL
  2018-09-04 18:51 [igt-dev] [PATCH i-g-t] igt/kms_vblank: Exercise some EINVAL Chris Wilson
@ 2018-09-04 19:21 ` Patchwork
  2018-09-04 21:52 ` [igt-dev] [PATCH i-g-t] " Daniel Vetter
  2018-09-05  2:49 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2018-09-04 19:21 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

== Series Details ==

Series: igt/kms_vblank: Exercise some EINVAL
URL   : https://patchwork.freedesktop.org/series/49147/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4767 -> IGTPW_1786 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/49147/revisions/1/mbox/

== Known issues ==

  Here are the changes found in IGTPW_1786 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@debugfs_test@read_all_entries:
      fi-snb-2520m:       PASS -> INCOMPLETE (fdo#103713)

    igt@drv_module_reload@basic-reload:
      fi-blb-e6850:       PASS -> INCOMPLETE (fdo#107718)

    igt@drv_selftest@live_evict:
      fi-bsw-kefka:       PASS -> DMESG-WARN (fdo#107709)

    igt@kms_frontbuffer_tracking@basic:
      fi-hsw-peppy:       PASS -> DMESG-WARN (fdo#102614)

    igt@kms_pipe_crc_basic@read-crc-pipe-a:
      fi-byt-clapper:     PASS -> FAIL (fdo#107362)

    
    ==== Possible fixes ====

    igt@gem_exec_suspend@basic-s3:
      fi-cfl-8109u:       DMESG-WARN (fdo#107345) -> PASS +1

    igt@gem_exec_suspend@basic-s4-devices:
      fi-kbl-7500u:       DMESG-WARN (fdo#105128, fdo#107139) -> PASS

    igt@kms_flip@basic-flip-vs-modeset:
      fi-cfl-8109u:       INCOMPLETE (fdo#107468) -> PASS

    igt@kms_frontbuffer_tracking@basic:
      fi-byt-clapper:     FAIL (fdo#103167) -> PASS

    igt@kms_pipe_crc_basic@hang-read-crc-pipe-a:
      fi-byt-clapper:     FAIL (fdo#107362, fdo#103191) -> PASS

    igt@pm_rpm@module-reload:
      fi-bsw-kefka:       DMESG-WARN (fdo#107704) -> PASS
      fi-bsw-n3050:       DMESG-WARN (fdo#107704) -> PASS
      fi-byt-j1900:       DMESG-WARN (fdo#107704) -> PASS
      fi-byt-n2820:       DMESG-WARN (fdo#107704) -> PASS

    
  fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
  fdo#105128 https://bugs.freedesktop.org/show_bug.cgi?id=105128
  fdo#107139 https://bugs.freedesktop.org/show_bug.cgi?id=107139
  fdo#107345 https://bugs.freedesktop.org/show_bug.cgi?id=107345
  fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
  fdo#107468 https://bugs.freedesktop.org/show_bug.cgi?id=107468
  fdo#107704 https://bugs.freedesktop.org/show_bug.cgi?id=107704
  fdo#107709 https://bugs.freedesktop.org/show_bug.cgi?id=107709
  fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718


== Participating hosts (50 -> 43) ==

  Missing    (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-pnv-d510 fi-skl-caroline 


== Build changes ==

    * IGT: IGT_4626 -> IGTPW_1786

  CI_DRM_4767: e9b69bafd3c2c13a8b9fa8e7a410f5d5ef32e328 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1786: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1786/
  IGT_4626: bfce01d8c93dbd86e6ab04ca1afb844e0cbc8078 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@kms_vblank@invalid

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1786/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [igt-dev] [PATCH i-g-t] igt/kms_vblank: Exercise some EINVAL
  2018-09-04 18:51 [igt-dev] [PATCH i-g-t] igt/kms_vblank: Exercise some EINVAL Chris Wilson
  2018-09-04 19:21 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-09-04 21:52 ` Daniel Vetter
  2018-09-04 22:00   ` Chris Wilson
  2018-09-05  2:49 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork
  2 siblings, 1 reply; 5+ messages in thread
From: Daniel Vetter @ 2018-09-04 21:52 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

On Tue, Sep 04, 2018 at 07:51:59PM +0100, Chris Wilson wrote:
> Feed some impossible garbage into drmWaitVblank and expect the kernel to
> report EINVAL.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  tests/kms_vblank.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 45 insertions(+)
> 
> diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
> index b3cd2d93c..3e7aff3fe 100644
> --- a/tests/kms_vblank.c
> +++ b/tests/kms_vblank.c
> @@ -455,6 +455,48 @@ static void run_subtests_for_pipe(data_t *data)
>  	}
>  }
>  
> +static void invalid_subtest(data_t *data, int fd)
> +{
> +	union drm_wait_vblank vbl;
> +	unsigned long invalid_flags;
> +
> +	igt_display_require_output_on_pipe(&data->display, 0);
> +
> +	/* First check all is well with a simple query */
> +	memset(&vbl, 0, sizeof(vbl));
> +	vbl.request.type = DRM_VBLANK_RELATIVE;
> +	igt_assert_eq(wait_vblank(fd, &vbl), 0);
> +
> +	invalid_flags = ~(_DRM_VBLANK_TYPES_MASK |
> +			  _DRM_VBLANK_FLAGS_MASK |
> +			  _DRM_VBLANK_HIGH_CRTC_MASK);
> +
> +	/* pick some interesting invalid permutations */
> +	memset(&vbl, 0, sizeof(vbl));
> +	vbl.request.type = _DRM_VBLANK_RELATIVE | invalid_flags;
> +	igt_assert_eq(wait_vblank(fd, &vbl), -EINVAL);
> +	for (int bit = 0; bit < 32; bit++) {
> +		int err;
> +
> +		if (~invalid_flags & (1 << bit))

Double-take on the ~~, but looks correct. I expect CI to complain about
the dmesg-error on this one, but it won't report because it's not yet
vetted. But should be in the full results somewhere.

> +			continue;
> +
> +		memset(&vbl, 0, sizeof(vbl));
> +		vbl.request.type = _DRM_VBLANK_RELATIVE | (1 << bit);
> +		err = wait_vblank(fd, &vbl);
> +		igt_assert_f(err == -EINVAL,
> +			     "vblank wait with invalid request.type bit %d [0x%08x] did not report -EINVAL, got %d\n",
> +			     bit, 1 << bit, err);
> +	}
> +
> +	/* check the maximum pipe, nobody should have that many pipes! */
> +	memset(&vbl, 0, sizeof(vbl));
> +	vbl.request.type = _DRM_VBLANK_RELATIVE;
> +	vbl.request.type |= _DRM_VBLANK_SECONDARY;
> +	vbl.request.type |= _DRM_VBLANK_FLAGS_MASK;
> +	igt_assert_eq(wait_vblank(fd, &vbl), -EINVAL);

Hm just realized that the kernel lets _DRM_VBLANK_SECONDARY and
_DRM_VBLANK_HIGH_CRTC_MASK through at the same time. Not really an issue,
just a bit silly. But for another day.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> +}
> +
>  igt_main
>  {
>  	int fd;
> @@ -469,6 +511,9 @@ igt_main
>  		igt_display_require_output(&data.display);
>  	}
>  
> +	igt_subtest("invalid")
> +		invalid_subtest(&data, fd);
> +
>  	igt_subtest("crtc-id")
>  		crtc_id_subtest(&data, fd);
>  
> -- 
> 2.19.0.rc1
> 

-- 
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [igt-dev] [PATCH i-g-t] igt/kms_vblank: Exercise some EINVAL
  2018-09-04 21:52 ` [igt-dev] [PATCH i-g-t] " Daniel Vetter
@ 2018-09-04 22:00   ` Chris Wilson
  0 siblings, 0 replies; 5+ messages in thread
From: Chris Wilson @ 2018-09-04 22:00 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: igt-dev

Quoting Daniel Vetter (2018-09-04 22:52:20)
> On Tue, Sep 04, 2018 at 07:51:59PM +0100, Chris Wilson wrote:
> > +     /* check the maximum pipe, nobody should have that many pipes! */
> > +     memset(&vbl, 0, sizeof(vbl));
> > +     vbl.request.type = _DRM_VBLANK_RELATIVE;
> > +     vbl.request.type |= _DRM_VBLANK_SECONDARY;
> > +     vbl.request.type |= _DRM_VBLANK_FLAGS_MASK;
> > +     igt_assert_eq(wait_vblank(fd, &vbl), -EINVAL);
> 
> Hm just realized that the kernel lets _DRM_VBLANK_SECONDARY and
> _DRM_VBLANK_HIGH_CRTC_MASK through at the same time. Not really an issue,
> just a bit silly. But for another day.

I forgot to mention that. Yes, that did look a bit silly. I felt like
writing a test to say use one or the other, but definitely not both, but
meh.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [igt-dev] ✓ Fi.CI.IGT: success for igt/kms_vblank: Exercise some EINVAL
  2018-09-04 18:51 [igt-dev] [PATCH i-g-t] igt/kms_vblank: Exercise some EINVAL Chris Wilson
  2018-09-04 19:21 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
  2018-09-04 21:52 ` [igt-dev] [PATCH i-g-t] " Daniel Vetter
@ 2018-09-05  2:49 ` Patchwork
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2018-09-05  2:49 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

== Series Details ==

Series: igt/kms_vblank: Exercise some EINVAL
URL   : https://patchwork.freedesktop.org/series/49147/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4626_full -> IGTPW_1786_full =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/49147/revisions/1/mbox/

== Possible new issues ==

  Here are the unknown changes that may have been introduced in IGTPW_1786_full:

  === IGT changes ===

    ==== Possible regressions ====

    {igt@kms_vblank@invalid}:
      shard-kbl:          NOTRUN -> DMESG-WARN
      shard-apl:          NOTRUN -> DMESG-WARN
      shard-snb:          NOTRUN -> DMESG-WARN
      shard-glk:          NOTRUN -> DMESG-WARN
      shard-hsw:          NOTRUN -> DMESG-WARN

    
== Known issues ==

  Here are the changes found in IGTPW_1786_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_request_retire@retire-vma-not-inactive:
      shard-snb:          PASS -> INCOMPLETE (fdo#105411)

    igt@kms_available_modes_crc@available_mode_test_crc:
      shard-snb:          PASS -> FAIL (fdo#106641)

    igt@kms_flip_tiling@flip-yf-tiled:
      shard-apl:          PASS -> INCOMPLETE (fdo#103927)

    igt@kms_rotation_crc@sprite-rotation-180:
      shard-snb:          PASS -> FAIL (fdo#103925)

    igt@kms_vblank@pipe-c-query-forked-busy-hang:
      shard-kbl:          PASS -> DMESG-WARN (fdo#105602, fdo#103558) +22

    
    ==== Possible fixes ====

    igt@drv_selftest@live_contexts:
      shard-glk:          DMESG-FAIL -> PASS

    igt@gem_wait@invalid-flags:
      shard-snb:          INCOMPLETE (fdo#105411) -> PASS

    igt@kms_cursor_legacy@cursor-vs-flip-toggle:
      shard-hsw:          FAIL (fdo#103355) -> PASS

    igt@kms_flip@flip-vs-panning-vs-hang:
      shard-apl:          DMESG-WARN (fdo#105602, fdo#103558) -> PASS +2

    igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-draw-pwrite:
      shard-glk:          FAIL (fdo#103167) -> PASS

    igt@kms_plane@pixel-format-pipe-a-planes:
      shard-snb:          FAIL (fdo#107749) -> PASS

    igt@kms_setmode@basic:
      shard-apl:          FAIL (fdo#99912) -> PASS

    igt@testdisplay:
      shard-glk:          INCOMPLETE (k.org#198133, fdo#103359, fdo#107093) -> PASS

    
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103355 https://bugs.freedesktop.org/show_bug.cgi?id=103355
  fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
  fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
  fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
  fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
  fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
  fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
  fdo#106641 https://bugs.freedesktop.org/show_bug.cgi?id=106641
  fdo#107093 https://bugs.freedesktop.org/show_bug.cgi?id=107093
  fdo#107749 https://bugs.freedesktop.org/show_bug.cgi?id=107749
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
  k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133


== Participating hosts (5 -> 5) ==

  No changes in participating hosts


== Build changes ==

    * IGT: IGT_4626 -> IGTPW_1786
    * Linux: CI_DRM_4766 -> CI_DRM_4767

  CI_DRM_4766: 0d35b9d0b3a74c41ac1ffe1a34aa9c98d2a3a0b9 @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_4767: e9b69bafd3c2c13a8b9fa8e7a410f5d5ef32e328 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1786: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1786/
  IGT_4626: bfce01d8c93dbd86e6ab04ca1afb844e0cbc8078 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1786/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-09-05  2:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-04 18:51 [igt-dev] [PATCH i-g-t] igt/kms_vblank: Exercise some EINVAL Chris Wilson
2018-09-04 19:21 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-09-04 21:52 ` [igt-dev] [PATCH i-g-t] " Daniel Vetter
2018-09-04 22:00   ` Chris Wilson
2018-09-05  2:49 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox