[PATCH i-g-t 3/3] tests/kms_color: Update all tests to use high resolution mode

Bhanuprakash Modem bhanuprakash.modem at intel.com
Fri May 24 10:12:02 UTC 2024


Instead of using the default mode, use the mode with highest
possible resolution.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 tests/kms_color.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/kms_color.c b/tests/kms_color.c
index 645a03537..75d28477b 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -771,6 +771,8 @@ static void test_cleanup(data_t *data)
 {
 	igt_pipe_crc_free(data->pipe_crc);
 	data->pipe_crc = NULL;
+	if (data->mode)
+		free(data->mode);
 }
 
 static void
@@ -785,7 +787,9 @@ run_gamma_degamma_tests_for_pipe(data_t *data, enum pipe p,
 	 */
 	data->color_depth = 8;
 	data->drm_format = DRM_FORMAT_XRGB8888;
-	data->mode = igt_output_get_mode(data->output);
+	data->mode = malloc(sizeof(drmModeModeInfo));
+	igt_assert(data->mode);
+	memcpy(data->mode, output_mode_with_max_resolution(data->output), sizeof(drmModeModeInfo));
 
 	if (!pipe_output_combo_valid(data, p))
 		goto out;
@@ -824,7 +828,9 @@ run_ctm_tests_for_pipe(data_t *data, enum pipe p,
 	data->color_depth = 8;
 	delta = 1.0 / (1 << data->color_depth);
 	data->drm_format = DRM_FORMAT_XRGB8888;
-	data->mode = igt_output_get_mode(data->output);
+	data->mode = malloc(sizeof(drmModeModeInfo));
+	igt_assert(data->mode);
+	memcpy(data->mode, output_mode_with_max_resolution(data->output), sizeof(drmModeModeInfo));
 
 	if (!pipe_output_combo_valid(data, p))
 		goto out;
-- 
2.43.2



More information about the igt-dev mailing list