diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2009-06-25 21:27:20 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2009-06-25 21:27:20 +0000 |
commit | 6632165d69aa6036c7a9b3b077fc0765a7fc8f70 (patch) | |
tree | 8b38ff01ec15084ccd5dae4207d3d78559cc7109 /driver/xf86-video-openchrome/src/via_swov.c | |
parent | 1968cea3515172a985c8cad914ead74b3621d8ff (diff) |
update to openchrome.net svn commit 750.
This adds among others support for the VX800 chipset.
This has been in snapshots for weeks.
Diffstat (limited to 'driver/xf86-video-openchrome/src/via_swov.c')
-rw-r--r-- | driver/xf86-video-openchrome/src/via_swov.c | 48 |
1 files changed, 41 insertions, 7 deletions
diff --git a/driver/xf86-video-openchrome/src/via_swov.c b/driver/xf86-video-openchrome/src/via_swov.c index df83d8e1f..52428f9ba 100644 --- a/driver/xf86-video-openchrome/src/via_swov.c +++ b/driver/xf86-video-openchrome/src/via_swov.c @@ -32,14 +32,14 @@ #include "xf86fbman.h" #include "via.h" -#ifdef CHROMEDRI +#ifdef OPENCHROMEDRI #include "xf86drm.h" #endif #include "via_driver.h" #include "via_priv.h" #include "via_swov.h" -#ifdef CHROMEDRI +#ifdef OPENCHROMEDRI #include "via_drm.h" #endif #include "via_vgahw.h" @@ -95,7 +95,8 @@ viaWaitHQVFlip(VIAPtr pVia) pdwState = (CARD32 volatile *)(pVia->VidMapBase + (HQV_CONTROL + proReg)); if (pVia->VideoEngine == VIDEO_ENGINE_CME) { - while (*pdwState & (HQV_SUBPIC_FLIP | HQV_SW_FLIP)) ; + // while (*pdwState & (HQV_SUBPIC_FLIP | HQV_SW_FLIP)) ; + while (*pdwState & HQV_SUBPIC_FLIP); } else { while (!(*pdwState & HQV_FLIP_STATUS)) ; } @@ -280,6 +281,14 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn) HWDiff->dwHQVDisablePatch = VID_HWDIFF_FALSE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; break; + case VIA_VX800: + 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; + HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; + break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "VIAVidHWDiffInit: Unhandled ChipSet.\n"); @@ -774,6 +783,7 @@ viaCalculateVideoColor(VIAPtr pVia, int hue, int saturation, case PCI_CHIP_VT3364: case PCI_CHIP_VT3324: case PCI_CHIP_VT3327: + case PCI_CHIP_VT3353: model = 0; break; case PCI_CHIP_CLE3122: @@ -911,6 +921,7 @@ viaSetColorSpace(VIAPtr pVia, int hue, int saturation, int brightness, case PCI_CHIP_VT3336: case PCI_CHIP_VT3324: case PCI_CHIP_VT3364: + case PCI_CHIP_VT3353: case PCI_CHIP_CLE3122: VIDOutD(V1_ColorSpaceReg_2, col2); VIDOutD(V1_ColorSpaceReg_1, col1); @@ -939,6 +950,7 @@ ViaInitVideoStatusFlag(VIAPtr pVia) case PCI_CHIP_VT3336: case PCI_CHIP_VT3324: case PCI_CHIP_VT3364: + case PCI_CHIP_VT3353: return (VIDEO_HQV_INUSE | SW_USE_HQV | VIDEO_1_INUSE | VIDEO_ACTIVE | VIDEO_SHOW); case PCI_CHIP_CLE3122: @@ -976,6 +988,7 @@ ViaSetVidCtl(VIAPtr pVia, unsigned int videoFlag) case PCI_CHIP_VT3336: case PCI_CHIP_VT3324: case PCI_CHIP_VT3364: + case PCI_CHIP_VT3353: return V3_ENABLE | VIDEO_EXPIRE_NUM_VT3336; case PCI_CHIP_CLE3122: if (CLE266_REV_IS_CX(pVia->ChipRev)) @@ -1258,7 +1271,8 @@ SetFIFO_V3(VIAPtr pVia, CARD8 depth, CARD8 prethreshold, CARD8 threshold) { if ((pVia->ChipId == PCI_CHIP_VT3314) || (pVia->ChipId == PCI_CHIP_VT3324) - || (pVia->ChipId == PCI_CHIP_VT3327)) { + || (pVia->ChipId == PCI_CHIP_VT3327 + || (pVia->ChipId == PCI_CHIP_VT3353))) { SaveVideoRegister(pVia, ALPHA_V3_FIFO_CONTROL, (VIDInD(ALPHA_V3_FIFO_CONTROL) & ALPHA_FIFO_MASK) | ((depth - 1) & 0xff) | ((threshold & 0xff) << 8)); @@ -1320,6 +1334,7 @@ SetFIFO_V3_64or32or32(VIAPtr pVia) case PCI_CHIP_VT3336: case PCI_CHIP_VT3324: case PCI_CHIP_VT3364: + case PCI_CHIP_VT3353: SetFIFO_V3(pVia, 225, 200, 250); break; case PCI_CHIP_VT3204: @@ -1351,6 +1366,7 @@ SetFIFO_V3_64or32or16(VIAPtr pVia) case PCI_CHIP_VT3336: case PCI_CHIP_VT3324: case PCI_CHIP_VT3364: + case PCI_CHIP_VT3353: SetFIFO_V3(pVia, 225, 200, 250); break; case PCI_CHIP_VT3204: @@ -1674,6 +1690,7 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag, unsigned long chromaKeyLow, unsigned long chromaKeyHigh) { VIAPtr pVia = VIAPTR(pScrn); + VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; vgaHWPtr hwp = VGAHWPTR(pScrn); VIAHWDiff *hwDiff = &pVia->HWDiff; @@ -1707,8 +1724,15 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag, pUpdate->DstLeft, pUpdate->DstRight, pUpdate->DstTop, pUpdate->DstBottom)); - pVia->swov.overlayRecordV1.dwWidth = dstWidth = - pUpdate->DstRight - pUpdate->DstLeft; + dstWidth = pUpdate->DstRight - pUpdate->DstLeft; + if (pBIOSInfo->Panel->IsActive && pBIOSInfo->Panel->Scale) { + /* FIXME: We need to determine if the panel is using V1 or V3 */ + float hfactor = (float)pBIOSInfo->Panel->NativeMode->Width + / pScrn->currentMode->HDisplay; + dstWidth *= hfactor; + } + + pVia->swov.overlayRecordV1.dwWidth = dstWidth; pVia->swov.overlayRecordV1.dwHeight = dstHeight = pUpdate->DstBottom - pUpdate->DstTop; srcWidth = (unsigned long)pUpdate->SrcRight - pUpdate->SrcLeft; @@ -1729,7 +1753,8 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag, */ if ((pVia->VideoEngine == VIDEO_ENGINE_CME || pVia->Chipset == VIA_VM800) - && pVia->pBIOSInfo->PanelActive) { + && pVia->pBIOSInfo->Panel->IsActive) { + /* V1_ON_SND_DISPLAY */ vidCtl |= 0x80000000; /* SECOND_DISPLAY_COLOR_KEY_ENABLE */ @@ -1983,6 +2008,15 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag, compose = SetChromaKey(pVia, videoFlag, chromaKeyLow, chromaKeyHigh, miniCtl, compose); + if (pVia->VideoEngine == VIDEO_ENGINE_CME) { + VIDOutD(HQV_SRC_DATA_OFFSET_CONTROL1,0); + VIDOutD(HQV_SRC_DATA_OFFSET_CONTROL3,((pUpdate->SrcRight - 1 ) << 16) | (pUpdate->SrcBottom - 1)); + if (pVia->Chipset == VIA_VX800) { + VIDOutD(HQV_SRC_DATA_OFFSET_CONTROL2,0); + VIDOutD(HQV_SRC_DATA_OFFSET_CONTROL4,((pUpdate->SrcRight - 1 ) << 16) | (pUpdate->SrcBottom - 1)); + } + } + /* Set up video control */ if (videoFlag & VIDEO_HQV_INUSE) { |