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

Naladala Ramanaidu ramanaidu.naladala at intel.com
Mon Jul 15 09:34:24 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 and multi-plane scaling operations.
- 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.

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 plane mode changes in separate
    patch (Ankit)

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

diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index 16b90931f..948ffb508 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -862,45 +862,50 @@ __test_planes_scaling_combo(data_t *d, double sf_plane1,
 	drmModeModeInfo *mode;
 	int ret;
 	int w1, h1, w2, h2;
+	bool mode_support = false;
 
-	mode = igt_output_get_mode(output);
-	w1 = get_width(mode, sf_plane1);
-	h1 = get_height(mode, sf_plane1);
-	w2 = get_width(mode, sf_plane2);
-	h2 = get_height(mode, sf_plane2);
-
-	igt_plane_set_fb(p1, fb1);
-	igt_plane_set_fb(p2, fb2);
+	for_each_connector_mode(output) {
+		mode = &output->config.connector->modes[j__];
+		w1 = get_width(mode, sf_plane1);
+		h1 = get_height(mode, sf_plane1);
+		w2 = get_width(mode, sf_plane2);
+		h2 = get_height(mode, sf_plane2);
+
+		igt_plane_set_fb(p1, fb1);
+		igt_plane_set_fb(p2, fb2);
+
+		switch (test_type) {
+		case TEST_PLANES_UPSCALE:
+			igt_plane_set_size(p1, mode->hdisplay, mode->vdisplay);
+			igt_plane_set_size(p2, mode->hdisplay - 20, mode->vdisplay - 20);
+			break;
+		case TEST_PLANES_DOWNSCALE:
+			igt_plane_set_size(p1, w1, h1);
+			igt_plane_set_size(p2, w2, h2);
+			break;
+		case TEST_PLANES_UPSCALE_DOWNSCALE:
+			igt_plane_set_size(p1, mode->hdisplay, mode->vdisplay);
+			igt_plane_set_size(p2, w2, h2);
+			break;
+		case TEST_PLANES_DOWNSCALE_UPSCALE:
+			igt_plane_set_size(p1, w1, h1);
+			igt_plane_set_size(p2, mode->hdisplay, mode->vdisplay);
+			break;
+		default:
+			igt_assert(0);
+		}
 
-	switch (test_type) {
-	case TEST_PLANES_UPSCALE:
-		igt_plane_set_size(p1, mode->hdisplay, mode->vdisplay);
-		igt_plane_set_size(p2, mode->hdisplay - 20, mode->vdisplay - 20);
-		break;
-	case TEST_PLANES_DOWNSCALE:
-		igt_plane_set_size(p1, w1, h1);
-		igt_plane_set_size(p2, w2, h2);
-		break;
-	case TEST_PLANES_UPSCALE_DOWNSCALE:
-		igt_plane_set_size(p1, mode->hdisplay, mode->vdisplay);
-		igt_plane_set_size(p2, w2, h2);
-		break;
-	case TEST_PLANES_DOWNSCALE_UPSCALE:
-		igt_plane_set_size(p1, w1, h1);
-		igt_plane_set_size(p2, mode->hdisplay, mode->vdisplay);
-		break;
-	default:
-		igt_assert(0);
+		ret = igt_display_try_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET,
+				NULL);
+		if (ret >= 0) {
+			igt_plane_set_fb(p1, NULL);
+			igt_plane_set_fb(p2, NULL);
+			igt_assert_eq(ret, 0);
+			mode_support = true;
+			break;
+		}
 	}
-
-	ret = igt_display_try_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
-
-	igt_plane_set_fb(p1, NULL);
-	igt_plane_set_fb(p2, NULL);
-
-	igt_skip_on_f(ret == -EINVAL || ret == -ERANGE,
-		      "Scaling op not supported by driver\n");
-	igt_assert_eq(ret, 0);
+	igt_skip_on_f(!mode_support, "Bandwidth not sufficent for Multi Plane scaling\n");
 }
 
 static void setup_fb(int fd, int width, int height, struct igt_fb *fb)
-- 
2.43.0



More information about the Intel-gfx-trybot mailing list