summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuc Verhaegen <libv@skynet.be>2009-10-15 16:43:57 +0200
committerLuc Verhaegen <libv@skynet.be>2009-10-15 16:43:57 +0200
commite4ee741e0a00f697b201976643fa200f715ad4f3 (patch)
treee63d1eade0c24ac86ad65d47b3e174eaa6d8efbf
parentb58f3c7fb64ce66d88c63603ab42305bde04c20a (diff)
Crtc: VT1122: Add initial modesetting support.
* Add FIFOSet functions. * Use VT3230 PLL calculation, close to this, but less steep and lower. * Leave the rest of CRTC testing for this device as a TODO.
-rw-r--r--src/via_crtc.c44
1 files changed, 43 insertions, 1 deletions
diff --git a/src/via_crtc.c b/src/via_crtc.c
index 78778a4..b2f2442 100644
--- a/src/via_crtc.c
+++ b/src/via_crtc.c
@@ -187,7 +187,8 @@ VT3118PLLGenerate(struct ViaCrtc *Crtc, int Clock)
/*
* VT3230 is the steepest, most left limit found for VT3157, VT3230, VT3343,
- * and VT3371. So use the limit close to VT3230 to limit all these dotclocks.
+ * VT3371, and VT1122. So use the limit close to VT3230 to limit all these
+ * dotclocks.
*/
static CARD32
VT3230PLLGenerate(struct ViaCrtc *Crtc, int Clock)
@@ -837,6 +838,21 @@ VT3371Crtc1FIFOSet(struct ViaCrtc *Crtc, DisplayModePtr Mode)
*
*/
static void
+VT1122Crtc1FIFOSet(struct ViaCrtc *Crtc, DisplayModePtr Mode)
+{
+ VIAFUNC(Crtc);
+
+ VIACrtc1FetchCountSet(Crtc, Mode);
+
+ /* Depth = 192 / 2 - 1; Threshold = 152 / 4;
+ HighThreshold = 152 / 4; Expire = 64 / 4 */
+ VT3108Crtc1FIFOHelper(Crtc, 95, 38, 38, 16);
+}
+
+/*
+ *
+ */
+static void
VT3122Crtc2FIFOHelper(struct ViaCrtc *Crtc, Bool ExtendedEnable, CARD8 Depth,
CARD8 Threshold)
{
@@ -1072,6 +1088,21 @@ VT3371Crtc2FIFOSet(struct ViaCrtc *Crtc, DisplayModePtr Mode)
}
/*
+ *
+ */
+static void
+VT1122Crtc2FIFOSet(struct ViaCrtc *Crtc, DisplayModePtr Mode)
+{
+ VIAFUNC(Crtc);
+
+ VIACrtc2FetchCountSet(Crtc, Mode);
+
+ /* Depth: 96 / 8 - 1; Threshold: 64 / 4;
+ HighThreshold: 32 / 4; Expire: 128 /4 */
+ VT3108Crtc2FIFOHelper(Crtc, 11, 16, 8, 32);
+}
+
+/*
* Check whether our CRTC1 supports this mode.
*/
static ModeStatus
@@ -1953,6 +1984,7 @@ ViaCrtcInit(ScrnInfoPtr pScrn)
case VT3157:
case VT3343:
case VT3371:
+ case VT1122:
break;
default:
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s: Unsupported chipset\n", __func__);
@@ -2005,6 +2037,9 @@ ViaCrtcInit(ScrnInfoPtr pScrn)
case VT3371:
Crtc->FIFOSet = VT3371Crtc1FIFOSet;
break;
+ case VT1122:
+ Crtc->FIFOSet = VT1122Crtc1FIFOSet;
+ 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__);
@@ -2028,6 +2063,7 @@ ViaCrtcInit(ScrnInfoPtr pScrn)
case VT3230:
case VT3343:
case VT3371:
+ case VT1122:
Crtc->PLLSet = VT3230Crtc1PLLSet;
break;
default:
@@ -2052,6 +2088,7 @@ ViaCrtcInit(ScrnInfoPtr pScrn)
case VT3157:
case VT3343:
case VT3371:
+ case VT1122:
Crtc->GammaEnable = VT3108Crtc1GammaEnable;
break;
default:
@@ -2122,6 +2159,9 @@ ViaCrtcInit(ScrnInfoPtr pScrn)
case VT3371:
Crtc->FIFOSet = VT3371Crtc2FIFOSet;
break;
+ case VT1122:
+ Crtc->FIFOSet = VT1122Crtc2FIFOSet;
+ 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__);
@@ -2145,6 +2185,7 @@ ViaCrtcInit(ScrnInfoPtr pScrn)
case VT3230:
case VT3343:
case VT3371:
+ case VT1122:
Crtc->PLLSet = VT3230Crtc2PLLSet;
break;
default:
@@ -2168,6 +2209,7 @@ ViaCrtcInit(ScrnInfoPtr pScrn)
case VT3230:
case VT3343:
case VT3371:
+ case VT1122:
Crtc->ScaleSet = VT3108Crtc2ScaleSet;
break;
default: