mediatek: Add support for Xiaomi Redmi Router AX6S
[openwrt/staging/wigyori.git] / target / linux / layerscape / patches-5.4 / 805-display-0026-drm-imx-hdp-add-colorspace-property.patch
1 From 55ebf12c54a53319d6a890eb499b68565242c3c4 Mon Sep 17 00:00:00 2001
2 From: Laurentiu Palcu <laurentiu.palcu@nxp.com>
3 Date: Thu, 7 Nov 2019 15:09:11 +0200
4 Subject: [PATCH] drm/imx/hdp: add colorspace property
5
6 iMX8MQ has the ability to adjust the DCSS output pipe gamut and nonlinearity
7 depending on the HDMI connector capability. Userspace can explicitly set this
8 property if it decides, based on EDID parsing, that the sink supports REC.2020
9 and it wants to switch when it plays HDR10 content.
10
11 Otherwise, the kernel will use the default settings specified in the HDMI
12 specifications.
13
14 Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
15 ---
16 drivers/gpu/drm/bridge/cadence/cdns-hdmi-core.c | 8 +++++++-
17 1 file changed, 7 insertions(+), 1 deletion(-)
18
19 --- a/drivers/gpu/drm/bridge/cadence/cdns-hdmi-core.c
20 +++ b/drivers/gpu/drm/bridge/cadence/cdns-hdmi-core.c
21 @@ -356,11 +356,17 @@ static int cdns_hdmi_bridge_attach(struc
22 drm_connector_init(bridge->dev, connector, &cdns_hdmi_connector_funcs,
23 DRM_MODE_CONNECTOR_HDMIA);
24
25 - if (!strncmp("imx8mq-hdmi", mhdp->plat_data->plat_name, 11))
26 + if (!strncmp("imx8mq-hdmi", mhdp->plat_data->plat_name, 11)) {
27 drm_object_attach_property(&connector->base,
28 config->hdr_output_metadata_property,
29 0);
30
31 + if (!drm_mode_create_colorspace_property(connector))
32 + drm_object_attach_property(&connector->base,
33 + connector->colorspace_property,
34 + 0);
35 + }
36 +
37 drm_connector_attach_encoder(connector, encoder);
38
39 return 0;