[Intel-gfx] [PATCH] Test the first mode if there is no preferred mode.

Hai Lan hai.lan at intel.com
Tue May 31 23:24:47 CEST 2011


For a TV device, there  might be no preferred mode. In this case,
we can test the first mode.
---
 tests/testdisplay.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index 41a5753..ef194fe 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -280,9 +280,16 @@ static void connector_find_preferred_mode(struct connector *c)
 	}
 
 	if (!c->mode_valid) {
-		fprintf(stderr, "failed to find any modes on connector %d\n",
-			c->id);
-		return;
+		if (connector->count_modes > 0) {
+			/* use the first mode as test mode */
+			c->mode = connector->modes[0];
+			c->mode_valid = 1;
+		}
+		else {
+			fprintf(stderr, "failed to find any modes on connector %d\n",
+				c->id);
+			return;
+		}
 	}
 
 	/* Now get the encoder */
-- 
1.7.3.4




More information about the Intel-gfx mailing list