summaryrefslogtreecommitdiff
path: root/src/radeon_textured_videofuncs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/radeon_textured_videofuncs.c')
-rw-r--r--src/radeon_textured_videofuncs.c70
1 files changed, 52 insertions, 18 deletions
diff --git a/src/radeon_textured_videofuncs.c b/src/radeon_textured_videofuncs.c
index 3e635e87..3e2bc309 100644
--- a/src/radeon_textured_videofuncs.c
+++ b/src/radeon_textured_videofuncs.c
@@ -127,7 +127,7 @@ FUNC_NAME(RADEONDisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv
RADEON_WAIT_HOST_IDLECLEAN | RADEON_WAIT_2D_IDLECLEAN | RADEON_WAIT_3D_IDLECLEAN);
FINISH_VIDEO();
- if (IS_R300_VARIANT) {
+ if (IS_R300_VARIANT || IS_AVIVO_VARIANT) {
switch (pPixmap->drawable.bitsPerPixel) {
case 16:
@@ -216,20 +216,54 @@ FUNC_NAME(RADEONDisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv
FINISH_VIDEO();
/* setup pixel shader */
- BEGIN_VIDEO(12);
- OUT_VIDEO_REG(R300_US_CONFIG, 0x8);
- OUT_VIDEO_REG(R300_US_PIXSIZE, 0x0);
- OUT_VIDEO_REG(R300_US_CODE_OFFSET, 0x40040);
- OUT_VIDEO_REG(R300_US_CODE_ADDR_0, 0x0);
- OUT_VIDEO_REG(R300_US_CODE_ADDR_1, 0x0);
- OUT_VIDEO_REG(R300_US_CODE_ADDR_2, 0x0);
- OUT_VIDEO_REG(R300_US_CODE_ADDR_3, 0x400000);
- OUT_VIDEO_REG(R300_US_TEX_INST_0, 0x8000);
- OUT_VIDEO_REG(R300_US_ALU_RGB_ADDR_0, 0x1f800000);
- OUT_VIDEO_REG(R300_US_ALU_RGB_INST_0, 0x50a80);
- OUT_VIDEO_REG(R300_US_ALU_ALPHA_ADDR_0, 0x1800000);
- OUT_VIDEO_REG(R300_US_ALU_ALPHA_INST_0, 0x00040889);
- FINISH_VIDEO();
+ if (IS_R300_VARIANT) {
+ BEGIN_VIDEO(16);
+ OUT_VIDEO_REG(R300_RS_COUNT, 0x40002);
+ OUT_VIDEO_REG(R300_RS_IP_0, 0x1610000);
+ OUT_VIDEO_REG(R300_RS_INST_COUNT, 0xC0);
+ OUT_VIDEO_REG(R300_RS_INST_0, R300_RS_INST_TEX_CN_WRITE);
+ OUT_VIDEO_REG(R300_US_CONFIG, 0x8);
+ OUT_VIDEO_REG(R300_US_PIXSIZE, 0x0);
+ OUT_VIDEO_REG(R300_US_CODE_OFFSET, 0x40040);
+ OUT_VIDEO_REG(R300_US_CODE_ADDR_0, 0x0);
+ OUT_VIDEO_REG(R300_US_CODE_ADDR_1, 0x0);
+ OUT_VIDEO_REG(R300_US_CODE_ADDR_2, 0x0);
+ OUT_VIDEO_REG(R300_US_CODE_ADDR_3, 0x400000);
+ OUT_VIDEO_REG(R300_US_TEX_INST_0, 0x8000);
+ OUT_VIDEO_REG(R300_US_ALU_RGB_ADDR_0, 0x1f800000);
+ OUT_VIDEO_REG(R300_US_ALU_RGB_INST_0, 0x50a80);
+ OUT_VIDEO_REG(R300_US_ALU_ALPHA_ADDR_0, 0x1800000);
+ OUT_VIDEO_REG(R300_US_ALU_ALPHA_INST_0, 0x00040889);
+ FINISH_VIDEO();
+ } else {
+ BEGIN_VIDEO(22);
+ OUT_VIDEO_REG(R300_RS_COUNT, 0x40002);
+ OUT_VIDEO_REG(R500_RS_IP_0, (0 << R500_RS_IP_TEX_PTR_S_SHIFT) | (1 << R500_RS_IP_TEX_PTR_T_SHIFT) |
+ (R500_RS_IP_PTR_K0 << R500_RS_IP_TEX_PTR_R_SHIFT) | (R500_RS_IP_PTR_K1 << R500_RS_IP_TEX_PTR_Q_SHIFT));
+
+ OUT_VIDEO_REG(R300_RS_INST_COUNT, 0x0);
+ OUT_VIDEO_REG(R500_RS_INST_0, R500_RS_INST_TEX_CN_WRITE);
+ OUT_VIDEO_REG(R300_US_CONFIG, 0x2);
+ OUT_VIDEO_REG(R300_US_PIXSIZE, 0x0);
+ OUT_VIDEO_REG(R500_US_FC_CTRL, 0x0);
+ OUT_VIDEO_REG(R500_US_CODE_ADDR, 0x10000);
+ OUT_VIDEO_REG(R500_US_CODE_RANGE, 0x10000);
+ OUT_VIDEO_REG(R500_US_CODE_OFFSET, 0x0);
+ OUT_VIDEO_REG(R500_GA_US_VECTOR_INDEX, 0x0);
+ OUT_VIDEO_REG(R500_GA_US_VECTOR_DATA, 0x00007807);
+ OUT_VIDEO_REG(R500_GA_US_VECTOR_DATA, 0x06400000);
+ OUT_VIDEO_REG(R500_GA_US_VECTOR_DATA, 0xe4000400);
+ OUT_VIDEO_REG(R500_GA_US_VECTOR_DATA, 0x00000000);
+ OUT_VIDEO_REG(R500_GA_US_VECTOR_DATA, 0x00000000);
+ OUT_VIDEO_REG(R500_GA_US_VECTOR_DATA, 0x00000000);
+ OUT_VIDEO_REG(R500_GA_US_VECTOR_DATA, 0x00078105);
+ OUT_VIDEO_REG(R500_GA_US_VECTOR_DATA, 0x10040000);
+ OUT_VIDEO_REG(R500_GA_US_VECTOR_DATA, 0x10040000);
+ OUT_VIDEO_REG(R500_GA_US_VECTOR_DATA, 0x00db0220);
+ OUT_VIDEO_REG(R500_GA_US_VECTOR_DATA, 0x00c0c000);
+ OUT_VIDEO_REG(R500_GA_US_VECTOR_DATA, 0x20490000);
+ FINISH_VIDEO();
+ }
BEGIN_VIDEO(6);
OUT_VIDEO_REG(R300_TX_INVALTAGS, 0x0);
@@ -414,7 +448,7 @@ FUNC_NAME(RADEONDisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv
RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE |
(4 << RADEON_CP_VC_CNTL_NUM_SHIFT));
} else {
- if (IS_R300_VARIANT)
+ if (IS_R300_VARIANT || IS_AVIVO_VARIANT)
BEGIN_RING(4 * VTX_DWORD_COUNT + 6);
else
BEGIN_RING(4 * VTX_DWORD_COUNT + 2);
@@ -425,7 +459,7 @@ FUNC_NAME(RADEONDisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv
(4 << RADEON_CP_VC_CNTL_NUM_SHIFT));
}
#else /* ACCEL_CP */
- if (IS_R300_VARIANT)
+ if (IS_R300_VARIANT || IS_AVIVO_VARIANT)
BEGIN_VIDEO(3 + VTX_DWORD_COUNT * 4);
else
BEGIN_VIDEO(1 + VTX_DWORD_COUNT * 4);
@@ -451,7 +485,7 @@ FUNC_NAME(RADEONDisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv
VTX_OUT((float)(dstX + dstw), (float)dstY,
xFixedToFloat(srcTopRight.x) / info->texW[0], xFixedToFloat(srcTopRight.y) / info->texH[0]);
- if (IS_R300_VARIANT) {
+ if (IS_R300_VARIANT || IS_AVIVO_VARIANT) {
OUT_VIDEO_REG(R300_RB3D_DSTCACHE_CTLSTAT, 0xA);
OUT_VIDEO_REG(RADEON_WAIT_UNTIL, RADEON_WAIT_3D_IDLECLEAN);
}