summaryrefslogtreecommitdiff
path: root/src/ativalid.c
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2017-02-16 11:13:59 -0500
committerAdam Jackson <ajax@redhat.com>2017-02-16 11:13:59 -0500
commite27785a3fbabc9f354c361b5058b0359b6d9b5ae (patch)
tree634e54091487771fbec3ad3d60c3eb405df6a59b /src/ativalid.c
parentdec6d18b61a1f8841303572ae5931fe6c937664f (diff)
Move max mode h/v checks into ATIValidMode
Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'src/ativalid.c')
-rw-r--r--src/ativalid.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ativalid.c b/src/ativalid.c
index 122f594..612bfe5 100644
--- a/src/ativalid.c
+++ b/src/ativalid.c
@@ -53,6 +53,23 @@ ATIValidMode
return MODE_OK;
}
+ {
+ int maxHValue, maxVValue;
+
+ maxHValue = (MaxBits(CRTC_H_TOTAL) + 1) << 3;
+ if (pATI->Chip < ATI_CHIP_264VT)
+ {
+ /* CRTC_H_TOTAL is one bit narrower */
+ maxHValue >>= 1;
+ }
+ if (pMode->HDisplay > maxHValue)
+ return MODE_BAD_HVALUE;
+
+ maxVValue = MaxBits(CRTC_V_TOTAL) + 1;
+ if (pMode->VDisplay > maxVValue)
+ return MODE_BAD_VVALUE;
+ }
+
/*
* The following is done for every mode in the monitor section that
* survives the common layer's basic checks.