diff options
author | Xavier Bachelot <xavier@bachelot.org> | 2007-03-28 15:17:48 +0000 |
---|---|---|
committer | Xavier Bachelot <xavier@bachelot.org> | 2007-03-28 15:17:48 +0000 |
commit | c7b3e9616e637155eea2733f5df98db0b989df23 (patch) | |
tree | 9465cbc172e7d573019984431f2c665b43142d43 | |
parent | 11d3a79d7ee2b434f68a1b1c639e885f5f7488e9 (diff) |
Fix Xv for CX700 (Gabriel Mansi)
-rw-r--r-- | unichrome/via_bandwidth.c | 3 | ||||
-rw-r--r-- | unichrome/via_swov.c | 30 | ||||
-rw-r--r-- | unichrome/via_video.c | 6 |
3 files changed, 24 insertions, 15 deletions
diff --git a/unichrome/via_bandwidth.c b/unichrome/via_bandwidth.c index 14d81b3..04b86ea 100644 --- a/unichrome/via_bandwidth.c +++ b/unichrome/via_bandwidth.c @@ -232,7 +232,6 @@ ViaSetPrimaryFIFO(ScrnInfoPtr pScrn, DisplayModePtr mode) hwp->writeSeq(hwp, 0x17, 0xB3); hwp->writeSeq(hwp, 0x18, 0x8A); break; - case VIA_CX700: case VIA_P4M890: hwp->writeSeq(hwp, 0x17, 0x2F); ViaSeqMask(hwp, 0x16, 0x14, 0xBF); @@ -243,6 +242,8 @@ ViaSetPrimaryFIFO(ScrnInfoPtr pScrn, DisplayModePtr mode) else ViaSeqMask(hwp, 0x22, 0x00, 0x1F); break; + case VIA_CX700: + break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ViaSetPrimaryFIFO:" " Chipset %d not implemented\n", pVia->Chipset); diff --git a/unichrome/via_swov.c b/unichrome/via_swov.c index 01b001d..b40d600 100644 --- a/unichrome/via_swov.c +++ b/unichrome/via_swov.c @@ -94,7 +94,7 @@ viaWaitHQVFlip(VIAPtr pVia) pdwState = (CARD32 volatile *)(pVia->VidMapBase + (HQV_CONTROL + proReg)); - if (pVia->ChipId == PCI_CHIP_VT3259 || pVia->ChipId == PCI_CHIP_VT3336 || pVia->ChipId == PCI_CHIP_VT3364) { + if (pVia->ChipId == PCI_CHIP_VT3259 || pVia->ChipId == PCI_CHIP_VT3336 || pVia->ChipId == PCI_CHIP_VT3157 || pVia->ChipId == PCI_CHIP_VT3364) { while (*pdwState & (HQV_SUBPIC_FLIP | HQV_SW_FLIP)) ; } else { while (!(*pdwState & HQV_FLIP_STATUS)) ; @@ -263,7 +263,6 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn) HWDiff->dwHQVDisablePatch = VID_HWDIFF_TRUE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_TRUE; break; - case VIA_CX700: case VIA_P4M890: HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; HWDiff->dwHQVFetchByteUnit = VID_HWDIFF_TRUE; @@ -271,6 +270,13 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn) HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; HWDiff->dwHQVDisablePatch = VID_HWDIFF_TRUE; break; + case VIA_CX700: + HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; + HWDiff->dwHQVFetchByteUnit = VID_HWDIFF_TRUE; + HWDiff->dwSupportTwoColorKey = VID_HWDIFF_TRUE; + HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; + HWDiff->dwHQVDisablePatch = VID_HWDIFF_FALSE; + break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "VIAVidHWDiffInit: Unhandled ChipSet.\n"); @@ -892,7 +898,6 @@ viaSetColorSpace(VIAPtr pVia, int hue, int saturation, int brightness, case PCI_CHIP_VT3204: case PCI_CHIP_VT3259: case PCI_CHIP_VT3314: - case PCI_CHIP_VT3157: case PCI_CHIP_VT3327: VIDOutD(V3_ColorSpaceReg_1, col1); VIDOutD(V3_ColorSpaceReg_2, col2); @@ -900,6 +905,7 @@ viaSetColorSpace(VIAPtr pVia, int hue, int saturation, int brightness, DBG_DD(ErrorF("000002C8 %08lx\n", col2)); break; case PCI_CHIP_VT3336: + case PCI_CHIP_VT3157: case PCI_CHIP_VT3364: case PCI_CHIP_CLE3122: VIDOutD(V1_ColorSpaceReg_2, col2); @@ -924,10 +930,10 @@ ViaInitVideoStatusFlag(VIAPtr pVia) case PCI_CHIP_VT3204: case PCI_CHIP_VT3259: case PCI_CHIP_VT3314: - case PCI_CHIP_VT3157: case PCI_CHIP_VT3327: return VIDEO_HQV_INUSE | SW_USE_HQV | VIDEO_3_INUSE; case PCI_CHIP_VT3336: + case PCI_CHIP_VT3157: case PCI_CHIP_VT3364: return VIDEO_HQV_INUSE | SW_USE_HQV | VIDEO_1_INUSE | \ VIDEO_ACTIVE | VIDEO_SHOW; @@ -963,6 +969,7 @@ ViaSetVidCtl(VIAPtr pVia, unsigned int videoFlag) case PCI_CHIP_VT3314: return V3_ENABLE | V3_EXPIRE_NUM_3205; case PCI_CHIP_VT3336: + case PCI_CHIP_VT3157: case PCI_CHIP_VT3364: return V3_ENABLE | VIDEO_EXPIRE_NUM_VT3336; case PCI_CHIP_CLE3122: @@ -1299,6 +1306,7 @@ SetFIFO_V3_64or32or32(VIAPtr pVia) { switch (pVia->ChipId) { case PCI_CHIP_VT3336: + case PCI_CHIP_VT3157: case PCI_CHIP_VT3364: SetFIFO_V3(pVia, 225, 200, 250); break; @@ -1306,7 +1314,6 @@ SetFIFO_V3_64or32or32(VIAPtr pVia) SetFIFO_V3(pVia, 100, 89, 89); break; case PCI_CHIP_VT3314: - case PCI_CHIP_VT3157: case PCI_CHIP_VT3327: SetFIFO_V3(pVia, 64, 61, 61); break; @@ -1330,6 +1337,7 @@ SetFIFO_V3_64or32or16(VIAPtr pVia) { switch (pVia->ChipId) { case PCI_CHIP_VT3336: + case PCI_CHIP_VT3157: case PCI_CHIP_VT3364: SetFIFO_V3(pVia, 225, 200, 250); break; @@ -1434,7 +1442,7 @@ SetColorKey(VIAPtr pVia, unsigned long videoFlag, CARD32 keyLow, CARD32 keyHigh, CARD32 compose) { keyLow &= 0x00FFFFFF; - if (pVia->ChipId == PCI_CHIP_VT3259 || pVia->ChipId == PCI_CHIP_VT3336 || pVia->ChipId == PCI_CHIP_VT3364) + if (pVia->ChipId == PCI_CHIP_VT3259 || pVia->ChipId == PCI_CHIP_VT3336 || pVia->ChipId == PCI_CHIP_VT3157 || pVia->ChipId == PCI_CHIP_VT3364) keyLow |= 0x40000000; /*SaveVideoRegister(pVia, V_COLOR_KEY, keyLow); */ @@ -1466,7 +1474,7 @@ SetChromaKey(VIAPtr pVia, unsigned long videoFlag, chromaLow |= (VIDInD(V_CHROMAKEY_LOW) & ~CHROMA_KEY_LOW); chromaHigh |= (VIDInD(V_CHROMAKEY_HIGH) & ~CHROMA_KEY_HIGH); - if (pVia->ChipId == PCI_CHIP_VT3259 || pVia->ChipId == PCI_CHIP_VT3336 || pVia->ChipId == PCI_CHIP_VT3364) + if (pVia->ChipId == PCI_CHIP_VT3259 || pVia->ChipId == PCI_CHIP_VT3336 || pVia->ChipId == PCI_CHIP_VT3157 || pVia->ChipId == PCI_CHIP_VT3364) chromaLow |= 0x40000000; SaveVideoRegister(pVia, V_CHROMAKEY_HIGH, chromaHigh); @@ -1738,7 +1746,7 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag, pVia->swov.overlayRecordV1.dwOffset, pVia->swov.overlayRecordV1.dwUVoffset, srcPitch, oriSrcHeight); - if (pVia->ChipId == PCI_CHIP_VT3259 || pVia->ChipId == PCI_CHIP_VT3336 || pVia->ChipId == PCI_CHIP_VT3364) { + if (pVia->ChipId == PCI_CHIP_VT3259 || pVia->ChipId == PCI_CHIP_VT3336 || pVia->ChipId == PCI_CHIP_VT3157 || pVia->ChipId == PCI_CHIP_VT3364) { SaveVideoRegister(pVia, HQV_SRC_STARTADDR_Y + proReg, YCbCr.dwY); SaveVideoRegister(pVia, HQV_SRC_STARTADDR_U + proReg, @@ -1776,7 +1784,7 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag, pVia->swov.overlayRecordV1.dwHQVAddr[1] + hqvOffset, pVia->swov.overlayRecordV1.dwHQVAddr[2] + hqvOffset); - if (pVia->ChipId == PCI_CHIP_VT3259 || pVia->ChipId == PCI_CHIP_VT3336 || pVia->ChipId == PCI_CHIP_VT3364) + if (pVia->ChipId == PCI_CHIP_VT3259 || pVia->ChipId == PCI_CHIP_VT3336 || pVia->ChipId == PCI_CHIP_VT3157 || pVia->ChipId == PCI_CHIP_VT3364) SaveVideoRegister(pVia, 0x1cc + proReg, dwOffset); SaveVideoRegister(pVia, HQV_SRC_STARTADDR_Y + proReg, startAddr); } else { @@ -1974,7 +1982,7 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag, usleep(1); } - if (pVia->ChipId == PCI_CHIP_VT3259 || pVia->ChipId == PCI_CHIP_VT3336 || pVia->ChipId == PCI_CHIP_VT3364) + if (pVia->ChipId == PCI_CHIP_VT3259 || pVia->ChipId == PCI_CHIP_VT3336 || pVia->ChipId == PCI_CHIP_VT3157 || pVia->ChipId == PCI_CHIP_VT3364) hqvCtl |= HQV_GEN_IRQ; VIDOutD(HQV_CONTROL + proReg, hqvCtl & ~HQV_SW_FLIP); @@ -1983,7 +1991,7 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag, DBG_DD(ErrorF("HQV control wf5 - %08lx\n", *HQVCtrl)); DBG_DD(ErrorF(" Wait flips5")); - if (pVia->ChipId != PCI_CHIP_VT3259 && pVia->ChipId != PCI_CHIP_VT3336 && pVia->ChipId != PCI_CHIP_VT3364) { + if (pVia->ChipId != PCI_CHIP_VT3259 && pVia->ChipId != PCI_CHIP_VT3336 && pVia->ChipId != PCI_CHIP_VT3157 && pVia->ChipId != PCI_CHIP_VT3364) { for (i = 0; (i < 50) && !(*HQVCtrl & HQV_FLIP_STATUS); i++) { DBG_DD(ErrorF(" HQV wait %d %08lx\n", i, *HQVCtrl)); diff --git a/unichrome/via_video.c b/unichrome/via_video.c index cfad973..9ad541c 100644 --- a/unichrome/via_video.c +++ b/unichrome/via_video.c @@ -1087,7 +1087,7 @@ Flip(VIAPtr pVia, viaPortPrivPtr pPriv, int fourcc, while ((VIDInD(HQV_CONTROL + proReg) & HQV_SW_FLIP)) ; VIDOutD(HQV_SRC_STARTADDR_Y + proReg, pVia->swov.SWDevice.dwSWPhysicalAddr[DisplayBufferIndex]); - if (pVia->ChipId == PCI_CHIP_VT3259 || pVia->ChipId == PCI_CHIP_VT3336 || pVia->ChipId == PCI_CHIP_VT3364) { + if (pVia->ChipId == PCI_CHIP_VT3259 || pVia->ChipId == PCI_CHIP_VT3336 || pVia->ChipId == PCI_CHIP_VT3157 || pVia->ChipId == PCI_CHIP_VT3364) { VIDOutD(HQV_SRC_STARTADDR_U + proReg, pVia->swov.SWDevice.dwSWCrPhysicalAddr[DisplayBufferIndex]); } else { @@ -1141,7 +1141,7 @@ viaDmaBlitImage(VIAPtr pVia, Bool nv12Conversion; bounceBuffer = ((unsigned long)src & 15); - nv12Conversion = ((pVia->ChipId == PCI_CHIP_VT3259 || pVia->ChipId == PCI_CHIP_VT3336 || pVia->ChipId == PCI_CHIP_VT3364) + nv12Conversion = ((pVia->ChipId == PCI_CHIP_VT3259 || pVia->ChipId == PCI_CHIP_VT3336 || pVia->ChipId == PCI_CHIP_VT3157 || pVia->ChipId == PCI_CHIP_VT3364) && (id == FOURCC_YV12)); switch (id) { @@ -1334,7 +1334,7 @@ viaPutImage(ScrnInfoPtr pScrn, } else { switch (id) { case FOURCC_YV12: - if (pVia->ChipId == PCI_CHIP_VT3259 || pVia->ChipId == PCI_CHIP_VT3336 || pVia->ChipId == PCI_CHIP_VT3364) { + if (pVia->ChipId == PCI_CHIP_VT3259 || pVia->ChipId == PCI_CHIP_VT3336 || pVia->ChipId == PCI_CHIP_VT3157 || pVia->ChipId == PCI_CHIP_VT3364) { nv12cp(pVia->swov.SWDevice. lpSWOverlaySurface[pVia->dwFrameNum & 1], buf, dstPitch, width, height, 0); |