diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-07-02 09:09:45 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-09-06 01:58:52 -0400 |
commit | 732ce74f4adfcdac84862fb74c6897b4a152d5e1 (patch) | |
tree | dd7f9c2f30d4038f113973c17bb81788ee96f319 /drivers/gpu/drm/i915/intel_dvo.c | |
parent | 4ac41f47f8f6ba1d05b39783ea0819435074ef37 (diff) |
drm/i915/dvo: implement get_hw_state
Similar to the sdvo code we poke the dvo encoder whether the output is
active. Safe that dvo encoders are not standardized, so this requires
a new callback into the dvo chip driver.
Hence implement that for all 6 dvo drivers.
v2: With the newly added ns2501 we now have 6 dvo drivers instead of
just 5 ...
Acked-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 | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c index 84c0867e212b..e9397b72b4f3 100644 --- a/drivers/gpu/drm/i915/intel_dvo.c +++ b/drivers/gpu/drm/i915/intel_dvo.c | |||
@@ -105,6 +105,31 @@ 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 bool intel_dvo_connector_get_hw_state(struct intel_connector *connector) | ||
109 | { | ||
110 | struct intel_dvo *intel_dvo = intel_attached_dvo(&connector->base); | ||
111 | |||
112 | return intel_dvo->dev.dev_ops->get_hw_state(&intel_dvo->dev); | ||
113 | } | ||
114 | |||
115 | static bool intel_dvo_get_hw_state(struct intel_encoder *encoder, | ||
116 | enum pipe *pipe) | ||
117 | { | ||
118 | struct drm_device *dev = encoder->base.dev; | ||
119 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
120 | struct intel_dvo *intel_dvo = enc_to_intel_dvo(&encoder->base); | ||
121 | u32 tmp; | ||
122 | |||
123 | tmp = I915_READ(intel_dvo->dev.dvo_reg); | ||
124 | |||
125 | if (!(tmp & DVO_ENABLE)) | ||
126 | return false; | ||
127 | |||
128 | *pipe = PORT_TO_PIPE(tmp); | ||
129 | |||
130 | return true; | ||
131 | } | ||
132 | |||
108 | static void intel_disable_dvo(struct intel_encoder *encoder) | 133 | static void intel_disable_dvo(struct intel_encoder *encoder) |
109 | { | 134 | { |
110 | struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; | 135 | struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; |
@@ -414,6 +439,8 @@ void intel_dvo_init(struct drm_device *dev) | |||
414 | 439 | ||
415 | intel_encoder->disable = intel_disable_dvo; | 440 | intel_encoder->disable = intel_disable_dvo; |
416 | intel_encoder->enable = intel_enable_dvo; | 441 | intel_encoder->enable = intel_enable_dvo; |
442 | intel_encoder->get_hw_state = intel_dvo_get_hw_state; | ||
443 | intel_connector->get_hw_state = intel_dvo_connector_get_hw_state; | ||
417 | 444 | ||
418 | /* Now, try to find a controller */ | 445 | /* Now, try to find a controller */ |
419 | for (i = 0; i < ARRAY_SIZE(intel_dvo_devices); i++) { | 446 | for (i = 0; i < ARRAY_SIZE(intel_dvo_devices); i++) { |