public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Swati Sharma <swati2.sharma@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Juha-pekka Heikkila <juha-pekka.heikkila@intel.com>
Subject: [PATCH i-g-t, v2 3/7] tests/kms_plane: add test and limitations for odd height planar tests
Date: Wed,  7 Jan 2026 15:05:31 +0530	[thread overview]
Message-ID: <20260107093535.70116-4-swati2.sharma@intel.com> (raw)
In-Reply-To: <20260107093535.70116-1-swati2.sharma@intel.com>

From: Juha-pekka Heikkila <juha-pekka.heikkila@intel.com>

With NVL need to disable odd height and odd src y for semiplanar
yuv formats. With older devices check with crc odd src y didn't
break framebuffer on screen.

Bspec: 68903

v2: -initialize display_ver (JP)
    -rebase

Signed-off-by: Juha-pekka Heikkila <juha-pekka.heikkila@intel.com>
---
 tests/kms_plane.c | 71 +++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 66 insertions(+), 5 deletions(-)

diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 2c083f4b7..cbc006d7e 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -1245,9 +1245,11 @@ static void test_planar_settings(data_t *data)
 {
 	enum pipe pipe = PIPE_A;
 	igt_output_t *output;
-	igt_fb_t fb;
+	igt_fb_t fb, fb_ref;
 	igt_plane_t *primary;
+	igt_crc_t crc, crc_ref;
 	int devid;
+	int display_ver = -1;
 	int rval;
 
 	/*
@@ -1259,6 +1261,8 @@ static void test_planar_settings(data_t *data)
 		igt_require_intel(data->drm_fd);
 		devid = intel_get_drm_devid(data->drm_fd);
 		igt_require(intel_display_ver(devid) >= 9);
+		display_ver = intel_display_ver(devid);
+		igt_require(display_ver >= 9);
 	}
 
 	output = igt_get_single_output_for_pipe(&data->display, pipe);
@@ -1276,14 +1280,15 @@ static void test_planar_settings(data_t *data)
 				     DRM_FORMAT_MOD_LINEAR)) {
 		int expected_rval = -EINVAL;
 
-		if (intel_display_ver(devid) >= 20)
+		if (display_ver >= 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,
+						     DRM_MODE_ATOMIC_ALLOW_MODESET |
+						     DRM_MODE_ATOMIC_TEST_ONLY,
 						     NULL);
 		igt_remove_fb(data->drm_fd, &fb);
 		igt_assert_f(rval == expected_rval, "Odd width NV12 framebuffer\n");
@@ -1296,14 +1301,15 @@ static void test_planar_settings(data_t *data)
 				     DRM_FORMAT_MOD_LINEAR)) {
 		int expected_rval = -EINVAL;
 
-		if (intel_display_ver(devid) >= 20)
+		if (display_ver >= 20 && display_ver < 35)
 			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,
+						     DRM_MODE_ATOMIC_ALLOW_MODESET |
+						     DRM_MODE_ATOMIC_TEST_ONLY,
 						     NULL);
 		igt_remove_fb(data->drm_fd, &fb);
 		igt_assert_f(rval == expected_rval, "Odd height NV12 framebuffer\n");
@@ -1329,6 +1335,61 @@ static void test_planar_settings(data_t *data)
 	} else {
 		igt_debug("Odd horizontal pan NV12 framebuffer test skipped\n");
 	}
+
+	if (igt_plane_has_format_mod(primary, DRM_FORMAT_P016,
+					    DRM_FORMAT_MOD_LINEAR)) {
+		int expected_rval = -EINVAL;
+
+		if (display_ver >= 20 && display_ver < 35)
+			expected_rval = 0;
+
+		igt_create_color_fb(data->drm_fd, 256, 260,
+			      DRM_FORMAT_P016, DRM_FORMAT_MOD_LINEAR,
+			      0.0, 0.0, 1.0,
+			      &fb);
+
+		igt_plane_set_fb(primary, &fb);
+		igt_plane_set_position(primary, 1, 1);
+		igt_plane_set_size(primary, 256, 256);
+
+		/* set odd v pan and check with crc fb didn't break */
+		igt_fb_set_position(&fb, primary, 0, 3);
+		igt_fb_set_size(&fb, primary, 256, 256);
+		rval = igt_display_try_commit_atomic(&data->display,
+						     DRM_MODE_ATOMIC_ALLOW_MODESET,
+						     NULL);
+		if (rval == 0) {
+			set_legacy_lut(data, pipe, LUT_MASK);
+			igt_wait_for_vblank_count(igt_crtc_for_pipe(&data->display, pipe), 1);
+			data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe,
+						IGT_PIPE_CRC_SOURCE_AUTO);
+			igt_pipe_crc_collect_crc(data->pipe_crc, &crc);
+
+			igt_create_color_fb(data->drm_fd, 256, 256,
+				DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_LINEAR,
+				0.0, 0.0, 1.0,
+				&fb_ref);
+
+			igt_plane_set_fb(primary, &fb_ref);
+			rval = igt_display_try_commit_atomic(&data->display,
+						     DRM_MODE_ATOMIC_ALLOW_MODESET,
+						     NULL);
+
+			igt_pipe_crc_collect_crc(data->pipe_crc, &crc_ref);
+			set_legacy_lut(data, pipe, 0xffff);
+
+			igt_pipe_crc_free(data->pipe_crc);
+			data->pipe_crc = NULL;
+
+			igt_remove_fb(data->drm_fd, &fb_ref);
+			igt_assert_crc_equal(&crc_ref, &crc);
+		}
+
+		igt_remove_fb(data->drm_fd, &fb);
+		igt_assert_f(rval == expected_rval, "Odd vertical pan P016 framebuffer\n");
+	} else {
+		igt_debug("Odd vertical pan P016 framebuffer test skipped\n");
+	}
 }
 
 static bool is_pipe_limit_reached(int count)
-- 
2.25.1


  parent reply	other threads:[~2026-01-07  9:27 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-07  9:35 [PATCH i-g-t,v2 0/7] Add NVL display related test updates Swati Sharma
2026-01-07  9:35 ` [PATCH i-g-t, v2 1/7] tests/intel/kms_big_fb: NVL supports horizontal flip with linear surfaces Swati Sharma
2026-01-08 15:32   ` Juha-Pekka Heikkilä
2026-01-09  8:37   ` Karthik B S
2026-01-07  9:35 ` [PATCH i-g-t, v2 2/7] tests/intel/kms_flip_scaled_crc: add flip to reflect-x tests Swati Sharma
2026-01-08 15:31   ` Juha-Pekka Heikkilä
2026-01-09  8:47   ` Karthik B S
2026-01-07  9:35 ` Swati Sharma [this message]
2026-01-08 15:30   ` [PATCH i-g-t, v2 3/7] tests/kms_plane: add test and limitations for odd height planar tests Juha-Pekka Heikkilä
2026-01-12  8:09   ` Karthik B S
2026-01-07  9:35 ` [PATCH i-g-t, v2 4/7] tests/kms_plane: modify the condition for odd pan Swati Sharma
2026-01-08 15:31   ` Juha-Pekka Heikkilä
2026-01-12  8:11   ` Karthik B S
2026-01-07  9:35 ` [PATCH i-g-t, v2 5/7] tests/intel/kms_frontbuffer_tracking: Add FBC support to FP16 formats Swati Sharma
2026-01-07  9:35 ` [PATCH i-g-t,v2 6/7] intel-ci: Add NVL display blocklist Swati Sharma
2026-01-07  9:35 ` [PATCH i-g-t, v2 7/7] tests/intel/kms_test_config: Add NVL display blocklist entry Swati Sharma
2026-01-07 10:48 ` ✓ Xe.CI.BAT: success for Add NVL display related test updates (rev2) Patchwork
2026-01-07 10:55 ` ✓ i915.CI.BAT: " Patchwork
2026-01-07 13:17 ` ✗ Xe.CI.Full: failure " Patchwork
2026-01-07 14:24 ` ✗ i915.CI.Full: " Patchwork
2026-01-14  5:17 ` ✓ i915.CI.Full: success " 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=20260107093535.70116-4-swati2.sharma@intel.com \
    --to=swati2.sharma@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=juha-pekka.heikkila@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