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_fbcon_fbt.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/kms_fbcon_fbt.c') diff --git a/tests/kms_fbcon_fbt.c b/tests/kms_fbcon_fbt.c index 3c93378e..586cdf57 100644 --- a/tests/kms_fbcon_fbt.c +++ b/tests/kms_fbcon_fbt.c @@ -114,7 +114,7 @@ static void set_mode_for_one_screen(struct drm_info *drm, struct igt_fb *fb, connector_possible_fn connector_possible) { int i, rc; - uint32_t connector_id = 0, crtc_id; + uint32_t crtc_id; drmModeModeInfoPtr mode; uint32_t buffer_id; drmModeConnectorPtr c = NULL; @@ -124,14 +124,14 @@ static void set_mode_for_one_screen(struct drm_info *drm, struct igt_fb *fb, if (c->connection == DRM_MODE_CONNECTED && c->count_modes && connector_possible(c)) { - connector_id = c->connector_id; mode = &c->modes[0]; break; } } - igt_require_f(connector_id, "No connector available\n"); + igt_require_f(i < drm->res->count_connectors, + "No connector available\n"); - crtc_id = drm->res->crtcs[0]; + crtc_id = kmstest_find_crtc_for_connector(drm->fd, drm->res, c, 0); buffer_id = igt_create_fb(drm->fd, mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB8888, @@ -142,8 +142,8 @@ static void set_mode_for_one_screen(struct drm_info *drm, struct igt_fb *fb, mode->hdisplay, mode->vdisplay, kmstest_connector_type_str(c->connector_type)); - rc = drmModeSetCrtc(drm->fd, crtc_id, buffer_id, 0, 0, &connector_id, 1, - mode); + rc = drmModeSetCrtc(drm->fd, crtc_id, buffer_id, 0, 0, + &c->connector_id, 1, mode); igt_assert_eq(rc, 0); } -- cgit v1.2.3