Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[sfrench/cifs-2.6.git] / drivers / gpu / drm / radeon / radeon_connectors.c
index 5eece186e03c5ae388bed2b6c5421365c9004538..b82ae61d4d17300c414c30d2eddba9e520eb03e3 100644 (file)
@@ -208,6 +208,18 @@ static struct drm_display_mode *radeon_fp_native_mode(struct drm_encoder *encode
                drm_mode_set_name(mode);
 
                DRM_DEBUG("Adding native panel mode %s\n", mode->name);
+       } else if (native_mode->hdisplay != 0 &&
+                  native_mode->vdisplay != 0) {
+               /* mac laptops without an edid */
+               /* Note that this is not necessarily the exact panel mode,
+                * but an approximation based on the cvt formula.  For these
+                * systems we should ideally read the mode info out of the
+                * registers or add a mode table, but this works and is much
+                * simpler.
+                */
+               mode = drm_cvt_mode(dev, native_mode->hdisplay, native_mode->vdisplay, 60, true, false, false);
+               mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER;
+               DRM_DEBUG("Adding cvt approximation of native panel mode %s\n", mode->name);
        }
        return mode;
 }
@@ -603,7 +615,7 @@ static enum drm_connector_status radeon_vga_detect(struct drm_connector *connect
                                ret = connector_status_connected;
                }
        } else {
-               if (radeon_connector->dac_load_detect) {
+               if (radeon_connector->dac_load_detect && encoder) {
                        encoder_funcs = encoder->helper_private;
                        ret = encoder_funcs->detect(encoder, connector);
                }
@@ -1171,7 +1183,7 @@ radeon_add_atom_connector(struct drm_device *dev,
                                                      1);
                        drm_connector_attach_property(&radeon_connector->base,
                                                      rdev->mode_info.tv_std_property,
-                                                     1);
+                                                     radeon_atombios_get_tv_info(rdev));
                }
                break;
        case DRM_MODE_CONNECTOR_LVDS:
@@ -1315,7 +1327,7 @@ radeon_add_legacy_connector(struct drm_device *dev,
                                                      1);
                        drm_connector_attach_property(&radeon_connector->base,
                                                      rdev->mode_info.tv_std_property,
-                                                     1);
+                                                     radeon_combios_get_tv_info(rdev));
                }
                break;
        case DRM_MODE_CONNECTOR_LVDS: