diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dvo.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_dvo.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c index cc70b16d5d42..eb2020eb2b7e 100644 --- a/drivers/gpu/drm/i915/intel_dvo.c +++ b/drivers/gpu/drm/i915/intel_dvo.c | |||
@@ -54,6 +54,13 @@ static const struct intel_dvo_device intel_dvo_devices[] = { | |||
54 | .dev_ops = &ch7xxx_ops, | 54 | .dev_ops = &ch7xxx_ops, |
55 | }, | 55 | }, |
56 | { | 56 | { |
57 | .type = INTEL_DVO_CHIP_TMDS, | ||
58 | .name = "ch7xxx", | ||
59 | .dvo_reg = DVOC, | ||
60 | .slave_addr = 0x75, /* For some ch7010 */ | ||
61 | .dev_ops = &ch7xxx_ops, | ||
62 | }, | ||
63 | { | ||
57 | .type = INTEL_DVO_CHIP_LVDS, | 64 | .type = INTEL_DVO_CHIP_LVDS, |
58 | .name = "ivch", | 65 | .name = "ivch", |
59 | .dvo_reg = DVOA, | 66 | .dvo_reg = DVOA, |
@@ -129,6 +136,26 @@ static bool intel_dvo_get_hw_state(struct intel_encoder *encoder, | |||
129 | return true; | 136 | return true; |
130 | } | 137 | } |
131 | 138 | ||
139 | static void intel_dvo_get_config(struct intel_encoder *encoder, | ||
140 | struct intel_crtc_config *pipe_config) | ||
141 | { | ||
142 | struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; | ||
143 | struct intel_dvo *intel_dvo = enc_to_intel_dvo(&encoder->base); | ||
144 | u32 tmp, flags = 0; | ||
145 | |||
146 | tmp = I915_READ(intel_dvo->dev.dvo_reg); | ||
147 | if (tmp & DVO_HSYNC_ACTIVE_HIGH) | ||
148 | flags |= DRM_MODE_FLAG_PHSYNC; | ||
149 | else | ||
150 | flags |= DRM_MODE_FLAG_NHSYNC; | ||
151 | if (tmp & DVO_VSYNC_ACTIVE_HIGH) | ||
152 | flags |= DRM_MODE_FLAG_PVSYNC; | ||
153 | else | ||
154 | flags |= DRM_MODE_FLAG_NVSYNC; | ||
155 | |||
156 | pipe_config->adjusted_mode.flags |= flags; | ||
157 | } | ||
158 | |||
132 | static void intel_disable_dvo(struct intel_encoder *encoder) | 159 | static void intel_disable_dvo(struct intel_encoder *encoder) |
133 | { | 160 | { |
134 | struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; | 161 | struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; |
@@ -153,6 +180,7 @@ static void intel_enable_dvo(struct intel_encoder *encoder) | |||
153 | intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, true); | 180 | intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, true); |
154 | } | 181 | } |
155 | 182 | ||
183 | /* Special dpms function to support cloning between dvo/sdvo/crt. */ | ||
156 | static void intel_dvo_dpms(struct drm_connector *connector, int mode) | 184 | static void intel_dvo_dpms(struct drm_connector *connector, int mode) |
157 | { | 185 | { |
158 | struct intel_dvo *intel_dvo = intel_attached_dvo(connector); | 186 | struct intel_dvo *intel_dvo = intel_attached_dvo(connector); |
@@ -174,6 +202,8 @@ static void intel_dvo_dpms(struct drm_connector *connector, int mode) | |||
174 | return; | 202 | return; |
175 | } | 203 | } |
176 | 204 | ||
205 | /* We call connector dpms manually below in case pipe dpms doesn't | ||
206 | * change due to cloning. */ | ||
177 | if (mode == DRM_MODE_DPMS_ON) { | 207 | if (mode == DRM_MODE_DPMS_ON) { |
178 | intel_dvo->base.connectors_active = true; | 208 | intel_dvo->base.connectors_active = true; |
179 | 209 | ||
@@ -440,6 +470,7 @@ void intel_dvo_init(struct drm_device *dev) | |||
440 | intel_encoder->disable = intel_disable_dvo; | 470 | intel_encoder->disable = intel_disable_dvo; |
441 | intel_encoder->enable = intel_enable_dvo; | 471 | intel_encoder->enable = intel_enable_dvo; |
442 | intel_encoder->get_hw_state = intel_dvo_get_hw_state; | 472 | intel_encoder->get_hw_state = intel_dvo_get_hw_state; |
473 | intel_encoder->get_config = intel_dvo_get_config; | ||
443 | intel_connector->get_hw_state = intel_dvo_connector_get_hw_state; | 474 | intel_connector->get_hw_state = intel_dvo_connector_get_hw_state; |
444 | 475 | ||
445 | /* Now, try to find a controller */ | 476 | /* Now, try to find a controller */ |