From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH v6 08/23] modetest: Add a command line parameter to set properties Date: Mon, 24 Jun 2013 18:08:37 +0300 Message-ID: <20130624150837.GM5004@intel.com> References: <1371245697-29504-1-git-send-email-laurent.pinchart@ideasonboard.com> <1371245697-29504-9-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 CBE75E5C6B for ; Mon, 24 Jun 2013 08:08:47 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1371245697-29504-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: Laurent Pinchart Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Fri, Jun 14, 2013 at 11:34:42PM +0200, 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 778af62..858d480 100644 > --- a/tests/modetest/modetest.c > +++ b/tests/modetest/modetest.c > @@ -1008,9 +1082,20 @@ static int parse_plane(struct plane_arg *p, const = char *arg) > return 0; > } > = > +static int parse_property(struct property_arg *p, const char *arg) > +{ > + if (sscanf(arg, "%d:%32[^:]:%" SCNu64, &p->obj_id, p->name, &p->value) = !=3D 3) nit: could use stringification to get rid of the magic number 32 here. I didn't spot any real problems in the series. But I must admit that I mainly just glanced at most of the changes in since many of the diffs are a bit hard to read. I also gave it a quick try using sprites and setting a few modes. And I found a bug in i915 while doing that, so clearly it has already proved useful ;) > + return -1; > + > + p->obj_type =3D 0; > + p->name[DRM_PROP_NAME_LEN] =3D '\0'; > + > + return 0; > +} > + > static void usage(char *name) > { > - fprintf(stderr, "usage: %s [-cdefMmPpsv]\n", name); > + fprintf(stderr, "usage: %s [-cdefMmPpsvw]\n", name); > = > fprintf(stderr, "\n Query options:\n\n"); > fprintf(stderr, "\t-c\tlist connectors\n"); -- = Ville Syrj=E4l=E4 Intel OTC