From 00147934598478f7fbd0a4ce5380f2fecad542b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Wed, 11 Jan 2017 14:57:21 +0200 Subject: drm/edid: Have drm_edid.h include hdmi.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit drm_edid.h depends on hdmi.h on account of enum hdmi_picture_aspect, so let's just include hdmi.h and drop some useless struct declarations. Signed-off-by: Ville Syrjälä Link: http://patchwork.freedesktop.org/patch/msgid/20170111125725.8086-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula Acked-by: Eric Anholt --- include/drm/drm_edid.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include/drm/drm_edid.h') diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 38eabf65f19d..838eaf2b42e9 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -24,6 +24,7 @@ #define __DRM_EDID_H__ #include +#include struct drm_device; struct i2c_adapter; @@ -322,8 +323,6 @@ struct cea_sad { struct drm_encoder; struct drm_connector; struct drm_display_mode; -struct hdmi_avi_infoframe; -struct hdmi_vendor_infoframe; void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid); int drm_edid_to_sad(struct edid *edid, struct cea_sad **sads); -- cgit v1.2.1 From c8127cf08ab9797c3954df463741ac47039d2b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Wed, 11 Jan 2017 16:18:35 +0200 Subject: drm/edid: Introduce drm_default_rgb_quant_range() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the code selecting the RGB quantization range a little less magicy by wrapping it up in a small helper. v2: s/adjusted_mode/mode in vc4 to make it actually compile v3: Add a comment proposed by Eric Signed-off-by: Ville Syrjälä Link: http://patchwork.freedesktop.org/patch/msgid/20170111141835.25369-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula Acked-by: Eric Anholt --- include/drm/drm_edid.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/drm/drm_edid.h') diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 838eaf2b42e9..25cdf5f7a0d8 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -441,6 +441,8 @@ enum hdmi_picture_aspect drm_get_cea_aspect_ratio(const u8 video_code); bool drm_detect_hdmi_monitor(struct edid *edid); 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); int drm_add_modes_noedid(struct drm_connector *connector, int hdisplay, int vdisplay); void drm_set_preferred_mode(struct drm_connector *connector, -- cgit v1.2.1 From a2ce26f815b16500d390fc46381ec770192a5fbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Wed, 11 Jan 2017 14:57:23 +0200 Subject: drm/edid: Introduce drm_hdmi_avi_infoframe_quant_range() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pull the logic to populate the quantization range information in the AVI infoframe into a small helper. We'll be adding a bit more logic to it, and having it in a central place seems like a good idea since it's based on the CEA-861 spec. Signed-off-by: Ville Syrjälä Link: http://patchwork.freedesktop.org/patch/msgid/20170111125725.8086-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula Acked-by: Eric Anholt --- include/drm/drm_edid.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/drm/drm_edid.h') diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 25cdf5f7a0d8..cfad4d89589f 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -345,6 +345,10 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, int drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame, const struct drm_display_mode *mode); +void +drm_hdmi_avi_infoframe_quant_range(struct hdmi_avi_infoframe *frame, + enum hdmi_quantization_range rgb_quant_range, + bool rgb_quant_range_selectable); /** * drm_eld_mnl - Get ELD monitor name length in bytes. -- cgit v1.2.1 From 779c4c2866150c1e5518d703b747f794f91f044c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Wed, 11 Jan 2017 14:57:24 +0200 Subject: drm/edid: Set AVI infoframe Q even when QS=0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HDMI 2.0 recommends that we set the Q bits in the AVI infoframe even when the sink does not support quantization range selection (QS=0). According to CEA-861 we can do that as long as the Q we send matches the default quantization range for the mode. Previously I think I had misread the spec as saying that you can't send a non-zero Q at all when QS=0. But that's not what the spec actually says. v2: Fix typo in commit message (Jani) Signed-off-by: Ville Syrjälä Link: http://patchwork.freedesktop.org/patch/msgid/20170111125725.8086-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula Acked-by: Eric Anholt --- include/drm/drm_edid.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/drm/drm_edid.h') diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index cfad4d89589f..43fb0ac5eb9c 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -347,6 +347,7 @@ drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame, const struct drm_display_mode *mode); void drm_hdmi_avi_infoframe_quant_range(struct hdmi_avi_infoframe *frame, + const struct drm_display_mode *mode, enum hdmi_quantization_range rgb_quant_range, bool rgb_quant_range_selectable); -- cgit v1.2.1