[Unichrome-devel] [PATCH] Support the VT3157 CRTCs
Brought to you by:
dwdeath
From: Simon F. <sim...@on...> - 2009-05-11 13:56:40
|
Values have been taken from Openchrome SVN, but reworked to use the helpers instead of direct register access (which should make tweaking the values easier if needed). --- src/via_crtc.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 45 insertions(+), 0 deletions(-) diff --git a/src/via_crtc.c b/src/via_crtc.c index 9eb02ce..060f318 100644 --- a/src/via_crtc.c +++ b/src/via_crtc.c @@ -595,6 +595,21 @@ VT3344Crtc1FIFOSet(struct ViaCrtc *Crtc, DisplayModePtr Mode) VT3108Crtc1FIFOHelper(Crtc, 47, 20, 16, 0); } +/* + * + */ +static void +VT3157Crtc1FIFOSet(struct ViaCrtc *Crtc, DisplayModePtr Mode) +{ + VIAFUNC(Crtc); + + VIACrtc1FetchCountSet(Crtc, Mode); + + /* Values taken from http://svn.openchrome.org/svn/trunk revision 747 + file via_bandwidth.c line 235 onwards */ + VT3108Crtc1FIFOHelper(Crtc, 95, 38, 38, 31); +} + /* * @@ -775,6 +790,25 @@ VT3344Crtc2FIFOSet(struct ViaCrtc *Crtc, DisplayModePtr Mode) } /* + * + */ +static void +VT3157Crtc2FIFOSet(struct ViaCrtc *Crtc, DisplayModePtr Mode) +{ + VIAFUNC(Crtc); + + VIACrtc2FetchCountSet(Crtc, Mode); + + /* Values taken from http://svn.openchrome.org/svn/trunk revision 747 + file via_bandwidth.c line 382 onwards */ + if (Crtc->Pitch >= 5600) + VT3108Crtc2FIFOHelper(Crtc, 10, 20, 8, 16); + else + VT3108Crtc2FIFOHelper(Crtc, 11, 20, 8, 32); + +} + +/* * Check whether our CRTC1 supports this mode. */ static ModeStatus @@ -1651,6 +1685,7 @@ ViaCrtcInit(ScrnInfoPtr pScrn) case VT7205: case VT3108: case VT3344: + case VT3157: break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s: Unsupported chipset\n", __func__); @@ -1691,6 +1726,9 @@ ViaCrtcInit(ScrnInfoPtr pScrn) case VT3344: Crtc->FIFOSet = VT3344Crtc1FIFOSet; break; + case VT3157: + Crtc->FIFOSet = VT3157Crtc1FIFOSet; + break; default: /* should never happen, fix up the check at the top of this function */ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s: unsupported chipset\n", __func__); @@ -1705,6 +1743,7 @@ ViaCrtcInit(ScrnInfoPtr pScrn) break; case VT3108: case VT3344: + case VT3157: Crtc->PLLSet = VT3108Crtc1PLLSet; break; default: @@ -1724,6 +1763,7 @@ ViaCrtcInit(ScrnInfoPtr pScrn) break; case VT3108: case VT3344: + case VT3157: Crtc->GammaEnable = VT3108Crtc1GammaEnable; break; default: @@ -1782,6 +1822,9 @@ ViaCrtcInit(ScrnInfoPtr pScrn) case VT3344: Crtc->FIFOSet = VT3344Crtc2FIFOSet; break; + case VT3157: + Crtc->FIFOSet = VT3157Crtc2FIFOSet; + break; default: /* should never happen, fix up the check at the top of this function */ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s: unsupported chipset\n", __func__); @@ -1796,6 +1839,7 @@ ViaCrtcInit(ScrnInfoPtr pScrn) break; case VT3108: case VT3344: + case VT3157: Crtc->PLLSet = VT3108Crtc2PLLSet; break; default: @@ -1814,6 +1858,7 @@ ViaCrtcInit(ScrnInfoPtr pScrn) break; case VT3108: case VT3344: + case VT3157: Crtc->ScaleSet = VT3108Crtc2ScaleSet; break; default: -- 1.5.4.1 |