lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <39016a6e-6e8d-d263-da9d-47f3bb13988f@foss.st.com>
Date:   Mon, 16 May 2022 12:12:48 +0200
From:   Benjamin Mugnier <benjamin.mugnier@...s.st.com>
To:     Hugues Fruchet <hugues.fruchet@...s.st.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Sylvain Petinot <sylvain.petinot@...s.st.com>
CC:     <linux-media@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        Alain Volmat <alain.volmat@...s.st.com>
Subject: Re: [PATCH 3/3] media: st-mipid02: expose 1X16 serial pixel format



On 16/05/2022 11:19, Hugues Fruchet wrote:
> Expose RGB & YUV 1X16 serial pixel format variants to comply
> with CSI-2 camera sensor pixel formats.
> 
> Signed-off-by: Hugues Fruchet <hugues.fruchet@...s.st.com>

Reviewed-by: Benjamin Mugnier <benjamin.mugnier@...s.st.com>

> ---
>  drivers/media/i2c/st-mipid02.c | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c
> index fe884d81b08b..16cc547976dd 100644
> --- a/drivers/media/i2c/st-mipid02.c
> +++ b/drivers/media/i2c/st-mipid02.c
> @@ -62,7 +62,9 @@ static const u32 mipid02_supported_fmt_codes[] = {
>  	MEDIA_BUS_FMT_SGRBG10_1X10, MEDIA_BUS_FMT_SRGGB10_1X10,
>  	MEDIA_BUS_FMT_SBGGR12_1X12, MEDIA_BUS_FMT_SGBRG12_1X12,
>  	MEDIA_BUS_FMT_SGRBG12_1X12, MEDIA_BUS_FMT_SRGGB12_1X12,
> -	MEDIA_BUS_FMT_UYVY8_1X16, MEDIA_BUS_FMT_BGR888_1X24,
> +	MEDIA_BUS_FMT_YUYV8_1X16, MEDIA_BUS_FMT_YVYU8_1X16,
> +	MEDIA_BUS_FMT_UYVY8_1X16, MEDIA_BUS_FMT_VYUY8_1X16,
> +	MEDIA_BUS_FMT_RGB565_1X16, MEDIA_BUS_FMT_BGR888_1X24,
>  	MEDIA_BUS_FMT_RGB565_2X8_LE, MEDIA_BUS_FMT_RGB565_2X8_BE,
>  	MEDIA_BUS_FMT_YUYV8_2X8, MEDIA_BUS_FMT_YVYU8_2X8,
>  	MEDIA_BUS_FMT_UYVY8_2X8, MEDIA_BUS_FMT_VYUY8_2X8,
> @@ -132,7 +134,11 @@ static int bpp_from_code(__u32 code)
>  	case MEDIA_BUS_FMT_SGRBG12_1X12:
>  	case MEDIA_BUS_FMT_SRGGB12_1X12:
>  		return 12;
> +	case MEDIA_BUS_FMT_YUYV8_1X16:
> +	case MEDIA_BUS_FMT_YVYU8_1X16:
>  	case MEDIA_BUS_FMT_UYVY8_1X16:
> +	case MEDIA_BUS_FMT_VYUY8_1X16:
> +	case MEDIA_BUS_FMT_RGB565_1X16:
>  	case MEDIA_BUS_FMT_YUYV8_2X8:
>  	case MEDIA_BUS_FMT_YVYU8_2X8:
>  	case MEDIA_BUS_FMT_UYVY8_2X8:
> @@ -165,7 +171,10 @@ static u8 data_type_from_code(__u32 code)
>  	case MEDIA_BUS_FMT_SGRBG12_1X12:
>  	case MEDIA_BUS_FMT_SRGGB12_1X12:
>  		return 0x2c;
> +	case MEDIA_BUS_FMT_YUYV8_1X16:
> +	case MEDIA_BUS_FMT_YVYU8_1X16:
>  	case MEDIA_BUS_FMT_UYVY8_1X16:
> +	case MEDIA_BUS_FMT_VYUY8_1X16:
>  	case MEDIA_BUS_FMT_YUYV8_2X8:
>  	case MEDIA_BUS_FMT_YVYU8_2X8:
>  	case MEDIA_BUS_FMT_UYVY8_2X8:
> @@ -173,6 +182,7 @@ static u8 data_type_from_code(__u32 code)
>  		return 0x1e;
>  	case MEDIA_BUS_FMT_BGR888_1X24:
>  		return 0x24;
> +	case MEDIA_BUS_FMT_RGB565_1X16:
>  	case MEDIA_BUS_FMT_RGB565_2X8_LE:
>  	case MEDIA_BUS_FMT_RGB565_2X8_BE:
>  		return 0x22;
> @@ -207,8 +217,16 @@ static __u32 get_fmt_code(__u32 code)
>  
>  static __u32 serial_to_parallel_code(__u32 serial)
>  {
> +	if (serial == MEDIA_BUS_FMT_RGB565_1X16)
> +		return MEDIA_BUS_FMT_RGB565_2X8_LE;
> +	if (serial == MEDIA_BUS_FMT_YUYV8_1X16)
> +		return MEDIA_BUS_FMT_YUYV8_2X8;
> +	if (serial == MEDIA_BUS_FMT_YVYU8_1X16)
> +		return MEDIA_BUS_FMT_YVYU8_2X8;
>  	if (serial == MEDIA_BUS_FMT_UYVY8_1X16)
>  		return MEDIA_BUS_FMT_UYVY8_2X8;
> +	if (serial == MEDIA_BUS_FMT_VYUY8_1X16)
> +		return MEDIA_BUS_FMT_VYUY8_2X8;
>  	if (serial == MEDIA_BUS_FMT_BGR888_1X24)
>  		return MEDIA_BUS_FMT_BGR888_3X8;
>  
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ