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/pm_rpm.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'tests/pm_rpm.c') diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c index 5f947e9e..e84a9d3b 100644 --- a/tests/pm_rpm.c +++ b/tests/pm_rpm.c @@ -226,27 +226,6 @@ static void disable_or_dpms_all_screens(struct mode_set_data *data, bool dpms) igt_assert(wait_for_suspended()); \ } while (0) -static uint32_t find_crtc_for_connector(drmModeResPtr res, - drmModeConnectorPtr connector) -{ - drmModeEncoderPtr e; - uint32_t crtc_id = 0; - int i, j; - - for (i = 0; i < connector->count_encoders && !crtc_id; i++) { - e = drmModeGetEncoder(drm_fd, connector->encoders[i]); - - for (j = 0; (e->possible_crtcs >> j) && !crtc_id; j++) - if (e->possible_crtcs & (1 << j)) - crtc_id = res->crtcs[j]; - - drmModeFreeEncoder(e); - } - - igt_assert(crtc_id); - return crtc_id; -} - static bool init_modeset_params_for_type(struct mode_set_data *data, struct modeset_params *params, enum screen_type type) @@ -280,7 +259,8 @@ static bool init_modeset_params_for_type(struct mode_set_data *data, DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE, ¶ms->fb); - params->crtc_id = find_crtc_for_connector(data->res, connector); + params->crtc_id = kmstest_find_crtc_for_connector(drm_fd, data->res, + connector, 0); params->connector_id = connector->connector_id; params->mode = mode; -- cgit v1.2.3