diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2016-02-26 11:27:20 -0300 |
---|---|---|
committer | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2016-03-03 16:57:48 -0300 |
commit | d8bf28f0cbe990d5b1906c686cdaa76c74b1cffd (patch) | |
tree | 44609a602e07119633c51a6e2b01c4f9568b4c50 /tests/pm_rpm.c | |
parent | 9751e602b7e10310b011586fe16d7eea2cfb9026 (diff) |
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 <paulo.r.zanoni@intel.com>
Diffstat (limited to 'tests/pm_rpm.c')
-rw-r--r-- | tests/pm_rpm.c | 24 |
1 files changed, 2 insertions, 22 deletions
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; |