diff options
author | Thomas Hellstrom <unichrome@shipmail.org> | 2005-06-12 11:03:04 +0000 |
---|---|---|
committer | Thomas Hellstrom <unichrome@shipmail.org> | 2005-06-12 11:03:04 +0000 |
commit | 9d06f1fba6161aaf0a1108122c7cc1d74b279be2 (patch) | |
tree | 12563a69b41097e6695d07091aea808f32941e74 | |
parent | 61c1606c43d2c96c4124aec7a3b91f8d3605aa86 (diff) |
Add Unichrome Pro Group A YUY2 Xv support. (Ivor Hewitt) Add Via RV15 andXORG-6_8_99_11
RV16 Xv support.
-rw-r--r-- | src/via_priv.h | 2 | ||||
-rw-r--r-- | src/via_swov.c | 35 | ||||
-rw-r--r-- | src/via_video.c | 50 |
3 files changed, 80 insertions, 7 deletions
diff --git a/src/via_priv.h b/src/via_priv.h index c4b6c23..7ebb35d 100644 --- a/src/via_priv.h +++ b/src/via_priv.h @@ -15,6 +15,8 @@ */ #define FOURCC_XVMC (('C' << 24) + ('M' << 16) + ('V' << 8) + 'X') +#define FOURCC_RV15 (('5' << 24) + ('1' << 16) + ('V' << 8) + 'R') +#define FOURCC_RV16 (('6' << 24) + ('1' << 16) + ('V' << 8) + 'R') /* * Structures for create surface diff --git a/src/via_swov.c b/src/via_swov.c index d938f57..a7cc5e4 100644 --- a/src/via_swov.c +++ b/src/via_swov.c @@ -323,6 +323,21 @@ viaOverlayGetV1V3Format(VIAPtr pVia, int vport, /* 1 or 3, as in V1 or V3 */ } else *pVidCtl |= V1_YUV422; break; + + case FOURCC_RV15: + case FOURCC_RV16: + if (videoFlag & VIDEO_HQV_INUSE) { + *pVidCtl |= + ((pVia->swov.SrcFourCC == FOURCC_RV15) ? V1_RGB15 : V1_RGB16) | + V1_SWAP_HW_HQV; + *pHQVCtl |= HQV_SRC_SW | + ((pVia->swov.SrcFourCC == FOURCC_RV15) ? HQV_RGB15 : HQV_RGB16) | + HQV_ENABLE | HQV_SW_FLIP; + } else { + ErrorF("viaOverlayGetV1V3Format: Can't display RGB video in this configuration.\n"); + is_ok = FALSE; + } + break; default: DBG_DD(ErrorF("viaOverlayGetV1V3Format: Invalid FOURCC format (0x%lx).\n", @@ -353,6 +368,8 @@ viaOverlayGetSrcStartAddress(VIAPtr pVia, unsigned long videoFlag, switch (pVia->swov.SrcFourCC) { case FOURCC_YUY2: case FOURCC_UYVY: + case FOURCC_RV15: + case FOURCC_RV16: if (videoFlag & VIDEO_HQV_INUSE) { offset = (((pUpdate->SrcTop & ~3) * srcPitch) + ((pUpdate->SrcLeft << 1) & ~31)); @@ -588,6 +605,8 @@ viaOverlayGetFetch(VIAPtr pVia, unsigned long videoFlag, break; case FOURCC_UYVY: case FOURCC_YUY2: + case FOURCC_RV15: + case FOURCC_RV16: n = 1; /* 2^n = 2 bytes per pixel (packed YUV) */ break; default: @@ -1018,11 +1037,13 @@ ViaSwovSurfaceCreate(ScrnInfoPtr pScrn, viaPortPrivPtr pPriv, CARD32 FourCC, pPriv->lastId = FourCC; switch (FourCC) { case FOURCC_YUY2: + case FOURCC_RV15: + case FOURCC_RV16: retCode = CreateSurface(pScrn, FourCC, Width, Height, TRUE); if (retCode != Success) break; if ((pVia->swov.gdwVideoFlagSW & SW_USE_HQV)) - retCode = AddHQVSurface(pScrn, numbuf, FOURCC_YUY2); + retCode = AddHQVSurface(pScrn, numbuf, FourCC); break; case FOURCC_HQVSW: @@ -1073,6 +1094,8 @@ ViaSwovSurfaceDestroy(ScrnInfoPtr pScrn, viaPortPrivPtr pPriv) switch (pPriv->FourCC) { case FOURCC_YUY2: + case FOURCC_RV16: + case FOURCC_RV15: pVia->swov.SrcFourCC = 0; VIAFreeLinear(&pVia->swov.SWfbMem); @@ -1848,13 +1871,13 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag, SaveVideoRegister(pVia, HQV_CONTROL + proReg, hqvCtl | HQV_FLIP_STATUS); SetVideoControl(pVia, videoFlag, vidCtl); FireVideoCommand(pVia, videoFlag, compose); - viaWaitHQVDone(pVia); /* HMM */ + viaWaitHQVDone(pVia); FlushVidRegBuffer(pVia); } } else { SetVideoControl(pVia, videoFlag, vidCtl); FireVideoCommand(pVia, videoFlag, compose); - viaWaitHQVDone(pVia); /* HMM */ + viaWaitHQVDone(pVia); FlushVidRegBuffer(pVia); } pVia->swov.SWVideo_ON = TRUE; @@ -1912,6 +1935,8 @@ VIAVidUpdateOverlay(ScrnInfoPtr pScrn, LPDDUPDATEOVERLAY pUpdate) pUpdate->DstTop, pUpdate->DstBottom)); if ((pVia->swov.SrcFourCC == FOURCC_YUY2) || + (pVia->swov.SrcFourCC == FOURCC_RV15) || + (pVia->swov.SrcFourCC == FOURCC_RV16) || (pVia->swov.SrcFourCC == FOURCC_YV12) || (pVia->swov.SrcFourCC == FOURCC_XVMC)) { @@ -1980,6 +2005,8 @@ VIAVidUpdateOverlay(ScrnInfoPtr pScrn, LPDDUPDATEOVERLAY pUpdate) /* Save modified src & original dest rectangle param. */ if ((pVia->swov.SrcFourCC == FOURCC_YUY2) || + (pVia->swov.SrcFourCC == FOURCC_RV15) || + (pVia->swov.SrcFourCC == FOURCC_RV16) || (pVia->swov.SrcFourCC == FOURCC_YV12) || (pVia->swov.SrcFourCC == FOURCC_XVMC)) { pVia->swov.SWDevice.gdwSWDstLeft = pUpdate->DstLeft + panDX; @@ -2035,6 +2062,8 @@ ViaOverlayHide(ScrnInfoPtr pScrn) unsigned long proReg = 0; if ((pVia->swov.SrcFourCC == FOURCC_YUY2) || + (pVia->swov.SrcFourCC == FOURCC_RV15) || + (pVia->swov.SrcFourCC == FOURCC_RV16) || (pVia->swov.SrcFourCC == FOURCC_YV12) || (pVia->swov.SrcFourCC == FOURCC_XVMC)) videoFlag = pVia->swov.gdwVideoFlagSW; diff --git a/src/via_video.c b/src/via_video.c index 6f0db57..e051313 100644 --- a/src/via_video.c +++ b/src/via_video.c @@ -129,7 +129,7 @@ static XF86AttributeRec AttributesG[NUM_ATTRIBUTES_G] = {XvSettable | XvGettable,0,1,"XV_AUTOPAINT_COLORKEY"} }; -#define NUM_IMAGES_G 3 +#define NUM_IMAGES_G 5 static XF86ImageRec ImagesG[NUM_IMAGES_G] = { @@ -157,7 +157,41 @@ static XF86ImageRec ImagesG[NUM_IMAGES_G] = {'Y','V','U', 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}, XvTopToBottom - } + }, + { /* RGB 555 */ + FOURCC_RV15, + XvRGB, + LSBFirst, + {'R','V','1','5', + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + 16, + XvPacked, + 1, + 15, 0x7C00, 0x03E0, 0x001F, + 0, 0, 0, + 0, 0, 0, + 0, 0, 0, + {'R', 'V', 'B',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}, + XvTopToBottom + }, + { /* RGB 565 */ + FOURCC_RV16, + XvRGB, + LSBFirst, + {'R','V','1','6', + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + 16, + XvPacked, + 1, + 16, 0xF800, 0x07E0, 0x001F, + 0, 0, 0, + 0, 0, 0, + 0, 0, 0, + {'R', 'V', 'B',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}, + XvTopToBottom + } }; static char * XvAdaptorName[XV_ADAPT_NUM] = @@ -750,8 +784,11 @@ static void Flip(VIAPtr pVia, viaPortPrivPtr pPriv, int fourcc, unsigned long Di { case FOURCC_UYVY: case FOURCC_YUY2: + case FOURCC_RV15: + case FOURCC_RV16: while ((VIDInD(HQV_CONTROL) & HQV_SW_FLIP) ); - VIDOutD(HQV_SRC_STARTADDR_Y, pVia->swov.SWDevice.dwSWPhysicalAddr[DisplayBufferIndex]); + VIDOutD(HQV_SRC_STARTADDR_Y + proReg, + pVia->swov.SWDevice.dwSWPhysicalAddr[DisplayBufferIndex]); VIDOutD(HQV_CONTROL,( VIDInD(HQV_CONTROL)&~HQV_FLIP_ODD) |HQV_SW_FLIP|HQV_FLIP_STATUS); break; @@ -901,8 +938,11 @@ viaPutImage( break; case FOURCC_UYVY: case FOURCC_YUY2: + case FOURCC_RV15: + case FOURCC_RV16: default: - (*viaFastVidCpy)(pVia->swov.SWDevice.lpSWOverlaySurface[pVia->dwFrameNum&1],buf,dstPitch,width,height,1); + (*viaFastVidCpy)(pVia->swov.SWDevice.lpSWOverlaySurface[pVia->dwFrameNum&1], + buf,dstPitch,width,height,1); break; } } @@ -1058,6 +1098,8 @@ viaQueryImageAttributes( break; case FOURCC_UYVY: /*Packed format : UYVY -4:2:2*/ case FOURCC_YUY2: /*Packed format : YUY2 -4:2:2*/ + case FOURCC_RV15: + case FOURCC_RV16: default: size = *w << 1; if(pitches) |