[PATCH i-g-t 3/5] tests/kms_plane_scaling: Improvise the plane scaling BW issues

Naladala Ramanaidu ramanaidu.naladala at intel.com
Mon Jul 15 09:34:23 UTC 2024


Many tests are failing due to Bandwidth issues.
To eliminate this failures we change the least
working display modes.

- Observed, for higher modes Bandwidth is not sufficient
  to downscale operation on the single plane
- Add a fix, when Bandwidth is not sufficent for higher
  modes it will try the next lower display mode.
- Fixed some styling issues in the patch.
- Split the patch into small patches.

v2: Fix some styling issues in the patch . (Ankit)
v3: Split single plane and multi plane scaling functions in
    separate patch. (Ankit)
v4: Split single plane and multi planes mode changes in
    separate patch. (Ankit)

Signed-off-by: Naladala Ramanaidu <ramanaidu.naladala at intel.com>
---
 tests/kms_plane_scaling.c | 99 ++++++++++++++++++++-------------------
 1 file changed, 50 insertions(+), 49 deletions(-)

diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index e46ad130c..16b90931f 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -581,56 +581,57 @@ static void check_scaling_pipe_plane_rot(data_t *d, igt_plane_t *plane,
 	int commit_ret;
 	int w, h;
 	int width, height;
-
-	mode = igt_output_get_mode(output);
-
-	if (flag == true) {
-		width = mode->hdisplay + 100;
-		height = mode->vdisplay + 100;
-	} else {
-		width = get_width(mode, sf_plane1);
-		height = get_height(mode, sf_plane1);
-	}
-
-	if (is_upscale) {
-		w = width;
-		h = height;
-	} else {
-		w = mode->hdisplay;
-		h = mode->vdisplay;
+	bool mode_support = false;
+
+	for_each_connector_mode(output) {
+		mode = &output->config.connector->modes[j__];
+		if (is_upscale) {
+			w = get_width(mode, sf_plane1);
+			h = get_height(mode, sf_plane1);
+		} else {
+			if (flag == true) {
+				width = mode->hdisplay + 100;
+				height = mode->vdisplay + 100;
+			} else {
+				width = get_width(mode, sf_plane1);
+				height = get_height(mode, sf_plane1);
+			}
+			w = mode->hdisplay;
+			h = mode->vdisplay;
+		}
+		/*
+		 * guarantee even value width/height to avoid fractional
+		 * uv component in chroma subsampling for yuv 4:2:0 formats
+		 */
+		w = ALIGN(w, 2);
+		h = ALIGN(h, 2);
+		igt_create_fb(display->drm_fd, w, h, pixel_format,
+				modifier, &d->fb[0]);
+		igt_plane_set_fb(plane, &d->fb[0]);
+		igt_fb_set_position(&d->fb[0], plane, 0, 0);
+		igt_fb_set_size(&d->fb[0], plane, w, h);
+		igt_plane_set_position(plane, 0, 0);
+		commit_ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
+		igt_skip_on_f(commit_ret == -ERANGE || commit_ret == -EINVAL,
+				 "Unsupported resolution parameters  %dx%d\n",
+				 w, h);
+		if (is_upscale)
+			igt_plane_set_size(plane, mode->hdisplay, mode->vdisplay);
+		else
+			igt_plane_set_size(plane, width, height);
+		if (rot != IGT_ROTATION_0)
+			igt_plane_set_rotation(plane, rot);
+		commit_ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
+		if (commit_ret >= 0) {
+			igt_plane_set_fb(plane, NULL);
+			igt_plane_set_position(plane, 0, 0);
+			cleanup_fbs(d);
+			mode_support = true;
+			igt_assert_eq(commit_ret, 0);
+			break;
+		}
 	}
-
-	/*
-	 * guarantee even value width/height to avoid fractional
-	 * uv component in chroma subsampling for yuv 4:2:0 formats
-	 * */
-	w = ALIGN(w, 2);
-	h = ALIGN(h, 2);
-
-	igt_create_fb(display->drm_fd, w, h, pixel_format, modifier, &d->fb[0]);
-
-	igt_plane_set_fb(plane, &d->fb[0]);
-	igt_fb_set_position(&d->fb[0], plane, 0, 0);
-	igt_fb_set_size(&d->fb[0], plane, w, h);
-	igt_plane_set_position(plane, 0, 0);
-
-	if (is_upscale)
-		igt_plane_set_size(plane, mode->hdisplay, mode->vdisplay);
-	else
-		igt_plane_set_size(plane, width, height);
-
-	if (rot != IGT_ROTATION_0)
-		igt_plane_set_rotation(plane, rot);
-	commit_ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
-
-	igt_plane_set_fb(plane, NULL);
-	igt_plane_set_position(plane, 0, 0);
-	cleanup_fbs(d);
-
-	igt_skip_on_f(commit_ret == -ERANGE || commit_ret == -EINVAL,
-		      "Unsupported scaling factor with fb size %dx%d\n",
-		      w, h);
-	igt_assert_eq(commit_ret, 0);
+	igt_skip_on_f(!mode_support, "Bandwidth not sufficent for scaling\n");
 }
 
 static const igt_rotation_t rotations[] = {
-- 
2.43.0



More information about the Intel-gfx-trybot mailing list