From 6cc92bcbc5301e79a9afa8f3dcbc73ec770be034 Mon Sep 17 00:00:00 2001 From: Hai Lan Date: Tue, 31 May 2011 17:13:30 -0400 Subject: [PATCH] testdisplay: Test the first mode if there is no preferred mode. For a TV device, there might be no preferred mode. In this case, we can test the first mode. Signed-off-by: Hai Lan --- tests/testdisplay.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/testdisplay.c b/tests/testdisplay.c index e8e3309c..dae52ca5 100644 --- a/tests/testdisplay.c +++ b/tests/testdisplay.c @@ -325,9 +325,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 */