drm/radeon: improve dvi_mode_valid
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 16 Jun 2014 21:46:57 +0000 (17:46 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 18 Jun 2014 20:30:48 +0000 (16:30 -0400)
Make sure we have an HDMI monitor before validating modes with
clocks >165 Mhz on single link connections.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_connectors.c

index cfb2c8f88890a7389c47a4fe628fd549d55b7af9..1b9177ed181fa2827bbbeae422bddb2cf06ad19f 100644 (file)
@@ -1288,17 +1288,15 @@ static int radeon_dvi_mode_valid(struct drm_connector *connector,
                    (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D) ||
                    (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_HDMI_TYPE_B))
                        return MODE_OK;
-               else if (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_HDMI_TYPE_A) {
-                       if (ASIC_IS_DCE6(rdev)) {
-                               /* HDMI 1.3+ supports max clock of 340 Mhz */
-                               if (mode->clock > 340000)
-                                       return MODE_CLOCK_HIGH;
-                               else
-                                       return MODE_OK;
-                       } else
+               else if (ASIC_IS_DCE6(rdev) && drm_detect_hdmi_monitor(radeon_connector->edid)) {
+                       /* HDMI 1.3+ supports max clock of 340 Mhz */
+                       if (mode->clock > 340000)
                                return MODE_CLOCK_HIGH;
-               } else
+                       else
+                               return MODE_OK;
+               } else {
                        return MODE_CLOCK_HIGH;
+               }
        }
 
        /* check against the max pixel clock */