summaryrefslogtreecommitdiff
path: root/src/atidac.c
diff options
context:
space:
mode:
authorGeorge Sapountzis <gsap7@yahoo.gr>2006-11-20 20:38:59 +0200
committerGeorge Sapountzis <gsap7@yahoo.gr>2007-01-28 01:24:20 +0200
commit9b126f45db27496c1ad16db65a61fe641a018983 (patch)
treeb2b1aa10abfb1ce153bea711a447b187eb85fd8e /src/atidac.c
parent0abcb2b2c84a50e64bb6aa9e94760659ecf33add (diff)
We always use the accelerator CRTC within the xserver.
- cull (pATI->NewHW.crtc != ATI_CRTC_MACH64).
Diffstat (limited to 'src/atidac.c')
-rw-r--r--src/atidac.c111
1 files changed, 41 insertions, 70 deletions
diff --git a/src/atidac.c b/src/atidac.c
index 31533774..f94e8ad7 100644
--- a/src/atidac.c
+++ b/src/atidac.c
@@ -185,20 +185,6 @@ ATIDACPreInit
pATIHW->lut[Index2 + 1] = 0x00U;
pATIHW->lut[Index2 + 2] = maxColour;
}
-
-#ifndef AVOID_CPIO
-
- if (pATIHW->crtc == ATI_CRTC_VGA)
- {
- /* Initialise overscan to black */
- Index = pATIHW->attr[17] * 3;
- pATIHW->lut[Index + 0] =
- pATIHW->lut[Index + 1] =
- pATIHW->lut[Index + 2] = 0x00U;
- }
-
-#endif /* AVOID_CPIO */
-
}
}
@@ -334,6 +320,44 @@ ATIDACSet
}
/*
+ * ATISetLUTEntry --
+ *
+ * This function is called to set one of a DAC's LUT entries.
+ */
+static void
+ATISetLUTEntry
+(
+ ATIPtr pATI,
+ int Index,
+ CARD8 *LUTEntry
+)
+{
+#ifdef AVOID_CPIO
+
+ out8(M64_DAC_WRITE, Index);
+ DACDelay;
+ out8(M64_DAC_DATA, LUTEntry[0]);
+ DACDelay;
+ out8(M64_DAC_DATA, LUTEntry[1]);
+ DACDelay;
+ out8(M64_DAC_DATA, LUTEntry[2]);
+ DACDelay;
+
+#else /* AVOID_CPIO */
+
+ outb(pATI->CPIO_DAC_WRITE, Index);
+ DACDelay;
+ outb(pATI->CPIO_DAC_DATA, LUTEntry[0]);
+ DACDelay;
+ outb(pATI->CPIO_DAC_DATA, LUTEntry[1]);
+ DACDelay;
+ outb(pATI->CPIO_DAC_DATA, LUTEntry[2]);
+ DACDelay;
+
+#endif /* AVOID_CPIO */
+}
+
+/*
* ATILoadPalette --
*
* This function updates the RAMDAC's LUT and the in-memory copy of it in
@@ -414,35 +438,8 @@ ATILoadPalette
for (Index = 0;
Index < (SizeOf(pATI->NewHW.lut) / 3);
Index += i, LUTEntry += i * 3)
- {
- if (!fChanged[Index])
- continue;
-
-#ifdef AVOID_CPIO
-
- out8(M64_DAC_WRITE, Index);
- DACDelay;
- out8(M64_DAC_DATA, LUTEntry[0]);
- DACDelay;
- out8(M64_DAC_DATA, LUTEntry[1]);
- DACDelay;
- out8(M64_DAC_DATA, LUTEntry[2]);
- DACDelay;
-
-#else /* AVOID_CPIO */
-
- outb(pATI->CPIO_DAC_WRITE, Index);
- DACDelay;
- outb(pATI->CPIO_DAC_DATA, LUTEntry[0]);
- DACDelay;
- outb(pATI->CPIO_DAC_DATA, LUTEntry[1]);
- DACDelay;
- outb(pATI->CPIO_DAC_DATA, LUTEntry[2]);
- DACDelay;
-
-#endif /* AVOID_CPIO */
-
- }
+ if (fChanged[Index])
+ ATISetLUTEntry(pATI, Index, LUTEntry);
}
}
else
@@ -459,33 +456,7 @@ ATILoadPalette
LUTEntry[2] = Colours[Index].blue;
if (pScreenInfo->vtSema || pATI->currentMode)
- {
-
-#ifdef AVOID_CPIO
-
- out8(M64_DAC_WRITE, Index);
- DACDelay;
- out8(M64_DAC_DATA, LUTEntry[0]);
- DACDelay;
- out8(M64_DAC_DATA, LUTEntry[1]);
- DACDelay;
- out8(M64_DAC_DATA, LUTEntry[2]);
- DACDelay;
-
-#else /* AVOID_CPIO */
-
- outb(pATI->CPIO_DAC_WRITE, Index);
- DACDelay;
- outb(pATI->CPIO_DAC_DATA, LUTEntry[0]);
- DACDelay;
- outb(pATI->CPIO_DAC_DATA, LUTEntry[1]);
- DACDelay;
- outb(pATI->CPIO_DAC_DATA, LUTEntry[2]);
- DACDelay;
-
-#endif /* AVOID_CPIO */
-
- }
+ ATISetLUTEntry(pATI, Index, LUTEntry);
}
}
}