summaryrefslogtreecommitdiff
path: root/src/radeon_atombios.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-11-26 15:28:15 +1000
committerDave Airlie <airlied@redhat.com>2009-11-26 15:29:44 +1000
commit381b14d5422131ea8ff942ab06a328f6beca0d3f (patch)
treea388ae366cfd622d3a8e87a012765ad5848cb4f1 /src/radeon_atombios.c
parenta67a13c315a9235be052662e2a3270686cccc0f0 (diff)
atombios: CV mode retrival was broken.
a) crev and frev are reversed b) my rv730 bios only has one mode in it, so bounds check the table size.
Diffstat (limited to 'src/radeon_atombios.c')
-rw-r--r--src/radeon_atombios.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c
index f3c88bc3..74606b3b 100644
--- a/src/radeon_atombios.c
+++ b/src/radeon_atombios.c
@@ -901,6 +901,7 @@ rhdAtomCVGetTimings(atomBiosHandlePtr handle, AtomBiosRequestID func,
DisplayModePtr new = NULL;
DisplayModePtr first = NULL;
int i;
+ uint16_t size;
data->modes = NULL;
@@ -908,12 +909,11 @@ rhdAtomCVGetTimings(atomBiosHandlePtr handle, AtomBiosRequestID func,
if (!rhdAtomGetTableRevisionAndSize(
(ATOM_COMMON_TABLE_HEADER *)(atomDataPtr->ComponentVideoInfo.base),
- &frev,&crev,NULL)) {
+ &crev,&frev,&size)) {
return ATOM_FAILED;
}
switch (frev) {
-
case 1:
switch (func) {
case ATOMBIOS_GET_CV_MODES:
@@ -947,6 +947,11 @@ rhdAtomCVGetTimings(atomBiosHandlePtr handle, AtomBiosRequestID func,
switch (func) {
case ATOMBIOS_GET_CV_MODES:
for (i = 0; i < MAX_SUPPORTED_CV_STANDARDS; i++) {
+ /* my rv730 table has only room for one mode */
+ if ((void *)&atomDataPtr->ComponentVideoInfo.ComponentVideoInfo_v21->aModeTimings[i] -
+ atomDataPtr->ComponentVideoInfo.base > size)
+ break;
+
new = rhdAtomDTDTimings(handle,
&atomDataPtr->ComponentVideoInfo
.ComponentVideoInfo_v21->aModeTimings[i]);