Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Louis Chauvet <louis.chauvet@bootlin.com>
To: igt-dev@lists.freedesktop.org
Cc: Louis Chauvet <louis.chauvet@bootlin.com>,
	thomas.petazzoni@bootlin.com,  miquel.raynal@bootlin.com
Subject: [PATCH i-g-t 1/3] tests/kms/plane: Rename test_planar_settings to test_odd_size_with_yuv
Date: Thu, 01 Feb 2024 17:35:53 +0100	[thread overview]
Message-ID: <20240201-kms_tests-v1-1-bc34c5d28b3f@bootlin.com> (raw)
In-Reply-To: <20240201-kms_tests-v1-0-bc34c5d28b3f@bootlin.com>

Rename the test test_planar_settings to test_odd_size_with_yuv, remove the
intel guard on this test.

Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
---
 tests/kms_plane.c | 91 ++++++++++++++++++++++++++-----------------------------
 1 file changed, 43 insertions(+), 48 deletions(-)

diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 406aecc04297..0bca96692b14 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -42,8 +42,8 @@
 #include "xe/xe_query.h"
 
 /**
- * SUBTEST: planar-pixel-format-settings
- * Description: verify planar settings for pixel format are handled correctly
+ * SUBTEST: test-odd-size-with-yuv
+ * Description: verify that yuv odd size are handled correctly by the driver
  * Functionality: pixel_formats, plane
  *
  * SUBTEST: plane-position-%s
@@ -1226,8 +1226,7 @@ test_pixel_formats(data_t *data, enum pipe pipe)
 
 	igt_assert_f(result, "At least one CRC mismatch happened\n");
 }
-
-static void test_planar_settings(data_t *data)
+static void test_odd_size_with_yuv(data_t *data)
 {
 	enum pipe pipe = PIPE_A;
 	igt_output_t *output;
@@ -1236,14 +1235,18 @@ static void test_planar_settings(data_t *data)
 	int devid;
 	int rval;
 
-	/*
-	 * If here is added non-intel tests below require will need to be
-	 * changed to if(..)
-	 */
+	bool should_fail = false;
 	igt_require(data->display.is_atomic);
-	igt_require_intel(data->drm_fd);
-	devid = intel_get_drm_devid(data->drm_fd);
-	igt_require(intel_display_ver(devid) >= 9);
+
+	/* Add more devices here if they are expected to fail */
+	if(is_intel_device(data->drm_fd)) {
+		/* This was required in the original test */
+		igt_require(intel_display_ver(devid) >= 9);
+		/* Intel display version below 20 are expected to fail */
+		if (intel_display_ver(devid) < 20) {
+			should_fail = true;
+		}
+	}
 
 	output = igt_get_single_output_for_pipe(&data->display, pipe);
 	igt_require(output);
@@ -1255,44 +1258,37 @@ static void test_planar_settings(data_t *data)
 				  DRM_MODE_ATOMIC_ALLOW_MODESET,
 				  NULL);
 
-	/* test against intel_plane_check_src_coordinates() in i915 */
-	if (igt_plane_has_format_mod(primary, DRM_FORMAT_NV12,
-				     DRM_FORMAT_MOD_LINEAR)) {
-		int expected_rval = -EINVAL;
-
-		if (intel_display_ver(devid) >= 20)
-			expected_rval = 0;
-
-		igt_create_fb(data->drm_fd, 257, 256,
-			      DRM_FORMAT_NV12, DRM_FORMAT_MOD_LINEAR, &fb);
-		igt_plane_set_fb(primary, &fb);
-		rval = igt_display_try_commit_atomic(&data->display,
-						     DRM_MODE_ATOMIC_ALLOW_MODESET,
-						     NULL);
-		igt_remove_fb(data->drm_fd, &fb);
-		igt_assert_f(rval == expected_rval, "Odd width NV12 framebuffer\n");
+	igt_require(igt_plane_has_format_mod(primary, DRM_FORMAT_NV12,
+					     DRM_FORMAT_MOD_LINEAR));
+
+
+	igt_create_fb(data->drm_fd, 257, 256,
+		      DRM_FORMAT_NV12, DRM_FORMAT_MOD_LINEAR, &fb);
+	igt_plane_set_fb(primary, &fb);
+	rval = igt_display_try_commit_atomic(&data->display,
+					     DRM_MODE_ATOMIC_ALLOW_MODESET,
+					     NULL);
+	igt_remove_fb(data->drm_fd, &fb);
+
+	if(should_fail) {
+		igt_assert_f(rval == -EINVAL, "Odd width NV12 framebuffer correctly failed\n");
 	} else {
-		igt_debug("Odd width NV12 framebuffer test skipped\n");
+		igt_assert_f(rval == 0, "Odd width NV12 framebuffer correctly succeed\n");
 	}
 
-	/* test against intel_plane_check_src_coordinates() in i915 */
-	if (igt_plane_has_format_mod(primary, DRM_FORMAT_NV12,
-				     DRM_FORMAT_MOD_LINEAR)) {
-		int expected_rval = -EINVAL;
-
-		if (intel_display_ver(devid) >= 20)
-			expected_rval = 0;
-
-		igt_create_fb(data->drm_fd, 256, 257,
-			      DRM_FORMAT_NV12, DRM_FORMAT_MOD_LINEAR, &fb);
-		igt_plane_set_fb(primary, &fb);
-		rval = igt_display_try_commit_atomic(&data->display,
-						     DRM_MODE_ATOMIC_ALLOW_MODESET,
-						     NULL);
-		igt_remove_fb(data->drm_fd, &fb);
-		igt_assert_f(rval == expected_rval, "Odd height NV12 framebuffer\n");
+
+	igt_create_fb(data->drm_fd, 256, 257,
+		      DRM_FORMAT_NV12, DRM_FORMAT_MOD_LINEAR, &fb);
+	igt_plane_set_fb(primary, &fb);
+	rval = igt_display_try_commit_atomic(&data->display,
+					     DRM_MODE_ATOMIC_ALLOW_MODESET,
+					     NULL);
+	igt_remove_fb(data->drm_fd, &fb);
+
+	if(should_fail) {
+		igt_assert_f(rval == -EINVAL, "Odd height NV12 framebuffer correctly failed\n");
 	} else {
-		igt_debug("Odd height NV12 framebuffer test skipped\n");
+		igt_assert_f(rval == 0, "Odd height NV12 framebuffer correctly succeed\n");
 	}
 }
 
@@ -1377,9 +1373,8 @@ run_tests_for_pipe_plane(data_t *data)
 		run_test(data, test_plane_panning);
 	}
 
-	igt_describe("verify planar settings for pixel format are accepted or rejected correctly");
-	igt_subtest_f("planar-pixel-format-settings")
-		test_planar_settings(data);
+	igt_describe("verify that odd sizes for yuv format are accepted or rejected correctly");
+	igt_subtest_f("test-odd-size-with-yuv") test_odd_size_with_yuv(data);
 }
 
 static int opt_handler(int opt, int opt_index, void *_data)

-- 
2.43.0


  reply	other threads:[~2024-02-01 16:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01 16:35 [PATCH i-g-t 0/3] Add tests for kms_plane and kms_rotation Louis Chauvet
2024-02-01 16:35 ` Louis Chauvet [this message]
2024-02-01 16:35 ` [PATCH i-g-t 2/3] tests/kms/plane: Use a complex pattern to test plane color conversion Louis Chauvet
2024-02-01 16:35 ` [PATCH i-g-t 3/3] tests/kms_rotation_crc: Remove intel guards Louis Chauvet
2024-02-01 17:16   ` Louis Chauvet
2024-02-01 18:08 ` ✓ CI.xeBAT: success for Add tests for kms_plane and kms_rotation Patchwork
2024-02-01 18:22 ` ✓ Fi.CI.BAT: " Patchwork
2024-02-01 20:07 ` ✗ Fi.CI.IGT: failure " Patchwork

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=20240201-kms_tests-v1-1-bc34c5d28b3f@bootlin.com \
    --to=louis.chauvet@bootlin.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=thomas.petazzoni@bootlin.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