diff options
author | Adam Jackson <ajax@redhat.com> | 2017-02-16 11:19:37 -0500 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2017-02-16 11:20:00 -0500 |
commit | 70dd6c22b8af58c415ee142468d19dc8b428fffd (patch) | |
tree | 12ce406296d9c9547f4813e4de8e4c829b8c2d95 | |
parent | 43bfe6c1ed6871aed076eaa5dbd8bf1a6a0cf2e5 (diff) |
Move [HV]Total checks into renditionValidMode
Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r-- | src/rendition.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rendition.c b/src/rendition.c index 9677850..02adecc 100644 --- a/src/rendition.c +++ b/src/rendition.c @@ -813,8 +813,6 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags) * Validate the modes. Note that the limits passed to * xf86ValidateModes() are VGA CRTC architectural limits. */ - pScreenInfo->maxHValue = MAX_HTOTAL; - pScreenInfo->maxVValue = MAX_VTOTAL; nModes = xf86ValidateModes(pScreenInfo, pScreenInfo->monitor->Modes, pScreenInfo->display->modes, &renditionClockRange, NULL, 8, MAX_HDISPLAY, Rounding, @@ -1338,6 +1336,12 @@ renditionValidMode(SCRN_ARG_TYPE arg, DisplayModePtr pMode, Bool Verbose, if (pMode->Flags & V_INTERLACE) return MODE_NO_INTERLACE; + if (pMode->HTotal > MAX_HTOTAL) + return MODE_BAD_HVALUE; + + if (pMode->VTotal > MAX_VTOTAL) + return MODE_BAD_VVALUE; + return MODE_OK; } |