All of lore.kernel.org
 help / color / mirror / Atom feed
From: Swati Sharma <swati2.sharma@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 3/3] tests/kms_plane_scaling: Add test to validate max source size
Date: Wed, 15 Feb 2023 22:29:47 +0530	[thread overview]
Message-ID: <20230215165947.15421-4-swati2.sharma@intel.com> (raw)
In-Reply-To: <20230215165947.15421-1-swati2.sharma@intel.com>

i915 specific test is added to validate max source size. This
test is expected to return -EINVAL for platforms where we have
max source width 4096 whereas it will pass on platforms having
max source width 5120. We have created fb of size 5120x4320
(=size of source) and downscaled to 3840x2400(=size of dest).

On MTL(disp_ver=14), in dmesg we can see
"[drm:skl_update_scaler [i915]] scaler_user index 0.0: src
5120x4320 dst 3840x2400 size is out of scaler range."
since max source width supported is 4096.
whereas same test will pass on ADLP(display_ver=13) since max
source width  supported is 5120.

Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
 tests/kms_plane_scaling.c | 94 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 94 insertions(+)

diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index 9737d8645..ae917b202 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -890,6 +890,95 @@ static void invalid_parameter_tests(data_t *d)
 	}
 }
 
+/*
+ *	Max source/destination width/height
+ *	for i915 driver.
+ *
+ *	DISPLAY_VER < 11
+ *		max_src_w = 4096
+ *		max_src_h = 4096
+ *		max_dst_w = 4096
+ *		max_dst_h = 4096
+ *
+ *	DISPLAY_VER = 11
+ *		max_src_w = 5120
+ *		max_src_h = 4096
+ *		max_dst_w = 5120
+ *		max_dst_h = 4096
+ *
+ *	DISPLAY_VER = 12-13
+ *		max_src_w = 5120
+ *		max_src_h = 8192
+ *		max_dst_w = 8192
+ *		max_dst_h = 8192
+ *
+ *	DISPLAY_VER = 14
+ *		max_src_w = 4096
+ *		max_src_h = 8192
+ *		max_dst_w = 8192
+ *		max_dst_h = 8192
+ */
+
+static void i915_max_source_size_test(data_t *d)
+{
+	enum pipe pipe = PIPE_A;
+	igt_output_t *output;
+	igt_fb_t fb;
+	igt_plane_t *plane;
+	int rval;
+
+	static const struct invalid_paramtests paramtests[1] = {
+		{
+			.testname = "max-src-size",
+			.planesize = {3840, 2400},
+			.params = {{~0}}
+		},
+	};
+
+	igt_fixture {
+		output = igt_get_single_output_for_pipe(&d->display, pipe);
+		igt_require(output);
+
+		igt_output_set_pipe(output, pipe);
+		plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
+
+		igt_create_fb(d->drm_fd, 5120, 4320,
+			DRM_FORMAT_XRGB8888,
+			DRM_FORMAT_MOD_NONE,
+			&fb);
+	}
+
+	igt_describe("test for validating max source size.");
+	igt_subtest_with_dynamic("i915-max-source-size") {
+		for (uint32_t i = 0; i < ARRAY_SIZE(paramtests); i++) {
+			igt_dynamic(paramtests[i].testname) {
+				igt_plane_set_position(plane, 0, 0);
+				igt_plane_set_fb(plane, &fb);
+				igt_plane_set_size(plane,
+							paramtests[i].planesize[0],
+							paramtests[i].planesize[1]);
+
+				for (uint32_t j = 0; paramtests[i].params[j].prop != ~0; j++)
+					igt_plane_set_prop_value(plane,
+								 paramtests[i].params[j].prop,
+								 paramtests[i].params[j].value);
+
+				rval = igt_display_try_commit2(&d->display, COMMIT_ATOMIC);
+
+				if (intel_display_ver(d->devid) < 11 || intel_display_ver(d->devid) >= 14)
+					igt_assert(rval == -EINVAL || rval == -ERANGE);
+				else
+					igt_assert_eq(rval, 0);
+			}
+		}
+	}
+
+	igt_fixture {
+		igt_remove_fb(d->drm_fd, &fb);
+		igt_output_set_pipe(output, PIPE_NONE);
+	}
+}
+
 static int opt_handler(int opt, int opt_index, void *_data)
 {
 	data_t *data = _data;
@@ -1055,6 +1144,11 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
 
 	invalid_parameter_tests(&data);
 
+	igt_fixture
+		igt_require_f(data.devid, "This test is valid only for i915 devices.\n");
+
+	i915_max_source_size_test(&data);
+
 	igt_fixture {
 		igt_display_fini(&data.display);
 		close(data.drm_fd);
-- 
2.25.1

  parent reply	other threads:[~2023-02-15 16:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-15 16:59 [igt-dev] [PATCH i-g-t 0/3] Validate max source size Swati Sharma
2023-02-15 16:59 ` [igt-dev] [PATCH i-g-t 1/3] tests/kms_plane_scaling: Prep work Swati Sharma
2023-02-16 15:30   ` Juha-Pekka Heikkila
2023-02-17  8:19     ` Swati Sharma
2023-02-15 16:59 ` [igt-dev] [PATCH i-g-t 2/3] tests/kms_plane_scaling: Remove extra newline Swati Sharma
2023-02-16 15:31   ` Juha-Pekka Heikkila
2023-02-17  8:20     ` Swati Sharma
2023-02-15 16:59 ` Swati Sharma [this message]
2023-02-16 15:31   ` [igt-dev] [PATCH i-g-t 3/3] tests/kms_plane_scaling: Add test to validate max source size Juha-Pekka Heikkila
2023-02-17  8:21     ` Swati Sharma
2023-02-16 19:29   ` Kamil Konieczny
2023-02-17  6:13     ` Juha-Pekka Heikkila
2023-02-17  8:29     ` Swati Sharma
2023-02-15 17:49 ` [igt-dev] ✓ Fi.CI.BAT: success for Validate max source size (rev2) Patchwork
2023-02-16 12:14 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-02-15 15:21 [igt-dev] [PATCH i-g-t 0/3] Validate max source size Swati Sharma
2023-02-15 15:21 ` [igt-dev] [PATCH i-g-t 3/3] tests/kms_plane_scaling: Add test to validate " Swati Sharma
2023-02-15 16:52 ` Swati Sharma

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=20230215165947.15421-4-swati2.sharma@intel.com \
    --to=swati2.sharma@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.