LinuxTV Patchwork [3/3] media: imx: Allow BT.709 encoding for IC routes

login
register
mail settings
Submitter Steve Longerbeam
Date Feb. 3, 2019, 7:47 p.m.
Message ID <20190203194744.11546-4-slongerbeam@gmail.com>
Download mbox | patch
Permalink /patch/54272/
State Superseded
Delegated to: Hans Verkuil
Headers show

Comments

Steve Longerbeam - Feb. 3, 2019, 7:47 p.m.
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@gateworks.com>
Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com>
---
 drivers/staging/media/imx/imx-media-utils.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Steve Longerbeam - Feb. 5, 2019, 1:55 a.m.
Sorry this patch isn't working, it's not possible to set BT.709 
encoding, working on a fix for v2.

Steve


On 2/3/19 11:47 AM, Steve Longerbeam wrote:
> 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@gateworks.com>
> Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com>
> ---
>   drivers/staging/media/imx/imx-media-utils.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c
> index 5f110d90a4ef..3512f09fb226 100644
> --- a/drivers/staging/media/imx/imx-media-utils.c
> +++ b/drivers/staging/media/imx/imx-media-utils.c
> @@ -571,7 +571,9 @@ void imx_media_fill_default_mbus_fields(struct v4l2_mbus_framefmt *tryfmt,
>   		tryfmt->quantization = is_rgb ?
>   			V4L2_QUANTIZATION_FULL_RANGE :
>   			V4L2_QUANTIZATION_LIM_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;
>   	}
>   }
>   EXPORT_SYMBOL_GPL(imx_media_fill_default_mbus_fields);

Patch

diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c
index 5f110d90a4ef..3512f09fb226 100644
--- a/drivers/staging/media/imx/imx-media-utils.c
+++ b/drivers/staging/media/imx/imx-media-utils.c
@@ -571,7 +571,9 @@  void imx_media_fill_default_mbus_fields(struct v4l2_mbus_framefmt *tryfmt,
 		tryfmt->quantization = is_rgb ?
 			V4L2_QUANTIZATION_FULL_RANGE :
 			V4L2_QUANTIZATION_LIM_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;
 	}
 }
 EXPORT_SYMBOL_GPL(imx_media_fill_default_mbus_fields);

Privacy Policy