diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2017-10-12 13:04:49 +0200 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2017-10-20 11:45:09 +0200 |
commit | d6fe4df0e14c06ac89a117324433576abb5e38e5 (patch) | |
tree | 97bfb8b124994e737b87a97f742c1dda9ac2e4d6 /tests/chamelium.c | |
parent | 162fe75c2c422aa3b3f6e9ba7fc7e997602ab31f (diff) |
tests/chamelium: Remove reliance on output->config.pipe
IGT has an api that can find a matching pipe for a given connector,
so use that.
igt_output_override_mode already forces a modeset on an affected pipe
since an earlier commit, so the second call to igt_output_set_pipe
can be removed.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Diffstat (limited to 'tests/chamelium.c')
-rw-r--r-- | tests/chamelium.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/chamelium.c b/tests/chamelium.c index 4ad29f9d..d4a185e7 100644 --- a/tests/chamelium.c +++ b/tests/chamelium.c @@ -416,6 +416,8 @@ prepare_output(data_t *data, drmModeRes *res; drmModeConnector *connector = chamelium_port_get_connector(data->chamelium, port, false); + enum pipe pipe; + bool found = false; igt_assert(res = drmModeGetResources(data->drm_fd)); kmstest_unset_all_crtcs(data->drm_fd, res); @@ -433,7 +435,18 @@ prepare_output(data_t *data, igt_assert(kmstest_probe_connector_config( data->drm_fd, connector->connector_id, ~0, &output->config)); - igt_output_set_pipe(output, output->config.pipe); + + for_each_pipe(display, pipe) { + if (!igt_pipe_connector_valid(pipe, output)) + continue; + + found = true; + break; + } + + igt_assert_f(found, "No pipe found for output %s\n", igt_output_name(output)); + + igt_output_set_pipe(output, pipe); drmModeFreeConnector(connector); drmModeFreeResources(res); @@ -459,8 +472,6 @@ enable_output(data_t *data, igt_plane_set_fb(primary, fb); igt_output_override_mode(output, mode); - igt_output_set_pipe(output, output->config.pipe); - /* Clear any color correction values that might be enabled */ igt_pipe_obj_replace_prop_blob(primary->pipe, IGT_CRTC_DEGAMMA_LUT, NULL, 0); igt_pipe_obj_replace_prop_blob(primary->pipe, IGT_CRTC_GAMMA_LUT, NULL, 0); |