[PATCH i-g-t 1/5] tests/kms_plane_scaling: Update the single plane scaling function arguments
Naladala Ramanaidu
ramanaidu.naladala at intel.com
Wed Jul 17 04:34:34 UTC 2024
Update the helper test_scaler_with_modifier_pipe,
test_scaler_with_rotation_pipe and test_scaler_with_pixel_format_pipe
to use a scaling_factor and is_clip_clamp flag instead of explicit
width and height parameters.This change simplifies the function interfaces
and allows for testing scenarios, where we need to recalculate the width
and height based on the display mode.Adjusted all function calls to match
new argument order.
Signed-off-by: Naladala Ramanaidu <ramanaidu.naladala at intel.com>
---
tests/kms_plane_scaling.c | 90 +++++++++++++++++++++++++++------------
1 file changed, 62 insertions(+), 28 deletions(-)
diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index 3f63d3cf4..1cb4a0cc2 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -693,7 +693,8 @@ static const uint64_t modifiers[] = {
};
static void test_scaler_with_modifier_pipe(data_t *d,
- int width, int height,
+ double sf_plane,
+ bool is_clip_clamp,
bool is_upscale,
enum pipe pipe,
igt_output_t *output)
@@ -701,11 +702,22 @@ static void test_scaler_with_modifier_pipe(data_t *d,
igt_display_t *display = &d->display;
unsigned format = DRM_FORMAT_XRGB8888;
igt_plane_t *plane;
+ drmModeModeInfo *mode;
+ int width, height;
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;
@@ -725,7 +737,8 @@ static void test_scaler_with_modifier_pipe(data_t *d,
}
static void test_scaler_with_rotation_pipe(data_t *d,
- int width, int height,
+ double sf_plane,
+ bool is_clip_clamp,
bool is_upscale,
enum pipe pipe,
igt_output_t *output)
@@ -733,11 +746,21 @@ static void test_scaler_with_rotation_pipe(data_t *d,
igt_display_t *display = &d->display;
unsigned format = DRM_FORMAT_XRGB8888;
uint64_t modifier = DRM_FORMAT_MOD_LINEAR;
+ drmModeModeInfo *mode;
+ int width, height;
igt_plane_t *plane;
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)
@@ -757,16 +780,30 @@ static void test_scaler_with_rotation_pipe(data_t *d,
}
}
-static void test_scaler_with_pixel_format_pipe(data_t *d, int width, int height, bool is_upscale,
- enum pipe pipe, igt_output_t *output)
+static void test_scaler_with_pixel_format_pipe(data_t *d, double sf_plane,
+ bool is_clip_clamp,
+ bool is_upscale,
+ enum pipe pipe,
+ igt_output_t *output)
{
igt_display_t *display = &d->display;
uint64_t modifier = DRM_FORMAT_MOD_LINEAR;
igt_plane_t *plane;
+ drmModeModeInfo *mode;
+ int width, height;
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;
@@ -1307,13 +1344,12 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
continue;
igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
- drmModeModeInfo *mode = igt_output_get_mode(output);
test_scaler_with_pixel_format_pipe(&data,
- get_width(mode, scaler_with_pixel_format_tests[index].sf),
- get_height(mode, scaler_with_pixel_format_tests[index].sf),
- scaler_with_pixel_format_tests[index].is_upscale,
- pipe, output);
+ scaler_with_pixel_format_tests[index].sf,
+ false,
+ scaler_with_pixel_format_tests[index].is_upscale,
+ pipe, output);
}
break;
}
@@ -1332,13 +1368,12 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
continue;
igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
- drmModeModeInfo *mode = igt_output_get_mode(output);
test_scaler_with_rotation_pipe(&data,
- get_width(mode, scaler_with_rotation_tests[index].sf),
- get_height(mode, scaler_with_rotation_tests[index].sf),
- scaler_with_rotation_tests[index].is_upscale,
- pipe, output);
+ scaler_with_rotation_tests[index].sf,
+ false,
+ scaler_with_rotation_tests[index].is_upscale,
+ pipe, output);
}
break;
}
@@ -1357,13 +1392,12 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
continue;
igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
- drmModeModeInfo *mode = igt_output_get_mode(output);
test_scaler_with_modifier_pipe(&data,
- get_width(mode, scaler_with_modifiers_tests[index].sf),
- get_height(mode, scaler_with_modifiers_tests[index].sf),
- scaler_with_modifiers_tests[index].is_upscale,
- pipe, output);
+ scaler_with_modifiers_tests[index].sf,
+ false,
+ scaler_with_modifiers_tests[index].is_upscale,
+ pipe, output);
}
break;
}
@@ -1381,10 +1415,10 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
continue;
igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
- drmModeModeInfo *mode = igt_output_get_mode(output);
- test_scaler_with_pixel_format_pipe(&data, mode->hdisplay + 100,
- mode->vdisplay + 100, false, pipe, output);
+ test_scaler_with_pixel_format_pipe(&data, 0.0, true,
+ false, pipe,
+ output);
}
break;
}
@@ -1401,10 +1435,10 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
continue;
igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
- drmModeModeInfo *mode = igt_output_get_mode(output);
- test_scaler_with_rotation_pipe(&data, mode->hdisplay + 100,
- mode->vdisplay + 100, false, pipe, output);
+ test_scaler_with_rotation_pipe(&data, 0.0, true,
+ false, pipe,
+ output);
}
break;
}
@@ -1421,9 +1455,9 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
continue;
igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
- drmModeModeInfo *mode = igt_output_get_mode(output);
- test_scaler_with_modifier_pipe(&data, mode->hdisplay + 100,
- mode->vdisplay + 100, false, pipe, output);
+ test_scaler_with_modifier_pipe(&data, 0.0, true,
+ false, pipe,
+ output);
}
break;
}
--
2.43.0
More information about the Intel-gfx-trybot
mailing list