aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-07-01 02:49:57 -0400
committerDave Airlie <airlied@redhat.com>2010-07-12 19:20:02 -0400
commit86a1b9d1f175e9e9d022c7674d6ba1ede48ee15f (patch)
tree55d6024d3e84bbabb0544c1bb60189e76c0d8dbb /drivers/gpu
parentf5f05c8a578395a22c190b11eea8e858965abbf7 (diff)
drm: disable encoder rather than dpms off in drm_crtc_prepare_encoders()
Original behaviour will be preserved for drivers that don't implement disable() hooks for an encoder. Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/drm_crtc_helper.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index fa1323ff56b3..774d21e4dcdd 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -201,6 +201,17 @@ bool drm_helper_crtc_in_use(struct drm_crtc *crtc)
201} 201}
202EXPORT_SYMBOL(drm_helper_crtc_in_use); 202EXPORT_SYMBOL(drm_helper_crtc_in_use);
203 203
204static void
205drm_encoder_disable(struct drm_encoder *encoder)
206{
207 struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private;
208
209 if (encoder_funcs->disable)
210 (*encoder_funcs->disable)(encoder);
211 else
212 (*encoder_funcs->dpms)(encoder, DRM_MODE_DPMS_OFF);
213}
214
204/** 215/**
205 * drm_helper_disable_unused_functions - disable unused objects 216 * drm_helper_disable_unused_functions - disable unused objects
206 * @dev: DRM device 217 * @dev: DRM device
@@ -215,7 +226,6 @@ void drm_helper_disable_unused_functions(struct drm_device *dev)
215{ 226{
216 struct drm_encoder *encoder; 227 struct drm_encoder *encoder;
217 struct drm_connector *connector; 228 struct drm_connector *connector;
218 struct drm_encoder_helper_funcs *encoder_funcs;
219 struct drm_crtc *crtc; 229 struct drm_crtc *crtc;
220 230
221 list_for_each_entry(connector, &dev->mode_config.connector_list, head) { 231 list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
@@ -226,12 +236,8 @@ void drm_helper_disable_unused_functions(struct drm_device *dev)
226 } 236 }
227 237
228 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { 238 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
229 encoder_funcs = encoder->helper_private;
230 if (!drm_helper_encoder_in_use(encoder)) { 239 if (!drm_helper_encoder_in_use(encoder)) {
231 if (encoder_funcs->disable) 240 drm_encoder_disable(encoder);
232 (*encoder_funcs->disable)(encoder);
233 else
234 (*encoder_funcs->dpms)(encoder, DRM_MODE_DPMS_OFF);
235 /* disconnector encoder from any connector */ 241 /* disconnector encoder from any connector */
236 encoder->crtc = NULL; 242 encoder->crtc = NULL;
237 } 243 }
@@ -295,11 +301,11 @@ drm_crtc_prepare_encoders(struct drm_device *dev)
295 encoder_funcs = encoder->helper_private; 301 encoder_funcs = encoder->helper_private;
296 /* Disable unused encoders */ 302 /* Disable unused encoders */
297 if (encoder->crtc == NULL) 303 if (encoder->crtc == NULL)
298 (*encoder_funcs->dpms)(encoder, DRM_MODE_DPMS_OFF); 304 drm_encoder_disable(encoder);
299 /* Disable encoders whose CRTC is about to change */ 305 /* Disable encoders whose CRTC is about to change */
300 if (encoder_funcs->get_crtc && 306 if (encoder_funcs->get_crtc &&
301 encoder->crtc != (*encoder_funcs->get_crtc)(encoder)) 307 encoder->crtc != (*encoder_funcs->get_crtc)(encoder))
302 (*encoder_funcs->dpms)(encoder, DRM_MODE_DPMS_OFF); 308 drm_encoder_disable(encoder);
303 } 309 }
304} 310}
305 311