From d8bf28f0cbe990d5b1906c686cdaa76c74b1cffd Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Fri, 26 Feb 2016 11:27:20 -0300 Subject: tests: fix CRTC assignment for a few tests All the tests I wrote always assumed that every connector supported CRTC 0. This is not the case for BSW and possibly others, so fix the tests before the CI reports more failures. Signed-off-by: Paulo Zanoni --- tests/kms_draw_crc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tests/kms_draw_crc.c') diff --git a/tests/kms_draw_crc.c b/tests/kms_draw_crc.c index 3f801749..9539fe45 100644 --- a/tests/kms_draw_crc.c +++ b/tests/kms_draw_crc.c @@ -58,25 +58,26 @@ struct modeset_params ms; static void find_modeset_params(void) { int i; - uint32_t connector_id = 0, crtc_id; + uint32_t crtc_id; + drmModeConnectorPtr connector = NULL; drmModeModeInfoPtr mode = NULL; for (i = 0; i < drm_res->count_connectors; i++) { drmModeConnectorPtr c = drm_connectors[i]; if (c->count_modes) { - connector_id = c->connector_id; + connector = c; mode = &c->modes[0]; break; } } - igt_require(connector_id); + igt_require(connector); - crtc_id = drm_res->crtcs[0]; - igt_assert(crtc_id); + crtc_id = kmstest_find_crtc_for_connector(drm_fd, drm_res, connector, + 0); igt_assert(mode); - ms.connector_id = connector_id; + ms.connector_id = connector->connector_id; ms.crtc_id = crtc_id; ms.mode = mode; -- cgit v1.2.3