summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Dirsch <sndirsch@suse.de>2018-06-25 15:55:06 +0200
committerEmil Velikov <emil.l.velikov@gmail.com>2018-06-26 16:11:38 +0100
commit0ece556daa8a88771b669d8104396abd9166d2d0 (patch)
tree4fe7c84834f204741600e05516e1e31c570b8394
parent4241304ee2101563d2d8eb8916d85fc3626f181b (diff)
Add check for max[HV]Value to ValidMode hook
xorg-server 1.20 removed this check, so implement this in the driver itself. Signed-off-by: Stefan Dirsch <sndirsch@suse.de> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
-rw-r--r--src/savage_driver.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/savage_driver.c b/src/savage_driver.c
index 58a294d..3cda923 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -2034,8 +2034,6 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected current MCLK value of %1.3f MHz\n",
mclk / 1000.0);
- pScrn->maxHValue = 2048 << 3; /* 11 bits of h_total 8-pixel units */
- pScrn->maxVValue = 2048; /* 11 bits of v_total */
pScrn->virtualX = pScrn->display->virtualX;
pScrn->virtualY = pScrn->display->virtualY;
@@ -3637,6 +3635,14 @@ static ModeStatus SavageValidMode(SCRN_ARG_TYPE arg, DisplayModePtr pMode,
(pMode->VDisplay > psav->PanelY)))
return MODE_PANEL;
+ /* 11 bits of h_total 8-pixel units */
+ if (pMode->HTotal > (2048 << 3))
+ return MODE_BAD_HVALUE;
+
+ /* 11 bits of v_total */
+ if (pMode->VTotal > 2048)
+ return MODE_BAD_VVALUE;
+
if (psav->UseBIOS) {
refresh = SavageGetRefresh(pMode);
return (SavageMatchBiosMode(pScrn,pMode->HDisplay,