Skip to content

Commit

Permalink
media: imx: Propagate quantization and encoding in CSI
Browse files Browse the repository at this point in the history
Unlike the PRPENC and PRPVF subdevices, the CSI's cannot convert
quantization from sink to source, or do any kind of Y'CbCr <-> RGB
encoding. So the CSI's cannot allow quantization and ycbcr_enc to be
selectable by the user and must be propagated from sink to source.

Fixes: 4791bd7 ("media: imx: Try colorimetry at both sink and source pads")

Reported-by: Tim Harvey <[email protected]>
Signed-off-by: Steve Longerbeam <[email protected]>
Tested-by: Tim Harvey <[email protected]>
Reviewed-by: Rui Miguel Silva <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
slongerbeam authored and mchehab committed Mar 5, 2020
1 parent 60d70d7 commit e300460
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/media/imx/imx-media-csi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1459,6 +1459,8 @@ static void csi_try_fmt(struct csi_priv *priv,
/* propagate colorimetry from sink */
sdformat->format.colorspace = infmt->colorspace;
sdformat->format.xfer_func = infmt->xfer_func;
sdformat->format.quantization = infmt->quantization;
sdformat->format.ycbcr_enc = infmt->ycbcr_enc;

break;
case CSI_SINK_PAD:
Expand Down
2 changes: 2 additions & 0 deletions drivers/staging/media/imx/imx7-media-csi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,8 @@ static int imx7_csi_try_fmt(struct imx7_csi *csi,

sdformat->format.colorspace = in_fmt->colorspace;
sdformat->format.xfer_func = in_fmt->xfer_func;
sdformat->format.quantization = in_fmt->quantization;
sdformat->format.ycbcr_enc = in_fmt->ycbcr_enc;
break;
case IMX7_CSI_PAD_SINK:
*cc = imx_media_find_mbus_format(sdformat->format.code,
Expand Down

0 comments on commit e300460

Please sign in to comment.