drm/radeon/kms: fix DP detect
authorAlex Deucher <alexdeucher@gmail.com>
Fri, 27 Nov 2009 18:01:46 +0000 (13:01 -0500)
committerDave Airlie <airlied@redhat.com>
Tue, 8 Dec 2009 00:22:48 +0000 (10:22 +1000)
only return connected if there is actually a
monitor connected.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/atombios_dp.c
drivers/gpu/drm/radeon/radeon_connectors.c
drivers/gpu/drm/radeon/radeon_display.c
drivers/gpu/drm/radeon/radeon_mode.h

index e1cbd5049f86df18c2cbd2a440ad16486d86e0ac..75977a46ba1cd68e25e3f6adc6e7de4c355deafc 100644 (file)
@@ -440,7 +440,7 @@ u8 radeon_dp_getsinktype(struct radeon_connector *radeon_connector)
                                         dig_connector->dp_i2c_bus->rec.i2c_id, 0);
 }
 
-void radeon_dp_getdpcd(struct radeon_connector *radeon_connector)
+bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector)
 {
        struct radeon_connector_atom_dig *dig_connector = radeon_connector->con_priv;
        u8 msg[25];
@@ -456,10 +456,10 @@ void radeon_dp_getdpcd(struct radeon_connector *radeon_connector)
                                printk("%02x ", msg[i]);
                        printk("\n");
                }
-               return;
+               return true;
        }
        dig_connector->dpcd[0] = 0;
-       return;
+       return false;
 }
 
 void radeon_dp_set_link_config(struct drm_connector *connector,
index 9c57633a4f4548d5a64a2aaf6d853cd53eb15f7e..563847213609245759c662440c572e0e62b76d4a 100644 (file)
@@ -936,9 +936,10 @@ static enum drm_connector_status radeon_dp_detect(struct drm_connector *connecto
 
        sink_type = radeon_dp_getsinktype(radeon_connector);
        if (sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) {
-               radeon_dp_getdpcd(radeon_connector);
-               radeon_dig_connector->dp_sink_type = sink_type;
-               ret = connector_status_connected;
+               if (radeon_dp_getdpcd(radeon_connector)) {
+                       radeon_dig_connector->dp_sink_type = sink_type;
+                       ret = connector_status_connected;
+               }
        } else {
                radeon_i2c_do_lock(radeon_connector->ddc_bus, 1);
                if (radeon_ddc_probe(radeon_connector)) {
index a1c2804b694d336373848ce6b1f799f854f7b0e3..62c929e5b089839b005557fb6b1c7eb4916248b1 100644 (file)
@@ -339,10 +339,8 @@ int radeon_ddc_get_modes(struct radeon_connector *radeon_connector)
 
        if (radeon_connector->base.connector_type == DRM_MODE_CONNECTOR_DisplayPort) {
                struct radeon_connector_atom_dig *dig = radeon_connector->con_priv;
-               if (dig->dp_i2c_bus) {
-                       radeon_connector->edid = drm_get_edid(&radeon_connector->base, &dig->dp_i2c_bus->adapter);      
-                       DRM_INFO("got edid %p from DP\n", radeon_connector->edid);
-               }
+               if (dig->dp_i2c_bus)
+                       radeon_connector->edid = drm_get_edid(&radeon_connector->base, &dig->dp_i2c_bus->adapter);
        }
        if (!radeon_connector->ddc_bus)
                return -1;
index 7d03e39714987e02198e623ede275146dc17001f..a2633628dbb83ef766dcdb17e6114e56afb6378e 100644 (file)
@@ -375,7 +375,7 @@ extern void radeon_dp_set_link_config(struct drm_connector *connector,
 extern void dp_link_train(struct drm_encoder *encoder,
                          struct drm_connector *connector);
 extern u8 radeon_dp_getsinktype(struct radeon_connector *radeon_connector);
-extern void radeon_dp_getdpcd(struct radeon_connector *radeon_connector);
+extern bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector);
 extern void atombios_dig_transmitter_setup(struct drm_encoder *encoder,
                                           int action, uint8_t lane_num,
                                           uint8_t lane_set);