drm/radeon: don't poll tv dac if crtc2 is in use.
authorDave Airlie <airlied@redhat.com>
Tue, 8 Jun 2010 00:42:28 +0000 (10:42 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 8 Jun 2010 05:17:48 +0000 (15:17 +1000)
So when we added output polling, we'd suddenly use this code more often, and the fact that it always takes over crtc2 and messes with it during probing isn't what we really want to be happening. A more complete fix would to change it to use whatever crtc was free at the time, but for now lets stay simple and just don't poll if crtc2 is already in use.

Although a more correct fix was found I suspect we should do this as well, until we get a chance to readdres the tv out polling issues.

Reported-by: Torsten Kaiser <just.for.lkml@googlemail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/radeon_legacy_encoders.c

index 5a13b3eeef1927f2cdeeb36ca3d70de8bf69f049..5b07b8848e09b22fbeeda3b802af280ba852af1b 100644 (file)
@@ -1168,6 +1168,17 @@ static enum drm_connector_status radeon_legacy_tv_dac_detect(struct drm_encoder
        struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
        struct radeon_encoder_tv_dac *tv_dac = radeon_encoder->enc_priv;
        bool color = true;
+       struct drm_crtc *crtc;
+
+       /* find out if crtc2 is in use or if this encoder is using it */
+       list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
+               struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
+               if ((radeon_crtc->crtc_id == 1) && crtc->enabled) {
+                       if (encoder->crtc != crtc) {
+                               return connector_status_disconnected;
+                       }
+               }
+       }
 
        if (connector->connector_type == DRM_MODE_CONNECTOR_SVIDEO ||
            connector->connector_type == DRM_MODE_CONNECTOR_Composite ||