summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2008-02-23 22:49:34 -0500
committerDave Airlie <airlied@redhat.com>2008-02-23 22:49:34 -0500
commit6ce9ee47c75620b2e5d211c5d59d17271a6a7b19 (patch)
tree4a3bd4cbf4f47ef2dae6494ee5141185b989502c
parent9aaf8b33b22b6ba112869558ae54e021b9487ad2 (diff)
r500: add textured video Xv adapter support
-rw-r--r--src/radeon_driver.c2
-rw-r--r--src/radeon_textured_videofuncs.c70
-rw-r--r--src/radeon_video.c2
3 files changed, 54 insertions, 20 deletions
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index abf7d5ce..5cf8d511 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -3485,7 +3485,7 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
RADEONDGAInit(pScreen);
/* Init Xv */
- if (!IS_AVIVO_VARIANT) {
+ if (info->ChipFamily < CHIP_FAMILY_R600) {
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"Initializing Xv\n");
RADEONInitVideo(pScreen);
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);
}
diff --git a/src/radeon_video.c b/src/radeon_video.c
index 487f064b..1b7d9240 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -285,7 +285,7 @@ void RADEONInitVideo(ScreenPtr pScreen)
RADEONInitOffscreenImages(pScreen);
}
- if (info->ChipFamily != CHIP_FAMILY_RS400) {
+ if (info->ChipFamily != CHIP_FAMILY_RS400 && info->ChipFamily != CHIP_FAMILY_RS690) {
texturedAdaptor = RADEONSetupImageTexturedVideo(pScreen);
if (texturedAdaptor != NULL) {
adaptors[num_adaptors++] = texturedAdaptor;