diff options
author | Damien Lespiau <damien.lespiau@intel.com> | 2014-02-06 16:05:19 +0000 |
---|---|---|
committer | Damien Lespiau <damien.lespiau@intel.com> | 2014-02-11 13:50:16 +0000 |
commit | 162914b9ed0af1436e260133a90b91f32e78b4fe (patch) | |
tree | 7840695c3f22b75ca43e121c9341542ed1cece12 | |
parent | 65fef0a43410b40f43dc5e0b8937199bebdccf79 (diff) |
lib/display: Check if we're trying to use the same pipe on 2 outputs
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
-rw-r--r-- | lib/igt_kms.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 9cc2cc8e..0354d3f4 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -978,10 +978,34 @@ void igt_display_fini(igt_display_t *display) static void igt_display_refresh(igt_display_t *display) { - int i; + int i, j; display->pipes_in_use = 0; + /* Check that two outputs aren't trying to use the same pipe */ + for (i = 0; i < display->n_outputs; i++) { + igt_output_t *a = &display->outputs[i]; + + if (a->pending_crtc_idx_mask == -1UL) + continue; + + for (j = 0; j < display->n_outputs; j++) { + igt_output_t *b = &display->outputs[j]; + + if (i == j) + continue; + + if (b->pending_crtc_idx_mask == -1UL) + continue; + + igt_assert_f(a->pending_crtc_idx_mask != + b->pending_crtc_idx_mask, + "%s and %s are both trying to use pipe %c\n", + igt_output_name(a), igt_output_name(b), + pipe_name(ffs(a->pending_crtc_idx_mask) - 1)); + } + } + /* * The pipe allocation has to be done in two phases: * - first, try to satisfy the outputs where a pipe has been specified |