From patchwork Wed Dec 26 07:27:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi Sun X-Patchwork-Id: 1910751 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id BF244DFAC4 for ; Wed, 26 Dec 2012 07:29:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A5283E6016 for ; Tue, 25 Dec 2012 23:29:47 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 8CD84E5F32 for ; Tue, 25 Dec 2012 23:29:37 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 25 Dec 2012 23:28:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,355,1355126400"; d="scan'208";a="238988677" Received: from sunyi-pc.sh.intel.com ([10.239.13.42]) by orsmga001.jf.intel.com with ESMTP; 25 Dec 2012 23:29:35 -0800 From: Yi Sun To: intel-gfx@lists.freedesktop.org Date: Wed, 26 Dec 2012 15:27:12 +0800 Message-Id: <1356506832-28766-1-git-send-email-yi.sun@intel.com> X-Mailer: git-send-email 1.7.6.4 Subject: [Intel-gfx] [PATCH] tests/testdisplay: Specify the display. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 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 It can specify the display when use option '-o'. E.g. command "./testdiplay -o 1,4" means setting number 4 mode line on the number 1 display. Signed-off-by: Yi Sun diff --git a/tests/testdisplay.c b/tests/testdisplay.c index 7287487..dda4eaa 100644 --- a/tests/testdisplay.c +++ b/tests/testdisplay.c @@ -72,7 +72,7 @@ int dump_info = 0, test_all_modes =0, test_preferred_mode = 0, force_mode = 0, int sleep_between_modes = 5; uint32_t depth = 24, stride, bpp; int qr_code = 0; -int only_one_mode = 0, specified_mode_num = 0; +int only_one_mode = 0, specified_mode_num = 0, specified_disp_num = 0; drmModeModeInfo force_timing; @@ -597,6 +597,8 @@ int update_display(void) if (test_preferred_mode || test_all_modes || force_mode || only_one_mode) { /* Find any connected displays */ for (c = 0; c < resources->count_connectors; c++) { + if ( c != specified_disp_num ) continue; + connectors[c].id = resources->connectors[c]; set_mode(&connectors[c]); } @@ -618,7 +620,7 @@ static void __attribute__((noreturn)) usage(char *name) fprintf(stderr, "\t-m\ttest the preferred mode\n"); fprintf(stderr, "\t-t\tuse a tiled framebuffer\n"); fprintf(stderr, "\t-r\tprint a QR code on the screen whose content is \"pass\" for the automatic test\n"); - fprintf(stderr, "\t-o\t\tonly test specified mode\n"); + fprintf(stderr, "\t-o\t,\tonly test specified mode on the specified display\n"); fprintf(stderr, "\t-f\t,,,,,\n"); fprintf(stderr, "\t\t,,,\n"); fprintf(stderr, "\t\ttest force mode\n"); @@ -715,7 +717,7 @@ int main(int argc, char **argv) break; case 'o': only_one_mode = 1; - specified_mode_num = atoi(optarg); + sscanf(optarg, "%d,%d", &specified_disp_num, &specified_mode_num); break; default: fprintf(stderr, "unknown option %c\n", c);