--- xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c.orig Sat Jul 31 05:30:52 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c Thu May 12 20:58:01 2005 @@ -86,6 +86,8 @@ { PCI_CHIP_GD5464BD, "CL-GD5464BD" }, { PCI_CHIP_GD5465, "CL-GD5465" }, { PCI_CHIP_GD7548, "CL-GD7548" }, + { PCI_CHIP_GD7555, "CL-GD7555" }, + { PCI_CHIP_GD7556, "CL-GD7556" }, {-1, NULL } }; @@ -103,6 +105,8 @@ { PCI_CHIP_GD5464BD,PCI_CHIP_GD5464BD, RES_SHARED_VGA }, { PCI_CHIP_GD5465, PCI_CHIP_GD5465, RES_SHARED_VGA }, { PCI_CHIP_GD7548, PCI_CHIP_GD7548, RES_SHARED_VGA }, + { PCI_CHIP_GD7555, PCI_CHIP_GD7555, RES_SHARED_VGA }, + { PCI_CHIP_GD7556, PCI_CHIP_GD7556, RES_SHARED_VGA }, { -1, -1, RES_UNDEFINED} }; --- xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c.orig Sat Apr 24 04:28:21 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c Thu May 12 20:58:01 2005 @@ -109,6 +109,12 @@ static void AlpDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags); +/* for PC98 */ +#define PC98_SKIP_INT10 + +static void PC98CIRRUS755xEnable(ScrnInfoPtr pScrn); +static void PC98CIRRUS755xDisable(ScrnInfoPtr pScrn); + /* * This is intentionally screen-independent. It indicates the binding * choice made in the first PreInit. @@ -143,6 +149,8 @@ static int gd5446_MaxClocks[] = { 135100, 135100, 85500, 85500, 0 }; static int gd5480_MaxClocks[] = { 135100, 200000, 200000, 135100, 135100 }; static int gd7548_MaxClocks[] = { 80100, 80100, 80100, 80100, 80100 }; +static int gd7555_MaxClocks[] = { 80100, 80100, 80100, 80100, 80100 }; +static int gd7556_MaxClocks[] = { 80100, 80100, 80100, 80100, 80100 }; /* * List of symbols from other modules that this module references. This @@ -453,6 +461,11 @@ break; } break; + + case PCI_CHIP_GD7555: + case PCI_CHIP_GD7556: + videoram = 2048; /* for PC-9821 La13 etc. */ + break; } /* UNMap the Alp memory and MMIO areas */ @@ -567,6 +580,9 @@ pCir->PciInfo->device, pCir->PciInfo->func); +#ifdef PC98_SKIP_INT10 + if (!xf86IsPc98()) { +#endif if (xf86LoadSubModule(pScrn, "int10")) { xf86LoaderReqSymLists(int10Symbols,NULL); xf86DrvMsg(pScrn->scrnIndex,X_INFO,"initializing int10\n"); @@ -580,6 +596,9 @@ pciWriteLong(pCir->PciTag,0x14,pCir->PciInfo->memBase[1]); } +#ifdef PC98_SKIP_INT10 + } +#endif /* Set pScrn->monitor */ pScrn->monitor = pScrn->confScreen->monitor; @@ -653,6 +672,16 @@ from = X_DEFAULT; pCir->HWCursor = FALSE; + + switch (pCir->Chipset) { + case PCI_CHIP_GD7555: + case PCI_CHIP_GD7556: + pCir->HWCursor = TRUE; + break; + default: + break; + } + if (xf86GetOptValBool(pCir->Options, OPTION_HW_CURSOR, &pCir->HWCursor)) from = X_CONFIG; @@ -939,6 +968,12 @@ case PCI_CHIP_GD7548: p = gd7548_MaxClocks; break; + case PCI_CHIP_GD7555: + p = gd7555_MaxClocks; + break; + case PCI_CHIP_GD7556: + p = gd7556_MaxClocks; + break; } if (!p) return FALSE; @@ -1425,6 +1460,9 @@ vgaHWProtect(pScrn, FALSE); + if (xf86IsPc98()) + PC98CIRRUS755xEnable(pScrn); + return TRUE; } @@ -1843,6 +1881,9 @@ AlpRestore(pScrn); vgaHWLock(hwp); + + if (xf86IsPc98()) + PC98CIRRUS755xDisable(pScrn); } @@ -1880,6 +1921,9 @@ pScrn->vtSema = FALSE; + if (xf86IsPc98()) + PC98CIRRUS755xDisable(pScrn); + pScreen->CloseScreen = pCir->CloseScreen; return (*pScreen->CloseScreen)(scrnIndex, pScreen); } @@ -2142,3 +2186,52 @@ box.y2 - pScrn->virtualY); } } + +static void +PC98CIRRUS755xEnable(ScrnInfoPtr pScrn) /* enter_aile() */ +{ + unsigned int index,data; + vgaHWPtr hwp = VGAHWPTR(pScrn); + + outb(0xfac, 0x02); + + outb(0x68, 0x0e); + outb(0x6a, 0x07); + outb(0x6a, 0x8f); + outb(0x6a, 0x06); + + outw(VGA_SEQ_INDEX, 0x1206); /* unlock cirrus special */ + + index = hwp->IOBase + VGA_CRTC_INDEX_OFFSET; + data = hwp->IOBase + VGA_CRTC_DATA_OFFSET; + outb(index, 0x3c); + outb(data, inb(data) & 0xef); + outb(index, 0x1a); + outb(data, inb(data) & 0xf3); +} + +static void +PC98CIRRUS755xDisable(ScrnInfoPtr pScrn) /* leave_aile() */ +{ + unsigned int index,data; + vgaHWPtr hwp = VGAHWPTR(pScrn); + + outw(VGA_SEQ_INDEX, 0x1206); /* unlock cirrus special */ + + index = hwp->IOBase + VGA_CRTC_INDEX_OFFSET; + data = hwp->IOBase + VGA_CRTC_DATA_OFFSET; + outb(index, 0x3c); + outb(data, 0x71); + outb(index, 0x1a); + outb(data, inb(data) | 0x0c); + + outb(0xfac,0x00); + + outb(0x68, 0x0f); + outb(0x6a, 0x07); + outb(0x6a, 0x8e); + outb(0x6a, 0x21); + outb(0x6a, 0x69); + outb(0x6a, 0x06); +} + --- xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h.orig Sat Jul 31 07:20:21 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h Thu May 12 20:58:01 2005 @@ -342,6 +342,7 @@ /* Cirrus Logic */ #define PCI_CHIP_GD7548 0x0038 #define PCI_CHIP_GD7555 0x0040 +#define PCI_CHIP_GD7556 0x004C #define PCI_CHIP_GD5430 0x00A0 #define PCI_CHIP_GD5434_4 0x00A4 #define PCI_CHIP_GD5434_8 0x00A8