[PATCH i-g-t 3/4] tests/kms_plane_scaling: Improvise the plane scaling BW issues
Naladala Ramanaidu
ramanaidu.naladala at intel.com
Wed Jul 17 02:40:35 UTC 2024
Anticipating bandwidth issues, we expect many tests to fail. To
address these failures, we will switch to the next lower display
mode.Some higher display modes will be identified as insufficient
for downscaling operations on plane scaling. As a solution, we
will implement a fix: when bandwidth is inadequate for current
modes, the system will automatically attempt the next lower
display mode.
Signed-off-by: Naladala Ramanaidu <ramanaidu.naladala at intel.com>
---
tests/kms_plane_scaling.c | 132 +++++++++++++++++++++++---------------
1 file changed, 82 insertions(+), 50 deletions(-)
diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index 475e6ceff..438f5c94a 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -566,7 +566,7 @@ static void cleanup_crtc(data_t *data)
cleanup_fbs(data);
}
-static void check_scaling_pipe_plane_rot(data_t *d, igt_plane_t *plane,
+static int check_scaling_pipe_plane_rot(data_t *d, igt_plane_t *plane,
uint32_t pixel_format,
uint64_t modifier,
int width, int height,
@@ -603,7 +603,9 @@ static void check_scaling_pipe_plane_rot(data_t *d, igt_plane_t *plane,
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,
+ "Mode fail %dx%d\n", w, h);
if (is_upscale)
igt_plane_set_size(plane, mode->hdisplay, mode->vdisplay);
else
@@ -616,11 +618,11 @@ static void check_scaling_pipe_plane_rot(data_t *d, igt_plane_t *plane,
igt_plane_set_fb(plane, NULL);
igt_plane_set_position(plane, 0, 0);
cleanup_fbs(d);
+ if (commit_ret == -ERANGE || commit_ret == -EINVAL)
+ igt_info("Unsupported scaling factor with fb size %dx%d\n",
+ w, h);
+ return commit_ret;
- 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);
}
static const igt_rotation_t rotations[] = {
@@ -704,20 +706,12 @@ static void test_scaler_with_modifier_pipe(data_t *d,
igt_plane_t *plane;
drmModeModeInfo *mode;
int width, height;
+ int ret;
cleanup_crtc(d);
igt_output_set_pipe(output, pipe);
- mode = igt_output_get_mode(output);
- if (is_clip_clamp == true) {
- width = mode->hdisplay + 100;
- height = mode->vdisplay + 100;
- } else {
- width = get_width(mode, sf_plane);
- height = get_height(mode, sf_plane);
- }
-
for_each_plane_on_pipe(display, pipe, plane) {
if (plane->type == DRM_PLANE_TYPE_CURSOR)
continue;
@@ -726,13 +720,30 @@ static void test_scaler_with_modifier_pipe(data_t *d,
uint64_t modifier = modifiers[i];
if (igt_plane_has_format_mod(plane, format, modifier))
- check_scaling_pipe_plane_rot(d, plane,
- format, modifier,
- width, height,
- is_upscale,
- pipe, output,
- IGT_ROTATION_0);
+ for (int k = 0; k < output->config.connector->count_modes; k++) {
+ mode = &output->config.connector->modes[k];
+ igt_output_override_mode(output, mode);
+ if (is_clip_clamp == true) {
+ width = mode->hdisplay + 100;
+ height = mode->vdisplay + 100;
+ } else {
+ width = get_width(mode, sf_plane);
+ height = get_height(mode, sf_plane);
+ }
+ igt_info("Trying mode %dx%d on plane %d\n",
+ mode->hdisplay, mode->vdisplay, j__);
+ ret = check_scaling_pipe_plane_rot(d, plane,
+ format, modifier,
+ width, height,
+ is_upscale,
+ pipe, output,
+ IGT_ROTATION_0);
+ if (ret == 0)
+ break;
+ }
}
+ igt_skip_on_f(ret == -ERANGE || ret == -EINVAL,
+ "Unsupported scaling factor on plane%d\n", j__);
}
}
@@ -749,18 +760,11 @@ static void test_scaler_with_rotation_pipe(data_t *d,
drmModeModeInfo *mode;
int width, height;
igt_plane_t *plane;
+ int ret;
cleanup_crtc(d);
igt_output_set_pipe(output, pipe);
- mode = igt_output_get_mode(output);
- if (is_clip_clamp == true) {
- width = mode->hdisplay + 100;
- height = mode->vdisplay + 100;
- } else {
- width = get_width(mode, sf_plane);
- height = get_height(mode, sf_plane);
- }
for_each_plane_on_pipe(display, pipe, plane) {
if (plane->type == DRM_PLANE_TYPE_CURSOR)
@@ -769,14 +773,32 @@ static void test_scaler_with_rotation_pipe(data_t *d,
for (int i = 0; i < ARRAY_SIZE(rotations); i++) {
igt_rotation_t rot = rotations[i];
- if (igt_plane_has_rotation(plane, rot))
- check_scaling_pipe_plane_rot(d, plane,
- format, modifier,
- width, height,
- is_upscale,
- pipe, output,
- rot);
+ if (igt_plane_has_rotation(plane, rot)) {
+ for (int k = 0; k < output->config.connector->count_modes; k++) {
+ mode = &output->config.connector->modes[k];
+ igt_output_override_mode(output, mode);
+ if (is_clip_clamp == true) {
+ width = mode->hdisplay + 100;
+ height = mode->vdisplay + 100;
+ } else {
+ width = get_width(mode, sf_plane);
+ height = get_height(mode, sf_plane);
+ }
+ igt_info("Trying mode %dx%d on plane %d\n",
+ mode->hdisplay, mode->vdisplay, j__);
+ ret = check_scaling_pipe_plane_rot(d, plane,
+ format, modifier,
+ width, height,
+ is_upscale,
+ pipe, output,
+ rot);
+ if (ret == 0)
+ break;
+ }
+ }
}
+ igt_skip_on_f(ret == -ERANGE || ret == -EINVAL,
+ "Unsupported scaling factor on plane%d\n", j__);
}
}
@@ -791,19 +813,11 @@ static void test_scaler_with_pixel_format_pipe(data_t *d, double sf_plane,
igt_plane_t *plane;
drmModeModeInfo *mode;
int width, height;
+ int ret = 0;
cleanup_crtc(d);
igt_output_set_pipe(output, pipe);
- mode = igt_output_get_mode(output);
-
- if (is_clip_clamp == true) {
- width = mode->hdisplay + 100;
- height = mode->vdisplay + 100;
- } else {
- width = get_width(mode, sf_plane);
- height = get_height(mode, sf_plane);
- }
for_each_plane_on_pipe(display, pipe, plane) {
struct igt_vec tested_formats;
@@ -822,14 +836,32 @@ static void test_scaler_with_pixel_format_pipe(data_t *d, double sf_plane,
if (test_format(d, &tested_formats, format) &&
igt_plane_has_format_mod(plane, format, modifier) &&
can_scale(d, format))
- check_scaling_pipe_plane_rot(d, plane,
- format, modifier,
- width, height,
- is_upscale,
- pipe, output, IGT_ROTATION_0);
+ for (int k = 0; k < output->config.connector->count_modes; k++) {
+ mode = &output->config.connector->modes[k];
+ igt_output_override_mode(output, mode);
+ if (is_clip_clamp == true) {
+ width = mode->hdisplay + 100;
+ height = mode->vdisplay + 100;
+ } else {
+ width = get_width(mode, sf_plane);
+ height = get_height(mode, sf_plane);
+ }
+ igt_info("Trying mode %dx%d on plane %d\n",
+ mode->hdisplay, mode->vdisplay, j__);
+ ret = check_scaling_pipe_plane_rot(d, plane,
+ format, modifier,
+ width, height,
+ is_upscale,
+ pipe, output,
+ IGT_ROTATION_0);
+ if (ret == 0)
+ break;
+ }
}
igt_vec_fini(&tested_formats);
+ igt_skip_on_f(ret == -ERANGE || ret == -EINVAL,
+ "Unsupported scaling factor on plane%d\n", j__);
}
}
--
2.43.0
More information about the Intel-gfx-trybot
mailing list