Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: priyanka.dandamudi@intel.com
To: priyanka.dandamudi@intel.com, ramadevi.gandi@intel.com,
	janga.rahul.kumar@intel.com, kamil.konieczny@intel.com,
	igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 1/3] xe/xe_mmap: Negative test for mmap flags
Date: Sat, 20 May 2023 17:40:54 +0530	[thread overview]
Message-ID: <20230520121056.3926557-2-priyanka.dandamudi@intel.com> (raw)
In-Reply-To: <20230520121056.3926557-1-priyanka.dandamudi@intel.com>

From: Priyanka Dandamudi <priyanka.dandamudi@intel.com>

Add negative test by adding invalid mmap flags and check
for related errors.

Cc: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi@intel.com>
---
 tests/xe/xe_mmap.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/tests/xe/xe_mmap.c b/tests/xe/xe_mmap.c
index 6b313a18..011b8893 100644
--- a/tests/xe/xe_mmap.c
+++ b/tests/xe/xe_mmap.c
@@ -57,6 +57,22 @@ test_mmap(int fd, uint32_t flags)
 	gem_close(fd, bo);
 }
 
+/**
+ * SUBTEST: bad-flags
+ * Description: Test mmap offset with bad flags.
+ *
+ */
+static void test_bad_flags(int fd)
+{
+	struct drm_xe_gem_mmap_offset mmo = {
+		.handle = xe_bo_create(fd, 0, 0, 4096),
+		.flags = -1u,
+	};
+
+	do_ioctl_err(fd, DRM_IOCTL_XE_GEM_MMAP_OFFSET, &mmo, EINVAL);
+	gem_close(fd, mmo.handle);
+}
+
 igt_main
 {
 	int fd;
@@ -75,6 +91,9 @@ igt_main
 	igt_subtest("vram-system")
 		test_mmap(fd, vram_memory(fd, 0) | system_memory(fd));
 
+	igt_subtest("bad-flags")
+		test_bad_flags(fd);
+
 	igt_fixture {
 		xe_device_put(fd);
 		close(fd);
-- 
2.25.1

  reply	other threads:[~2023-05-20 12:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-20 12:10 [igt-dev] [PATCH i-g-t 0/3] Negative tests to mmap offset priyanka.dandamudi
2023-05-20 12:10 ` priyanka.dandamudi [this message]
2023-05-22 11:36   ` [igt-dev] [PATCH i-g-t 1/3] xe/xe_mmap: Negative test for mmap flags Zbigniew Kempczyński
2023-05-22 11:39   ` Zbigniew Kempczyński
2023-05-20 12:10 ` [igt-dev] [PATCH i-g-t 2/3] xe/xe_mmap: Negative test to extensions priyanka.dandamudi
2023-05-22 11:41   ` Zbigniew Kempczyński
2023-05-20 12:10 ` [igt-dev] [PATCH i-g-t 3/3] xe/xe_mmap: Negative test to object priyanka.dandamudi
2023-05-22 11:44   ` Zbigniew Kempczyński
2023-05-20 21:15 ` [igt-dev] ✓ Fi.CI.BAT: success for Negative tests to mmap offset Patchwork
2023-05-20 22:38 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-05-26  5:08 [igt-dev] [PATCH i-g-t 0/3] " priyanka.dandamudi
2023-05-26  5:08 ` [igt-dev] [PATCH i-g-t 1/3] xe/xe_mmap: Negative test for mmap flags priyanka.dandamudi
2023-05-26 10:42   ` Zbigniew Kempczyński

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=20230520121056.3926557-2-priyanka.dandamudi@intel.com \
    --to=priyanka.dandamudi@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=janga.rahul.kumar@intel.com \
    --cc=kamil.konieczny@intel.com \
    --cc=ramadevi.gandi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox