[PATCH v3 7/8] drm/edid: Enable Additional Colorimetry Extension in AVI Infoframes
Ankit Nautiyal
ankit.k.nautiyal at intel.com
Mon Aug 30 12:26:31 UTC 2021
Add support for AVI version 4 as defined by CTA-861-G.
This allows Additional Colorimetry Extension for DCI3-P3-R'G'B' D65 and
Theatre color space.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal at intel.com>
---
drivers/gpu/drm/drm_edid.c | 6 ++++++
include/linux/hdmi.h | 8 ++++++++
2 files changed, 14 insertions(+)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 0e7da78c842f..fd20d871c1e4 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -5756,6 +5756,8 @@ static const u32 hdmi_colorimetry_val[] = {
[DRM_MODE_COLORIMETRY_BT2020_CYCC] = HDMI_COLORIMETRY_BT2020_CYCC,
[DRM_MODE_COLORIMETRY_BT2020_RGB] = HDMI_COLORIMETRY_BT2020_RGB,
[DRM_MODE_COLORIMETRY_BT2020_YCC] = HDMI_COLORIMETRY_BT2020_YCC,
+ [DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65] = HDMI_COLORIMETRY_DCI_P3_RGB_D65,
+ [DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER] = HDMI_COLORIMETRY_DCI_P3_RGB_THEATER,
};
#undef C
@@ -5787,6 +5789,10 @@ drm_hdmi_avi_infoframe_colorspace(struct hdmi_avi_infoframe *frame,
*/
frame->extended_colorimetry = (colorimetry_val >> 2) &
EXTENDED_COLORIMETRY_MASK;
+
+ if (frame->extended_colorimetry == HDMI_EXTENDED_COLORIMETRY_RESERVED)
+ frame->ace_colorimetry = (colorimetry_val >> 5) &
+ EXTENDED_ACE_COLORIMETRY_MASK;
}
EXPORT_SYMBOL(drm_hdmi_avi_infoframe_colorspace);
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
index 2fe012670ad3..0ae9ecd1e28b 100644
--- a/include/linux/hdmi.h
+++ b/include/linux/hdmi.h
@@ -54,6 +54,7 @@ enum hdmi_infoframe_type {
#define HDMI_FORUM_IEEE_OUI 0xc45dd8
#define HDMI_INFOFRAME_HEADER_SIZE 4
#define HDMI_AVI_INFOFRAME_SIZE 13
+#define HDMI_AVI_V4_INFOFRAME_SIZE 14
#define HDMI_SPD_INFOFRAME_SIZE 25
#define HDMI_AUDIO_INFOFRAME_SIZE 10
#define HDMI_DRM_INFOFRAME_SIZE 26
@@ -128,6 +129,12 @@ enum hdmi_extended_colorimetry {
HDMI_EXTENDED_COLORIMETRY_RESERVED,
};
+enum hdmi_ace_colorimetry {
+ HDMI_ACE_COLORIMETRY_DCI_P3_D65,
+ HDMI_ACE_COLORIMETRY_DCI_P3_CINEMA,
+ HDMI_ACE_COLORIMETRY_RESERVED,
+};
+
enum hdmi_quantization_range {
HDMI_QUANTIZATION_RANGE_DEFAULT,
HDMI_QUANTIZATION_RANGE_LIMITED,
@@ -177,6 +184,7 @@ struct hdmi_avi_infoframe {
enum hdmi_active_aspect active_aspect;
bool itc;
enum hdmi_extended_colorimetry extended_colorimetry;
+ enum hdmi_ace_colorimetry ace_colorimetry;
enum hdmi_quantization_range quantization_range;
enum hdmi_nups nups;
unsigned char video_code;
--
2.25.1
More information about the Intel-gfx-trybot
mailing list