summaryrefslogtreecommitdiff
path: root/xc
diff options
context:
space:
mode:
authormdaenzer <mdaenzer>2001-09-30 21:18:24 +0000
committermdaenzer <mdaenzer>2001-09-30 21:18:24 +0000
commitab0db887d72de6f89051f05cf9202f4abe47986f (patch)
treeb7085627d5adc2bda81e6cd3333b215329826b8e /xc
parent19ef3aec5f863ff9880358914816b37ca3b14041 (diff)
add CCE acceleration for mono 8x8 patterns
Diffstat (limited to 'xc')
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128_accel.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_accel.c
index 0c740488a..4a6708953 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_accel.c
@@ -1269,6 +1269,52 @@ static void R128CCESubsequentDashedBresenhamLine(ScrnInfoPtr pScrn,
ADVANCE_RING();
}
+/* Mono 8x8 pattern color expansion */
+static void R128CCESetupForMono8x8PatternFill(ScrnInfoPtr pScrn,
+ int patternx, int patterny,
+ int fg, int bg, int rop,
+ unsigned int planemask)
+{
+ R128InfoPtr info = R128PTR(pScrn);
+ RING_LOCALS;
+
+ R128CCE_REFRESH( pScrn, info );
+
+ BEGIN_RING( 12 );
+
+ OUT_RING_REG(R128_DP_GUI_MASTER_CNTL, (info->dp_gui_master_cntl
+ | (bg == -1
+ ? R128_GMC_BRUSH_8X8_MONO_FG_LA
+ : R128_GMC_BRUSH_8X8_MONO_FG_BG)
+ | R128_ROP[rop].pattern
+ | R128_GMC_BYTE_LSB_TO_MSB));
+ OUT_RING_REG(R128_DP_WRITE_MASK, planemask);
+ OUT_RING_REG(R128_DP_BRUSH_FRGD_CLR, fg);
+ OUT_RING_REG(R128_DP_BRUSH_BKGD_CLR, bg);
+ OUT_RING_REG(R128_BRUSH_DATA0, patternx);
+ OUT_RING_REG(R128_BRUSH_DATA1, patterny);
+
+ ADVANCE_RING();
+}
+
+static void R128CCESubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn,
+ int patternx, int patterny,
+ int x, int y, int w, int h)
+{
+ R128InfoPtr info = R128PTR(pScrn);
+ RING_LOCALS;
+
+ R128CCE_REFRESH( pScrn, info );
+
+ BEGIN_RING( 6 );
+
+ OUT_RING_REG(R128_BRUSH_Y_X, (patterny << 8) | patternx);
+ OUT_RING_REG(R128_DST_Y_X, (y << 16) | x);
+ OUT_RING_REG(R128_DST_HEIGHT_WIDTH, (h << 16) | w);
+
+ ADVANCE_RING();
+}
+
/* Get an indirect buffer for the CCE 2D acceleration commands.
*/
drmBufPtr R128CCEGetBuffer( ScrnInfoPtr pScrn )
@@ -1413,6 +1459,14 @@ static void R128CCEAccelInit(ScrnInfoPtr pScrn, XAAInfoRecPtr a)
a->DashPatternMaxLength = 32;
a->DashedLineFlags = (LINE_PATTERN_LSBFIRST_LSBJUSTIFIED
| LINE_PATTERN_POWER_OF_2_ONLY);
+
+ /* Mono 8x8 Pattern Fill (Color Expand) */
+ a->SetupForMono8x8PatternFill = R128CCESetupForMono8x8PatternFill;
+ a->SubsequentMono8x8PatternFillRect = R128CCESubsequentMono8x8PatternFillRect;
+ a->Mono8x8PatternFillFlags = (HARDWARE_PATTERN_PROGRAMMED_BITS
+ | HARDWARE_PATTERN_PROGRAMMED_ORIGIN
+ | HARDWARE_PATTERN_SCREEN_ORIGIN
+ | BIT_ORDER_IN_BYTE_LSBFIRST);
}
#endif