summaryrefslogtreecommitdiff
path: root/src/g80_display.c
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2007-07-10 00:41:21 -0700
committerAaron Plattner <aaron@weasel.nvidia.com>2007-07-10 00:41:21 -0700
commite77a2d9b62bc65062e7e2167642be5ab75ac4864 (patch)
treeec85c9457a0550dc6a7fe2616e1239fbf2e826d6 /src/g80_display.c
parentc1503c864d495f8a3e5380fed5cb8ca5e21a3750 (diff)
G80: Add a dithering property and corresponding config file option.
Diffstat (limited to 'src/g80_display.c')
-rw-r--r--src/g80_display.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/g80_display.c b/src/g80_display.c
index d10f2d6..04ae3ec 100644
--- a/src/g80_display.c
+++ b/src/g80_display.c
@@ -41,6 +41,7 @@ typedef struct G80CrtcPrivRec {
int pclk; /* Target pixel clock in kHz */
Bool cursorVisible;
Bool skipModeFixup;
+ Bool dither;
} G80CrtcPrivRec, *G80CrtcPrivPtr;
static void G80CrtcShowHideCursor(xf86CrtcPtr crtc, Bool show, Bool update);
@@ -362,6 +363,7 @@ G80CrtcModeSet(xf86CrtcPtr crtc, DisplayModePtr mode,
case 16: C(0x00000870 + headOff, 0xE800); break;
case 24: C(0x00000870 + headOff, 0xCF00); break;
}
+ G80CrtcSetDither(crtc, pPriv->dither, FALSE);
if((adjusted_mode->Flags & V_DBLSCAN) || (adjusted_mode->Flags & V_INTERLACE) ||
adjusted_mode->CrtcHDisplay != HDisplay || adjusted_mode->CrtcVDisplay != VDisplay) {
C(0x000008A4 + headOff, 9);
@@ -478,6 +480,19 @@ G80CrtcSkipModeFixup(xf86CrtcPtr crtc)
pPriv->skipModeFixup = TRUE;
}
+void
+G80CrtcSetDither(xf86CrtcPtr crtc, Bool dither, Bool update)
+{
+ ScrnInfoPtr pScrn = crtc->scrn;
+ G80CrtcPrivPtr pPriv = crtc->driver_private;
+ const int headOff = 0x400 * G80CrtcGetHead(crtc);
+
+ pPriv->dither = dither;
+
+ C(0x000008A0 + headOff, dither ? 0x11 : 0);
+ if(update) C(0x00000080, 0);
+}
+
static void
G80CrtcCommit(xf86CrtcPtr crtc)
{
@@ -524,6 +539,7 @@ static const xf86CrtcFuncsRec g80_crtc_funcs = {
void
G80DispCreateCrtcs(ScrnInfoPtr pScrn)
{
+ G80Ptr pNv = G80PTR(pScrn);
Head head;
xf86CrtcPtr crtc;
G80CrtcPrivPtr g80_crtc;
@@ -535,6 +551,7 @@ G80DispCreateCrtcs(ScrnInfoPtr pScrn)
g80_crtc = xnfcalloc(sizeof(*g80_crtc), 1);
g80_crtc->head = head;
+ g80_crtc->dither = pNv->Dither;
crtc->driver_private = g80_crtc;
}
}