drm: lcdif: Switch to limited range for RGB to YUV conversion
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 30 Sep 2022 08:39:54 +0000 (11:39 +0300)
committerMarek Vasut <marex@denx.de>
Sat, 15 Oct 2022 03:33:15 +0000 (05:33 +0200)
commitec39dee8b25229a646271815cc86a8fc865525cf
tree05158aeb038b4e1f3f53c042fd2bdee9abd08c9f
parent664a7eca9bfa73b9cd2e48a4668f159f65c1d74e
drm: lcdif: Switch to limited range for RGB to YUV conversion

Up to and including v1.3, HDMI supported limited quantization range only
for YCbCr. HDMI v1.4 introduced selectable quantization ranges, but this
feature isn't supported in the dw-hdmi driver that is used in
conjunction with the LCDIF in the i.MX8MP. The HDMI YCbCr output is thus
always advertised in the AVI infoframe as limited range.

The LCDIF driver, on the other hand, configures the CSC to produce full
range YCbCr. This mismatch results in loss of details and incorrect
colours. Fix it by switching to limited range YCbCr.

The coefficients are copied from drivers/media/platforms/nxp/imx-pxp.c
for coherency, as the hardware is most likely identical.

Fixes: 9db35bb349a0 ("drm: lcdif: Add support for i.MX8MP LCDIF variant")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220930083955.31580-4-laurent.pinchart@ideasonboard.com
drivers/gpu/drm/mxsfb/lcdif_kms.c