[igt-dev] [PATCH i-g-t v1 1/5] tests/chamelium/kms_chamelium.c: test cleanup

Kunal Joshi kunal1.joshi at intel.com
Mon Sep 26 18:53:17 UTC 2022


-> Sanitize the state before starting the subtest

Cc: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
Signed-off-by: Kunal Joshi <kunal1.joshi at intel.com>
---
 tests/chamelium/kms_chamelium.c | 48 +++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/tests/chamelium/kms_chamelium.c b/tests/chamelium/kms_chamelium.c
index 1be1c41a..985a906c 100644
--- a/tests/chamelium/kms_chamelium.c
+++ b/tests/chamelium/kms_chamelium.c
@@ -756,6 +756,13 @@ static void test_display_one_mode(data_t *data, struct chamelium_port *port,
 	igt_output_t *output;
 	igt_plane_t *primary;
 
+	/*
+	 * Reset basic pipes, connectors and planes on
+	 * @display back to default values.
+	 */
+	igt_display_reset(&data->display);
+
+
 	igt_modeset_disable_all_outputs(&data->display);
 	chamelium_reset_state(&data->display, data->chamelium,
 			      port, data->ports, data->port_count);
@@ -792,6 +799,12 @@ static void test_display_all_modes(data_t *data, struct chamelium_port *port,
 	if (check == CHAMELIUM_CHECK_ANALOG)
 		bridge = check_analog_bridge(data, port);
 
+	/*
+	 * Reset basic pipes, connectors and planes on
+	 * @display back to default values.
+	 */
+	igt_display_reset(&data->display);
+
 	i = 0;
 	do {
 		igt_output_t *output;
@@ -847,6 +860,12 @@ test_display_frame_dump(data_t *data, struct chamelium_port *port)
 
 	int i, count_modes;
 
+	/*
+	 * Reset basic pipes, connectors and planes on
+	 * @display back to default values.
+	 */
+	igt_display_reset(&data->display);
+
 	i = 0;
 	do {
 		igt_output_t *output;
@@ -986,6 +1005,12 @@ static void test_mode_timings(data_t *data, struct chamelium_port *port)
 {
 	int i, count_modes;
 
+	/*
+	 * Reset basic pipes, connectors and planes on
+	 * @display back to default values.
+	 */
+	igt_display_reset(&data->display);
+
 	i = 0;
 	igt_require(chamelium_supports_get_video_params(data->chamelium));
 	do {
@@ -1104,6 +1129,11 @@ static void test_display_aspect_ratio(data_t *data, struct chamelium_port *port)
 	uint32_t aspect_ratio;
 	enum infoframe_avi_picture_aspect_ratio frame_ar;
 
+	/*
+	 * Reset basic pipes, connectors and planes on
+	 * @display back to default values.
+	 */
+	igt_display_reset(&data->display);
 	igt_require(chamelium_supports_get_last_infoframe(data->chamelium));
 
 	igt_modeset_disable_all_outputs(&data->display);
@@ -1835,6 +1865,12 @@ test_display_audio(data_t *data, struct chamelium_port *port,
 	 * chamelium_get_audio_format support. */
 	igt_require(chamelium_has_audio_support(data->chamelium, port));
 
+	/*
+	 * Reset basic pipes, connectors and planes on
+	 * @display back to default values.
+	 */
+	igt_display_reset(&data->display);
+
 	alsa = alsa_init();
 	igt_assert(alsa);
 
@@ -1921,6 +1957,12 @@ test_display_audio_edid(data_t *data, struct chamelium_port *port,
 
 	igt_require(eld_is_supported());
 
+	/*
+	 * Reset basic pipes, connectors and planes on
+	 * @display back to default values.
+	 */
+	igt_display_reset(&data->display);
+
 	igt_modeset_disable_all_outputs(&data->display);
 	chamelium_reset_state(&data->display, data->chamelium,
 			      port, data->ports, data->port_count);
@@ -2348,6 +2390,12 @@ static void test_display_planes_random(data_t *data,
 	unsigned int i;
 	unsigned int fb_id;
 
+	/*
+	 * Reset basic pipes, connectors and planes on
+	 * @display back to default values.
+	 */
+	igt_display_reset(&data->display);
+
 	switch (check) {
 	case CHAMELIUM_CHECK_CRC:
 		allow_scaling = false;
-- 
2.25.1



More information about the igt-dev mailing list