From: Swati Sharma <swati2.sharma@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [v2 1/6] tests/kms_plane_scaling: Removal of plane-scaling subtest
Date: Fri, 21 Jan 2022 19:18:28 +0530 [thread overview]
Message-ID: <20220121134833.28740-2-swati2.sharma@intel.com> (raw)
In-Reply-To: <20220121134833.28740-1-swati2.sharma@intel.com>
The test case has dead code, primary_plane_scaling is always 0.
Also, upscaling and downscaling scenarios seems little bit messy.
Lets simplify those scenarios by introducing new subtests covering both
upscaling and downscaling.
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
tests/kms_plane_scaling.c | 179 --------------------------------------
1 file changed, 179 deletions(-)
diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index 85db11ee..4e2be7f2 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -323,178 +323,6 @@ static void test_scaler_with_pixel_format_pipe(data_t *d, enum pipe pipe, igt_ou
}
}
-/* does iterative scaling on plane2 */
-static void iterate_plane_scaling(data_t *d, drmModeModeInfo *mode)
-{
- igt_display_t *display = &d->display;
-
- if (mode->hdisplay >= d->fb[1].width) {
- int w, h;
- /* fixed fb */
- igt_fb_set_position(&d->fb[1], d->plane2, 0, 0);
- igt_fb_set_size(&d->fb[1], d->plane2, d->fb[1].width, d->fb[1].height);
- igt_plane_set_position(d->plane2, 0, 0);
-
- /* adjust plane size */
- for (w = d->fb[1].width; w <= mode->hdisplay; w+=10) {
- h = w * d->fb[1].height / d->fb[1].width;
- igt_plane_set_size(d->plane2, w, h);
- igt_display_commit2(display, COMMIT_ATOMIC);
- }
- } else {
- int w, h;
- /* fixed plane */
- igt_plane_set_position(d->plane2, 0, 0);
- igt_plane_set_size(d->plane2, mode->hdisplay, mode->vdisplay);
- igt_fb_set_position(&d->fb[1], d->plane2, 0, 0);
-
- /* adjust fb size */
- for (w = mode->hdisplay; w <= d->fb[1].width; w+=10) {
- /* Source coordinates must not be clipped. */
- h = min(w * mode->hdisplay / mode->vdisplay, d->fb[1].height);
- igt_fb_set_size(&d->fb[1], d->plane2, w, h);
- igt_display_commit2(display, COMMIT_ATOMIC);
- }
- }
-}
-
-static void
-test_plane_scaling_on_pipe(data_t *d, enum pipe pipe, igt_output_t *output)
-{
- igt_display_t *display = &d->display;
- igt_pipe_t *pipe_obj = &display->pipes[pipe];
- drmModeModeInfo *mode;
- int primary_plane_scaling = 0; /* For now */
- uint64_t modifier = is_i915_device(display->drm_fd) ?
- I915_FORMAT_MOD_X_TILED : DRM_FORMAT_MOD_LINEAR;
-
- igt_require(get_num_scalers(d, pipe) > 0);
-
- igt_skip_on(!igt_display_has_format_mod(display, DRM_FORMAT_XRGB8888,
- modifier));
-
- mode = igt_output_get_mode(output);
-
- /* Set up display with plane 1 */
- d->plane1 = igt_pipe_get_plane_type(pipe_obj, DRM_PLANE_TYPE_PRIMARY);
- prepare_crtc(d, output, pipe, d->plane1, mode);
-
- igt_create_color_pattern_fb(display->drm_fd, 600, 600,
- DRM_FORMAT_XRGB8888,
- modifier,
- .5, .5, .5, &d->fb[1]);
-
- igt_create_pattern_fb(d->drm_fd,
- mode->hdisplay, mode->vdisplay,
- DRM_FORMAT_XRGB8888,
- modifier,
- &d->fb[2]);
-
- if (primary_plane_scaling) {
- /* Primary plane upscaling */
- igt_fb_set_position(&d->fb[0], d->plane1, 100, 100);
- igt_fb_set_size(&d->fb[0], d->plane1, 500, 500);
- igt_plane_set_position(d->plane1, 0, 0);
- igt_plane_set_size(d->plane1, mode->hdisplay, mode->vdisplay);
- igt_display_commit2(display, COMMIT_ATOMIC);
-
- /* Primary plane 1:1 no scaling */
- igt_fb_set_position(&d->fb[0], d->plane1, 0, 0);
- igt_fb_set_size(&d->fb[0], d->plane1, d->fb[0].width, d->fb[0].height);
- igt_plane_set_position(d->plane1, 0, 0);
- igt_plane_set_size(d->plane1, mode->hdisplay, mode->vdisplay);
- igt_display_commit2(display, COMMIT_ATOMIC);
- }
-
- /* Set up fb[1]->plane2 mapping. */
- d->plane2 = igt_pipe_get_plane_type_index(pipe_obj,
- DRM_PLANE_TYPE_OVERLAY, 0);
-
- if (!d->plane2) {
- igt_debug("Plane-2 doesnt exist on pipe %s\n", kmstest_pipe_name(pipe));
- return;
- }
-
- igt_plane_set_fb(d->plane2, &d->fb[1]);
-
- /* 2nd plane windowed */
- igt_fb_set_position(&d->fb[1], d->plane2, 100, 100);
- igt_fb_set_size(&d->fb[1], d->plane2, d->fb[1].width-200, d->fb[1].height-200);
- igt_plane_set_position(d->plane2, 100, 100);
- igt_plane_set_size(d->plane2, mode->hdisplay-200, mode->vdisplay-200);
- igt_display_commit2(display, COMMIT_ATOMIC);
-
- iterate_plane_scaling(d, mode);
-
- /* 2nd plane up scaling */
- igt_fb_set_position(&d->fb[1], d->plane2, 100, 100);
- igt_fb_set_size(&d->fb[1], d->plane2, 500, 500);
- igt_plane_set_position(d->plane2, 10, 10);
- igt_plane_set_size(d->plane2, mode->hdisplay-20, mode->vdisplay-20);
- igt_display_commit2(display, COMMIT_ATOMIC);
-
- /* 2nd plane downscaling */
- igt_fb_set_position(&d->fb[1], d->plane2, 0, 0);
- igt_fb_set_size(&d->fb[1], d->plane2, d->fb[1].width, d->fb[1].height);
- igt_plane_set_position(d->plane2, 10, 10);
-
- /* Downscale (10/9)x of original image */
- igt_plane_set_size(d->plane2, (d->fb[1].width * 10)/9, (d->fb[1].height * 10)/9);
- igt_display_commit2(display, COMMIT_ATOMIC);
-
- if (primary_plane_scaling) {
- /* Primary plane up scaling */
- igt_fb_set_position(&d->fb[0], d->plane1, 100, 100);
- igt_fb_set_size(&d->fb[0], d->plane1, 500, 500);
- igt_plane_set_position(d->plane1, 0, 0);
- igt_plane_set_size(d->plane1, mode->hdisplay, mode->vdisplay);
- igt_display_commit2(display, COMMIT_ATOMIC);
- }
-
- /* Set up fb[2]->plane3 mapping. */
- d->plane3 = igt_pipe_get_plane_type_index(pipe_obj,
- DRM_PLANE_TYPE_OVERLAY, 1);
- if(!d->plane3) {
- igt_debug("Plane-3 doesnt exist on pipe %s\n", kmstest_pipe_name(pipe));
- return;
- }
-
- igt_plane_set_fb(d->plane3, &d->fb[2]);
-
- /* 3rd plane windowed - no scaling */
- igt_fb_set_position(&d->fb[2], d->plane3, 100, 100);
- igt_fb_set_size(&d->fb[2], d->plane3, d->fb[2].width-300, d->fb[2].height-300);
- igt_plane_set_position(d->plane3, 100, 100);
- igt_plane_set_size(d->plane3, mode->hdisplay-300, mode->vdisplay-300);
- igt_display_commit2(display, COMMIT_ATOMIC);
-
- /* Switch scaler from plane 2 to plane 3 */
- igt_fb_set_position(&d->fb[1], d->plane2, 100, 100);
- igt_fb_set_size(&d->fb[1], d->plane2, d->fb[1].width-200, d->fb[1].height-200);
- igt_plane_set_position(d->plane2, 100, 100);
- igt_plane_set_size(d->plane2, d->fb[1].width-200, d->fb[1].height-200);
-
- igt_fb_set_position(&d->fb[2], d->plane3, 100, 100);
- igt_fb_set_size(&d->fb[2], d->plane3, d->fb[2].width-400, d->fb[2].height-400);
- igt_plane_set_position(d->plane3, 10, 10);
- igt_plane_set_size(d->plane3, mode->hdisplay-300, mode->vdisplay-300);
- igt_display_commit2(display, COMMIT_ATOMIC);
-
- if (primary_plane_scaling) {
- /* Switch scaler from plane 1 to plane 2 */
- igt_fb_set_position(&d->fb[0], d->plane1, 0, 0);
- igt_fb_set_size(&d->fb[0], d->plane1, d->fb[0].width, d->fb[0].height);
- igt_plane_set_position(d->plane1, 0, 0);
- igt_plane_set_size(d->plane1, mode->hdisplay, mode->vdisplay);
-
- igt_fb_set_position(&d->fb[1], d->plane2, 100, 100);
- igt_fb_set_size(&d->fb[1], d->plane2, d->fb[1].width-500,d->fb[1].height-500);
- igt_plane_set_position(d->plane2, 100, 100);
- igt_plane_set_size(d->plane2, mode->hdisplay-200, mode->vdisplay-200);
- igt_display_commit2(display, COMMIT_ATOMIC);
- }
-}
-
static void
__test_scaler_with_clipping_clamping_scenario(data_t *d, drmModeModeInfo *mode)
{
@@ -719,13 +547,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
igt_subtest_group {
igt_output_t *output;
- igt_describe("Tests plane scaling per pipe.");
- igt_subtest_with_dynamic("plane-scaling") {
- for_each_pipe_with_single_output(&data.display, pipe, output)
- igt_dynamic_f("pipe-%s-plane-scaling", kmstest_pipe_name(pipe))
- test_plane_scaling_on_pipe(&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:34 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 ` Swati Sharma [this message]
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 ` [igt-dev] [v2 6/6] tests/kms_plane_scaling: Add negative test to check num of scalers Swati Sharma
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-2-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.