From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v6 08/23] modetest: Add a command line parameter to set properties
Date: Thu, 27 Jun 2013 11:11:40 +0200 [thread overview]
Message-ID: <2094354.dKMbxamvuK@avalon> (raw)
In-Reply-To: <20130627083148.GX5004@intel.com>
On Thursday 27 June 2013 11:31:48 Ville Syrjälä wrote:
> On Thu, Jun 27, 2013 at 10:10:43AM +0200, Laurent Pinchart wrote:
> > On Monday 24 June 2013 18:08:37 Ville Syrjälä wrote:
> > > 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 <laurent.pinchart@ideasonboard.com>
> > > > ---
> > > >
> > > > 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
> > >
> > > <snip>
> > >
> > > > @@ -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)
> > >
> > > > != 3)
> > >
> > > nit: could use stringification to get rid of the magic number 32 here.
> >
> > What do you mean exactly ?
>
> Something like this:
>
> #define str(x) #x
> #define xstr(x) str(x)
> sscanf(arg, "%d:%" xstr(DRM_PROP_NAME_LEN) "[^:]:%" SCNu64, ...
>
> Although it does make it a bit hard to parse for a human.
Right. I'm fine with both. "%m[^:]" might be an interesting alternative
option.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2013-06-27 9:11 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-14 21:34 [PATCH v6 00/23] modetest enhancements Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 01/23] modetest: Fix warnings Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 02/23] modetest: Remove extern declarations of opt(arg|ind|err|opt) Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 03/23] modetest: Sort command line arguments Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 04/23] modetest: Add a command line parameter to select the driver Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 05/23] modetest: Add a command line parameter to drop master after mode set Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 06/23] modetest: Retrieve all resources in one go Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 07/23] modetest: Don't limit mode set and planes to two instances Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 08/23] modetest: Add a command line parameter to set properties Laurent Pinchart
2013-06-24 15:08 ` Ville Syrjälä
2013-06-27 8:10 ` Laurent Pinchart
2013-06-27 8:31 ` Ville Syrjälä
2013-06-27 9:11 ` Laurent Pinchart [this message]
2013-06-14 21:34 ` [PATCH v6 09/23] modetest: Allow specifying plane position Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 10/23] modetest: Print the plane ID when setting up a plane Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 11/23] modetest: Remove the -m argument Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 12/23] modetest: Create a device structure Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 13/23] modetest: Compute CRTC pipe number as needed Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 14/23] modetest: Remove the struct connector_arg encoder field Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 15/23] modetest: Store the crtc in the connector_arg structure Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 16/23] modetest: Store the mode in the crtc structure Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 17/23] modetest: Give the CRTC ID to the -P option Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 18/23] modetest: Split mode setting and plane setup Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 19/23] modetest: Rename struct connector_arg to struct pipe_arg Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 20/23] modetest: Support pipes with multiple connectors Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 21/23] modetest: Try all possible encoders for a connector Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 22/23] modetest: Fix line stride in SMPTE YUV packet pattern generator Laurent Pinchart
2013-06-14 21:34 ` [PATCH v6 23/23] modetest: Allocate NV buffers large enough for the two planes Laurent Pinchart
2013-06-27 8:12 ` [PATCH v6 00/23] modetest enhancements Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2094354.dKMbxamvuK@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).