aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_display.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-10-15 16:16:35 -0400
committerDave Airlie <airlied@redhat.com>2009-10-15 18:46:52 -0400
commit0294cf4f7f895ddcf284b1ce7cf27a2c9d7106f7 (patch)
tree7c69f11e946519457c08e8106c05df1a850b77fd /drivers/gpu/drm/radeon/radeon_display.c
parent1b4d7d75ccff38008ccd40f8e2d74e33a087caaa (diff)
drm/radeon/kms: fix connector edid handling
Based partly on a patch from Christian Koenig <deathsimple@vodafone.de> - fix several memory leaks in radeon_connector->edid handling - store edid in radeon_connector->edid in detect() or get_modes() - switch hdmi detect code to use radeon_connector->edid - add support for oem boards multiple connectors that share a ddc line. - short circuit lvds_detect() if have a stored edid Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_display.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_display.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index a20bf43389b3..c85df4afcb7a 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -334,27 +334,19 @@ static bool radeon_setup_enc_conn(struct drm_device *dev)
334 334
335int radeon_ddc_get_modes(struct radeon_connector *radeon_connector) 335int radeon_ddc_get_modes(struct radeon_connector *radeon_connector)
336{ 336{
337 struct edid *edid;
338 int ret = 0; 337 int ret = 0;
339 338
340 if (!radeon_connector->ddc_bus) 339 if (!radeon_connector->ddc_bus)
341 return -1; 340 return -1;
342 if (!radeon_connector->edid) { 341 if (!radeon_connector->edid) {
343 radeon_i2c_do_lock(radeon_connector, 1); 342 radeon_i2c_do_lock(radeon_connector, 1);
344 edid = drm_get_edid(&radeon_connector->base, &radeon_connector->ddc_bus->adapter); 343 radeon_connector->edid = drm_get_edid(&radeon_connector->base, &radeon_connector->ddc_bus->adapter);
345 radeon_i2c_do_lock(radeon_connector, 0); 344 radeon_i2c_do_lock(radeon_connector, 0);
346 } else 345 }
347 edid = radeon_connector->edid;
348 346
349 if (edid) { 347 if (radeon_connector->edid) {
350 /* update digital bits here */ 348 drm_mode_connector_update_edid_property(&radeon_connector->base, radeon_connector->edid);
351 if (edid->input & DRM_EDID_INPUT_DIGITAL) 349 ret = drm_add_edid_modes(&radeon_connector->base, radeon_connector->edid);
352 radeon_connector->use_digital = 1;
353 else
354 radeon_connector->use_digital = 0;
355 drm_mode_connector_update_edid_property(&radeon_connector->base, edid);
356 ret = drm_add_edid_modes(&radeon_connector->base, edid);
357 kfree(edid);
358 return ret; 350 return ret;
359 } 351 }
360 drm_mode_connector_update_edid_property(&radeon_connector->base, NULL); 352 drm_mode_connector_update_edid_property(&radeon_connector->base, NULL);