diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2009-10-08 13:02:19 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-10-11 23:42:32 -0400 |
commit | 2ffb842948ba64b03986f4064140a74c1780c44b (patch) | |
tree | 88372d325525367faad2a4cf489c78806673c198 /drivers/gpu/drm | |
parent | b5fc901002db0519093ec723fd98969bc03cd629 (diff) |
drm/radeon/kms: make sure LVDS panel is valid in detect()
If the panel data is bogus this can lead to problems
later when the hardware trys to set the mode. If the
data is invalid, report LVDS as disconnected.
Should fix fdo bug 24247.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_connectors.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index e376be47a4a0..466f6010a2e4 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
@@ -415,8 +415,20 @@ static int radeon_lvds_mode_valid(struct drm_connector *connector, | |||
415 | 415 | ||
416 | static enum drm_connector_status radeon_lvds_detect(struct drm_connector *connector) | 416 | static enum drm_connector_status radeon_lvds_detect(struct drm_connector *connector) |
417 | { | 417 | { |
418 | enum drm_connector_status ret = connector_status_connected; | 418 | enum drm_connector_status ret = connector_status_disconnected; |
419 | struct drm_encoder *encoder = radeon_best_single_encoder(connector); | ||
420 | |||
421 | if (encoder) { | ||
422 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | ||
423 | struct radeon_native_mode *native_mode = &radeon_encoder->native_mode; | ||
424 | |||
425 | /* check if panel is valid */ | ||
426 | if (native_mode->panel_xres >= 320 && native_mode->panel_yres >= 240) | ||
427 | ret = connector_status_connected; | ||
428 | |||
429 | } | ||
419 | /* check acpi lid status ??? */ | 430 | /* check acpi lid status ??? */ |
431 | |||
420 | radeon_connector_update_scratch_regs(connector, ret); | 432 | radeon_connector_update_scratch_regs(connector, ret); |
421 | return ret; | 433 | return ret; |
422 | } | 434 | } |