From: Laurent Pinchart Subject: Re: [PATCH v2 3/3] modetest: Add a command line parameter to select the driver Date: Mon, 11 Feb 2013 21:33:30 +0100 Message-ID: <11436156.kyK6xg2gh8@avalon> References: <1360613625-4718-1-git-send-email-laurent.pinchart@ideasonboard.com> <1360613625-4718-4-git-send-email-laurent.pinchart@ideasonboard.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [95.142.166.194]) by gabe.freedesktop.org (Postfix) with ESMTP id 2D658E5EEA for ; Mon, 11 Feb 2013 12:33:19 -0800 (PST) Received: from avalon.localnet (unknown [91.177.159.221]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 193433598B for ; Mon, 11 Feb 2013 21:33:14 +0100 (CET) In-Reply-To: <1360613625-4718-4-git-send-email-laurent.pinchart@ideasonboard.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Monday 11 February 2013 21:13:45 Laurent Pinchart wrote: > If the -M parameter is specific, modetest will use the requested device > name instead of trying its builtin list of device names. > > Signed-off-by: Laurent Pinchart > --- > tests/modetest/modetest.c | 41 ++++++++++++++++++++++++++++------------- > 1 file changed, 28 insertions(+), 13 deletions(-) > > diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c > index 34457e2..9a2d1f8 100644 > --- a/tests/modetest/modetest.c > +++ b/tests/modetest/modetest.c [snip] > @@ -989,14 +996,27 @@ int main(int argc, char **argv) > if (argc == 1) > encoders = connectors = crtcs = planes = modes = framebuffers = 1; > > - for (i = 0; i < ARRAY_SIZE(modules); i++) { > - printf("trying to load module %s...", modules[i]); > - fd = drmOpen(modules[i], NULL); > + if (module) { > + fd = drmOpen(module, NULL); > if (fd < 0) { > - printf("failed.\n"); > - } else { > - printf("success.\n"); > - break; > + fprintf(stderr, "failed to open device '%s'.\n", module); > + return 1; > + } > + } else { > + for (i = 0; i < ARRAY_SIZE(modules); i++) { > + printf("trying to open device '%s'...", modules[i]); > + fd = drmOpen(modules[i], NULL); > + if (fd < 0) { > + printf("failed.\n"); > + } else { > + printf("success.\n"); > + break; > + } > + } > + > + if (fd < 0) { > + fprintf(stderr, "no device found.\n", module); I should sleep before sending patches... Sorry for the noise, v3 will fix that. > + return 1; > } > } -- Regards, Laurent Pinchart