diff options
Diffstat (limited to 'xc/programs/Xserver/hw/xfree86/drivers/trident')
5 files changed, 68 insertions, 144 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/blade_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/trident/blade_accel.c index 8fea7a726..a20eacbda 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/blade_accel.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/blade_accel.c @@ -23,7 +23,7 @@ * * Trident Blade3D accelerated options. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/blade_accel.c,v 1.10 2000/11/28 00:04:39 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/blade_accel.c,v 1.13 2000/12/04 08:46:17 alanh Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -71,12 +71,11 @@ static void BladeSetupForScreenToScreenColorExpand(ScrnInfoPtr pScrn, static void BladeSubsequentScreenToScreenColorExpand(ScrnInfoPtr pScrn, int x, int y, int w, int h, int srcx, int srcy, int offset); -static void BladeSetupForScanlineCPUToScreenColorExpand(ScrnInfoPtr pScrn, +static void BladeSetupForCPUToScreenColorExpand(ScrnInfoPtr pScrn, int fg, int bg, int rop, unsigned int planemask); -static void BladeSubsequentScanlineCPUToScreenColorExpand(ScrnInfoPtr pScrn, +static void BladeSubsequentCPUToScreenColorExpand(ScrnInfoPtr pScrn, int x, int y, int w, int h, int skipleft); -static void BladeSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno); static void BladeSetClippingRectangle(ScrnInfoPtr pScrn, int x1, int y1, int x2, int y2); static void BladeDisableClipping(ScrnInfoPtr pScrn); @@ -92,18 +91,21 @@ static void BladeSetupForColor8x8PatternFill(ScrnInfoPtr pScrn, static void BladeSubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrn, int patternx, int patterny, int x, int y, int w, int h); -static void BladeSetupForScanlineImageWrite(ScrnInfoPtr pScrn, int rop, +static void BladeSetupForImageWrite(ScrnInfoPtr pScrn, int rop, unsigned int planemask, int transparency_color, int bpp, int depth); -static void BladeSubsequentScanlineImageWriteRect(ScrnInfoPtr pScrn, int x, +static void BladeSubsequentImageWriteRect(ScrnInfoPtr pScrn, int x, int y, int w, int h, int skipleft); -static void BladeSubsequentImageWriteScanline(ScrnInfoPtr pScrn, int bufno); static void BladeInitializeAccelerator(ScrnInfoPtr pScrn) { TRIDENTPtr pTrident = TRIDENTPTR(pScrn); CARD32 stride; + + BLADE_OUT(0x2124, 1<<7); + BLADE_OUT(0x2124, 0); + BladeSync(pScrn); stride = (pScrn->displayWidth >> 3) << 20; @@ -163,9 +165,6 @@ BladeAccelInit(ScreenPtr pScreen) infoPtr->SetClippingRectangle = BladeSetClippingRectangle; infoPtr->DisableClipping = BladeDisableClipping; - infoPtr->ClippingFlags = HARDWARE_CLIP_SOLID_FILL | - HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY | - HARDWARE_CLIP_MONO_8x8_FILL; #if 0 infoPtr->SolidLineFlags = 0; @@ -220,45 +219,27 @@ BladeAccelInit(ScreenPtr pScreen) #endif infoPtr->CPUToScreenColorExpandFillFlags = CPU_TRANSFER_PAD_DWORD | - NO_TRANSPARENCY | LEFT_EDGE_CLIPPING | - LEFT_EDGE_CLIPPING_NEGATIVE_X | + SYNC_AFTER_COLOR_EXPAND | NO_PLANEMASK | BIT_ORDER_IN_BYTE_MSBFIRST | SCANLINE_PAD_DWORD; infoPtr->ColorExpandRange = 0x10000; infoPtr->ColorExpandBase = pTrident->IOBase + 0x10000; infoPtr->SetupForCPUToScreenColorExpandFill = - BladeSetupForScanlineCPUToScreenColorExpand; + BladeSetupForCPUToScreenColorExpand; infoPtr->SubsequentCPUToScreenColorExpandFill = - BladeSubsequentScanlineCPUToScreenColorExpand; - infoPtr->SubsequentColorExpandScanline = - BladeSubsequentColorExpandScanline; - - pTrident->XAAScanlineColorExpandBuffers[0] = - xnfalloc(((pScrn->virtualX + 63)) *4* (pScrn->bitsPerPixel / 8)); - - infoPtr->NumScanlineColorExpandBuffers = 1; - infoPtr->ScanlineColorExpandBuffers = - pTrident->XAAScanlineColorExpandBuffers; + BladeSubsequentCPUToScreenColorExpand; - infoPtr->SetupForImageWrite = BladeSetupForScanlineImageWrite; - infoPtr->SubsequentImageWriteRect = BladeSubsequentScanlineImageWriteRect; - infoPtr->SubsequentImageWriteScanline = - BladeSubsequentImageWriteScanline; + infoPtr->SetupForImageWrite = BladeSetupForImageWrite; + infoPtr->SubsequentImageWriteRect = + BladeSubsequentImageWriteRect; infoPtr->ImageWriteFlags = NO_PLANEMASK | - NO_TRANSPARENCY | - LEFT_EDGE_CLIPPING_NEGATIVE_X | LEFT_EDGE_CLIPPING | CPU_TRANSFER_PAD_DWORD | SYNC_AFTER_IMAGE_WRITE; infoPtr->ImageWriteBase = pTrident->IOBase + 0x10000; infoPtr->ImageWriteRange = 0x10000; - infoPtr->NumScanlineImageWriteBuffers = 1; - infoPtr->ScanlineImageWriteBuffers = pTrident->XAAImageScanlineBuffer; - - pTrident->XAAImageScanlineBuffer[0] = - xnfalloc(pScrn->virtualX * pScrn->bitsPerPixel / 8); AvailFBArea.x1 = 0; AvailFBArea.y1 = 0; @@ -273,25 +254,6 @@ BladeAccelInit(ScreenPtr pScreen) } static void -BladeSyncClip(ScrnInfoPtr pScrn) -{ - TRIDENTPtr pTrident = TRIDENTPTR(pScrn); - int busy; - int cnt = 10000000; - - BLADEBUSY(busy); - while (busy != 0) { - if (--cnt < 0) { - ErrorF("GE timeout\n"); - BLADE_OUT(0x2124, 1<<7); - BLADE_OUT(0x2124, 0); - break; - } - BLADEBUSY(busy); - } -} - -static void BladeSync(ScrnInfoPtr pScrn) { TRIDENTPtr pTrident = TRIDENTPTR(pScrn); @@ -360,8 +322,6 @@ BladeSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, BLADE_OUT(0x2108, y2<<16 | x2); BLADE_OUT(0x210C, ((y2+h-1)&0xfff)<<16 | ((x2+w-1)&0xfff)); } - if (!pTrident->UsePCIRetry) - BladeSyncClip(pScrn); } static void @@ -435,9 +395,6 @@ BladeSubsequentSolidBresenhamLine( ScrnInfoPtr pScrn, BLADE_OUT(0x2140, E<<30 | (y&0xfff)<<20 | ((x&0xfff)<<4)); BLADE_OUT(0x2144, D<<30 | (((dmaj-dmin)&0xfff) << 16) | (-dmin&0xfff)); BLADE_OUT(0x2148, ((-(dmin+e)&0xfff) << 16)); - - if (!pTrident->UsePCIRetry) - BladeSyncClip(pScrn); } @@ -461,9 +418,6 @@ BladeSubsequentSolidTwoPointLine( ScrnInfoPtr pScrn, if (flags & OMIT_LAST) BladeDisableClipping(pScrn); #endif - - if (!pTrident->UsePCIRetry) - BladeSyncClip(pScrn); } static void @@ -511,9 +465,6 @@ BladeSubsequentDashedTwoPointLine( ScrnInfoPtr pScrn, if (flags & OMIT_LAST) BladeDisableClipping(pScrn); - - if (!pTrident->UsePCIRetry) - BladeSyncClip(pScrn); } static void @@ -541,8 +492,6 @@ BladeSubsequentFillRectSolid(ScrnInfoPtr pScrn, int x, int y, int w, int h) BLADE_OUT(0x2144, 0x20000000 | pTrident->BltScanDirection | 1<<19 | 1<<4 | 2<<2 | (pTrident->Clipping ? 1:0)); BLADE_OUT(0x2108, y<<16 | x); BLADE_OUT(0x210C, ((y+h-1)&0xfff)<<16 | ((x+w-1)&0xfff)); - if (!pTrident->UsePCIRetry) - BladeSyncClip(pScrn); } static void @@ -581,36 +530,8 @@ BladeSubsequentScreenToScreenColorExpand(ScrnInfoPtr pScrn, IMAGE_OUT(0x24, 0x80000000 | 3<<22 | 1<<7 | pTrident->BltScanDirection | (pTrident->ROP == GXcopy ? 0 : 1<<10) | offset<<25); } -static void MoveDWORDS( - register CARD32* dest, - register CARD32* src, - register int dwords ) -{ - while(dwords & ~0x03) { - *dest = *src; - *(dest + 1) = *(src + 1); - *(dest + 2) = *(src + 2); - *(dest + 3) = *(src + 3); - src += 4; - dest += 4; - dwords -= 4; - } - if (!dwords) return; - *dest = *src; - dest += 1; - src += 1; - if (dwords == 1) return; - *dest = *src; - dest += 1; - src += 1; - if (dwords == 2) return; - *dest = *src; - dest += 1; - src += 1; -} - static void -BladeSetupForScanlineCPUToScreenColorExpand(ScrnInfoPtr pScrn, +BladeSetupForCPUToScreenColorExpand(ScrnInfoPtr pScrn, int fg, int bg, int rop, unsigned int planemask) { @@ -638,7 +559,7 @@ BladeSetupForScanlineCPUToScreenColorExpand(ScrnInfoPtr pScrn, } static void -BladeSubsequentScanlineCPUToScreenColorExpand(ScrnInfoPtr pScrn, +BladeSubsequentCPUToScreenColorExpand(ScrnInfoPtr pScrn, int x, int y, int w, int h, int skipleft) { TRIDENTPtr pTrident = TRIDENTPTR(pScrn); @@ -647,23 +568,6 @@ BladeSubsequentScanlineCPUToScreenColorExpand(ScrnInfoPtr pScrn, BLADE_OUT(0x2144, 0xE0000000 | pTrident->BltScanDirection | 1<<4 | (skipleft ? 1 : 0)); BLADE_OUT(0x2108, (y&0xfff)<<16 | (x&0xfff)); BLADE_OUT(0x210C, ((y+h-1)&0xfff)<<16 | ((x+w-1)&0xfff)); - pTrident->dwords = (w + 31) >> 5; - pTrident->h = h; -} - -static void -BladeSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno) -{ - TRIDENTPtr pTrident = TRIDENTPTR(pScrn); - XAAInfoRecPtr infoRec; - infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - - MoveDWORDS((CARD32*)infoRec->ColorExpandBase, - (CARD32*)pTrident->XAAScanlineColorExpandBuffers[bufno], pTrident->dwords); - - pTrident->h--; - if (!pTrident->h) - BladeSync(pScrn); } static void @@ -717,8 +621,6 @@ BladeSubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn, BLADE_OUT(0x2144, 0x20000000 | pTrident->BltScanDirection | 7<<12 | 1<<4 | 1<<19 | 2<<2 | clip); BLADE_OUT(0x2108, y<<16 | x); BLADE_OUT(0x210C, ((y+h-1)&0xfff)<<16 | ((x+w-1)&0xfff)); - if (!pTrident->UsePCIRetry) - BladeSyncClip(pScrn); } static void @@ -759,7 +661,7 @@ BladeSubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrn, CHECKCLIPPING; } -static void BladeSetupForScanlineImageWrite( +static void BladeSetupForImageWrite( ScrnInfoPtr pScrn, int rop, unsigned int planemask, @@ -777,33 +679,15 @@ static void BladeSetupForScanlineImageWrite( } } -static void BladeSubsequentScanlineImageWriteRect( +static void BladeSubsequentImageWriteRect( ScrnInfoPtr pScrn, int x, int y, int w, int h, int skipleft ){ TRIDENTPtr pTrident = TRIDENTPTR(pScrn); - pTrident->dwords = ((w * (pScrn->bitsPerPixel/8)) + 3) >> 2; - pTrident->h = h; - if (skipleft) BladeSetClippingRectangle(pScrn,x+skipleft,y,(x+w-1),(y+h-1)); BLADE_OUT(0x2144, 0xE0000000 | 1<<19 | 1<<4 | pTrident->BltScanDirection | (skipleft ? 1 : 0)); BLADE_OUT(0x2108, y<<16 | (x&0xfff)); BLADE_OUT(0x210C, ((y+h-1)&0xfff)<<16 | ((x+w-1)&0xfff)); } - -static void -BladeSubsequentImageWriteScanline(ScrnInfoPtr pScrn, int bufno) -{ - TRIDENTPtr pTrident = TRIDENTPTR(pScrn); - XAAInfoRecPtr infoRec; - infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - - MoveDWORDS((CARD32*)infoRec->ImageWriteBase, - (CARD32*)pTrident->XAAImageScanlineBuffer[bufno], pTrident->dwords); - - pTrident->h--; - if (!pTrident->h) - BladeSync(pScrn); -} diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h index 453d33e2e..91744dd1e 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h @@ -21,7 +21,7 @@ * * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h,v 1.29 2000/11/26 10:08:52 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h,v 1.31 2000/11/30 11:53:25 alanh Exp $ */ #ifndef _TRIDENT_H_ #define _TRIDENT_H_ @@ -247,7 +247,9 @@ typedef enum { CYBERBLADEI7, CYBERBLADEI7D, CYBERBLADEI1, - CYBERBLADEI1D + CYBERBLADEI1D, + CYBERBLADEAI1, + CYBERBLADEAI1D } TRIDENTType; #define UseMMIO (pTrident->NoMMIO == FALSE) @@ -272,6 +274,8 @@ typedef enum { (pTrident->Chipset == CYBERBLADEI7D) || \ (pTrident->Chipset == CYBERBLADEI1) || \ (pTrident->Chipset == CYBERBLADEI1D) || \ + (pTrident->Chipset == CYBERBLADEAI1) || \ + (pTrident->Chipset == CYBERBLADEAI1D) || \ (pTrident->Chipset == BLADE3D)) /* diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c index 849d25c78..8166ab42b 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c @@ -21,7 +21,7 @@ * * Author: Alan Hourihane, alanh@fairlite.demon.co.uk */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c,v 1.32 2000/11/27 23:07:27 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c,v 1.33 2000/11/30 10:19:48 alanh Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -314,6 +314,8 @@ TridentInit(ScrnInfoPtr pScrn, DisplayModePtr mode) case CYBERBLADEI7D: case CYBERBLADEI1: case CYBERBLADEI1D: + case CYBERBLADEAI1: + case CYBERBLADEAI1D: case CYBERBLADEE4: case BLADE3D: OUTB(vgaIOBase + 4, RAMDACTiming); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c index 191984040..145076dee 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c @@ -28,7 +28,7 @@ * Massimiliano Ghilardi, max@Linuz.sns.it, some fixes to the * clockchip programming code. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c,v 1.111 2000/11/26 10:08:52 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c,v 1.113 2000/12/02 15:30:58 tsi Exp $ */ #include "xf1bpp.h" #include "xf4bpp.h" @@ -159,6 +159,8 @@ static SymTabRec TRIDENTChipsets[] = { { CYBERBLADEI7D, "cyberbladei7d" }, { CYBERBLADEI1, "cyberbladei1" }, { CYBERBLADEI1D, "cyberbladei1d" }, + { CYBERBLADEAI1, "cyberbladeAi1" }, + { CYBERBLADEAI1D, "cyberbladeAi1d" }, { -1, NULL } }; @@ -190,6 +192,8 @@ static PciChipsets TRIDENTPciChipsets[] = { { CYBERBLADEI7D, PCI_CHIP_8420, RES_SHARED_VGA }, { CYBERBLADEI1, PCI_CHIP_8500, RES_SHARED_VGA }, { CYBERBLADEI1D, PCI_CHIP_8520, RES_SHARED_VGA }, + { CYBERBLADEAI1, PCI_CHIP_8600, RES_SHARED_VGA }, + { CYBERBLADEAI1D, PCI_CHIP_8620, RES_SHARED_VGA }, { -1, -1, RES_UNDEFINED } }; @@ -300,6 +304,8 @@ static int ClockLimit[] = { 230000, 230000, 230000, + 230000, + 230000, }; static int ClockLimit16bpp[] = { @@ -338,6 +344,8 @@ static int ClockLimit16bpp[] = { 230000, 230000, 230000, + 230000, + 230000, }; static int ClockLimit24bpp[] = { @@ -376,6 +384,8 @@ static int ClockLimit24bpp[] = { 115000, 115000, 115000, + 115000, + 115000, }; static int ClockLimit32bpp[] = { @@ -415,6 +425,8 @@ static int ClockLimit32bpp[] = { 115000, 115000, 115000, + 115000, + 115000, }; /* @@ -837,7 +849,7 @@ static Bool TRIDENTProbe(DriverPtr drv, int flags) { int i; - GDevPtr *devSections = NULL; + GDevPtr *devSections; int *usedChips = NULL; int numDevSections; int numUsed; @@ -897,6 +909,7 @@ TRIDENTProbe(DriverPtr drv, int flags) foundScreen = TRUE; } } + xfree(usedChips); } } @@ -931,8 +944,7 @@ TRIDENTProbe(DriverPtr drv, int flags) xfree(usedChips); } - if (devSections) - xfree(devSections); + xfree(devSections); return foundScreen; } @@ -1669,6 +1681,24 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) pTrident->NewClockCode = TRUE; pTrident->frequency = NTSC; break; + case CYBERBLADEAI1: + pTrident->ddc1Read = Tridentddc1Read; + ramtype = "SDRAM"; + pTrident->IsCyber = TRUE; + Support24bpp = TRUE; + chipset = "CyberBlade/Ai1"; + pTrident->NewClockCode = TRUE; + pTrident->frequency = NTSC; + break; + case CYBERBLADEAI1D: + pTrident->ddc1Read = Tridentddc1Read; + ramtype = "SDRAM"; + pTrident->IsCyber = TRUE; + Support24bpp = TRUE; + chipset = "CyberBlade/DSTN/Ai1"; + pTrident->NewClockCode = TRUE; + pTrident->frequency = NTSC; + break; } if (!pScrn->progClock) { @@ -2177,6 +2207,8 @@ TRIDENTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) case CYBERBLADEI7D: case CYBERBLADEI1: case CYBERBLADEI1D: + case CYBERBLADEAI1: + case CYBERBLADEAI1D: case CYBER9520: case CYBER9525DVD: case CYBERBLADEE4: @@ -2476,6 +2508,8 @@ TRIDENTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) (pTrident->Chipset == CYBERBLADEI7D) || (pTrident->Chipset == CYBERBLADEI1) || (pTrident->Chipset == CYBERBLADEI1D) || + (pTrident->Chipset == CYBERBLADEAI1) || + (pTrident->Chipset == CYBERBLADEAI1D) || (pTrident->Chipset == CYBERBLADEE4) || (pTrident->Chipset == BLADE3D)) BladeAccelInit(pScreen); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h index 22b1bedd4..754192162 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h @@ -21,7 +21,7 @@ * * Author: Alan Hourihane, alanh@fairlite.demon.co.uk */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h,v 1.15 2000/11/28 00:04:39 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h,v 1.16 2000/12/04 08:46:17 alanh Exp $ */ #define DEBUG 1 @@ -325,7 +325,7 @@ #define IMAGEBUSY(b) \ (b = MMIO_IN32(pTrident->IOBase,IMAGE_GE_STATUS) & 0xF0000000) #define BLADEBUSY(b) \ - (b = MMIO_IN32(pTrident->IOBase,BLADE_GE_STATUS) & 0xF0000000) + (b = MMIO_IN32(pTrident->IOBase,BLADE_GE_STATUS) & 0xFA800000) #define IMAGE_OUT(addr, c) \ MMIO_OUT32(pTrident->IOBase, addr, (c)) #define BLADE_OUT(addr, c) \ |