linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: meson: vdec: fix OUTPUT buffer size configuration
@ 2020-01-27 15:19 Maxime Jourdan
  2020-02-06  7:59 ` Neil Armstrong
  0 siblings, 1 reply; 2+ messages in thread
From: Maxime Jourdan @ 2020-01-27 15:19 UTC (permalink / raw)
  To: mchehab, hans.verkuil
  Cc: linux-amlogic, linux-media, linux-kernel, linux-arm-kernel,
	Neil Armstrong

There's a bug currently where we always override the OUTPUT buffer size
in try_fmt to the default value (1M), preventing userspace from setting
a higher or lower size.

Now, only update the size in try_fmt if userspace passed 0.

Signed-off-by: Maxime Jourdan <mjourdan@baylibre.com>
---

Note: this patch depends on Neil's series:
media: meson: vdec: Add compliant H264 support
https://patchwork.kernel.org/cover/11336953/

 drivers/staging/media/meson/vdec/vdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/meson/vdec/vdec.c b/drivers/staging/media/meson/vdec/vdec.c
index 1be67b122546..2f30945ce916 100644
--- a/drivers/staging/media/meson/vdec/vdec.c
+++ b/drivers/staging/media/meson/vdec/vdec.c
@@ -519,7 +519,8 @@ vdec_try_fmt_common(struct amvdec_session *sess, u32 size,
 	output_size = get_output_size(pixmp->width, pixmp->height);
 
 	if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
-		pfmt[0].sizeimage = sess->src_buffer_size;
+		if (!pfmt[0].sizeimage)
+			pfmt[0].sizeimage = sess->src_buffer_size;
 		pfmt[0].bytesperline = 0;
 		pixmp->num_planes = 1;
 	} else if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
-- 
2.25.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: meson: vdec: fix OUTPUT buffer size configuration
  2020-01-27 15:19 [PATCH] media: meson: vdec: fix OUTPUT buffer size configuration Maxime Jourdan
@ 2020-02-06  7:59 ` Neil Armstrong
  0 siblings, 0 replies; 2+ messages in thread
From: Neil Armstrong @ 2020-02-06  7:59 UTC (permalink / raw)
  To: Maxime Jourdan, mchehab, hans.verkuil
  Cc: linux-amlogic, linux-kernel, linux-arm-kernel, linux-media

On 27/01/2020 16:19, Maxime Jourdan wrote:
> There's a bug currently where we always override the OUTPUT buffer size
> in try_fmt to the default value (1M), preventing userspace from setting
> a higher or lower size.
> 
> Now, only update the size in try_fmt if userspace passed 0.
> 
> Signed-off-by: Maxime Jourdan <mjourdan@baylibre.com>
> ---
> 
> Note: this patch depends on Neil's series:
> media: meson: vdec: Add compliant H264 support
> https://patchwork.kernel.org/cover/11336953/
> 
>  drivers/staging/media/meson/vdec/vdec.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/meson/vdec/vdec.c b/drivers/staging/media/meson/vdec/vdec.c
> index 1be67b122546..2f30945ce916 100644
> --- a/drivers/staging/media/meson/vdec/vdec.c
> +++ b/drivers/staging/media/meson/vdec/vdec.c
> @@ -519,7 +519,8 @@ vdec_try_fmt_common(struct amvdec_session *sess, u32 size,
>  	output_size = get_output_size(pixmp->width, pixmp->height);
>  
>  	if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
> -		pfmt[0].sizeimage = sess->src_buffer_size;
> +		if (!pfmt[0].sizeimage)
> +			pfmt[0].sizeimage = sess->src_buffer_size;
>  		pfmt[0].bytesperline = 0;
>  		pixmp->num_planes = 1;
>  	} else if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
> 


Will squash into v5 of "media: meson: vdec: Add compliant H264 support"

Thanks,
Neil

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-06  8:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-27 15:19 [PATCH] media: meson: vdec: fix OUTPUT buffer size configuration Maxime Jourdan
2020-02-06  7:59 ` Neil Armstrong

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).