diff mbox series

[5/8] media: imx: imx7_mipi_csis: store colorspace in set_fmt as well

Message ID 20220204121514.2762676-6-alexander.stein@ew.tq-group.com
State New
Headers show
Series imx7/imx8mm media / csi patches | expand

Commit Message

Alexander Stein Feb. 4, 2022, 12:15 p.m. UTC
Without this the default (SMPTE 170M) from init_cfg stays unchanged.
Even after configuring 'srgb' colorspace (or 'raw')
$ media-ctl -V "'csis-32e30000.mipi-csi':0 [colorspace:srgb]"
the colorspace does not change at all:
$ media-ctl --get-v4l2 "'csis-32e30000.mipi-csi':0"
  [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:smpte170m xfer:709
   ycbcr:601 quantization:lim-range]

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
 drivers/staging/media/imx/imx7-mipi-csis.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Laurent Pinchart Feb. 5, 2022, 3:26 a.m. UTC | #1
Hi Alexander,

Thank you for the patch.

On Fri, Feb 04, 2022 at 01:15:11PM +0100, Alexander Stein wrote:
> Without this the default (SMPTE 170M) from init_cfg stays unchanged.
> Even after configuring 'srgb' colorspace (or 'raw')
> $ media-ctl -V "'csis-32e30000.mipi-csi':0 [colorspace:srgb]"
> the colorspace does not change at all:
> $ media-ctl --get-v4l2 "'csis-32e30000.mipi-csi':0"
>   [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:smpte170m xfer:709
>    ycbcr:601 quantization:lim-range]
> 
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> ---
>  drivers/staging/media/imx/imx7-mipi-csis.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c
> index a22d0e6b3d44..7b0e57efcf82 100644
> --- a/drivers/staging/media/imx/imx7-mipi-csis.c
> +++ b/drivers/staging/media/imx/imx7-mipi-csis.c
> @@ -1062,6 +1062,7 @@ static int mipi_csis_set_fmt(struct v4l2_subdev *sd,
>  	fmt->code = csis_fmt->code;
>  	fmt->width = sdformat->format.width;
>  	fmt->height = sdformat->format.height;
> +	fmt->colorspace = sdformat->format.colorspace;

Looks good, but shouldn't you also store the other colorspace-related
fields (ycbcr_enc, quantization and xfer_func) ?

>  	sdformat->format = *fmt;
Alexander Stein Feb. 7, 2022, 9:55 a.m. UTC | #2
Hi Laurent,

Am Samstag, 5. Februar 2022, 04:26:31 CET schrieb Laurent Pinchart:
> Hi Alexander,
> 
> Thank you for the patch.
> 
> On Fri, Feb 04, 2022 at 01:15:11PM +0100, Alexander Stein wrote:
> > Without this the default (SMPTE 170M) from init_cfg stays unchanged.
> > Even after configuring 'srgb' colorspace (or 'raw')
> > $ media-ctl -V "'csis-32e30000.mipi-csi':0 [colorspace:srgb]"
> > the colorspace does not change at all:
> > $ media-ctl --get-v4l2 "'csis-32e30000.mipi-csi':0"
> > 
> >   [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:smpte170m xfer:709
> >   
> >    ycbcr:601 quantization:lim-range]
> > 
> > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> > ---
> > 
> >  drivers/staging/media/imx/imx7-mipi-csis.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c
> > b/drivers/staging/media/imx/imx7-mipi-csis.c index
> > a22d0e6b3d44..7b0e57efcf82 100644
> > --- a/drivers/staging/media/imx/imx7-mipi-csis.c
> > +++ b/drivers/staging/media/imx/imx7-mipi-csis.c
> > @@ -1062,6 +1062,7 @@ static int mipi_csis_set_fmt(struct v4l2_subdev *sd,
> > 
> >  	fmt->code = csis_fmt->code;
> >  	fmt->width = sdformat->format.width;
> >  	fmt->height = sdformat->format.height;
> > 
> > +	fmt->colorspace = sdformat->format.colorspace;
> 
> Looks good, but shouldn't you also store the other colorspace-related
> fields (ycbcr_enc, quantization and xfer_func) ?

Thanks for that feedback. Sounds reasonable, will do that. 

Regards,
Alexander
diff mbox series

Patch

diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c
index a22d0e6b3d44..7b0e57efcf82 100644
--- a/drivers/staging/media/imx/imx7-mipi-csis.c
+++ b/drivers/staging/media/imx/imx7-mipi-csis.c
@@ -1062,6 +1062,7 @@  static int mipi_csis_set_fmt(struct v4l2_subdev *sd,
 	fmt->code = csis_fmt->code;
 	fmt->width = sdformat->format.width;
 	fmt->height = sdformat->format.height;
+	fmt->colorspace = sdformat->format.colorspace;
 
 	sdformat->format = *fmt;