From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: Re: [PATCH v2] tests/testdisplay: Specify the display. Date: Wed, 26 Dec 2012 10:55:57 -0800 Message-ID: <20121226105557.4245943a@bwidawsk.net> References: <1356513777-3678-1-git-send-email-yi.sun@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from shiva.chad-versace.us (209-20-75-48.static.cloud-ips.com [209.20.75.48]) by gabe.freedesktop.org (Postfix) with ESMTP id 04541E5BFD for ; Wed, 26 Dec 2012 10:56:10 -0800 (PST) In-Reply-To: <1356513777-3678-1-git-send-email-yi.sun@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Yi Sun Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Wed, 26 Dec 2012 17:22:57 +0800 Yi Sun wrote: > 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. > > v2. Specify the display by id which can be got from option '-i' where? > > Signed-off-by: Yi Sun > > diff --git a/tests/testdisplay.c b/tests/testdisplay.c > index 7287487..7aef940 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_id = 0; > > drmModeModeInfo force_timing; > > @@ -598,6 +598,9 @@ int update_display(void) > /* Find any connected displays */ > for (c = 0; c < resources->count_connectors; c++) { > connectors[c].id = resources->connectors[c]; > + if ( connectors[c].id != specified_disp_id ) > + continue; > + > set_mode(&connectors[c]); > } > } > @@ -618,7 +621,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 +718,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_id, &specified_mode_num); > break; > default: > fprintf(stderr, "unknown option %c\n", c); -- Ben Widawsky, Intel Open Source Technology Center