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_lpsp.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_lpsp.c')
-rw-r--r-- | tests/pm_lpsp.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/tests/pm_lpsp.c b/tests/pm_lpsp.c index 4cedefff..bfe58288 100644 --- a/tests/pm_lpsp.c +++ b/tests/pm_lpsp.c @@ -65,7 +65,8 @@ static void edp_subtest(int drm_fd, drmModeResPtr drm_res, bool use_panel_fitter) { int i, rc; - uint32_t connector_id = 0, crtc_id = 0, buffer_id = 0; + uint32_t crtc_id = 0, buffer_id = 0; + drmModeConnectorPtr connector = NULL; drmModeModeInfoPtr mode = NULL; drmModeModeInfo std_1024_mode = { .clock = 65000, @@ -96,12 +97,12 @@ static void edp_subtest(int drm_fd, drmModeResPtr drm_res, continue; if (!use_panel_fitter && c->count_modes) { - connector_id = c->connector_id; + connector = c; mode = &c->modes[0]; break; } if (use_panel_fitter) { - connector_id = c->connector_id; + connector = c; /* This is one of the modes Xorg creates for panels, so * it should work just fine. Notice that Gens that @@ -116,18 +117,18 @@ static void edp_subtest(int drm_fd, drmModeResPtr drm_res, break; } } - igt_require(connector_id); + igt_require(connector); - crtc_id = drm_res->crtcs[0]; + crtc_id = kmstest_find_crtc_for_connector(drm_fd, drm_res, connector, + 0); buffer_id = create_fb(drm_fd, mode->hdisplay, mode->vdisplay); - igt_assert(crtc_id); igt_assert(buffer_id); - igt_assert(connector_id); + igt_assert(connector); igt_assert(mode); - rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0, &connector_id, 1, - mode); + rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0, + &connector->connector_id, 1, mode); igt_assert_eq(rc, 0); if (use_panel_fitter) { @@ -144,7 +145,8 @@ static void non_edp_subtest(int drm_fd, drmModeResPtr drm_res, drmModeConnectorPtr *drm_connectors) { int i, rc; - uint32_t connector_id = 0, crtc_id = 0, buffer_id = 0; + uint32_t crtc_id = 0, buffer_id = 0; + drmModeConnectorPtr connector = NULL; drmModeModeInfoPtr mode = NULL; kmstest_unset_all_crtcs(drm_fd, drm_res); @@ -158,23 +160,22 @@ static void non_edp_subtest(int drm_fd, drmModeResPtr drm_res, continue; 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]; + crtc_id = kmstest_find_crtc_for_connector(drm_fd, drm_res, connector, + 0); buffer_id = create_fb(drm_fd, mode->hdisplay, mode->vdisplay); - igt_assert(crtc_id); igt_assert(buffer_id); - igt_assert(connector_id); igt_assert(mode); - rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0, &connector_id, 1, - mode); + rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0, + &connector->connector_id, 1, mode); igt_assert_eq(rc, 0); igt_assert(!lpsp_is_enabled(drm_fd)); |