diff mbox series

[v3,22/38] media: ti-vpe: cal: set field always to V4L2_FIELD_NONE

Message ID 20210524110909.672432-23-tomi.valkeinen@ideasonboard.com
State Accepted
Commit 37fa1d2a5c0502b97172e297eae06917b98d1f70
Headers show
Series media: ti-vpe: cal: multistream & embedded data support | expand

Commit Message

Tomi Valkeinen May 24, 2021, 11:08 a.m. UTC
cal_camerarx_sd_set_fmt() accepts any value for the format field, but
there should be no reason to have any other value accepted than
V4L2_FIELD_NONE. So set the field always to V4L2_FIELD_NONE.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
 drivers/media/platform/ti-vpe/cal-camerarx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Laurent Pinchart June 4, 2021, 1:48 p.m. UTC | #1
Hi Tomi,

Thank you for the patch.

On Mon, May 24, 2021 at 02:08:53PM +0300, Tomi Valkeinen wrote:
> cal_camerarx_sd_set_fmt() accepts any value for the format field, but

> there should be no reason to have any other value accepted than

> V4L2_FIELD_NONE. So set the field always to V4L2_FIELD_NONE.

> 

> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>


Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


> ---

>  drivers/media/platform/ti-vpe/cal-camerarx.c | 6 ++----

>  1 file changed, 2 insertions(+), 4 deletions(-)

> 

> diff --git a/drivers/media/platform/ti-vpe/cal-camerarx.c b/drivers/media/platform/ti-vpe/cal-camerarx.c

> index a8cca30f3f51..f2ea2bdb9ea3 100644

> --- a/drivers/media/platform/ti-vpe/cal-camerarx.c

> +++ b/drivers/media/platform/ti-vpe/cal-camerarx.c

> @@ -705,10 +705,7 @@ static int cal_camerarx_sd_set_fmt(struct v4l2_subdev *sd,

>  	if (!fmtinfo)

>  		fmtinfo = &cal_formats[0];

>  

> -	/*

> -	 * Clamp the size, update the code. The field and colorspace are

> -	 * accepted as-is.

> -	 */

> +	/* Clamp the size, update the code. The colorspace is accepted as-is. */

>  	bpp = ALIGN(fmtinfo->bpp, 8);

>  

>  	format->format.width = clamp_t(unsigned int, format->format.width,

> @@ -718,6 +715,7 @@ static int cal_camerarx_sd_set_fmt(struct v4l2_subdev *sd,

>  					CAL_MIN_HEIGHT_LINES,

>  					CAL_MAX_HEIGHT_LINES);

>  	format->format.code = fmtinfo->code;

> +	format->format.field = V4L2_FIELD_NONE;

>  

>  	/* Store the format and propagate it to the source pad. */

>  	fmt = cal_camerarx_get_pad_format(phy, sd_state,


-- 
Regards,

Laurent Pinchart
diff mbox series

Patch

diff --git a/drivers/media/platform/ti-vpe/cal-camerarx.c b/drivers/media/platform/ti-vpe/cal-camerarx.c
index a8cca30f3f51..f2ea2bdb9ea3 100644
--- a/drivers/media/platform/ti-vpe/cal-camerarx.c
+++ b/drivers/media/platform/ti-vpe/cal-camerarx.c
@@ -705,10 +705,7 @@  static int cal_camerarx_sd_set_fmt(struct v4l2_subdev *sd,
 	if (!fmtinfo)
 		fmtinfo = &cal_formats[0];
 
-	/*
-	 * Clamp the size, update the code. The field and colorspace are
-	 * accepted as-is.
-	 */
+	/* Clamp the size, update the code. The colorspace is accepted as-is. */
 	bpp = ALIGN(fmtinfo->bpp, 8);
 
 	format->format.width = clamp_t(unsigned int, format->format.width,
@@ -718,6 +715,7 @@  static int cal_camerarx_sd_set_fmt(struct v4l2_subdev *sd,
 					CAL_MIN_HEIGHT_LINES,
 					CAL_MAX_HEIGHT_LINES);
 	format->format.code = fmtinfo->code;
+	format->format.field = V4L2_FIELD_NONE;
 
 	/* Store the format and propagate it to the source pad. */
 	fmt = cal_camerarx_get_pad_format(phy, sd_state,