diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-02-21 17:23:52 -0500 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-02-22 10:56:56 -0500 |
commit | e953fd7bb32f55309a96abd5ceba9cf68d221434 (patch) | |
tree | 67110619366878f6412405ab63b7525f1c627544 /drivers/gpu/drm/i915/intel_dp.c | |
parent | ce453d81cb0397aa7d5148984f51907e14072d74 (diff) |
drm/i915: Add support for limited color range of broadcast outputs
In order to prevent "crushed blacks" on TVs, the range of the RGB output
may be limited to 16-235. This used to be available through Xorg under
the "Broadcast RGB" option, so reintroduce support for KMS.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34543
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dp.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 7ffb324b6a7d..3216adcf54d2 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -49,6 +49,7 @@ struct intel_dp { | |||
49 | uint8_t link_configuration[DP_LINK_CONFIGURATION_SIZE]; | 49 | uint8_t link_configuration[DP_LINK_CONFIGURATION_SIZE]; |
50 | bool has_audio; | 50 | bool has_audio; |
51 | int force_audio; | 51 | int force_audio; |
52 | uint32_t color_range; | ||
52 | int dpms_mode; | 53 | int dpms_mode; |
53 | uint8_t link_bw; | 54 | uint8_t link_bw; |
54 | uint8_t lane_count; | 55 | uint8_t lane_count; |
@@ -741,8 +742,8 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
741 | struct drm_crtc *crtc = intel_dp->base.base.crtc; | 742 | struct drm_crtc *crtc = intel_dp->base.base.crtc; |
742 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 743 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
743 | 744 | ||
744 | intel_dp->DP = (DP_VOLTAGE_0_4 | | 745 | intel_dp->DP = DP_VOLTAGE_0_4 | DP_PRE_EMPHASIS_0; |
745 | DP_PRE_EMPHASIS_0); | 746 | intel_dp->DP |= intel_dp->color_range; |
746 | 747 | ||
747 | if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) | 748 | if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) |
748 | intel_dp->DP |= DP_SYNC_HS_HIGH; | 749 | intel_dp->DP |= DP_SYNC_HS_HIGH; |
@@ -1680,6 +1681,7 @@ intel_dp_set_property(struct drm_connector *connector, | |||
1680 | struct drm_property *property, | 1681 | struct drm_property *property, |
1681 | uint64_t val) | 1682 | uint64_t val) |
1682 | { | 1683 | { |
1684 | struct drm_i915_private *dev_priv = connector->dev->dev_private; | ||
1683 | struct intel_dp *intel_dp = intel_attached_dp(connector); | 1685 | struct intel_dp *intel_dp = intel_attached_dp(connector); |
1684 | int ret; | 1686 | int ret; |
1685 | 1687 | ||
@@ -1708,6 +1710,14 @@ intel_dp_set_property(struct drm_connector *connector, | |||
1708 | goto done; | 1710 | goto done; |
1709 | } | 1711 | } |
1710 | 1712 | ||
1713 | if (property == dev_priv->broadcast_rgb_property) { | ||
1714 | if (val == !!intel_dp->color_range) | ||
1715 | return 0; | ||
1716 | |||
1717 | intel_dp->color_range = val ? DP_COLOR_RANGE_16_235 : 0; | ||
1718 | goto done; | ||
1719 | } | ||
1720 | |||
1711 | return -EINVAL; | 1721 | return -EINVAL; |
1712 | 1722 | ||
1713 | done: | 1723 | done: |
@@ -1827,6 +1837,8 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect | |||
1827 | intel_dp->force_audio_property->values[1] = 1; | 1837 | intel_dp->force_audio_property->values[1] = 1; |
1828 | drm_connector_attach_property(connector, intel_dp->force_audio_property, 0); | 1838 | drm_connector_attach_property(connector, intel_dp->force_audio_property, 0); |
1829 | } | 1839 | } |
1840 | |||
1841 | intel_attach_broadcast_rgb_property(connector); | ||
1830 | } | 1842 | } |
1831 | 1843 | ||
1832 | void | 1844 | void |