summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKunal Joshi <kunal1.joshi@intel.com>2020-05-12 03:12:39 +0530
committerKunal Joshi <kunal1.joshi@intel.com>2020-05-12 03:16:42 +0530
commit0c5b0e37242449f1beb58245e6ad131d26ea1b5c (patch)
tree4219a89613f860944c3f49b348419b18f4e31c91 /tests
parentef5bb4714fe5cd08acc8a7522f40f3495d824dda (diff)
tests/kms_chamelium Fix DP FSM in dp-mode-timings
Receiver reset is always required after we set a new mode, so let's disable the mode (reset_state() does that) before we switch to a new mode. With this we will get the HPD pulses reliably for each iteration over all the supoprted modes. For more details Refer c8dc1fd926a5 ("tests/kms_chamelium: Capture on type-c") Cc: Hiler Arkadiusz <arkadiusz.hiler@intel.com> Cc: Imre Deak <imre.deak@intel.com> Issue: https://gitlab.freedesktop.org/drm/intel/issues/262 Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/kms_chamelium.c46
1 files changed, 30 insertions, 16 deletions
diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
index 421a9006..dc1b8d1e 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -1017,24 +1017,39 @@ static const char test_mode_timings_desc[] =
"mode detected by the Chamelium receiver matches the mode we set";
static void test_mode_timings(data_t *data, struct chamelium_port *port)
{
- igt_output_t *output;
- igt_plane_t *primary;
- drmModeConnector *connector;
- int fb_id, i;
- struct igt_fb fb;
+ int i, count_modes;
+ i = 0;
igt_require(chamelium_supports_get_video_params(data->chamelium));
+ do {
+ igt_output_t *output;
+ igt_plane_t *primary;
+ drmModeConnector *connector;
+ drmModeModeInfo *mode;
+ int fb_id;
+ struct igt_fb fb;
- reset_state(data, port);
+ /*
+ * let's reset state each mode so we will get the
+ * HPD pulses realibably
+ */
+ reset_state(data, port);
- output = prepare_output(data, port, TEST_EDID_BASE);
- connector = chamelium_port_get_connector(data->chamelium, port, false);
- primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
- igt_assert(primary);
+ /*
+ * modes may change due to mode pruining and link issues, so we
+ * need to refresh the connector
+ */
+ output = prepare_output(data, port, TEST_EDID_BASE);
+ connector = chamelium_port_get_connector(data->chamelium, port, false);
+ primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
+ igt_assert(primary);
- igt_assert(connector->count_modes > 0);
- for (i = 0; i < connector->count_modes; i++) {
- drmModeModeInfo *mode = &connector->modes[i];
+ /* we may skip some modes due to above but that's ok */
+ count_modes = connector->count_modes;
+ if (i >= count_modes)
+ break;
+
+ mode = &connector->modes[i];
fb_id = igt_create_color_pattern_fb(data->drm_fd,
mode->hdisplay, mode->vdisplay,
@@ -1051,9 +1066,8 @@ static void test_mode_timings(data_t *data, struct chamelium_port *port)
check_mode(data->chamelium, port, mode);
igt_remove_fb(data->drm_fd, &fb);
- }
-
- drmModeFreeConnector(connector);
+ drmModeFreeConnector(connector);
+ } while (++i < count_modes);
}
/* Set of Video Identification Codes advertised in the EDID */