diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2004-02-23 20:35:12 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2004-02-23 20:35:12 +0000 |
commit | 5905b7fb4d3a6fe513c6ecaa09f6691b6c395af2 (patch) | |
tree | 6c395bd80a4ce54242a2d5b73d94485e41333417 | |
parent | d4caf3cf47fff18c45123b46ec60f96d4d9629b1 (diff) |
Import most of XFree86 4.4RC3. This import excludes files which have thexf86-4_3_99_903_special
new license. If we want to, later we can import 4.4RC3 again and pick
up the files that have the new license, but for now the vendor branch
is "pure."
-rw-r--r-- | src/via_accel.c | 4 | ||||
-rw-r--r-- | src/via_dri.c | 47 | ||||
-rw-r--r-- | src/via_driver.c | 11 | ||||
-rw-r--r-- | src/via_driver.h | 9 | ||||
-rw-r--r-- | src/via_memory.c | 6 | ||||
-rw-r--r-- | src/via_mode.h | 8 | ||||
-rw-r--r-- | src/via_swov.c | 25 | ||||
-rw-r--r-- | src/via_video.c | 20 |
8 files changed, 84 insertions, 46 deletions
diff --git a/src/via_accel.c b/src/via_accel.c index 9d6a6e4..e39f087 100644 --- a/src/via_accel.c +++ b/src/via_accel.c @@ -21,7 +21,7 @@ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_accel.c,v 1.10 2004/01/27 02:38:15 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_accel.c,v 1.11 2004/01/29 03:13:24 dawes Exp $ */ /************************************************************************* * @@ -557,7 +557,7 @@ void VIAInitLinear(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; VIAPtr pVia = VIAPTR(pScrn); -#ifdef XFREE_44 +#ifdef XFREE86_44 /* * In the 44 path we must take care not to truncate offset and size so * that we get overlaps. If there is available memory below line 2048 diff --git a/src/via_dri.c b/src/via_dri.c index 08ff891..0ea0eb7 100644 --- a/src/via_dri.c +++ b/src/via_dri.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_dri.c,v 1.6 2004/01/05 00:34:17 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_dri.c,v 1.9 2004/02/08 17:57:10 tsi Exp $ */ /* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. @@ -82,7 +82,7 @@ static void VIADRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, static Bool VIADRIAgpInit(ScreenPtr pScreen, VIAPtr pVia) { unsigned long agp_phys; - unsigned int agpaddr; + drmAddress agpaddr; VIADRIPtr pVIADRI; DRIInfoPtr pDRIInfo; pDRIInfo = pVia->pDRIInfo; @@ -129,11 +129,14 @@ static Bool VIADRIAgpInit(ScreenPtr pScreen, VIAPtr pVia) xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] Failed to map public agp area\n"); pVIADRI->agp.size = 0; - return FALSE; + drmAgpUnbind(pVia->drmFD, pVia->agpHandle); + drmAgpFree(pVia->drmFD, pVia->agpHandle); + drmAgpRelease(pVia->drmFD); + return FALSE; } /* Map AGP from kernel to Xserver - Not really needed */ - drmMap(pVia->drmFD, pVIADRI->agp.handle,pVIADRI->agp.size, - (drmAddressPtr)&agpaddr); + drmMap(pVia->drmFD, pVIADRI->agp.handle, pVIADRI->agp.size, &agpaddr); + pVia->agpMappedAddr = agpaddr; xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] agpBase = %p\n", pVia->agpBase); @@ -149,8 +152,14 @@ static Bool VIADRIAgpInit(ScreenPtr pScreen, VIAPtr pVia) agp.offset = 0; agp.size = AGP_SIZE; if (drmCommandWrite(pVia->drmFD, DRM_VIA_AGP_INIT, &agp, - sizeof(drmViaAgp)) < 0) + sizeof(drmViaAgp)) < 0) { + drmUnmap(agpaddr,pVia->agpSize); + drmRmMap(pVia->drmFD,pVIADRI->agp.handle); + drmAgpUnbind(pVia->drmFD, pVia->agpHandle); + drmAgpFree(pVia->drmFD, pVia->agpHandle); + drmAgpRelease(pVia->drmFD); return FALSE; + } } return TRUE; @@ -462,8 +471,18 @@ VIADRICloseScreen(ScreenPtr pScreen) ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; VIAPtr pVia = VIAPTR(pScrn); - DRICloseScreen(pScreen); + if (pVia->agpSize) { + drmUnmap(pVia->agpMappedAddr,pVia->agpSize); + drmRmMap(pVia->drmFD,pVia->agpHandle); + drmAgpUnbind(pVia->drmFD, pVia->agpHandle); + xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Freeing agp memory\n"); + drmAgpFree(pVia->drmFD, pVia->agpHandle); + xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Releasing agp module\n"); + drmAgpRelease(pVia->drmFD); + } + DRICloseScreen(pScreen); + if (pVia->pDRIInfo) { if (pVia->pDRIInfo->devPrivate) { xfree(pVia->pDRIInfo->devPrivate); @@ -473,13 +492,13 @@ VIADRICloseScreen(ScreenPtr pScreen) pVia->pDRIInfo=0; } - if (pVia->pVisualConfigs) xfree(pVia->pVisualConfigs); - if (pVia->pVisualConfigsPriv) xfree(pVia->pVisualConfigsPriv); - if (pVia->agpSize) { - xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Freeing agp memory\n"); - drmAgpFree(pVia->drmFD, pVia->agpHandle); - xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Releasing agp module\n"); - drmAgpRelease(pVia->drmFD); + if (pVia->pVisualConfigs) { + xfree(pVia->pVisualConfigs); + pVia->pVisualConfigs = NULL; + } + if (pVia->pVisualConfigsPriv) { + xfree(pVia->pVisualConfigsPriv); + pVia->pVisualConfigsPriv = NULL; } } diff --git a/src/via_driver.c b/src/via_driver.c index 7ec6627..ef4557c 100644 --- a/src/via_driver.c +++ b/src/via_driver.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.c,v 1.25 2004/01/27 17:01:20 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.c,v 1.28 2004/02/08 17:57:10 tsi Exp $ */ /* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. @@ -537,7 +537,7 @@ static Bool VIAProbe(DriverPtr drv, int flags) { pScrn->driverVersion = VIA_VERSION; pScrn->driverName = DRIVER_NAME; - pScrn->name = DRIVER_NAME; + pScrn->name = "VIA"; pScrn->Probe = VIAProbe; pScrn->PreInit = VIAPreInit; pScrn->ScreenInit = VIAScreenInit; @@ -2370,7 +2370,7 @@ static Bool VIAScreenInit(int scrnIndex, ScreenPtr pScreen, if (!pVia->NoAccel) { VIAInitAccel(pScreen); } -#ifdef XFREE_44 +#ifdef XFREE86_44 else { /* * This is needed because xf86InitFBManagerLinear in VIAInitLinear @@ -2712,6 +2712,11 @@ static Bool VIACloseScreen(int scrnIndex, ScreenPtr pScreen) VIASETREG(0x440, 0x00000004); } } +#ifdef XF86DRI + if (pVia->directRenderingEnabled) { + VIADRICloseScreen(pScreen); + } +#endif if (pVia->AccelInfoRec) { XAADestroyInfoRec(pVia->AccelInfoRec); pVia->AccelInfoRec = NULL; diff --git a/src/via_driver.h b/src/via_driver.h index 4284963..929ca35 100644 --- a/src/via_driver.h +++ b/src/via_driver.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.h,v 1.10 2004/01/05 00:34:17 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.h,v 1.13 2004/02/08 17:57:10 tsi Exp $ */ /* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. @@ -79,6 +79,12 @@ #define PATCHLEVEL 30 #define VIA_VERSION ((VERSION_MAJOR<<24) | (VERSION_MINOR<<16) | PATCHLEVEL) +#if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,3,99,14,0) +#undef XFREE86_44 +#else +#define XFREE86_44 1 +#endif + #define VGAIN8(addr) MMIO_IN8(pVia->MapBase+0x8000, addr) #define VGAIN16(addr) MMIO_IN16(pVia->MapBase+0x8000, addr) #define VGAIN(addr) MMIO_IN32(pVia->MapBase+0x8000, addr) @@ -324,6 +330,7 @@ typedef struct _VIA { unsigned long agpHandle; unsigned long registerHandle; unsigned long agpAddr; + drmAddress agpMappedAddr; unsigned char *agpBase; unsigned int agpSize; Bool IsPCI; diff --git a/src/via_memory.c b/src/via_memory.c index 508b142..7150c2e 100644 --- a/src/via_memory.c +++ b/src/via_memory.c @@ -20,7 +20,7 @@ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_memory.c,v 1.4 2004/01/27 02:25:07 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_memory.c,v 1.5 2004/01/29 03:13:25 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -85,7 +85,7 @@ void VIAFreeLinear(VIAMemPtr mem) unsigned long VIAAllocLinear(VIAMemPtr mem, ScrnInfoPtr pScrn, unsigned long size) { -#if defined(XF86DRI) || !defined(XFREE_44) +#if defined(XF86DRI) || !defined(XFREE86_44) VIAPtr pVia = VIAPTR(pScrn); #endif @@ -114,7 +114,7 @@ unsigned long VIAAllocLinear(VIAMemPtr mem, ScrnInfoPtr pScrn, unsigned long siz } #endif -#ifdef XFREE_44 +#ifdef XFREE86_44 { int depth = (pScrn->bitsPerPixel + 7) >> 3; /* Make sure we don't truncate requested size */ diff --git a/src/via_mode.h b/src/via_mode.h index 323c9d0..4897a4d 100644 --- a/src/via_mode.h +++ b/src/via_mode.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_mode.h,v 1.3 2003/08/27 15:16:09 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_mode.h,v 1.4 2004/02/09 01:45:23 dawes Exp $ */ /* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. @@ -132,9 +132,9 @@ static VIAModeEntry Modes[] = { { 512, 384, 8, 0X25, 3, 0X432E, 0XC53F, { 64, 47, 8, 0XFFFF, { 0, 0X1, 0XF, 0, 0XE }, 0X4F, { 0X4D, 0X3F, 0X3F, 0X91, 0X42, 0X9, 0X92, 0X1F, 0, 0X40, 0X1E, 0, 0, 0, 0, 0, 0X80, 0X3, 0X7F, 0X40, 0X40, 0X7F, 0X93, 0XE3, 0XFF }, { 0, 0X1, 0X2, 0X3, 0X4, 0X5, 0X6, 0X7, 0X8, 0X9, 0XA, 0XB, 0XC, 0XD, 0XE, 0XF, 0X41, 0, 0XF, 0 }, { 0, 0, 0, 0, 0, 0X40, 0X5, 0XF, 0XFF } }, { { 0XC4, 0XD4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0X15, 0X33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0XFE, 0X27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0X22, 0X26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 2 } }, { 512, 384, 16, 0X26, 6, 0X432E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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0XAE, 0XC, 0X1F, 0X4C, 0X6, 0X40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 6 } } }; static const VIABIOSRegTableRec commExtTable = { diff --git a/src/via_swov.c b/src/via_swov.c index 9bd28f1..6d8be58 100644 --- a/src/via_swov.c +++ b/src/via_swov.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_swov.c,v 1.10 2003/12/17 19:01:59 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_swov.c,v 1.11 2004/02/04 04:15:09 dawes Exp $ */ /* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. @@ -65,19 +65,18 @@ unsigned long VIAVidCreateSurface(ScrnInfoPtr pScrn, LPDDSURFACEDESC lpDDSurface { VIAPtr pVia = VIAPTR(pScrn); unsigned long dwWidth, dwHeight, dwPitch=0; - unsigned long dwRet=PI_OK; unsigned long size; unsigned long dwAddr; unsigned long HQVFBSIZE = 0, SWFBSIZE = 0; int iCount; /* iCount for clean HQV FB use */ unsigned char *lpTmpAddr; /* for clean HQV FB use */ VIAHWRec *hwDiff = &pVia->ViaHW; - + unsigned long retCode; DBG_DD(ErrorF("//VIAVidCreateSurface: \n")); if ( lpDDSurfaceDesc == NULL ) - return PI_ERR; + return BadAccess; ErrorF("Creating %lu surface\n", lpDDSurfaceDesc->dwFourCC); @@ -120,8 +119,8 @@ unsigned long VIAVidCreateSurface(ScrnInfoPtr pScrn, LPDDSURFACEDESC lpDDSurface SWFBSIZE = dwPitch*dwHeight; /*YUYV*/ VIAFreeLinear(&pVia->swov.SWOVMem); - if(VIAAllocLinear(&pVia->swov.SWOVMem, pScrn, SWFBSIZE * 2)) - return BadAccess; + if(Success != (retCode = VIAAllocLinear(&pVia->swov.SWOVMem, pScrn, SWFBSIZE * 2))) + return retCode; dwAddr = pVia->swov.SWOVMem.base; /* fill in the SW buffer with 0x8000 (YUY2-black color) to clear FB buffer*/ @@ -169,8 +168,8 @@ unsigned long VIAVidCreateSurface(ScrnInfoPtr pScrn, LPDDSURFACEDESC lpDDSurface size = HQVFBSIZE*2; VIAFreeLinear(&pVia->swov.HQVMem); - if(VIAAllocLinear(&pVia->swov.HQVMem, pScrn, size)) - return BadAccess; + if(Success != (retCode = VIAAllocLinear(&pVia->swov.HQVMem, pScrn, size))) + return retCode; dwAddr = pVia->swov.HQVMem.base; /* dwAddr = pVia->swov.SWOVlinear->offset * depth + SWOVFBSIZE; */ @@ -252,8 +251,8 @@ unsigned long VIAVidCreateSurface(ScrnInfoPtr pScrn, LPDDSURFACEDESC lpDDSurface SWFBSIZE = dwPitch * dwHeight * 1.5; /* 1.5 bytes per pixel */ VIAFreeLinear(&pVia->swov.SWfbMem); - if(VIAAllocLinear(&pVia->swov.SWfbMem, pScrn, 2 * SWFBSIZE)) - return BadAccess; + if(Success != (retCode = VIAAllocLinear(&pVia->swov.SWfbMem, pScrn, 2 * SWFBSIZE))) + return retCode; dwAddr = pVia->swov.SWfbMem.base; DEBUG(ErrorF("dwAddr for SWfbMem is %lu\n", dwAddr)); @@ -315,8 +314,8 @@ if (!(pVia->swov.gdwVideoFlagSW & SW_USE_HQV)) size = HQVFBSIZE * 2; VIAFreeLinear(&pVia->swov.HQVMem); - if(VIAAllocLinear(&pVia->swov.HQVMem, pScrn, size)) - return BadAccess; + if(Success != (retCode = VIAAllocLinear(&pVia->swov.HQVMem, pScrn, size))) + return retCode; dwAddr = pVia->swov.HQVMem.base; DEBUG(ErrorF("dwAddr for HQV is %lu\n", dwAddr)); @@ -358,7 +357,7 @@ if (!(pVia->swov.gdwVideoFlagSW & SW_USE_HQV)) break; } - return dwRet; + return Success; } /*VIAVidCreateSurface*/ diff --git a/src/via_video.c b/src/via_video.c index 9253594..040c85d 100644 --- a/src/via_video.c +++ b/src/via_video.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_video.c,v 1.15 2004/01/05 00:34:17 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_video.c,v 1.17 2004/02/04 04:15:09 dawes Exp $ */ /* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. @@ -476,7 +476,11 @@ viaSetupImageVideoG(ScreenPtr pScreen) gviaPortPriv[i]->xv_portnum = i; /* gotta uninit this someplace */ +#ifdef XFREE86_44 REGION_NULL(pScreen, &gviaPortPriv[i]->clip); +#else + REGION_INIT(pScreen, &gviaPortPriv[i]->clip, NullBox, 1); +#endif } /* End of for */ viaResetVideo(pScrn); return adaptPtr[0]; @@ -513,13 +517,14 @@ RegionsEqual(RegionPtr A, RegionPtr B) } -static unsigned long CreateSWOVSurface(ScrnInfoPtr pScrn, viaPortPrivPtr pPriv, int fourcc, short width, short height) +static int CreateSWOVSurface(ScrnInfoPtr pScrn, viaPortPrivPtr pPriv, int fourcc, short width, short height) { VIAPtr pVia = VIAPTR(pScrn); LPDDSURFACEDESC lpSurfaceDesc = &pPriv->SurfaceDesc; + unsigned long retCode; if (pVia->Video.VideoStatus & SWOV_SURFACE_CREATED) - return TRUE; + return Success; lpSurfaceDesc->dwWidth = (unsigned long)width; lpSurfaceDesc->dwHeight = (unsigned long)height; @@ -527,7 +532,8 @@ static unsigned long CreateSWOVSurface(ScrnInfoPtr pScrn, viaPortPrivPtr pPriv, lpSurfaceDesc->dwFourCC = (unsigned long)fourcc; - VIAVidCreateSurface(pScrn, lpSurfaceDesc); + if (Success != (retCode = VIAVidCreateSurface(pScrn, lpSurfaceDesc))) + return retCode; pPriv->ddLock.dwFourCC = (unsigned long)fourcc; @@ -541,7 +547,7 @@ static unsigned long CreateSWOVSurface(ScrnInfoPtr pScrn, viaPortPrivPtr pPriv, pVia->Video.VideoStatus |= SWOV_SURFACE_CREATED|SW_VIDEO_ON; pVia->Video.dwAction = ACTION_SET_VIDEOSTATUS; - return TRUE; + return Success; } @@ -986,6 +992,7 @@ viaPutImageG( VIAPtr pVia = VIAPTR(pScrn); viaPortPrivPtr pPriv = (viaPortPrivPtr)data; vmmtr viaVidEng = (vmmtr) pVia->VidMapBase; + unsigned long retCode; /* int i; BoxPtr pbox; */ @@ -1022,9 +1029,10 @@ viaPutImageG( if ( (pPriv->old_src_w != src_w) || (pPriv->old_src_h != src_h) ) DestroySWOVSurface(pScrn, pPriv); - if ( !CreateSWOVSurface(pScrn, pPriv, id, width, height) ) + if (Success != ( retCode = CreateSWOVSurface(pScrn, pPriv, id, width, height) )) { DBG_DD(ErrorF(" : Fail to Create SW Video Surface\n")); + return retCode; } |