From: Swati Sharma <swati2.sharma@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] tests/kms_plane_scaling: Add test to validate max source size
Date: Fri, 23 Dec 2022 15:57:39 +0530 [thread overview]
Message-ID: <20221223102739.2900-1-swati2.sharma@intel.com> (raw)
From: Swati2 Sharma <swati2.sharma@intel.com>
Test is added for i915 devices to validate max source size.
This test is expected to pass for platforms having
11 <= display ver < 14 since for these platforms max source
size supported is 5120. For remaining platforms this test is
expected to fail since max source size supported is 4096.
In this test, we are creating 4k fb and trying to upscale it to
5k on a 5k monitor. Platforms having max source size of 5120
will be able to do it, and for remaining platforms its expected
to get -EINVAL.
Signed-off-by: Swati2 Sharma <swati2.sharma@intel.com>
---
tests/kms_plane_scaling.c | 64 +++++++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index 4c621cce..170e8c28 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -26,6 +26,8 @@
#include "igt_vec.h"
#include <math.h>
+#define HDISPLAY_5K 5120
+
IGT_TEST_DESCRIPTION("Test display plane scaling");
enum scaler_combo_test_type {
@@ -674,6 +676,49 @@ test_planes_scaling_combo(data_t *d, int w1, int h1, int w2, int h2,
igt_remove_fb(display->drm_fd, &d->fb[2]);
}
+static void
+test_max_source_size(data_t *d, enum pipe pipe, igt_output_t *output)
+{
+ igt_display_t *display = &d->display;
+ int w_4k = 4096, h_4k = 2160;
+ int w_5k = 5120, h_5k = 2880;
+ igt_plane_t *plane;
+ int ret;
+
+ cleanup_crtc(d);
+
+ igt_output_set_pipe(output, pipe);
+
+ plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
+ igt_require(plane);
+
+ igt_create_color_pattern_fb(display->drm_fd,
+ w_4k, h_4k,
+ DRM_FORMAT_XRGB8888,
+ I915_TILING_NONE,
+ 1.0, 0.0, 0.0, &d->fb[0]);
+
+ igt_plane_set_fb(plane, &d->fb[0]);
+ igt_plane_set_size(plane, w_5k, h_5k);
+
+ /* This commit is expected to pass for platforms having
+ * 11 <= display ver < 14 since for these platforms max source
+ * size supported is 5120. For remaining platforms, this test is
+ * expected to fail since max source size supported is 4096.
+ * In dmesg we can find: size is out of scaler range in the case
+ * of failure.
+ * */
+ ret = igt_display_try_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+
+ if (intel_display_ver(d->devid) >= 11 && intel_display_ver(d->devid) < 14)
+ igt_assert_eq(ret, 0);
+ else
+ igt_assert_eq(ret, -EINVAL);
+
+ igt_plane_set_fb(plane, NULL);
+ igt_remove_fb(display->drm_fd, &d->fb[0]);
+}
+
static void
test_invalid_num_scalers(data_t *d, enum pipe pipe, igt_output_t *output)
{
@@ -970,6 +1015,25 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
}
}
+ igt_fixture
+ igt_require_f(data.devid, "This test is valid only for i915 devices\n");
+
+ igt_describe("Test for max source size.");
+ igt_subtest_with_dynamic("max-source-size") {
+ for_each_pipe_with_valid_output(&data.display, pipe, output) {
+ drmModeModeInfo *mode;
+
+ mode = igt_output_get_mode(output);
+
+ if (mode->hdisplay < HDISPLAY_5K)
+ continue;
+
+ igt_dynamic_f("pipe-%s-%s-max-source-size",
+ kmstest_pipe_name(pipe), igt_output_name(output))
+ test_max_source_size(&data, pipe, output);
+ }
+ }
+
igt_describe("Negative test for number of scalers per pipe.");
igt_subtest_with_dynamic("invalid-num-scalers") {
for_each_pipe_with_valid_output(&data.display, pipe, output)
--
2.25.1
next reply other threads:[~2022-12-23 10:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-23 10:27 Swati Sharma [this message]
2022-12-23 11:04 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_plane_scaling: Add test to validate max source size Patchwork
2022-12-23 12:29 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-12-30 10:31 ` [igt-dev] [PATCH i-g-t] " Luca Coelho
[not found] ` <23be17762e6c65a5ceebaa4a27d00b566dd9e5a2.camel@intel.com>
2022-12-30 18:57 ` 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=20221223102739.2900-1-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox