[PATCH] media: rkvdec: Fix .buf_prepare
From: Ezequiel Garcia The driver should only set the payload on .buf_prepare if the buffer is CAPTURE type. If an OUTPUT buffer has a zero bytesused set by userspace then v4l2-core will set it to buffer length. Fixes: cd33c830448ba ("media: rkvdec: Add the rkvdec driver") Signed-off-by: Ezequiel Garcia Signed-off-by: Adrian Ratiu Signed-off-by: Andrzej Pietrasiewicz --- @Hans: I haven't had anyone complain about the issue. The fix is needed for the rkvdec vp9 work, so I think 5.14 is fine. drivers/staging/media/rkvdec/rkvdec.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c index d821661d30f3..ef2166043127 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -481,7 +481,15 @@ static int rkvdec_buf_prepare(struct vb2_buffer *vb) if (vb2_plane_size(vb, i) < sizeimage) return -EINVAL; } - vb2_set_plane_payload(vb, 0, f->fmt.pix_mp.plane_fmt[0].sizeimage); + + /* +* Buffer bytesused is written by driver for CAPTURE buffers. +* (if userspace passes 0 bytesused for OUTPUT buffers, v4l2-core sets +* it to buffer length). +*/ + if (!V4L2_TYPE_IS_OUTPUT(vq->type)) + vb2_set_plane_payload(vb, 0, f->fmt.pix_mp.plane_fmt[0].sizeimage); + return 0; } base-commit: 0b276e470a4d43e1365d3eb53c608a3d208cabd4 -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] media: rkvdec: Fix .buf_prepare
Hi Andrzej, Thanks a lot for picking this up. On Tue, 2021-05-04 at 13:37 +0200, Andrzej Pietrasiewicz wrote: > From: Ezequiel Garcia > > The driver should only set the payload on .buf_prepare if the > buffer is CAPTURE type. If an OUTPUT buffer has a zero bytesused > set by userspace then v4l2-core will set it to buffer length. > > Fixes: cd33c830448ba ("media: rkvdec: Add the rkvdec driver") > Signed-off-by: Ezequiel Garcia > Signed-off-by: Adrian Ratiu > Signed-off-by: Andrzej Pietrasiewicz > > --- > @Hans: I haven't had anyone complain about the issue. The fix is needed for > the rkvdec vp9 work, so I think 5.14 is fine. > > drivers/staging/media/rkvdec/rkvdec.c | 10 +- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/staging/media/rkvdec/rkvdec.c > b/drivers/staging/media/rkvdec/rkvdec.c > index d821661d30f3..ef2166043127 100644 > --- a/drivers/staging/media/rkvdec/rkvdec.c > +++ b/drivers/staging/media/rkvdec/rkvdec.c > @@ -481,7 +481,15 @@ static int rkvdec_buf_prepare(struct vb2_buffer *vb) > if (vb2_plane_size(vb, i) < sizeimage) > return -EINVAL; > } > - vb2_set_plane_payload(vb, 0, f->fmt.pix_mp.plane_fmt[0].sizeimage); > + > + /* > + * Buffer bytesused is written by driver for CAPTURE buffers. > + * (if userspace passes 0 bytesused for OUTPUT buffers, v4l2-core sets > + * it to buffer length). > + */ > + if (!V4L2_TYPE_IS_OUTPUT(vq->type)) Please use V4L2_TYPE_IS_CAPTURE here. Also, why is this change needed in rkvdec, but not in cedrus or hantro? Thanks! Ezequiel ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: media: atomisp: pci: reposition braces as per coding style
On Fri, Apr 30, 2021 at 10:48:12PM +0530, Deepak R Varma wrote: > On Fri, Apr 30, 2021 at 08:12:41PM +0300, Sakari Ailus wrote: > > Hi Deepak, > > > > On Fri, Apr 30, 2021 at 10:34:37PM +0530, Deepak R Varma wrote: > > > On Fri, Apr 30, 2021 at 07:33:27PM +0300, Sakari Ailus wrote: > > > > Hi Deepak, > > > > > > > > If you're touching all these lines, I might do a little more. Please see > > > > the comments below. > > > > > > > Hello Sakari, > > > I can definitely include other changes, but then it will be many different > > > types of changes into a single patch. Will that be okay? > > > > > > I was planning to address one issue per patch as I think the volume of > > > change is going to be high. I mentioned that in the notes section of the > > > patch > > > message. > > > > I think I'd split the patch into smaller chunks if the result becomes too > > big but I don't think it's necessary yet. > > > > Splitting different kinds of simple cleanups into several patches takes > > longer time to review when they're touching the same piece of code. As the > > chunks in these patches have virtually no dependencies to other chunks, > > it's fine to do several kinds of cleanups at once. > > Okay, sure. That sounds good to me. I will include other related > improvements in the same area and send split patch set accordingly. I will > include this patch in the patch set. Hello Sakari and all, I have sent in the changes as suggested in a patch set with 5 individual patches. I will wait for your review and feedback before I work on other files. Thank you, deepak. > > Thank you for the guidance. > deepak. > > > > > -- > > Kind regards, > > > > Sakari Ailus ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel