From: Swati Sharma <swati2.sharma@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [v2 6/6] tests/kms_plane_scaling: Add negative test to check num of scalers
Date: Fri, 21 Jan 2022 19:18:33 +0530 [thread overview]
Message-ID: <20220121134833.28740-7-swati2.sharma@intel.com> (raw)
In-Reply-To: <20220121134833.28740-1-swati2.sharma@intel.com>
To validate i915 supports max of 2 scalers, applied upscaling on
3 planes simultaneously. This is a negative test and commit is expected
to fail.
v2: -add check for min 2 scalers
-add igt_require() for overlay planes, fixes CRASH on KBL
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
tests/kms_plane_scaling.c | 62 +++++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index f5457bc7..d6a88829 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -385,6 +385,61 @@ test_upscale_downscale_plane_scaling_on_pipe(data_t *d, enum pipe pipe, igt_outp
igt_display_commit2(display, COMMIT_ATOMIC);
}
+static void
+test_invalid_num_scalers(data_t *d, enum pipe pipe, igt_output_t *output)
+{
+ drmModeModeInfo *mode;
+ igt_display_t *display = &d->display;
+ igt_pipe_t *pipe_obj = &display->pipes[pipe];
+
+ igt_require(get_num_scalers(d, pipe) >= 2);
+
+ mode = igt_output_get_mode(output);
+
+ /* setup display with primary plane */
+ d->plane1 = igt_pipe_get_plane_type(pipe_obj, DRM_PLANE_TYPE_PRIMARY);
+ prepare_crtc(d, output, pipe, d->plane1, mode);
+
+ d->plane2 = igt_pipe_get_plane_type_index(pipe_obj, DRM_PLANE_TYPE_OVERLAY, 0);
+ igt_require(d->plane2);
+ d->plane3 = igt_pipe_get_plane_type_index(pipe_obj, DRM_PLANE_TYPE_OVERLAY, 1);
+ igt_require(d->plane3);
+ d->plane4 = igt_pipe_get_plane_type_index(pipe_obj, DRM_PLANE_TYPE_OVERLAY, 2);
+ igt_require(d->plane4);
+
+ igt_create_color_pattern_fb(display->drm_fd,
+ mode->hdisplay / 3, mode->vdisplay / 3,
+ DRM_FORMAT_XRGB8888,
+ I915_TILING_NONE,
+ 1.0, 0.0, 0.0, &d->fb[1]);
+ igt_create_color_pattern_fb(display->drm_fd,
+ mode->hdisplay / 3, mode->vdisplay / 3,
+ DRM_FORMAT_XRGB8888,
+ I915_TILING_NONE,
+ 0.0, 1.0, 0.0, &d->fb[2]);
+ igt_create_color_pattern_fb(display->drm_fd,
+ mode->hdisplay / 3, mode->vdisplay / 3,
+ DRM_FORMAT_XRGB8888,
+ I915_TILING_NONE,
+ 0.0, 0.0, 1.0, &d->fb[3]);
+
+ igt_plane_set_fb(d->plane2, &d->fb[1]);
+ igt_plane_set_fb(d->plane3, &d->fb[2]);
+ igt_plane_set_fb(d->plane4, &d->fb[3]);
+
+ /* 1st plane upscaling */
+ igt_plane_set_size(d->plane2, mode->hdisplay, mode->vdisplay);
+
+ /* 2nd plane upscaling */
+ igt_plane_set_size(d->plane3, mode->hdisplay, mode->vdisplay);
+
+ /* 3rd plane upscaling */
+ igt_plane_set_size(d->plane4, mode->hdisplay, mode->vdisplay);
+
+ /* This commit is expectd to fail as we can have max 2 scalers/pipe */
+ igt_assert_eq(igt_display_try_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL), -EINVAL);
+}
+
static void test_scaler_with_rotation_pipe(data_t *d, enum pipe pipe,
igt_output_t *output)
{
@@ -711,6 +766,13 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
test_upscale_downscale_plane_scaling_on_pipe(&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)
+ igt_dynamic_f("%s-pipe-%s-invalid-num-scalers", igt_output_name(output), kmstest_pipe_name(pipe))
+ test_invalid_num_scalers(&data, pipe, output);
+ }
+
igt_describe("Tests scaling with pixel formats.");
igt_subtest_with_dynamic("scaler-with-pixel-format") {
for_each_pipe_with_single_output(&data.display, pipe, output)
--
2.25.1
next prev parent reply other threads:[~2022-01-21 13:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-21 13:48 [igt-dev] [v2 0/6] Addition of new plane scaling test cases Swati Sharma
2022-01-21 13:48 ` [igt-dev] [v2 1/6] tests/kms_plane_scaling: Removal of plane-scaling subtest Swati Sharma
2022-01-21 13:48 ` [igt-dev] [v2 2/6] tests/kms_plane_scaling: Add output name in dynamic subtests Swati Sharma
2022-01-21 13:48 ` [igt-dev] [v2 3/6] tests/kms_plane_scaling: Upscaling on 2 planes Swati Sharma
2022-01-21 13:48 ` [igt-dev] [v2 4/6] tests/kms_plane_scaling: Downscaling " Swati Sharma
2022-01-21 13:48 ` [igt-dev] [v2 5/6] tests/kms_plane_scaling: Upscaling and downscaling scenario Swati Sharma
2022-01-21 13:48 ` Swati Sharma [this message]
2022-01-21 14:19 ` [igt-dev] ✓ Fi.CI.BAT: success for Addition of new plane scaling test cases (rev2) Patchwork
2022-01-21 17:31 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-01-24 11:13 ` [igt-dev] [v2 0/6] Addition of new plane scaling test cases Ville Syrjälä
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=20220121134833.28740-7-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.