summaryrefslogtreecommitdiff
path: root/src/mga_driver.c
diff options
context:
space:
mode:
authorMathieu Larouche <mathieu.larouche@matrox.com>2016-06-17 10:52:42 -0400
committerDave Airlie <airlied@redhat.com>2016-07-28 05:35:32 +1000
commit12781f2e3deb7f6d86fde53134384996a6004894 (patch)
treee680e4680d07110411ef0c1d656e1d5d1fd1d6e5 /src/mga_driver.c
parentdf094bfffe4ef097bfd9a569f2d2e35649c1a3c7 (diff)
xf86-video-mga: Add support for a new G200eW3 chipset
- Added support for the new deviceID for G200eW3 - Added PLL algorithm for the G200eW3 - Added some initialization code for G200eW3 Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=92541 Signed-off-by: Mathieu Larouche <mathieu.larouche@matrox.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/mga_driver.c')
-rw-r--r--src/mga_driver.c49
1 files changed, 40 insertions, 9 deletions
diff --git a/src/mga_driver.c b/src/mga_driver.c
index 8a7186f..96d1d7a 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -408,6 +408,22 @@ static const struct mga_device_attributes attribs[] = {
},
16384, 0x4000, /* Memory probe size & offset values */
+ },
+
+ /* G200WB */
+ [16] = { 0, 1, 0, 0, 1, 0, 0, 0, new_BARs,
+ (TRANSC_SOLID_FILL | TWO_PASS_COLOR_EXPAND | USE_LINEAR_EXPANSION),
+ {
+ { 50000, 230000 }, /* System VCO frequencies */
+ { 50000, 203400 }, /* Pixel VCO frequencies */
+ { 0, 0 }, /* Video VCO frequencies */
+ 45000, /* Memory clock */
+ 27050, /* PLL reference frequency */
+ 0, /* Supports fast bitblt? */
+ MGA_HOST_PCI /* Host interface */
+ },
+
+ 16384, 0x4000, /* Memory probe size & offset values */
}
};
@@ -438,7 +454,9 @@ static const struct pci_id_match mga_device_match[] = {
MGA_DEVICE_MATCH( PCI_CHIP_MGAG200_EH_PCI, 14 ),
- MGA_DEVICE_MATCH(PCI_CHIP_MGAG200_ER_PCI, 15 ),
+ MGA_DEVICE_MATCH(PCI_CHIP_MGAG200_ER_PCI, 15 ),
+
+ MGA_DEVICE_MATCH( PCI_CHIP_MGAG200_EW3_PCI, 16 ),
{ 0, 0, 0 },
};
@@ -459,6 +477,7 @@ static SymTabRec MGAChipsets[] = {
{ PCI_CHIP_MGAG200_EV_PCI, "mgag200 EV Maxim" },
{ PCI_CHIP_MGAG200_ER_PCI, "mgag200 ER SH7757" },
{ PCI_CHIP_MGAG200_WINBOND_PCI, "mgag200 eW Nuvoton" },
+ { PCI_CHIP_MGAG200_EW3_PCI, "mgag200 eW3 Nuvoton" },
{ PCI_CHIP_MGAG200_EH_PCI, "mgag200eH" },
{ PCI_CHIP_MGAG400, "mgag400" },
{ PCI_CHIP_MGAG550, "mgag550" },
@@ -484,6 +503,8 @@ static PciChipsets MGAPciChipsets[] = {
RES_SHARED_VGA },
{ PCI_CHIP_MGAG200_WINBOND_PCI, PCI_CHIP_MGAG200_WINBOND_PCI,
RES_SHARED_VGA },
+ { PCI_CHIP_MGAG200_EW3_PCI, PCI_CHIP_MGAG200_EW3_PCI,
+ RES_SHARED_VGA },
{ PCI_CHIP_MGAG200_EH_PCI, PCI_CHIP_MGAG200_EH_PCI,
RES_SHARED_VGA },
{ PCI_CHIP_MGAG400, PCI_CHIP_MGAG400, RES_SHARED_VGA },
@@ -923,6 +944,9 @@ MGAProbe(DriverPtr drv, int flags)
attrib_no = 15;
break;
+ case PCI_CHIP_MGAG200_EW3_PCI:
+ attrib_no = 16;
+ break;
default:
return FALSE;
@@ -1541,7 +1565,8 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
pMga->is_G200SE = (pMga->Chipset == PCI_CHIP_MGAG200_SE_A_PCI)
|| (pMga->Chipset == PCI_CHIP_MGAG200_SE_B_PCI);
pMga->is_G200EV = (pMga->Chipset == PCI_CHIP_MGAG200_EV_PCI);
- pMga->is_G200WB = (pMga->Chipset == PCI_CHIP_MGAG200_WINBOND_PCI);
+ pMga->is_G200WB = (pMga->Chipset == PCI_CHIP_MGAG200_WINBOND_PCI)
+ || (pMga->Chipset == PCI_CHIP_MGAG200_EW3_PCI);
pMga->is_G200EH = (pMga->Chipset == PCI_CHIP_MGAG200_EH_PCI);
pMga->is_G200ER = (pMga->Chipset == PCI_CHIP_MGAG200_ER_PCI);
@@ -2049,6 +2074,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
case PCI_CHIP_MGAG200_SE_A_PCI:
case PCI_CHIP_MGAG200_SE_B_PCI:
case PCI_CHIP_MGAG200_WINBOND_PCI:
+ case PCI_CHIP_MGAG200_EW3_PCI:
case PCI_CHIP_MGAG200_EV_PCI:
case PCI_CHIP_MGAG200_EH_PCI:
case PCI_CHIP_MGAG200_ER_PCI:
@@ -2163,8 +2189,9 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
case PCI_CHIP_MGAG200_SE_A_PCI:
case PCI_CHIP_MGAG200_SE_B_PCI:
case PCI_CHIP_MGAG200_WINBOND_PCI:
+ case PCI_CHIP_MGAG200_EW3_PCI:
case PCI_CHIP_MGAG200_EV_PCI:
- case PCI_CHIP_MGAG200_EH_PCI:
+ case PCI_CHIP_MGAG200_EH_PCI:
case PCI_CHIP_MGAG200_ER_PCI:
pMga->SrcOrg = 0;
pMga->DstOrg = 0;
@@ -2347,6 +2374,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
case PCI_CHIP_MGAG200_PCI:
case PCI_CHIP_MGAG200_SE_B_PCI:
case PCI_CHIP_MGAG200_WINBOND_PCI:
+ case PCI_CHIP_MGAG200_EW3_PCI:
case PCI_CHIP_MGAG200_EV_PCI:
case PCI_CHIP_MGAG200_EH_PCI:
case PCI_CHIP_MGAG200_ER_PCI:
@@ -3838,12 +3866,15 @@ MGAValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags)
} else if (pMga->is_G200WB){
if (mode->Flags & V_DBLSCAN)
return MODE_NO_DBLESCAN;
- if (pMga->KVM && mode->HDisplay > 1280)
- return MODE_VIRTUAL_X;
- if (pMga->KVM && mode->VDisplay > 1024)
- return MODE_VIRTUAL_Y;
- if (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 318.77)
- return MODE_BANDWIDTH;
+ if (pMga->Chipset != PCI_CHIP_MGAG200_EW3_PCI)
+ {
+ if (pMga->KVM && mode->HDisplay > 1280)
+ return MODE_VIRTUAL_X;
+ if (pMga->KVM && mode->VDisplay > 1024)
+ return MODE_VIRTUAL_Y;
+ if (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 318.77)
+ return MODE_BANDWIDTH;
+ }
} else if (pMga->is_G200EV
&& (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 327)) {
return MODE_BANDWIDTH;