diff mbox series

[v9.2,3/9] fixes! [max9286]: Use single sample per pixel

Message ID 20200610124623.51085-4-kieran@bingham.xyz (mailing list archive)
State Superseded
Delegated to: Kieran Bingham
Headers show
Series GMSL fixups ready for v10. | expand

Commit Message

Kieran Bingham June 10, 2020, 12:46 p.m. UTC
From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

MBUS formats for a serial bus should be specified as a single sample
point.

This change requires updating user-space test scripts to configure as
1x16 accordingly:

-    media-ctl -d $mdev -V "'$CSI':$IDX [fmt:UYVY8_2X8/1280x800 field:none]"
+    media-ctl -d $mdev -V "'$CSI':$IDX [fmt:UYVY8_1X16/1280x800 field:none]"

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
---
 drivers/media/i2c/max9286.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Comments

Jacopo Mondi June 10, 2020, 3:14 p.m. UTC | #1
Hi Kieran,

On Wed, Jun 10, 2020 at 01:46:17PM +0100, Kieran Bingham wrote:
> From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
>
> MBUS formats for a serial bus should be specified as a single sample
> point.
>
> This change requires updating user-space test scripts to configure as
> 1x16 accordingly:
>
> -    media-ctl -d $mdev -V "'$CSI':$IDX [fmt:UYVY8_2X8/1280x800 field:none]"
> +    media-ctl -d $mdev -V "'$CSI':$IDX [fmt:UYVY8_1X16/1280x800 field:none]"
>
> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

FWIW I just sent a patch to update vin tests to use the new format.

Patch is fine, please squash in.

Thanks
  j

> ---
>  drivers/media/i2c/max9286.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
> index 7e59391a5736..807024a9a149 100644
> --- a/drivers/media/i2c/max9286.c
> +++ b/drivers/media/i2c/max9286.c
> @@ -684,7 +684,7 @@ static int max9286_enum_mbus_code(struct v4l2_subdev *sd,
>  	if (code->pad || code->index > 0)
>  		return -EINVAL;
>
> -	code->code = MEDIA_BUS_FMT_UYVY8_2X8;
> +	code->code = MEDIA_BUS_FMT_UYVY8_1X16;
>
>  	return 0;
>  }
> @@ -720,13 +720,13 @@ static int max9286_set_fmt(struct v4l2_subdev *sd,
>
>  	/* Refuse non YUV422 formats as we hardcode DT to 8 bit YUV422 */
>  	switch (format->format.code) {
> -	case MEDIA_BUS_FMT_UYVY8_2X8:
> -	case MEDIA_BUS_FMT_VYUY8_2X8:
> -	case MEDIA_BUS_FMT_YUYV8_2X8:
> -	case MEDIA_BUS_FMT_YVYU8_2X8:
> +	case MEDIA_BUS_FMT_UYVY8_1X16:
> +	case MEDIA_BUS_FMT_VYUY8_1X16:
> +	case MEDIA_BUS_FMT_YUYV8_1X16:
> +	case MEDIA_BUS_FMT_YVYU8_1X16:
>  		break;
>  	default:
> -		format->format.code = MEDIA_BUS_FMT_UYVY8_2X8;
> +		format->format.code = MEDIA_BUS_FMT_UYVY8_1X16;
>  		break;
>  	}
>
> @@ -788,7 +788,7 @@ static void max9286_init_format(struct v4l2_mbus_framefmt *fmt)
>  {
>  	fmt->width		= 1280;
>  	fmt->height		= 800;
> -	fmt->code		= MEDIA_BUS_FMT_UYVY8_2X8;
> +	fmt->code		= MEDIA_BUS_FMT_UYVY8_1X16;
>  	fmt->colorspace		= V4L2_COLORSPACE_SRGB;
>  	fmt->field		= V4L2_FIELD_NONE;
>  	fmt->ycbcr_enc		= V4L2_YCBCR_ENC_DEFAULT;
> --
> 2.25.1
>
diff mbox series

Patch

diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
index 7e59391a5736..807024a9a149 100644
--- a/drivers/media/i2c/max9286.c
+++ b/drivers/media/i2c/max9286.c
@@ -684,7 +684,7 @@  static int max9286_enum_mbus_code(struct v4l2_subdev *sd,
 	if (code->pad || code->index > 0)
 		return -EINVAL;
 
-	code->code = MEDIA_BUS_FMT_UYVY8_2X8;
+	code->code = MEDIA_BUS_FMT_UYVY8_1X16;
 
 	return 0;
 }
@@ -720,13 +720,13 @@  static int max9286_set_fmt(struct v4l2_subdev *sd,
 
 	/* Refuse non YUV422 formats as we hardcode DT to 8 bit YUV422 */
 	switch (format->format.code) {
-	case MEDIA_BUS_FMT_UYVY8_2X8:
-	case MEDIA_BUS_FMT_VYUY8_2X8:
-	case MEDIA_BUS_FMT_YUYV8_2X8:
-	case MEDIA_BUS_FMT_YVYU8_2X8:
+	case MEDIA_BUS_FMT_UYVY8_1X16:
+	case MEDIA_BUS_FMT_VYUY8_1X16:
+	case MEDIA_BUS_FMT_YUYV8_1X16:
+	case MEDIA_BUS_FMT_YVYU8_1X16:
 		break;
 	default:
-		format->format.code = MEDIA_BUS_FMT_UYVY8_2X8;
+		format->format.code = MEDIA_BUS_FMT_UYVY8_1X16;
 		break;
 	}
 
@@ -788,7 +788,7 @@  static void max9286_init_format(struct v4l2_mbus_framefmt *fmt)
 {
 	fmt->width		= 1280;
 	fmt->height		= 800;
-	fmt->code		= MEDIA_BUS_FMT_UYVY8_2X8;
+	fmt->code		= MEDIA_BUS_FMT_UYVY8_1X16;
 	fmt->colorspace		= V4L2_COLORSPACE_SRGB;
 	fmt->field		= V4L2_FIELD_NONE;
 	fmt->ycbcr_enc		= V4L2_YCBCR_ENC_DEFAULT;