From patchwork Sun Sep 8 01:36:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilia Mirkin X-Patchwork-Id: 2856811 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2C697BF43F for ; Sun, 8 Sep 2013 01:37:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 46A6D20333 for ; Sun, 8 Sep 2013 01:37:02 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 200A720328 for ; Sun, 8 Sep 2013 01:37:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F0925E60AE for ; Sat, 7 Sep 2013 18:36:58 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qc0-f174.google.com (mail-qc0-f174.google.com [209.85.216.174]) by gabe.freedesktop.org (Postfix) with ESMTP id 44F13E5FDA for ; Sat, 7 Sep 2013 18:36:48 -0700 (PDT) Received: by mail-qc0-f174.google.com with SMTP id n9so142214qcw.33 for ; Sat, 07 Sep 2013 18:36:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=OnQe5PC3COFjFx8pmvoxlT2Z3EiD/fZqY/pLzTRgVso=; b=J9204a81Lb1s16uo8yho9h9Cx5RAoe4b5noZmlAE16d22hkIgOgzhJbAdHGKw3n4Ug jGc4vetNYOrucdgHnyG1zAvzqSC9h/piXAAL/OlxoH6/yRQP4vOb9N+tnqJhx0wCaJ6I gO0xGFDdBTD+Zgfn+Y2dG7xBJuZhcd82v6tx1xqkLjGtJ5y5KyH6NIWSbxL8cDfkJFeX a69bbWPBa1GMmJ6hotnQ/xAcuNT0yXO36J4WNGkwH/01mnJfST4ibL5a78toq6AEN+a5 G+9zvkNXrf/3h8Us/MkROgB6ewg6rKR+8YZb3yw0R26WaT8lVeeQgr4OKcxCH638AE9V dPTg== X-Received: by 10.49.94.207 with SMTP id de15mr165185qeb.62.1378604207781; Sat, 07 Sep 2013 18:36:47 -0700 (PDT) Received: from localhost.localdomain (pool-108-14-120-31.nycmny.east.verizon.net. [108.14.120.31]) by mx.google.com with ESMTPSA id h20sm4548948qen.5.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 07 Sep 2013 18:36:47 -0700 (PDT) From: Ilia Mirkin To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] modetest: add a -D option to specify a device to be used Date: Sat, 7 Sep 2013 21:36:01 -0400 Message-Id: <1378604162-12622-1-git-send-email-imirkin@alum.mit.edu> X-Mailer: git-send-email 1.8.1.5 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is helpful for differentiating between multiple devices that use the same module. Signed-off-by: Ilia Mirkin Reviewed-by: Rob Clark --- tests/modetest/modetest.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index f0ed56b..9d6e279 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -1303,7 +1303,7 @@ static int parse_property(struct property_arg *p, const char *arg) static void usage(char *name) { - fprintf(stderr, "usage: %s [-cdefMmPpsvw]\n", name); + fprintf(stderr, "usage: %s [-cDdefMPpsvw]\n", name); fprintf(stderr, "\n Query options:\n\n"); fprintf(stderr, "\t-c\tlist connectors\n"); @@ -1320,6 +1320,7 @@ static void usage(char *name) fprintf(stderr, "\n Generic options:\n\n"); fprintf(stderr, "\t-d\tdrop master after mode set\n"); fprintf(stderr, "\t-M module\tuse the given driver\n"); + fprintf(stderr, "\t-D device\tuse the given device\n"); fprintf(stderr, "\n\tDefault is to dump all info.\n"); exit(0); @@ -1346,7 +1347,7 @@ static int page_flipping_supported(void) #endif } -static char optstr[] = "cdefM:P:ps:vw:"; +static char optstr[] = "cdD:efM:P:ps:vw:"; int main(int argc, char **argv) { @@ -1357,6 +1358,7 @@ int main(int argc, char **argv) int drop_master = 0; int test_vsync = 0; const char *modules[] = { "i915", "radeon", "nouveau", "vmwgfx", "omapdrm", "exynos", "tilcdc", "msm" }; + char *device = NULL; char *module = NULL; unsigned int i; int count = 0, plane_count = 0; @@ -1377,6 +1379,10 @@ int main(int argc, char **argv) case 'c': connectors = 1; break; + case 'D': + device = optarg; + args--; + break; case 'd': drop_master = 1; break; @@ -1447,7 +1453,7 @@ int main(int argc, char **argv) encoders = connectors = crtcs = planes = framebuffers = 1; if (module) { - dev.fd = drmOpen(module, NULL); + dev.fd = drmOpen(module, device); if (dev.fd < 0) { fprintf(stderr, "failed to open device '%s'.\n", module); return 1; @@ -1455,7 +1461,7 @@ int main(int argc, char **argv) } else { for (i = 0; i < ARRAY_SIZE(modules); i++) { printf("trying to open device '%s'...", modules[i]); - dev.fd = drmOpen(modules[i], NULL); + dev.fd = drmOpen(modules[i], device); if (dev.fd < 0) { printf("failed.\n"); } else {