lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1543579332-16609-2-git-send-email-c.manszewski@samsung.com>
Date:   Fri, 30 Nov 2018 13:02:11 +0100
From:   Christoph Manszewski <c.manszewski@...sung.com>
To:     dri-devel@...ts.freedesktop.org
Cc:     Christoph Manszewski <c.manszewski@...sung.com>,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Maxime Ripard <maxime.ripard@...tlin.com>,
        Sean Paul <sean@...rly.run>, David Airlie <airlied@...ux.ie>,
        Inki Dae <inki.dae@...sung.com>,
        Joonyoung Shim <jy0922.shim@...sung.com>,
        Seung-Woo Kim <sw0312.kim@...sung.com>,
        Kyungmin Park <kyungmin.park@...sung.com>,
        Kukjin Kim <kgene@...nel.org>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-samsung-soc@...r.kernel.org
Subject: [PATCH 1/2] drm/edid: Add colorimetry helper function

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@...sung.com>
---
 drivers/gpu/drm/drm_edid.c | 12 ++++++++++++
 include/drm/drm_edid.h     |  2 ++
 2 files changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index b506e3622b08..03ac833dcc3c 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -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)
 {
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index e3c404833115..da43a5d02f7f 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -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,
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ