[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20190307233356.23748-8-slongerbeam@gmail.com>
Date: Thu, 7 Mar 2019 15:33:56 -0800
From: Steve Longerbeam <slongerbeam@...il.com>
To: linux-media@...r.kernel.org
Cc: Tim Harvey <tharvey@...eworks.com>,
Steve Longerbeam <slongerbeam@...il.com>,
Philipp Zabel <p.zabel@...gutronix.de>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
devel@...verdev.osuosl.org (open list:STAGING SUBSYSTEM),
linux-kernel@...r.kernel.org (open list)
Subject: [PATCH v6 7/7] media: imx: Allow BT.709 encoding for IC routes
The IC now supports BT.709 Y'CbCr encoding, in addition to existing BT.601
encoding, so allow both, for pipelines that route through the IC.
Reported-by: Tim Harvey <tharvey@...eworks.com>
Signed-off-by: Steve Longerbeam <slongerbeam@...il.com>
---
Changes in v5:
- rebased this patch on top of repurposing the function to
imx_media_try_colorimetry().
Changes in v2:
- move ic_route check above default colorimetry checks, and fill default
colorimetry for ic_route, otherwise it's not possible to set BT.709
encoding for ic routes.
---
drivers/staging/media/imx/imx-media-utils.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c
index aa7d4be77a7e..12967d6d7e1a 100644
--- a/drivers/staging/media/imx/imx-media-utils.c
+++ b/drivers/staging/media/imx/imx-media-utils.c
@@ -524,7 +524,7 @@ EXPORT_SYMBOL_GPL(imx_media_init_cfg);
* If this format is destined to be routed through the Image Converter,
* quantization and Y`CbCr encoding must be fixed. The IC supports only
* full-range quantization for RGB at its input and output, and only
- * BT.601 Y`CbCr encoding.
+ * BT.601 or Rec.709 Y`CbCr encoding.
*/
void imx_media_try_colorimetry(struct v4l2_mbus_framefmt *tryfmt,
bool ic_route)
@@ -563,7 +563,9 @@ void imx_media_try_colorimetry(struct v4l2_mbus_framefmt *tryfmt,
tryfmt->quantization == V4L2_QUANTIZATION_DEFAULT)
tryfmt->quantization = V4L2_QUANTIZATION_FULL_RANGE;
- tryfmt->ycbcr_enc = V4L2_YCBCR_ENC_601;
+ if (tryfmt->ycbcr_enc != V4L2_YCBCR_ENC_601 &&
+ tryfmt->ycbcr_enc != V4L2_YCBCR_ENC_709)
+ tryfmt->ycbcr_enc = V4L2_YCBCR_ENC_601;
} else {
if (tryfmt->ycbcr_enc == V4L2_YCBCR_ENC_DEFAULT) {
tryfmt->ycbcr_enc =
--
2.17.1
Powered by blists - more mailing lists