diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2013-01-17 09:31:29 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-01-20 07:09:44 -0500 |
commit | 55bc60db5988c8366751d3d04dd690698a53412c (patch) | |
tree | 1fc546713d825d8b2892d2b113f36c965008f7f1 /drivers/gpu/drm/i915/intel_hdmi.c | |
parent | 3685a8f38f2c54bb6058c0e66ae0562f8ab84e66 (diff) |
drm/i915: Add "Automatic" mode for the "Broadcast RGB" property
Add a new "Automatic" mode to the "Broadcast RGB" range property.
When selected the driver automagically selects between full range and
limited range output.
Based on CEA-861 [1] guidelines, limited range output is selected if the
mode is a CEA mode, except 640x480. Otherwise full range output is used.
Additionally DVI monitors should most likely default to full range
always.
As per DP1.2a [2] DisplayPort should always use full range for 18bpp, and
otherwise will follow CEA-861 rules.
NOTE: The default value for the property will now be "Automatic"
so some people may be affected in case they're relying on the
current full range default.
[1] CEA-861-E - 5.1 Default Encoding Parameters
[2] VESA DisplayPort Ver.1.2a - 5.1.1.1 Video Colorimetry
v2: Use has_hdmi_sink to check if a HDMI monitor is present
v3: Add information about relevant spec chapters
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_hdmi.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_hdmi.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index f194d756a58c..db67be66639b 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
@@ -768,6 +768,15 @@ bool intel_hdmi_mode_fixup(struct drm_encoder *encoder, | |||
768 | { | 768 | { |
769 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); | 769 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); |
770 | 770 | ||
771 | if (intel_hdmi->color_range_auto) { | ||
772 | /* See CEA-861-E - 5.1 Default Encoding Parameters */ | ||
773 | if (intel_hdmi->has_hdmi_sink && | ||
774 | drm_mode_cea_vic(adjusted_mode) > 1) | ||
775 | intel_hdmi->color_range = SDVO_COLOR_RANGE_16_235; | ||
776 | else | ||
777 | intel_hdmi->color_range = 0; | ||
778 | } | ||
779 | |||
771 | if (intel_hdmi->color_range) | 780 | if (intel_hdmi->color_range) |
772 | adjusted_mode->private_flags |= INTEL_MODE_LIMITED_COLOR_RANGE; | 781 | adjusted_mode->private_flags |= INTEL_MODE_LIMITED_COLOR_RANGE; |
773 | 782 | ||
@@ -912,10 +921,21 @@ intel_hdmi_set_property(struct drm_connector *connector, | |||
912 | } | 921 | } |
913 | 922 | ||
914 | if (property == dev_priv->broadcast_rgb_property) { | 923 | if (property == dev_priv->broadcast_rgb_property) { |
915 | if (val == !!intel_hdmi->color_range) | 924 | switch (val) { |
916 | return 0; | 925 | case INTEL_BROADCAST_RGB_AUTO: |
917 | 926 | intel_hdmi->color_range_auto = true; | |
918 | intel_hdmi->color_range = val ? SDVO_COLOR_RANGE_16_235 : 0; | 927 | break; |
928 | case INTEL_BROADCAST_RGB_FULL: | ||
929 | intel_hdmi->color_range_auto = false; | ||
930 | intel_hdmi->color_range = 0; | ||
931 | break; | ||
932 | case INTEL_BROADCAST_RGB_LIMITED: | ||
933 | intel_hdmi->color_range_auto = false; | ||
934 | intel_hdmi->color_range = SDVO_COLOR_RANGE_16_235; | ||
935 | break; | ||
936 | default: | ||
937 | return -EINVAL; | ||
938 | } | ||
919 | goto done; | 939 | goto done; |
920 | } | 940 | } |
921 | 941 | ||
@@ -964,6 +984,7 @@ intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c | |||
964 | { | 984 | { |
965 | intel_attach_force_audio_property(connector); | 985 | intel_attach_force_audio_property(connector); |
966 | intel_attach_broadcast_rgb_property(connector); | 986 | intel_attach_broadcast_rgb_property(connector); |
987 | intel_hdmi->color_range_auto = true; | ||
967 | } | 988 | } |
968 | 989 | ||
969 | void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, | 990 | void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, |