aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_connectors.c
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2011-08-08 12:21:15 -0400
committerDave Airlie <airlied@redhat.com>2011-08-12 06:02:46 -0400
commit13bb9430cd6154d1f088549656c4a3ed10eaf35e (patch)
tree0a8c3e19bcbcb80e5ec9ba06fce9b7e3c8b6aa33 /drivers/gpu/drm/radeon/radeon_connectors.c
parent92bdfd4a35415dd3741b95df60782a32c586d399 (diff)
drm/radeon: Allow panel preferred EDID to override BIOS native mode
We have two sources of information about panel capabilities on mobile radeon - the BIOS, which gives us a native mode, and the panel's preferred mode. In theory these two will always match, but there's some corner cases where the BIOS hasn't been fully initialised and so the native mode in it ends up with default values. However, if we get a panel with reasonable EDID, it's probably the case that the panel's preferred mode does actually represent the panel capabilities. This patch handles that case by replacing the native mode with the panel's preferred mode if the resolutions don't match. Systems without a valid internal panel EDID will still use the BIOS native mode. Signed-off-by: Matthew Garrett <mjg@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_connectors.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_connectors.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index 519b5e2f1ee8..441e07054853 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -478,11 +478,19 @@ static void radeon_fixup_lvds_native_mode(struct drm_encoder *encoder,
478{ 478{
479 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); 479 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
480 struct drm_display_mode *native_mode = &radeon_encoder->native_mode; 480 struct drm_display_mode *native_mode = &radeon_encoder->native_mode;
481 struct drm_display_mode *t, *mode;
482
483 /* If the EDID preferred mode doesn't match the native mode, use it */
484 list_for_each_entry_safe(mode, t, &connector->probed_modes, head) {
485 if (mode->type & DRM_MODE_TYPE_PREFERRED) {
486 if (mode->hdisplay != native_mode->hdisplay ||
487 mode->vdisplay != native_mode->vdisplay)
488 memcpy(native_mode, mode, sizeof(*mode));
489 }
490 }
481 491
482 /* Try to get native mode details from EDID if necessary */ 492 /* Try to get native mode details from EDID if necessary */
483 if (!native_mode->clock) { 493 if (!native_mode->clock) {
484 struct drm_display_mode *t, *mode;
485
486 list_for_each_entry_safe(mode, t, &connector->probed_modes, head) { 494 list_for_each_entry_safe(mode, t, &connector->probed_modes, head) {
487 if (mode->hdisplay == native_mode->hdisplay && 495 if (mode->hdisplay == native_mode->hdisplay &&
488 mode->vdisplay == native_mode->vdisplay) { 496 mode->vdisplay == native_mode->vdisplay) {
@@ -493,6 +501,7 @@ static void radeon_fixup_lvds_native_mode(struct drm_encoder *encoder,
493 } 501 }
494 } 502 }
495 } 503 }
504
496 if (!native_mode->clock) { 505 if (!native_mode->clock) {
497 DRM_DEBUG_KMS("No LVDS native mode details, disabling RMX\n"); 506 DRM_DEBUG_KMS("No LVDS native mode details, disabling RMX\n");
498 radeon_encoder->rmx_type = RMX_OFF; 507 radeon_encoder->rmx_type = RMX_OFF;