diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-26 22:48:59 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-26 22:48:59 +0000 |
commit | a6dbf328e124511ea2b4dc796f6b67dd919bf839 (patch) | |
tree | 513474734457bff05d4bd284f442c7d392105c86 | |
parent | 3c5e383a433be77572808336ce06a6da5990ee61 (diff) |
merge latest (4.3.99.16) from XFree86 (vendor) branchXEVIE-BASE
-rw-r--r-- | src/ct_accel.c | 5 | ||||
-rw-r--r-- | src/ct_cursor.c | 16 | ||||
-rw-r--r-- | src/ct_ddc.c | 4 | ||||
-rw-r--r-- | src/ct_driver.c | 63 | ||||
-rw-r--r-- | src/ct_driver.h | 3 | ||||
-rw-r--r-- | src/ct_regs.c | 26 | ||||
-rw-r--r-- | src/ct_video.c | 158 |
7 files changed, 81 insertions, 194 deletions
diff --git a/src/ct_accel.c b/src/ct_accel.c index d936291..9bf4c55 100644 --- a/src/ct_accel.c +++ b/src/ct_accel.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_accel.c,v 1.40 2002/11/25 14:04:58 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_accel.c,v 1.41 2003/11/03 05:11:07 tsi Exp $ */ /* * Copyright 1996, 1997, 1998 by David Bateman <dbateman@ee.uts.edu.au> * Modified 1997, 1998 by Nozomi Ytow @@ -248,9 +248,12 @@ CTNAME(AccelInit)(ScreenPtr pScreen) * then used by a CopyArea function with a complex ROP. */ infoPtr->SubsequentSolidFillRect = CTNAME(24SubsequentSolidFillRect); +#if 0 + /* How can an unsigned quantity be less than zero? */ if (cAcl->ScratchAddress < 0) infoPtr->ScreenToScreenCopyFlags |= GXCOPY_ONLY; #endif +#endif break; #ifdef CHIPS_HIQV case 32: diff --git a/src/ct_cursor.c b/src/ct_cursor.c index 44a7e8a..55b56a3 100644 --- a/src/ct_cursor.c +++ b/src/ct_cursor.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_cursor.c,v 1.27 2002/11/25 14:04:58 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_cursor.c,v 1.28 2003/07/17 08:19:34 eich Exp $ */ /* * Copyright 1994 The XFree86 Project @@ -156,10 +156,7 @@ CHIPSSetCursorPosition(ScrnInfoPtr pScrn, int x, int y) CHIPSPtr cPtr = CHIPSPTR(pScrn); CURSOR_SYNC(pScrn); - - if (pScrn->currentMode->Flags & V_DBLSCAN) - y *= 2; - + if (x < 0) x = ~(x-1) | 0x8000; if (y < 0) @@ -429,10 +426,13 @@ CHIPSLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src) } static Bool -CHIPSUseHWCursor(ScreenPtr pScr, CursorPtr pCurs) +CHIPSUseHWCursor(ScreenPtr pScreen, CursorPtr pCurs) { - CHIPSPtr cPtr = CHIPSPTR(xf86Screens[pScr->myNum]); - return ((cPtr->Flags & ChipsHWCursor) != 0); + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + CHIPSPtr cPtr = CHIPSPTR(pScrn); + + return (((cPtr->Flags & ChipsHWCursor) != 0) + && !(pScrn->currentMode->Flags & V_DBLSCAN)); } Bool diff --git a/src/ct_ddc.c b/src/ct_ddc.c index 0286685..323dfe9 100644 --- a/src/ct_ddc.c +++ b/src/ct_ddc.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_ddc.c,v 1.8 2001/05/09 19:57:04 dbateman Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_ddc.c,v 1.9 2003/09/24 02:43:20 dawes Exp $ */ /* All drivers should typically include these */ #include "xf86.h" @@ -39,7 +39,7 @@ chips_ddc1(ScrnInfoPtr pScrn) { unsigned char FR0B, FR0C, XR62; unsigned char mask_c = 0x00; - unsigned char val, tmp_val; + unsigned char val, tmp_val = 0; int i; CHIPSPtr cPtr = CHIPSPTR(pScrn); diff --git a/src/ct_driver.c b/src/ct_driver.c index 2aa6cc2..a39ba2e 100644 --- a/src/ct_driver.c +++ b/src/ct_driver.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c,v 1.122 2002/11/25 14:04:58 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c,v 1.133 2003/11/03 05:11:07 tsi Exp $ */ /* * Copyright 1993 by Jon Block <block@frc.com> @@ -142,7 +142,7 @@ static Bool CHIPSEnterVT(int scrnIndex, int flags); static void CHIPSLeaveVT(int scrnIndex, int flags); static Bool CHIPSCloseScreen(int scrnIndex, ScreenPtr pScreen); static void CHIPSFreeScreen(int scrnIndex, int flags); -static int CHIPSValidMode(int scrnIndex, DisplayModePtr mode, +static ModeStatus CHIPSValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags); static Bool CHIPSSaveScreen(ScreenPtr pScreen, int mode); @@ -679,12 +679,14 @@ static const char *vgahwSymbols[] = { NULL }; +#ifdef XFree86LOADER static const char *miscfbSymbols[] = { "xf1bppScreenInit", "xf4bppScreenInit", "cfb8_16ScreenInit", NULL }; +#endif static const char *fbSymbols[] = { "fbScreenInit", @@ -695,7 +697,6 @@ static const char *fbSymbols[] = { static const char *xaaSymbols[] = { "XAACreateInfoRec", "XAADestroyInfoRec", - "XAAFillSolidRects" , "XAAInit", "XAAInitDualFramebufferOverlay", "XAAStippleScanlineFuncMSBFirst", @@ -1390,7 +1391,7 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags) pScrn->monitor = pScrn->confScreen->monitor; /* All HiQV chips support 16/24/32 bpp */ - if (!xf86SetDepthBpp(pScrn, 8, 8, 8, Support24bppFb | Support32bppFb | + if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support24bppFb | Support32bppFb | SupportConvert32to24 | PreferConvert32to24)) return FALSE; else { @@ -1557,7 +1558,7 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Enabling linear addressing\n"); xf86DrvMsg(pScrn->scrnIndex, from, - "base address is set at 0x%X.\n", cPtr->FbAddress); + "base address is set at 0x%lX.\n", cPtr->FbAddress); cPtr->IOAddress = cPtr->FbAddress + 0x400000L; } else xf86DrvMsg(pScrn->scrnIndex, from, @@ -1768,10 +1769,12 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags) case CHIPS_CT69030: /* The ct69030 has 4Mb of SGRAM integrated */ pScrn->videoRam = 4096; + cPtr->Flags |= Chips64BitMemory; break; case CHIPS_CT69000: /* The ct69000 has 2Mb of SGRAM integrated */ pScrn->videoRam = 2048; + cPtr->Flags |= Chips64BitMemory; break; case CHIPS_CT65550: /* XR43: DRAM interface */ @@ -1820,6 +1823,13 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags) pScrn->videoRam = 1024; break; } + /* XR43: DRAM interface */ + /* bit 4-5 mem interface width */ + /* 00: 32Bit */ + /* 01: 64Bit */ + tmp = cPtr->readXR(cPtr, 0x43); + if ((tmp & 0x10) == 0x10) + cPtr->Flags |= Chips64BitMemory; break; } } @@ -2271,9 +2281,9 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags) /* Check if maxClock is limited by the MemClk. Only 70% to allow for */ /* RAS/CAS. Extra byte per memory clock needed if framebuffer used */ /* Extra byte if the overlay plane is activated */ - /* We have a 64bit wide memory bus on the 69030 and 69000, and 32bits */ - /* on the others. Thus multiply by a suitable factor */ - if ((cPtr->Chipset == CHIPS_CT69030) || (cPtr->Chipset == CHIPS_CT69000)) { + /* If flag Chips64BitMemory is set assume a 64bitmemory interface, */ + /* and 32bits on the others. Thus multiply by a suitable factor */ + if (cPtr->Flags & Chips64BitMemory) { if (cPtr->FrameBufferSize && (cPtr->PanelType & ChipsLCD)) if (cPtr->Flags & ChipsOverlay8plus16 ) cPtr->MaxClock = min(cPtr->MaxClock, MemClk->Clk * 8 * 0.7 / 4); @@ -2416,10 +2426,10 @@ chipsPreInitWingine(ScrnInfoPtr pScrn, int flags) pScrn->monitor = pScrn->confScreen->monitor; if (cPtr->Flags & ChipsHDepthSupport) - i = xf86SetDepthBpp(pScrn, 8, 8, 8, Support24bppFb | + i = xf86SetDepthBpp(pScrn, 0, 0, 0, Support24bppFb | SupportConvert32to24 | PreferConvert32to24); else - i = xf86SetDepthBpp(pScrn, 8, 8, 8, NoDepth24Support); + i = xf86SetDepthBpp(pScrn, 8, 0, 0, NoDepth24Support); if (!i) return FALSE; @@ -2618,7 +2628,7 @@ chipsPreInitWingine(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Enabling linear addressing\n"); xf86DrvMsg(pScrn->scrnIndex, from, - "base address is set at 0x%X.\n", cPtr->FbAddress); + "base address is set at 0x%lX.\n", cPtr->FbAddress); if (xf86ReturnOptValBool(cPtr->Options, OPTION_MMIO, FALSE) && (cPtr->Flags & ChipsMMIOSupport)) { cPtr->UseMMIO = TRUE; @@ -2877,10 +2887,10 @@ chipsPreInit655xx(ScrnInfoPtr pScrn, int flags) pScrn->monitor = pScrn->confScreen->monitor; if (cPtr->Flags & ChipsHDepthSupport) - i = xf86SetDepthBpp(pScrn, 8, 8, 8, Support24bppFb | + i = xf86SetDepthBpp(pScrn, 0, 0, 0, Support24bppFb | SupportConvert32to24 | PreferConvert32to24); else - i = xf86SetDepthBpp(pScrn, 8, 8, 8, NoDepth24Support); + i = xf86SetDepthBpp(pScrn, 8, 0, 0, NoDepth24Support); if (!i) return FALSE; @@ -3106,7 +3116,7 @@ chipsPreInit655xx(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Enabling linear addressing\n"); xf86DrvMsg(pScrn->scrnIndex, from, - "base address is set at 0x%X.\n", cPtr->FbAddress); + "base address is set at 0x%lX.\n", cPtr->FbAddress); if (xf86ReturnOptValBool(cPtr->Options, OPTION_MMIO, FALSE) && (cPtr->Flags & ChipsMMIOSupport)) { cPtr->UseMMIO = TRUE; @@ -3238,7 +3248,7 @@ chipsPreInit655xx(ScrnInfoPtr pScrn, int flags) Size->HRetraceStart = ((tmp + ((xr17 & 0x04) << 9)) + 1) << 3; tmp1 = cPtr->readXR(cPtr, 0x1A); tmp2 = (tmp1 & 0x1F) + ((xr17 & 0x08) << 2) - (tmp & 0x3F); - Size->HRetraceEnd = ((((tmp2 < 0) ? (tmp2 + 0x40) : tmp2) << 3) + Size->HRetraceEnd = ((((tmp2 & 0x080u) ? (tmp2 + 0x40) : tmp2) << 3) + Size->HRetraceStart); tmp1 = cPtr->readXR(cPtr, 0x65); tmp = cPtr->readXR(cPtr, 0x68); @@ -4530,7 +4540,7 @@ CHIPSFreeScreen(int scrnIndex, int flags) } /* Optional */ -static int +static ModeStatus CHIPSValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; @@ -4546,7 +4556,8 @@ CHIPSValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) /* The tests here need to be expanded */ if ((mode->Flags & V_INTERLACE) && (cPtr->PanelType & ChipsLCD)) return MODE_NO_INTERLACE; - if ((cPtr->PanelType & ChipsLCD) + if ((cPtr->PanelType & ChipsLCD) + && !xf86ReturnOptValBool(cPtr->Options, OPTION_PANEL_SIZE, FALSE) && ((cPtr->PanelSize.HDisplay < mode->HDisplay) || (cPtr->PanelSize.VDisplay < mode->VDisplay))) return MODE_PANEL; @@ -5067,7 +5078,10 @@ chipsCalcClock(ScrnInfoPtr pScrn, int Clock, unsigned char *vclk) int M, N, P = 0, PSN = 0, PSNx = 0; int bestM = 0, bestN = 0, bestP = 0, bestPSN = 0; - double bestError, abest = 42, bestFout = 0; + double abest = 42; +#ifdef DEBUG + double bestFout = 0; +#endif double target; double Fvco, Fout; @@ -5175,12 +5189,13 @@ chipsCalcClock(ScrnInfoPtr pScrn, int Clock, unsigned char *vclk) aerror = (error < 0) ? -error : error; if (aerror < abest) { abest = aerror; - bestError = error; bestM = M; bestN = N; bestP = P; bestPSN = PSN; +#ifdef DEBUG bestFout = Fout; +#endif } } } @@ -5768,9 +5783,11 @@ chipsModeInitHiQV(ScrnInfoPtr pScrn, DisplayModePtr mode) * This handles 1024 and 1280 interlaced modes only. Its * pretty arbitrary, but its what C&T recommends */ +#if 0 if (mode->CrtcHDisplay == 1024) cPtr->OverlaySkewY += 5; - if (mode->CrtcHDisplay == 1280) + else if (mode->CrtcHDisplay == 1280) +#endif cPtr->OverlaySkewY *= 2; } @@ -6610,9 +6627,9 @@ chipsModeInit655xx(ScrnInfoPtr pScrn, DisplayModePtr mode) } if (cPtr->PanelType & ChipsLCD) - ChipsNew->XR[0x51] |= 0x02; + ChipsNew->XR[0x51] |= 0x04; else - ChipsNew->XR[0x51] &= ~0x02; + ChipsNew->XR[0x51] &= ~0x04; /* Program the registers */ /*vgaHWProtect(pScrn, TRUE);*/ @@ -7444,7 +7461,7 @@ chipsSetPanelType(CHIPSPtr cPtr) /* LCD */ tmp = cPtr->readFR(cPtr, 0x01); if ((tmp & 0x03) == 0x02) { - cPtr->PanelType |= ChipsLCD; + cPtr->PanelType |= ChipsLCD | ChipsLCDProbed; } tmp = cPtr->readXR(cPtr,0xD0); if (tmp & 0x01) { diff --git a/src/ct_driver.h b/src/ct_driver.h index 831ac9b..8a66353 100644 --- a/src/ct_driver.h +++ b/src/ct_driver.h @@ -22,7 +22,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h,v 1.34 2002/01/25 21:56:00 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h,v 1.35 2003/10/08 15:48:39 eich Exp $ */ #ifndef _CT_DRIVER_H_ @@ -108,6 +108,7 @@ typedef struct { #define ChipsVideoSupport 0x00000100 #define ChipsDualChannelSupport 0x00000200 #define ChipsDualRefresh 0x00000400 +#define Chips64BitMemory 0x00000800 /* Options flags for the C&T chipsets */ #define ChipsHWCursor 0x00001000 diff --git a/src/ct_regs.c b/src/ct_regs.c index 201ac5c..99e5791 100644 --- a/src/ct_regs.c +++ b/src/ct_regs.c @@ -19,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c,v 1.8 2002/01/25 21:56:00 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c,v 1.9 2003/11/03 05:11:09 tsi Exp $ */ /* * The functions in this file are used to read/write the C&T extension register @@ -361,17 +361,15 @@ chipsMmioReadSeq(vgaHWPtr hwp, CARD8 index) static void chipsMmioWriteAttr(vgaHWPtr hwp, CARD8 index, CARD8 value) { - CARD8 tmp; - if (hwp->paletteEnabled) index &= ~0x20; else index |= 0x20; if (hwp->IOBase == VGA_IOBASE_MONO) - tmp = minb(CHIPS_MMIO_MONO_STAT_1); + (void) minb(CHIPS_MMIO_MONO_STAT_1); else - tmp = minb(CHIPS_MMIO_COLOR_STAT_1); + (void) minb(CHIPS_MMIO_COLOR_STAT_1); moutb(CHIPS_MMIO_ATTR_INDEX, index); moutb(CHIPS_MMIO_ATTR_DATA_W, value); } @@ -379,17 +377,15 @@ chipsMmioWriteAttr(vgaHWPtr hwp, CARD8 index, CARD8 value) static CARD8 chipsMmioReadAttr(vgaHWPtr hwp, CARD8 index) { - CARD8 tmp; - if (hwp->paletteEnabled) index &= ~0x20; else index |= 0x20; if (hwp->IOBase == VGA_IOBASE_MONO) - tmp = minb(CHIPS_MMIO_MONO_STAT_1); + (void) minb(CHIPS_MMIO_MONO_STAT_1); else - tmp = minb(CHIPS_MMIO_COLOR_STAT_1); + (void) minb(CHIPS_MMIO_COLOR_STAT_1); moutb(CHIPS_MMIO_ATTR_INDEX, index); return minb(CHIPS_MMIO_ATTR_DATA_R); } @@ -409,12 +405,10 @@ chipsMmioReadMiscOut(vgaHWPtr hwp) static void chipsMmioEnablePalette(vgaHWPtr hwp) { - CARD8 tmp; - if (hwp->IOBase == VGA_IOBASE_MONO) - tmp = minb(CHIPS_MMIO_MONO_STAT_1); + (void) minb(CHIPS_MMIO_MONO_STAT_1); else - tmp = minb(CHIPS_MMIO_COLOR_STAT_1); + (void) minb(CHIPS_MMIO_COLOR_STAT_1); moutb(CHIPS_MMIO_ATTR_INDEX, 0x00); hwp->paletteEnabled = TRUE; } @@ -422,12 +416,10 @@ chipsMmioEnablePalette(vgaHWPtr hwp) static void chipsMmioDisablePalette(vgaHWPtr hwp) { - CARD8 tmp; - if (hwp->IOBase == VGA_IOBASE_MONO) - tmp = minb(CHIPS_MMIO_MONO_STAT_1); + (void) minb(CHIPS_MMIO_MONO_STAT_1); else - tmp = minb(CHIPS_MMIO_COLOR_STAT_1); + (void) minb(CHIPS_MMIO_COLOR_STAT_1); moutb(CHIPS_MMIO_ATTR_INDEX, 0x20); hwp->paletteEnabled = FALSE; } diff --git a/src/ct_video.c b/src/ct_video.c index f5a824e..666000c 100644 --- a/src/ct_video.c +++ b/src/ct_video.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c,v 1.12 2002/11/25 14:04:58 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c,v 1.17 2003/11/10 18:22:19 tsi Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -26,11 +26,6 @@ #define TIMER_MASK (OFF_TIMER | FREE_TIMER) -#ifndef XvExtension -void CHIPSInitVideo(ScreenPtr pScreen) {} -void CHIPSResetVideo(ScrnInfoPtr pScrn) {} -#else - static XF86VideoAdaptorPtr CHIPSSetupImageVideo(ScreenPtr); static void CHIPSInitOffscreenImages(ScreenPtr); static void CHIPSStopVideo(ScrnInfoPtr, pointer, Bool); @@ -277,7 +272,7 @@ CHIPSSetupImageVideo(ScreenPtr pScreen) pPriv->currentBuffer = 0; /* gotta uninit this someplace */ - REGION_INIT(pScreen, &pPriv->clip, NullBox, 0); + REGION_NULL(pScreen, &pPriv->clip); cPtr->adaptor = adapt; @@ -289,124 +284,6 @@ CHIPSSetupImageVideo(ScreenPtr pScreen) } -static Bool -RegionsEqual(RegionPtr A, RegionPtr B) -{ - int *dataA, *dataB; - int num; - - num = REGION_NUM_RECTS(A); - if(num != REGION_NUM_RECTS(B)) - return FALSE; - - if((A->extents.x1 != B->extents.x1) || - (A->extents.x2 != B->extents.x2) || - (A->extents.y1 != B->extents.y1) || - (A->extents.y2 != B->extents.y2)) - return FALSE; - - dataA = (int*)REGION_RECTS(A); - dataB = (int*)REGION_RECTS(B); - - while(num--) { - if((dataA[0] != dataB[0]) || (dataA[1] != dataB[1])) - return FALSE; - dataA += 2; - dataB += 2; - } - - return TRUE; -} - - -/* CHIPSClipVideo - - - Takes the dst box in standard X BoxRec form (top and left - edges inclusive, bottom and right exclusive). The new dst - box is returned. The source boundaries are given (x1, y1 - inclusive, x2, y2 exclusive) and returned are the new source - boundaries in 16.16 fixed point. -*/ - -static Bool -CHIPSClipVideo( - BoxPtr dst, - INT32 *x1, - INT32 *x2, - INT32 *y1, - INT32 *y2, - RegionPtr reg, - INT32 width, - INT32 height -){ - INT32 vscale, hscale, delta; - BoxPtr extents = REGION_EXTENTS(DummyScreen, reg); - int diff; - - hscale = ((*x2 - *x1) << 16) / (dst->x2 - dst->x1); - vscale = ((*y2 - *y1) << 16) / (dst->y2 - dst->y1); - - *x1 <<= 16; *x2 <<= 16; - *y1 <<= 16; *y2 <<= 16; - - diff = extents->x1 - dst->x1; - if(diff > 0) { - dst->x1 = extents->x1; - *x1 += diff * hscale; - } - diff = dst->x2 - extents->x2; - if(diff > 0) { - dst->x2 = extents->x2; - *x2 -= diff * hscale; - } - diff = extents->y1 - dst->y1; - if(diff > 0) { - dst->y1 = extents->y1; - *y1 += diff * vscale; - } - diff = dst->y2 - extents->y2; - if(diff > 0) { - dst->y2 = extents->y2; - *y2 -= diff * vscale; - } - - if(*x1 < 0) { - diff = (- *x1 + hscale - 1)/ hscale; - dst->x1 += diff; - *x1 += diff * hscale; - } - delta = *x2 - (width << 16); - if(delta > 0) { - diff = (delta + hscale - 1)/ hscale; - dst->x2 -= diff; - *x2 -= diff * hscale; - } - if(*x1 >= *x2) return FALSE; - - if(*y1 < 0) { - diff = (- *y1 + vscale - 1)/ vscale; - dst->y1 += diff; - *y1 += diff * vscale; - } - delta = *y2 - (height << 16); - if(delta > 0) { - diff = (delta + vscale - 1)/ vscale; - dst->y2 -= diff; - *y2 -= diff * vscale; - } - if(*y1 >= *y2) return FALSE; - - if((dst->x1 != extents->x1) || (dst->x2 != extents->x2) || - (dst->y1 != extents->y1) || (dst->y2 != extents->y2)) - { - RegionRec clipReg; - REGION_INIT(DummyScreen, &clipReg, dst, 1); - REGION_INTERSECT(DummyScreen, reg, reg, &clipReg); - REGION_UNINIT(DummyScreen, &clipReg); - } - return TRUE; -} - static void CHIPSStopVideo(ScrnInfoPtr pScrn, pointer data, Bool shadow) { @@ -589,23 +466,23 @@ CHIPSAllocateMemory( pScreen = screenInfo.screens[pScrn->scrnIndex]; - new_linear = xf86AllocateOffscreenLinear(pScreen, size, 16, + new_linear = xf86AllocateOffscreenLinear(pScreen, size, 8, NULL, NULL, NULL); if(!new_linear) { int max_size; - xf86QueryLargestOffscreenLinear(pScreen, &max_size, 16, + xf86QueryLargestOffscreenLinear(pScreen, &max_size, 8, PRIORITY_EXTREME); if(max_size < size) return NULL; xf86PurgeUnlockedOffscreenAreas(pScreen); - new_linear = xf86AllocateOffscreenLinear(pScreen, size, 16, + new_linear = xf86AllocateOffscreenLinear(pScreen, size, 8, NULL, NULL, NULL); } - + return new_linear; } @@ -748,8 +625,8 @@ CHIPSDisplayVideo( /* Vertical Zoom */ if (drw_h > src_h) { - m1f = m1f | 0x80; - m1e = m1e | 0x08; /* set V-interpolation */ + m1f = m1f | 0x80; /* set V-interpolation */ + m1e = m1e | 0x08; tmp = cPtr->VideoZoomMax * src_h / drw_h ; cPtr->writeMR(cPtr, 0x33, tmp); } @@ -778,7 +655,7 @@ CHIPSPutImage( CHIPSPtr cPtr = CHIPSPTR(pScrn); INT32 x1, x2, y1, y2; unsigned char *dst_start; - int pitch, new_size, offset, offset2 = 0, offset3 = 0; + int new_size, offset, offset2 = 0, offset3 = 0; int srcPitch, srcPitch2 = 0, dstPitch; int top, left, npixels, nlines, bpp; BoxRec dstBox; @@ -797,7 +674,8 @@ CHIPSPutImage( dstBox.y1 = drw_y; dstBox.y2 = drw_y + drw_h; - if (!CHIPSClipVideo(&dstBox, &x1, &x2, &y1, &y2, clipBoxes, width, height)) + if (!xf86XVClipVideoHelper(&dstBox, &x1, &x2, &y1, &y2, + clipBoxes, width, height)) return Success; dstBox.x1 -= pScrn->frameX0 & cPtr->viewportMask; @@ -806,7 +684,6 @@ CHIPSPutImage( dstBox.y2 -= pScrn->frameY0; bpp = pScrn->bitsPerPixel >> 3; - pitch = bpp * pScrn->displayWidth; dstPitch = ((width << 1) + 15) & ~15; new_size = ((dstPitch * height) + bpp - 1) / bpp; @@ -868,8 +745,8 @@ CHIPSPutImage( } /* update cliplist */ - if(!RegionsEqual(&pPriv->clip, clipBoxes)) { - REGION_COPY(pScreen, &pPriv->clip, clipBoxes); + if(!REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) { + REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes); xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes); } @@ -973,7 +850,7 @@ CHIPSAllocateSurface( XF86SurfacePtr surface ){ FBLinearPtr linear; - int pitch, fbpitch, size, bpp; + int pitch, size, bpp; OffscreenPrivPtr pPriv; if((w > 1024) || (h > 1024)) @@ -982,7 +859,6 @@ CHIPSAllocateSurface( w = (w + 1) & ~1; pitch = ((w << 1) + 15) & ~15; bpp = pScrn->bitsPerPixel >> 3; - fbpitch = bpp * pScrn->displayWidth; size = ((pitch * h) + bpp - 1) / bpp; if(!(linear = CHIPSAllocateMemory(pScrn, NULL, size))) @@ -1102,8 +978,8 @@ CHIPSDisplaySurface( dstBox.y1 = drw_y; dstBox.y2 = drw_y + drw_h; - if(!CHIPSClipVideo(&dstBox, &x1, &x2, &y1, &y2, clipBoxes, - surface->width, surface->height)) + if(!xf86XVClipVideoHelper(&dstBox, &x1, &x2, &y1, &y2, clipBoxes, + surface->width, surface->height)) return Success; dstBox.x1 -= pScrn->frameX0; @@ -1159,5 +1035,3 @@ CHIPSInitOffscreenImages(ScreenPtr pScreen) xf86XVRegisterOffscreenImages(pScreen, offscreenImages, 1); } - -#endif /* !XvExtension */ |