aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_combios.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-02-05 04:21:19 -0500
committerDave Airlie <airlied@redhat.com>2010-02-08 18:31:20 -0500
commit3c537889e17232e9073f75ae8710ea0f008c5a29 (patch)
tree9d3c25825b466b8ddc3fdc8224d4484c99173b08 /drivers/gpu/drm/radeon/radeon_combios.c
parent2739d49cd7f1f44876cad614b072da698967b370 (diff)
drm/radeon/kms: add support for hardcoded edids in rom (v2)
Some servers hardcode an edid in rom so that they will work properly with KVMs. This is a port of the relevant code from the ddx. [airlied: reworked to validate edid at boot stage - and remove special quirk, if there is a valid EDID in the BIOS rom we'll just try and use it.] Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_combios.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_combios.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
index e208d730f51..257ce1774e4 100644
--- a/drivers/gpu/drm/radeon/radeon_combios.c
+++ b/drivers/gpu/drm/radeon/radeon_combios.c
@@ -443,6 +443,39 @@ static uint16_t combios_get_table_offset(struct drm_device *dev,
443 443
444} 444}
445 445
446bool radeon_combios_check_hardcoded_edid(struct radeon_device *rdev)
447{
448 int edid_info;
449 struct edid *edid;
450 edid_info = combios_get_table_offset(rdev->ddev, COMBIOS_HARDCODED_EDID_TABLE);
451 if (!edid_info)
452 return false;
453
454 edid = kmalloc(EDID_LENGTH * (DRM_MAX_EDID_EXT_NUM + 1),
455 GFP_KERNEL);
456 if (edid == NULL)
457 return false;
458
459 memcpy((unsigned char *)edid,
460 (unsigned char *)(rdev->bios + edid_info), EDID_LENGTH);
461
462 if (!drm_edid_is_valid(edid)) {
463 kfree(edid);
464 return false;
465 }
466
467 rdev->mode_info.bios_hardcoded_edid = edid;
468 return true;
469}
470
471struct edid *
472radeon_combios_get_hardcoded_edid(struct radeon_device *rdev)
473{
474 if (rdev->mode_info.bios_hardcoded_edid)
475 return rdev->mode_info.bios_hardcoded_edid;
476 return NULL;
477}
478
446static struct radeon_i2c_bus_rec combios_setup_i2c_bus(struct radeon_device *rdev, 479static struct radeon_i2c_bus_rec combios_setup_i2c_bus(struct radeon_device *rdev,
447 int ddc_line) 480 int ddc_line)
448{ 481{