linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] drm: Create and use helper function
       [not found] <CGME20181130120225eucas1p2563258e9ede809b9d82af135e1442d80@eucas1p2.samsung.com>
@ 2018-11-30 12:02 ` Christoph Manszewski
       [not found]   ` <CGME20181130120228eucas1p17dd7e4da8adb8bb8c88f1e372fb0ebd9@eucas1p1.samsung.com>
       [not found]   ` <CGME20181130120230eucas1p28cfa1960874470828230d288830f6974@eucas1p2.samsung.com>
  0 siblings, 2 replies; 3+ messages in thread
From: Christoph Manszewski @ 2018-11-30 12:02 UTC (permalink / raw)
  To: dri-devel
  Cc: Christoph Manszewski, Maarten Lankhorst, Maxime Ripard,
	Sean Paul, David Airlie, Inki Dae, Joonyoung Shim, Seung-Woo Kim,
	Kyungmin Park, Kukjin Kim, Krzysztof Kozlowski, linux-kernel,
	linux-arm-kernel, linux-samsung-soc

Hello,

This patch series implements a generic helper function, to determine
the default color space format. I've tried to do it in analogy to 
an already existing function, but I'am not sure if it is done the right way.

Patch 1 implements the mentioned function
Patch 2 makes use of it in exynos_mixer.c

Regards,
Chris

Christoph Manszewski (2):
  drm/edid: Add colorimetry helper function
  drm/exynos: mixer: Use colorimetry helper function

 drivers/gpu/drm/drm_edid.c            | 12 ++++++++++++
 drivers/gpu/drm/exynos/exynos_mixer.c |  3 ++-
 include/drm/drm_edid.h                |  2 ++
 3 files changed, 16 insertions(+), 1 deletion(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] drm/edid: Add colorimetry helper function
       [not found]   ` <CGME20181130120228eucas1p17dd7e4da8adb8bb8c88f1e372fb0ebd9@eucas1p1.samsung.com>
@ 2018-11-30 12:02     ` Christoph Manszewski
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Manszewski @ 2018-11-30 12:02 UTC (permalink / raw)
  To: dri-devel
  Cc: Christoph Manszewski, Maarten Lankhorst, Maxime Ripard,
	Sean Paul, David Airlie, Inki Dae, Joonyoung Shim, Seung-Woo Kim,
	Kyungmin Park, Kukjin Kim, Krzysztof Kozlowski, linux-kernel,
	linux-arm-kernel, linux-samsung-soc

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(+)

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] drm/exynos: mixer: Use colorimetry helper function
       [not found]   ` <CGME20181130120230eucas1p28cfa1960874470828230d288830f6974@eucas1p2.samsung.com>
@ 2018-11-30 12:02     ` Christoph Manszewski
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Manszewski @ 2018-11-30 12:02 UTC (permalink / raw)
  To: dri-devel
  Cc: Christoph Manszewski, Maarten Lankhorst, Maxime Ripard,
	Sean Paul, David Airlie, Inki Dae, Joonyoung Shim, Seung-Woo Kim,
	Kyungmin Park, Kukjin Kim, Krzysztof Kozlowski, linux-kernel,
	linux-arm-kernel, linux-samsung-soc

Use drm_default_colorimetry helper function to determine the default
colorspace type (ITU-R BT.601 or ITU-R BT.709).

Signed-off-by: Christoph Manszewski <c.manszewski@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_mixer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 2a25822bd6a1..895c6268025d 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -384,9 +384,10 @@ static void mixer_cfg_scan(struct mixer_context *ctx, int width, int height)
 static void mixer_cfg_rgb_fmt(struct mixer_context *ctx, struct drm_display_mode *mode)
 {
 	enum hdmi_quantization_range range = drm_default_rgb_quant_range(mode);
+	enum hdmi_colorimetry format = drm_default_colorimetry(mode);
 	u32 val;
 
-	if (mode->vdisplay < 720) {
+	if (format == HDMI_COLORIMETRY_ITU_601) {
 		val = MXR_CFG_RGB601;
 	} else {
 		val = MXR_CFG_RGB709;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-30 12:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20181130120225eucas1p2563258e9ede809b9d82af135e1442d80@eucas1p2.samsung.com>
2018-11-30 12:02 ` [PATCH 0/2] drm: Create and use helper function Christoph Manszewski
     [not found]   ` <CGME20181130120228eucas1p17dd7e4da8adb8bb8c88f1e372fb0ebd9@eucas1p1.samsung.com>
2018-11-30 12:02     ` [PATCH 1/2] drm/edid: Add colorimetry " Christoph Manszewski
     [not found]   ` <CGME20181130120230eucas1p28cfa1960874470828230d288830f6974@eucas1p2.samsung.com>
2018-11-30 12:02     ` [PATCH 2/2] drm/exynos: mixer: Use " Christoph Manszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).