dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Stone <daniels@collabora.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH igt v7 3/4] tests/core_prop_blob: Add multiple blobs per connection
Date: Thu, 29 Oct 2015 10:35:23 +0000	[thread overview]
Message-ID: <1446114924-7192-2-git-send-email-daniels@collabora.com> (raw)
In-Reply-To: <1446114924-7192-1-git-send-email-daniels@collabora.com>

This should hit the bug fixed in:
XXX FIXME INSERT SEANPAUL COMMIT CITE

which was introduced with the initial blob support in:
    commit e2f5d2ea479b9b2619965d43db70939589afe43a
    Author: Daniel Stone <daniels@collabora.com>
    Date:   Fri May 22 13:34:51 2015 +0100

        drm/mode: Add user blob-creation ioctl

        Add an ioctl which allows users to create blob properties from supplied
        data. Currently this only supports modes, creating a drm_display_mode from
        the userspace drm_mode_modeinfo.

        v2: Removed size/type checks.
            Rebased on new patches to allow error propagation from create_blob,
            as well as avoiding double-allocation.

        Signed-off-by: Daniel Stone <daniels@collabora.com>
        Reviewed-by: Maarten Lankhorst <maarten.lankhorst@intel.com>
        Tested-by: Sean Paul <seanpaul@chromium.org>
        Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Signed-off-by: Daniel Stone <daniels@collabora.com>
---
 tests/core_prop_blob.c | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/tests/core_prop_blob.c b/tests/core_prop_blob.c
index df4f3ad..365d728 100644
--- a/tests/core_prop_blob.c
+++ b/tests/core_prop_blob.c
@@ -208,6 +208,43 @@ test_lifetime(int fd)
 }
 
 static void
+test_multiple(int fd)
+{
+	uint32_t prop_ids[5];
+	int fd2;
+	int i;
+
+	fd2 = drm_open_driver(DRIVER_ANY);
+	igt_assert_fd(fd2);
+
+	/* Ensure destroying multiple properties explicitly works as needed. */
+	for (i = 0; i < ARRAY_SIZE(prop_ids); i++) {
+		prop_ids[i] = create_prop(fd2);
+		igt_assert_eq(validate_prop(fd, prop_ids[i]), 0);
+		igt_assert_eq(validate_prop(fd2, prop_ids[i]), 0);
+	}
+	for (i = 0; i < ARRAY_SIZE(prop_ids); i++) {
+		igt_assert_eq(destroy_prop(fd2, prop_ids[i]), 0);
+		igt_assert_eq(validate_prop(fd2, prop_ids[i]), ENOENT);
+	}
+	igt_assert_eq(close(fd2), 0);
+
+	fd2 = drm_open_driver(DRIVER_ANY);
+	igt_assert_fd(fd2);
+
+	/* Ensure that multiple properties get cleaned up on fd close. */
+	for (i = 0; i < ARRAY_SIZE(prop_ids); i++) {
+		prop_ids[i] = create_prop(fd2);
+		igt_assert_eq(validate_prop(fd, prop_ids[i]), 0);
+		igt_assert_eq(validate_prop(fd2, prop_ids[i]), 0);
+	}
+	igt_assert_eq(close(fd2), 0);
+
+	for (i = 0; i < ARRAY_SIZE(prop_ids); i++)
+		igt_assert_eq(validate_prop(fd, prop_ids[i]), ENOENT);
+}
+
+static void
 test_core(int fd)
 {
 	uint32_t prop_id;
@@ -256,6 +293,9 @@ igt_main
 	igt_subtest("blob-prop-lifetime")
 		test_lifetime(fd);
 
+	igt_subtest("blob-multiple")
+		test_multiple(fd);
+
 	igt_fixture
 		close(fd);
 }
-- 
2.5.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-10-29 10:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29 10:31 [PATCH igt v7 0/4] Assert tests, atomic, multi-blob Daniel Stone
2015-10-29 10:31 ` [PATCH igt v7 1/4] lib/tests: Add igt_assert_*() self-tests Daniel Stone
2015-10-29 12:36   ` Thomas Wood
2015-10-29 10:35 ` [PATCH igt v7 2/4] tests: Run igt.cocci Daniel Stone
2015-10-29 10:35   ` Daniel Stone [this message]
2015-10-29 10:35   ` [PATCH igt v7 4/4] kms_atomic: Add basic atomic modesetting tests Daniel Stone
2015-10-29 11:33     ` Emil Velikov
2015-10-30 10:44       ` Daniel Vetter
  -- strict thread matches above, loose matches on Subject: below --
2015-10-29 11:01 [PATCH igt v7 0/4] Assert tests, atomic, multi-blob Daniel Stone
2015-10-29 11:01 ` [PATCH igt v7 3/4] tests/core_prop_blob: Add multiple blobs per connection Daniel Stone

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=1446114924-7192-2-git-send-email-daniels@collabora.com \
    --to=daniels@collabora.com \
    --cc=dri-devel@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