From patchwork Tue May 31 21:24:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hai.lan@intel.com X-Patchwork-Id: 831742 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4V8WBJs016844 for ; Tue, 31 May 2011 08:32:31 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 830B09ECCE for ; Tue, 31 May 2011 01:32:10 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id AC8109E9BE for ; Tue, 31 May 2011 01:31:48 -0700 (PDT) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 31 May 2011 01:31:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.65,296,1304319600"; d="scan'208";a="4353023" Received: from unknown (HELO lanhai-test.sh.intel.com) ([10.239.36.69]) by azsmga001.ch.intel.com with ESMTP; 31 May 2011 01:31:47 -0700 From: Hai Lan To: intel-gfx@lists.freedesktop.org Date: Tue, 31 May 2011 17:24:47 -0400 Message-Id: <1306877087-6952-1-git-send-email-hai.lan@intel.com> X-Mailer: git-send-email 1.7.3.4 Subject: [Intel-gfx] [PATCH] Test the first mode if there is no preferred mode. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 31 May 2011 08:32:32 +0000 (UTC) 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 */