summaryrefslogtreecommitdiff
path: root/lib/igt_kms.h
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2016-06-30 09:18:49 +0200
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2016-07-26 14:50:15 +0200
commit5a63668766ac7645f6f019deb1e9fc7f2d8f2fa5 (patch)
tree762206ea4a2d2221a82afb05583d4ccf089f1a96 /lib/igt_kms.h
parente33c51e1b9f06decca6b8c0640b460934cf3c27d (diff)
igt_kms: Change PIPE_ANY behavior to mean unassigned, v2.
None of the tests requires that a output bound to PIPE_ANY is assigned, so don't do it. Fix the display commit to iterate over crtc's instead oof outputs to properly disable pipes without outputs. This also means that output->valid is only set after connecting a output to a pipe, so no longer depend on it in for_each_connected_output and similar macros. New code should use PIPE_NONE to avoid confusion, PIPE_ANY is a deprecated alias, and will be removed. Changes since v1: - Split out the property changes. - Split out the commit changes. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
Diffstat (limited to 'lib/igt_kms.h')
-rw-r--r--lib/igt_kms.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index dc6be5e5..3531dc20 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -334,17 +334,31 @@ void igt_fb_set_size(struct igt_fb *fb, igt_plane_t *plane,
void igt_wait_for_vblank(int drm_fd, enum pipe pipe);
+static inline bool igt_output_is_connected(igt_output_t *output)
+{
+ /* Something went wrong during probe? */
+ if (!output->config.connector)
+ return false;
+
+ if (output->config.connector->connection == DRM_MODE_CONNECTED)
+ return true;
+
+ return false;
+}
+
static inline bool igt_pipe_connector_valid(enum pipe pipe,
igt_output_t *output)
{
- return output->valid && (output->config.valid_crtc_idx_mask & (1 << pipe));
+ return igt_output_is_connected(output) &&
+ (output->config.valid_crtc_idx_mask & (1 << pipe));
}
#define for_each_if(condition) if (!(condition)) {} else
#define for_each_connected_output(display, output) \
for (int i__ = 0; i__ < (display)->n_outputs; i__++) \
- for_each_if (((output = &(display)->outputs[i__]), output->valid))
+ for_each_if (((output = &(display)->outputs[i__]), \
+ igt_output_is_connected(output)))
#define for_each_pipe(display, pipe) \
for (pipe = 0; pipe < igt_display_get_n_pipes(display); pipe++) \