@@ -4278,6 +4278,18 @@ drm_default_rgb_quant_range(const struct drm_display_mode *mode)
}
EXPORT_SYMBOL(drm_default_rgb_quant_range);
+enum hdmi_colorimetry
+drm_default_colorimetry(const struct drm_display_mode *mode)
+{
+ if (mode->vdisplay < 720)
+ return HDMI_COLORIMETRY_ITU_601;
+ else if (mode->vdisplay <= 1080)
+ return HDMI_COLORIMETRY_ITU_709;
+ else
+ return HDMI_COLORIMETRY_EXTENDED;
+}
+EXPORT_SYMBOL(drm_default_colorimetry);
+
static void drm_parse_ycbcr420_deep_color_info(struct drm_connector *connector,
const u8 *db)
{
@@ -474,6 +474,8 @@ bool drm_detect_monitor_audio(struct edid *edid);
bool drm_rgb_quant_range_selectable(struct edid *edid);
enum hdmi_quantization_range
drm_default_rgb_quant_range(const struct drm_display_mode *mode);
+enum hdmi_colorimetry
+drm_default_colorimetry(const struct drm_display_mode *mode);
int drm_add_modes_noedid(struct drm_connector *connector,
int hdisplay, int vdisplay);
void drm_set_preferred_mode(struct drm_connector *connector,
In analogy to drm_default_rgb_quant_range, create drm_default_colorimetry helper function to determine the default colorimetry value based on drm_display_mode. Currently there isn't any standarized way to determine the default color space format. Signed-off-by: Christoph Manszewski <c.manszewski@samsung.com> --- drivers/gpu/drm/drm_edid.c | 12 ++++++++++++ include/drm/drm_edid.h | 2 ++ 2 files changed, 14 insertions(+)