xf86-video-mach64: Branch 'master'

Adam Jackson ajax at kemper.freedesktop.org
Thu Feb 16 16:15:02 UTC 2017


 src/atipreinit.c |    6 ------
 src/ativalid.c   |   17 +++++++++++++++++
 2 files changed, 17 insertions(+), 6 deletions(-)

New commits:
commit e27785a3fbabc9f354c361b5058b0359b6d9b5ae
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Feb 16 11:13:59 2017 -0500

    Move max mode h/v checks into ATIValidMode
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/src/atipreinit.c b/src/atipreinit.c
index dbcd9fd..96ec68f 100644
--- a/src/atipreinit.c
+++ b/src/atipreinit.c
@@ -2252,8 +2252,6 @@ ATIPreInit
 
     pitchInc = minPitch * pATI->bitsPerPixel;
 
-    pScreenInfo->maxHValue = (MaxBits(CRTC_H_TOTAL) + 1) << 3;
-
     if (pATI->Chip < ATI_CHIP_264VT)
     {
         /*
@@ -2264,12 +2262,8 @@ ATIPreInit
          */
         ATIClockRange.doubleScanAllowed = FALSE;
 
-        /* CRTC_H_TOTAL is one bit narrower */
-        pScreenInfo->maxHValue >>= 1;
     }
 
-    pScreenInfo->maxVValue = MaxBits(CRTC_V_TOTAL) + 1;
-
     maxPitch = minPitch * MaxBits(CRTC_PITCH);
 
     if (pATI->OptionAccel)
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.


More information about the xorg-commit mailing list