From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH v4 04/21] modetest: Add a command line parameter to select the driver Date: Wed, 3 Apr 2013 13:06:30 +0300 Message-ID: <20130403100630.GX4469@intel.com> References: <1363704962-14077-1-git-send-email-laurent.pinchart@ideasonboard.com> <1363704962-14077-5-git-send-email-laurent.pinchart@ideasonboard.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 40A99E6123 for ; Wed, 3 Apr 2013 03:06:33 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1363704962-14077-5-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: Laurent Pinchart Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Tue, Mar 19, 2013 at 03:55:45PM +0100, Laurent Pinchart wrote: > If the -M parameter is specified, modetest will use the requested device > name instead of trying its builtin list of device names. > = > Signed-off-by: Laurent Pinchart > Reviewed-by: Jani Nikula > --- > 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 1d1f49d..91dabfc 100644 > --- a/tests/modetest/modetest.c > +++ b/tests/modetest/modetest.c > @@ -908,6 +908,9 @@ static void usage(char *name) > fprintf(stderr, "\t-s [@]:[@]\tset= a mode\n"); > fprintf(stderr, "\t-v\ttest vsynced page flipping\n"); > = > + fprintf(stderr, "\n Generic options:\n\n"); > + fprintf(stderr, "\t-M module\tuse the given driver\n"); You didn't add it to the "usage: ..." line. Same goes for patch 05/21. > + > fprintf(stderr, "\n\tDefault is to dump all info.\n"); > exit(0); > } > @@ -935,7 +938,7 @@ static int page_flipping_supported(void) > #endif > } > = > -static char optstr[] =3D "cefmP:ps:v"; > +static char optstr[] =3D "cefM:mP:ps:v"; > = > int main(int argc, char **argv) > { > @@ -943,6 +946,7 @@ int main(int argc, char **argv) > int encoders =3D 0, connectors =3D 0, crtcs =3D 0, planes =3D 0, frameb= uffers =3D 0; > int test_vsync =3D 0; > const char *modules[] =3D { "i915", "radeon", "nouveau", "vmwgfx", "oma= pdrm", "exynos" }; > + char *module =3D NULL; > unsigned int i; > int count =3D 0, plane_count =3D 0; > struct connector con_args[2]; > @@ -960,6 +964,9 @@ int main(int argc, char **argv) > case 'f': > framebuffers =3D 1; > break; > + case 'M': > + module =3D optarg; > + break; > case 'm': > modes =3D 1; > break; > @@ -989,14 +996,27 @@ int main(int argc, char **argv) > if (argc =3D=3D 1) > encoders =3D connectors =3D crtcs =3D planes =3D modes =3D framebuffer= s =3D 1; > = > - for (i =3D 0; i < ARRAY_SIZE(modules); i++) { > - printf("trying to load module %s...", modules[i]); > - fd =3D drmOpen(modules[i], NULL); > + if (module) { > + fd =3D 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 =3D 0; i < ARRAY_SIZE(modules); i++) { > + printf("trying to open device '%s'...", modules[i]); > + fd =3D drmOpen(modules[i], NULL); > + if (fd < 0) { > + printf("failed.\n"); > + } else { > + printf("success.\n"); > + break; > + } > + } > + > + if (fd < 0) { > + fprintf(stderr, "no device found.\n"); > + return 1; > } > } > = > @@ -1005,11 +1025,6 @@ int main(int argc, char **argv) > return -1; > } > = > - if (i =3D=3D ARRAY_SIZE(modules)) { > - fprintf(stderr, "failed to load any modules, aborting.\n"); > - return -1; > - } > - > resources =3D drmModeGetResources(fd); > if (!resources) { > fprintf(stderr, "drmModeGetResources failed: %s\n", > -- = > 1.8.1.5 > = > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel -- = Ville Syrj=E4l=E4 Intel OTC