[PATCH] fixup! media: imx: set and propagate default field, colorimetry
From: Philipp Zabel
Date: Mon May 08 2017 - 05:38:05 EST
Signed-off-by: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>
---
drivers/staging/media/imx/imx-media-utils.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c
index a8766489e8a18..ec2abd618cc44 100644
--- a/drivers/staging/media/imx/imx-media-utils.c
+++ b/drivers/staging/media/imx/imx-media-utils.c
@@ -497,12 +497,9 @@ void imx_media_fill_default_mbus_fields(struct v4l2_mbus_framefmt *tryfmt,
/* fill colorimetry if necessary */
if (tryfmt->colorspace == V4L2_COLORSPACE_DEFAULT) {
tryfmt->colorspace = fmt->colorspace;
- if (tryfmt->xfer_func == V4L2_XFER_FUNC_DEFAULT)
- tryfmt->xfer_func = fmt->xfer_func;
- if (tryfmt->ycbcr_enc == V4L2_YCBCR_ENC_DEFAULT)
- tryfmt->ycbcr_enc = fmt->ycbcr_enc;
- if (tryfmt->quantization == V4L2_QUANTIZATION_DEFAULT)
- tryfmt->quantization = fmt->quantization;
+ tryfmt->xfer_func = fmt->xfer_func;
+ tryfmt->ycbcr_enc = fmt->ycbcr_enc;
+ tryfmt->quantization = fmt->quantization;
} else {
if (tryfmt->xfer_func == V4L2_XFER_FUNC_DEFAULT) {
tryfmt->xfer_func =
--
2.11.0
---------->8----------
> + } else {
> + const struct imx_media_pixfmt *cc;
> + bool is_rgb = false;
> +
> + cc = imx_media_find_mbus_format(tryfmt->code,
> + CS_SEL_ANY, false);
> + if (!cc)
> + cc = imx_media_find_ipu_format(tryfmt->code,
> + CS_SEL_ANY);
> + if (cc && cc->cs != IPUV3_COLORSPACE_YUV)
> + is_rgb = true;
> +
> + if (tryfmt->xfer_func == V4L2_XFER_FUNC_DEFAULT) {
> + tryfmt->xfer_func =
> + V4L2_MAP_XFER_FUNC_DEFAULT(tryfmt->colorspace);
> + }
> + if (tryfmt->ycbcr_enc == V4L2_YCBCR_ENC_DEFAULT) {
> + tryfmt->ycbcr_enc =
> + V4L2_MAP_YCBCR_ENC_DEFAULT(tryfmt->colorspace);
> + }
> + if (tryfmt->quantization == V4L2_QUANTIZATION_DEFAULT) {
> + tryfmt->quantization =
> + V4L2_MAP_QUANTIZATION_DEFAULT(
> + is_rgb, tryfmt->colorspace,
> + tryfmt->ycbcr_enc);
> + }
> + }
I'm not sure about removing this part yet.
regards
Philipp