All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 2/7] media: ipu3-cio2: Set valid initial format
@ 2021-10-01  9:33 Ricardo Ribalda
  2021-10-01  9:42 ` Sakari Ailus
  0 siblings, 1 reply; 2+ messages in thread
From: Ricardo Ribalda @ 2021-10-01  9:33 UTC (permalink / raw)
  To: Sakari Ailus, Mauro Carvalho Chehab, Yong Zhi, Bingbu Cao,
	linux-media, linux-kernel, Chiranjeevi Rapolu
  Cc: Ricardo Ribalda

The initial format did not have a valid size.

Fixes v4l2-compliance:

fail: v4l2-test-formats.cpp(723): Video Output Multiplanar:
				  TRY_FMT(G_FMT) != G_FMT
test VIDIOC_TRY_FMT: FAIL

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
v2: Suggested by Sakari Ailus <sakari.ailus@linux.intel.com>

Replace number with calculation based on width.

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

diff --git a/drivers/staging/media/ipu3/ipu3-v4l2.c b/drivers/staging/media/ipu3/ipu3-v4l2.c
index 38a2407645096..19c4fcabce0db 100644
--- a/drivers/staging/media/ipu3/ipu3-v4l2.c
+++ b/drivers/staging/media/ipu3/ipu3-v4l2.c
@@ -1136,7 +1136,8 @@ static int imgu_v4l2_node_setup(struct imgu_device *imgu, unsigned int pipe,
 	def_pix_fmt.height = def_bus_fmt.height;
 	def_pix_fmt.field = def_bus_fmt.field;
 	def_pix_fmt.num_planes = 1;
-	def_pix_fmt.plane_fmt[0].bytesperline = def_pix_fmt.width * 2;
+	def_pix_fmt.plane_fmt[0].bytesperline =
+		DIV_ROUND_UP(def_bus_fmt.width, 50) * 64;
 	def_pix_fmt.plane_fmt[0].sizeimage =
 		def_pix_fmt.height * def_pix_fmt.plane_fmt[0].bytesperline;
 	def_pix_fmt.flags = 0;
-- 
2.33.0.800.g4c38ced690-goog


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

* Re: [PATCH v2 2/7] media: ipu3-cio2: Set valid initial format
  2021-10-01  9:33 [PATCH v2 2/7] media: ipu3-cio2: Set valid initial format Ricardo Ribalda
@ 2021-10-01  9:42 ` Sakari Ailus
  0 siblings, 0 replies; 2+ messages in thread
From: Sakari Ailus @ 2021-10-01  9:42 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: Mauro Carvalho Chehab, Yong Zhi, Bingbu Cao, linux-media,
	linux-kernel, Chiranjeevi Rapolu

On Fri, Oct 01, 2021 at 09:33:43AM +0000, Ricardo Ribalda wrote:
> The initial format did not have a valid size.
> 
> Fixes v4l2-compliance:
> 
> fail: v4l2-test-formats.cpp(723): Video Output Multiplanar:
> 				  TRY_FMT(G_FMT) != G_FMT
> test VIDIOC_TRY_FMT: FAIL
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
> v2: Suggested by Sakari Ailus <sakari.ailus@linux.intel.com>
> 
> Replace number with calculation based on width.
> 
>  drivers/staging/media/ipu3/ipu3-v4l2.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/ipu3/ipu3-v4l2.c b/drivers/staging/media/ipu3/ipu3-v4l2.c
> index 38a2407645096..19c4fcabce0db 100644
> --- a/drivers/staging/media/ipu3/ipu3-v4l2.c
> +++ b/drivers/staging/media/ipu3/ipu3-v4l2.c
> @@ -1136,7 +1136,8 @@ static int imgu_v4l2_node_setup(struct imgu_device *imgu, unsigned int pipe,
>  	def_pix_fmt.height = def_bus_fmt.height;
>  	def_pix_fmt.field = def_bus_fmt.field;
>  	def_pix_fmt.num_planes = 1;
> -	def_pix_fmt.plane_fmt[0].bytesperline = def_pix_fmt.width * 2;
> +	def_pix_fmt.plane_fmt[0].bytesperline =
> +		DIV_ROUND_UP(def_bus_fmt.width, 50) * 64;

cio2_bytesperline()? :-)

-- 
Sakari Ailus

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

end of thread, other threads:[~2021-10-01  9:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-01  9:33 [PATCH v2 2/7] media: ipu3-cio2: Set valid initial format Ricardo Ribalda
2021-10-01  9:42 ` Sakari Ailus

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.