diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-07-11 03:48:04 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-09-06 01:55:11 -0400 |
commit | 19c63fa8070b09f409f64c5b3bcd0444e6e67b3b (patch) | |
tree | ad89187e54d293615be18501d205648b2bdbed82 /drivers/gpu/drm/i915/intel_dvo.c | |
parent | ce22c320b8cad000f1b82da6e03848d59c5cf215 (diff) |
drm/i915/dvo: convert to encoder disable/enable
Similar to the sdvo conversion.
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dvo.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_dvo.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c index 227551f12d25..4ad988fb8685 100644 --- a/drivers/gpu/drm/i915/intel_dvo.c +++ b/drivers/gpu/drm/i915/intel_dvo.c | |||
@@ -105,6 +105,30 @@ static struct intel_dvo *intel_attached_dvo(struct drm_connector *connector) | |||
105 | struct intel_dvo, base); | 105 | struct intel_dvo, base); |
106 | } | 106 | } |
107 | 107 | ||
108 | static void intel_disable_dvo(struct intel_encoder *encoder) | ||
109 | { | ||
110 | struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; | ||
111 | struct intel_dvo *intel_dvo = enc_to_intel_dvo(&encoder->base); | ||
112 | u32 dvo_reg = intel_dvo->dev.dvo_reg; | ||
113 | u32 temp = I915_READ(dvo_reg); | ||
114 | |||
115 | intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, false); | ||
116 | I915_WRITE(dvo_reg, temp & ~DVO_ENABLE); | ||
117 | I915_READ(dvo_reg); | ||
118 | } | ||
119 | |||
120 | static void intel_enable_dvo(struct intel_encoder *encoder) | ||
121 | { | ||
122 | struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; | ||
123 | struct intel_dvo *intel_dvo = enc_to_intel_dvo(&encoder->base); | ||
124 | u32 dvo_reg = intel_dvo->dev.dvo_reg; | ||
125 | u32 temp = I915_READ(dvo_reg); | ||
126 | |||
127 | I915_WRITE(dvo_reg, temp | DVO_ENABLE); | ||
128 | I915_READ(dvo_reg); | ||
129 | intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, true); | ||
130 | } | ||
131 | |||
108 | static void intel_dvo_dpms(struct drm_encoder *encoder, int mode) | 132 | static void intel_dvo_dpms(struct drm_encoder *encoder, int mode) |
109 | { | 133 | { |
110 | struct drm_i915_private *dev_priv = encoder->dev->dev_private; | 134 | struct drm_i915_private *dev_priv = encoder->dev->dev_private; |
@@ -277,9 +301,10 @@ static void intel_dvo_destroy(struct drm_connector *connector) | |||
277 | static const struct drm_encoder_helper_funcs intel_dvo_helper_funcs = { | 301 | static const struct drm_encoder_helper_funcs intel_dvo_helper_funcs = { |
278 | .dpms = intel_dvo_dpms, | 302 | .dpms = intel_dvo_dpms, |
279 | .mode_fixup = intel_dvo_mode_fixup, | 303 | .mode_fixup = intel_dvo_mode_fixup, |
280 | .prepare = intel_encoder_prepare, | 304 | .prepare = intel_encoder_noop, |
281 | .mode_set = intel_dvo_mode_set, | 305 | .mode_set = intel_dvo_mode_set, |
282 | .commit = intel_encoder_commit, | 306 | .commit = intel_encoder_noop, |
307 | .disable = intel_encoder_disable, | ||
283 | }; | 308 | }; |
284 | 309 | ||
285 | static const struct drm_connector_funcs intel_dvo_connector_funcs = { | 310 | static const struct drm_connector_funcs intel_dvo_connector_funcs = { |
@@ -372,6 +397,9 @@ void intel_dvo_init(struct drm_device *dev) | |||
372 | drm_encoder_init(dev, &intel_encoder->base, | 397 | drm_encoder_init(dev, &intel_encoder->base, |
373 | &intel_dvo_enc_funcs, encoder_type); | 398 | &intel_dvo_enc_funcs, encoder_type); |
374 | 399 | ||
400 | intel_encoder->disable = intel_disable_dvo; | ||
401 | intel_encoder->enable = intel_enable_dvo; | ||
402 | |||
375 | /* Now, try to find a controller */ | 403 | /* Now, try to find a controller */ |
376 | for (i = 0; i < ARRAY_SIZE(intel_dvo_devices); i++) { | 404 | for (i = 0; i < ARRAY_SIZE(intel_dvo_devices); i++) { |
377 | struct drm_connector *connector = &intel_connector->base; | 405 | struct drm_connector *connector = &intel_connector->base; |