[PATCH video-mga] xf86-video-mga: Fix to always set HiPri for G200e4 V2

Samer El Haj Mahmoud smahmoud at lenovo.com
Wed Jun 14 19:32:05 UTC 2017


Reviewed-by: Samer El-Haj-Mahmoud <smahmoud at lenovo.com>

-----Original Message-----
From: xorg-devel [mailto:xorg-devel-bounces at lists.x.org] On Behalf Of mathieu.larouche at matrox.com
Sent: Tuesday, June 13, 2017 1:44 PM
To: xorg-devel at lists.x.org
Cc: Mathieu Larouche <mathieu.larouche at matrox.com>
Subject: [PATCH video-mga] xf86-video-mga: Fix to always set HiPri for G200e4 V2

From: Mathieu Larouche <mathieu.larouche at matrox.com>

  - Changed the HiPri value for G200e4 to always be 0.
  - Added Bandwith limitation to block resolution above 1920x1200x60Hz

  - (V2): Pulled out ulMemoryBandwidth of condition so it's always initialized
        as reviewed by : Stefan Dirsch <sndirsch at suse.de>
---
 src/mga_driver.c | 40 +++++++++++++++++++++++++---------------
 1 file changed, 25 insertions(+), 15 deletions(-)

diff --git a/src/mga_driver.c b/src/mga_driver.c index 79c6da7..e496d0b 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -2971,12 +2971,20 @@ MGAModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
             
             ulMemoryBandwidth = (mode->Clock * ulBitsPerPixel) / 1000;
 
-            if      (ulMemoryBandwidth    > 3100)  ucHiPriLvl = 0;
-            else if (ulMemoryBandwidth    > 2600)  ucHiPriLvl = 1;
-            else if (ulMemoryBandwidth    > 1900)  ucHiPriLvl = 2;
-            else if (ulMemoryBandwidth    > 1160)  ucHiPriLvl = 3;
-            else if (ulMemoryBandwidth    > 440)   ucHiPriLvl = 4;
-            else ucHiPriLvl = 5;
+            if (pMga->reg_1e24 >= 0x04)
+            {
+                ucHiPriLvl = 0;
+            }
+            else
+            {
+
+                if      (ulMemoryBandwidth    > 3100)  ucHiPriLvl = 0;
+                else if (ulMemoryBandwidth    > 2600)  ucHiPriLvl = 1;
+                else if (ulMemoryBandwidth    > 1900)  ucHiPriLvl = 2;
+                else if (ulMemoryBandwidth    > 1160)  ucHiPriLvl = 3;
+                else if (ulMemoryBandwidth    > 440)   ucHiPriLvl = 4;
+                else ucHiPriLvl = 5;
+            }
 
             OUTREG8(0x1FDE, 0x06);
 		    OUTREG8(0x1FDF, ucHiPriLvl);
@@ -3883,15 +3891,17 @@ MGAValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags)
 	            return MODE_VIRTUAL_Y;
 	        if (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 244)
 	            return MODE_BANDWIDTH;
-        } else {
-            if (pMga->reg_1e24 == 0x02) {
-	            if (mode->HDisplay > 1920)
-	                return MODE_VIRTUAL_X;
-	            if (mode->VDisplay > 1200)
-	                return MODE_VIRTUAL_Y;
-	            if (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 301)
-	                return MODE_BANDWIDTH;
-            }
+        } else if (pMga->reg_1e24 == 0x02) {
+            if (mode->HDisplay > 1920)
+                return MODE_VIRTUAL_X;
+            if (mode->VDisplay > 1200)
+                return MODE_VIRTUAL_Y;
+            if (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 301)
+                return MODE_BANDWIDTH;
+        }
+        else {
+            if (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 550)
+                return MODE_BANDWIDTH;
         }
     } else if (pMga->is_G200WB){
         if (mode->Flags & V_DBLSCAN)
--
1.8.3.1

_______________________________________________
xorg-devel at lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel


More information about the xorg-devel mailing list