All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	linux-media@vger.kernel.org, linux-input@vger.kernel.org,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Nick Dyer <nick@shmanahar.org>,
	Christopher Heiny <cheiny@synaptics.com>,
	Vandana BN <bnvandana@gmail.com>
Subject: Re: [PATCH 2/5] input/rmi4/rmi_f54: fix various V4L2 compliance problems
Date: Fri, 22 Nov 2019 16:19:37 -0800	[thread overview]
Message-ID: <20191123001937.GH248138@dtor-ws> (raw)
In-Reply-To: <54e84fe8a6d1fdd6faf11e3a5c4a7314b0151474.camel@pengutronix.de>

On Tue, Nov 19, 2019 at 12:42:46PM +0100, Lucas Stach wrote:
> On Di, 2019-11-19 at 11:51 +0100, Hans Verkuil wrote:
> > The v4l2-compliance utility reported several V4L2 API compliance
> > issues:
> > 
> > - the sequence counter wasn't filled in
> > - the sequence counter wasn't reset to 0 at the start of streaming
> > - the returned field value wasn't set to V4L2_FIELD_NONE
> > - the timestamp wasn't set
> > - the payload size was undefined if an error was returned
> > - min_buffers_needed doesn't need to be initialized
> > 
> > Fix these issues.
> > 
> > Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> 
> Reviewed-by: Lucas Stach <l.stach@pengutronix.de

Applied, thank you.

> 
> > ---
> >  drivers/input/rmi4/rmi_f54.c | 15 ++++++++++++++-
> >  1 file changed, 14 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/input/rmi4/rmi_f54.c
> > b/drivers/input/rmi4/rmi_f54.c
> > index 710b02595486..ebccab7a4834 100644
> > --- a/drivers/input/rmi4/rmi_f54.c
> > +++ b/drivers/input/rmi4/rmi_f54.c
> > @@ -116,6 +116,7 @@ struct f54_data {
> >  	struct video_device vdev;
> >  	struct vb2_queue queue;
> >  	struct mutex lock;
> > +	u32 sequence;
> >  	int input;
> >  	enum rmi_f54_report_type inputs[F54_MAX_REPORT_TYPE];
> >  };
> > @@ -290,6 +291,7 @@ static int rmi_f54_queue_setup(struct vb2_queue
> > *q, unsigned int *nbuffers,
> >  
> >  static void rmi_f54_buffer_queue(struct vb2_buffer *vb)
> >  {
> > +	struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
> >  	struct f54_data *f54 = vb2_get_drv_priv(vb->vb2_queue);
> >  	u16 *ptr;
> >  	enum vb2_buffer_state state;
> > @@ -298,6 +300,7 @@ static void rmi_f54_buffer_queue(struct
> > vb2_buffer *vb)
> >  
> >  	mutex_lock(&f54->status_mutex);
> >  
> > +	vb2_set_plane_payload(vb, 0, 0);
> >  	reptype = rmi_f54_get_reptype(f54, f54->input);
> >  	if (reptype == F54_REPORT_NONE) {
> >  		state = VB2_BUF_STATE_ERROR;
> > @@ -344,14 +347,25 @@ static void rmi_f54_buffer_queue(struct
> > vb2_buffer *vb)
> >  data_done:
> >  	mutex_unlock(&f54->data_mutex);
> >  done:
> > +	vb->timestamp = ktime_get_ns();
> > +	vbuf->field = V4L2_FIELD_NONE;
> > +	vbuf->sequence = f54->sequence++;
> >  	vb2_buffer_done(vb, state);
> >  	mutex_unlock(&f54->status_mutex);
> >  }
> >  
> > +static void rmi_f54_stop_streaming(struct vb2_queue *q)
> > +{
> > +	struct f54_data *f54 = vb2_get_drv_priv(q);
> > +
> > +	f54->sequence = 0;
> > +}
> > +
> >  /* V4L2 structures */
> >  static const struct vb2_ops rmi_f54_queue_ops = {
> >  	.queue_setup            = rmi_f54_queue_setup,
> >  	.buf_queue              = rmi_f54_buffer_queue,
> > +	.stop_streaming		= rmi_f54_stop_streaming,
> >  	.wait_prepare           = vb2_ops_wait_prepare,
> >  	.wait_finish            = vb2_ops_wait_finish,
> >  };
> > @@ -363,7 +377,6 @@ static const struct vb2_queue rmi_f54_queue = {
> >  	.ops = &rmi_f54_queue_ops,
> >  	.mem_ops = &vb2_vmalloc_memops,
> >  	.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC,
> > -	.min_buffers_needed = 1,
> >  };
> >  
> >  static int rmi_f54_vidioc_querycap(struct file *file, void *priv,
> 

-- 
Dmitry

  reply	other threads:[~2019-11-23  0:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-19 10:51 [PATCH 0/5] input: rmi4/synaptics fixes Hans Verkuil
2019-11-19 10:51 ` [PATCH 1/5] input/mouse/synaptics: add LEN0091 support Hans Verkuil
2019-11-23  0:17   ` Dmitry Torokhov
2019-11-19 10:51 ` [PATCH 2/5] input/rmi4/rmi_f54: fix various V4L2 compliance problems Hans Verkuil
2019-11-19 11:42   ` Lucas Stach
2019-11-23  0:19     ` Dmitry Torokhov [this message]
2019-11-19 10:51 ` [PATCH 3/5] pixfmt-tch-td16/tu16.rst: document that this is little endian Hans Verkuil
2019-11-23 16:12   ` Hans Verkuil
2019-11-25 18:51     ` Dmitry Torokhov
2019-11-19 10:51 ` [PATCH 4/5] input/rmi4/rmi_driver: check if irq_find_mapping returns 0 Hans Verkuil
2019-11-19 11:38   ` Lucas Stach
2019-11-19 11:43     ` Hans Verkuil
2019-11-23 13:53       ` Hans Verkuil
2019-11-19 10:51 ` [PATCH 5/5] input/rmi4/rmi_smbus.c: don't increment rmiaddr in rmi_smb_read_block() Hans Verkuil
2019-11-19 11:48   ` Lucas Stach
2019-11-19 12:19     ` Hans Verkuil
2019-11-23 16:27   ` [PATCHv2 5/5] input/rmi4/rmi_smbus.c: don't increment rmiaddr Hans Verkuil
2019-12-02 18:09     ` Dmitry Torokhov

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=20191123001937.GH248138@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=bnvandana@gmail.com \
    --cc=cheiny@synaptics.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=l.stach@pengutronix.de \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=nick@shmanahar.org \
    --cc=p.zabel@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.