[PATCH video-mga] xf86-video-mga: Fix-to-always-set-HiPri-for-G200e4
Samer El Haj Mahmoud
smahmoud at lenovo.com
Tue Jun 13 09:12:21 UTC 2017
Reviewed-by: Samer El-Haj-Mahmoud <smahmoud at lenovo.com>
________________________________
From: xorg-devel <xorg-devel-bounces at lists.x.org> on behalf of mathieu.larouche at matrox.com <mathieu.larouche at matrox.com>
Sent: Monday, June 12, 2017 4:08:42 PM
To: xorg-devel at lists.x.org
Cc: Mathieu Larouche
Subject: [PATCH video-mga] xf86-video-mga: Fix-to-always-set-HiPri-for-G200e4
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
---
src/mga_driver.c | 43 ++++++++++++++++++++++++++-----------------
1 file changed, 26 insertions(+), 17 deletions(-)
diff --git a/src/mga_driver.c b/src/mga_driver.c
index 79c6da7..615518a 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -2969,14 +2969,21 @@ 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
+ {
+ 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;
+ }
OUTREG8(0x1FDE, 0x06);
OUTREG8(0x1FDF, ucHiPriLvl);
@@ -3883,15 +3890,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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.x.org/archives/xorg-devel/attachments/20170613/207e781d/attachment.html>
More information about the xorg-devel
mailing list