[Intel-gfx] [PATCH igt 14/28] lib/display: Check if we're trying to use the same pipe on 2 outputs

Damien Lespiau damien.lespiau at intel.com
Fri Feb 7 15:48:58 CET 2014


Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 lib/igt_kms.c | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index c503ebb..1933fa6 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -977,10 +977,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
-- 
1.8.3.1




More information about the Intel-gfx mailing list