From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laurent Pinchart Subject: Re: [PATCH v4 08/21] modetest: Add a command line parameter to set properties Date: Thu, 28 Mar 2013 13:23:40 +0100 Message-ID: <2858972.CNh4PtcFn5@avalon> References: <1363704962-14077-1-git-send-email-laurent.pinchart@ideasonboard.com> <1363704962-14077-9-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 090F2E5CEA for ; Thu, 28 Mar 2013 05:22:51 -0700 (PDT) Received: from avalon.localnet (unknown [91.177.137.142]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1C40435A54 for ; Thu, 28 Mar 2013 13:22:35 +0100 (CET) In-Reply-To: <1363704962-14077-9-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 Tuesday 19 March 2013 15:55:49 Laurent Pinchart wrote: > The -w parameter can be used to set a property value from the command > line, using the target object ID and the property name. > > Signed-off-by: Laurent Pinchart > --- > tests/modetest/modetest.c | 108 ++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 106 insertions(+), 2 deletions(-) > > diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c > index f58c01d..7153a40 100644 > --- a/tests/modetest/modetest.c > +++ b/tests/modetest/modetest.c [snip] > @@ -1122,6 +1210,19 @@ int main(int argc, char **argv) > case 'v': > test_vsync = 1; > break; > + case 'w': > + prop_args = realloc(prop_args, > + (prop_count + 1) * sizeof *prop_args); > + if (con_args == NULL) { This should obviously be prop_args. I'll fix it in v5. > + fprintf(stderr, "memory allocation failed\n"); > + return 1; > + } > + > + if (parse_property(&prop_args[prop_count], optarg) < 0) > + usage(argv[0]); > + > + prop_count++; > + break; > default: > usage(argv[0]); > break; -- Regards, Laurent Pinchart