public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Keith Packard" <keithp@keithp.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>,
	IGT development <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t 3/9] tests/kms_lease: invalid corner-cases for create-lease ioctl
Date: Wed, 20 Feb 2019 19:08:30 -0800	[thread overview]
Message-ID: <87imxdltxt.fsf@keithp.com> (raw)
In-Reply-To: <20190220162530.31643-3-daniel.vetter@ffwll.ch>


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

Daniel Vetter <daniel.vetter@ffwll.ch> writes:

> Found a few things in the kernel that looks suspicious, separate
> patches on their way.

Thanks for adding more tests!

> +	/* empty lease */
> +	mcl.object_ids = 0;
> +	mcl.object_count = 0;
> +	mcl.flags = 0;
> +	igt_assert_eq(create_lease(data->master.fd, &mcl), -EINVAL);

Not sure why this should be invalid? It's not useful, but then neither
are 0x0 windows and look at all the pain not allowing them has caused
over the years...

> +
> +	/* NULL array pointer */
> +	mcl.object_count = 1;
> +	igt_assert_eq(create_lease(data->master.fd, &mcl), -EFAULT);

Should probably explicitly initialize the array pointer here, avoids any
dependency on the previous test.

> +	/* no crtc, non-universal_plane */
> +	drmSetClientCap(data->master.fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 0);
> +	object_ids[0] = data->master.display.outputs[0].id;
> +	igt_assert_eq(create_lease(data->master.fd, &mcl), -EINVAL);

Similarly, initialize the object count and pointers explicitly.

> +	/* no subleasing */
> +	mcl.object_count = 3;
> +	mcl.flags = 0;
> +	igt_assert_eq(create_lease(data->master.fd, &mcl), 0);
> +	tmp_fd = mcl.fd;
> +	igt_assert_eq(create_lease(tmp_fd, &mcl), -EINVAL);
> +	close(tmp_fd);

Just reminds me that we should probably enable sub-leasing -- useful in
a multi-head environment where you also want to run leased applications
under one of the heads.

All of these tests look OK to me; as usual, the precise errno values are
subject to interpretation, but it looks like you've made reasonable
choices here making me wonder how reasonable the kernel is :-)

Reviewed-by: Keith Packard <keithp@keithp.com>

-- 
-keith

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 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

  parent reply	other threads:[~2019-02-21  3:08 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-20 16:25 [igt-dev] [PATCH i-g-t 1/9] tests/kms_lease: Add invalid planes tests Daniel Vetter
2019-02-20 16:25 ` [igt-dev] [PATCH i-g-t 2/9] tests/kms_lease: Run on simulation Daniel Vetter
2019-03-14  9:29   ` Boris Brezillon
2019-02-20 16:25 ` [igt-dev] [PATCH i-g-t 3/9] tests/kms_lease: invalid corner-cases for create-lease ioctl Daniel Vetter
2019-02-20 20:43   ` Lyude Paul
2019-02-20 21:20     ` Daniel Vetter
2019-02-20 21:23   ` [igt-dev] [PATCH i-g-t] " Daniel Vetter
2019-02-21  3:08   ` Keith Packard [this message]
2019-02-21  9:16     ` [igt-dev] [PATCH i-g-t 3/9] " Daniel Vetter
2019-02-20 16:25 ` [igt-dev] [PATCH i-g-t 4/9] tests/kms_release: invalid checks for revoke-lease ioctl Daniel Vetter
2019-03-14  9:35   ` Boris Brezillon
2019-02-20 16:25 ` [igt-dev] [PATCH i-g-t 5/9] tests/kms_lease: validate the possible_crtcs filtering Daniel Vetter
2019-02-20 16:25 ` [igt-dev] [PATCH i-g-t 6/9] tests/kms_lease: Test drop/set_master interactions Daniel Vetter
2019-02-20 16:25 ` [igt-dev] [PATCH i-g-t 7/9] tests/kms_lease: multimaster testcase Daniel Vetter
2019-02-20 16:25 ` [igt-dev] [PATCH i-g-t 8/9] tests/kms_lease: validate implicitly added planes Daniel Vetter
2019-02-20 16:25 ` [igt-dev] [PATCH i-g-t 9/9] tests/kms_lease: exercise uevent Daniel Vetter
2019-02-20 20:33   ` [igt-dev] [PATCH i-g-t] " Daniel Vetter
2019-02-20 22:25     ` Lyude Paul
2019-02-20 23:33       ` Daniel Vetter
2019-02-20 23:34         ` Lyude Paul
2019-02-20 21:01   ` Daniel Vetter
2019-02-20 21:17   ` Daniel Vetter
2019-02-20 23:42     ` Lyude Paul
2019-02-20 23:48       ` Daniel Vetter
2019-02-21  0:16         ` Lyude Paul
2019-02-20 17:00 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/9] tests/kms_lease: Add invalid planes tests Patchwork
2019-02-20 19:51 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-02-20 20:42   ` Daniel Vetter
2019-02-20 21:11 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/9] tests/kms_lease: Add invalid planes tests (rev2) Patchwork
2019-02-20 21:51 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/9] tests/kms_lease: Add invalid planes tests (rev3) Patchwork
2019-02-20 22:02 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/9] tests/kms_lease: Add invalid planes tests (rev5) Patchwork
2019-02-20 22:26 ` [igt-dev] [PATCH i-g-t 1/9] tests/kms_lease: Add invalid planes tests Lyude Paul
2019-02-21  1:25 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/9] tests/kms_lease: Add invalid planes tests (rev2) Patchwork
2019-02-21  1:52 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/9] tests/kms_lease: Add invalid planes tests (rev3) Patchwork
2019-02-21  2:57 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/9] tests/kms_lease: Add invalid planes tests (rev5) Patchwork
2019-02-21 12:57 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/9] tests/kms_lease: Add invalid planes tests (rev6) Patchwork
2019-02-21 18:24 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-02-21 19:28 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/9] tests/kms_lease: Add invalid planes tests (rev7) Patchwork
2019-02-22  8:00 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-02-22 10:50 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/9] tests/kms_lease: Add invalid planes tests (rev8) Patchwork
2019-02-22 20:23 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-03-14  9:26 ` [igt-dev] [PATCH i-g-t 1/9] tests/kms_lease: Add invalid planes tests Boris Brezillon

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=87imxdltxt.fsf@keithp.com \
    --to=keithp@keithp.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=igt-dev@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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox