summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Nettleton <jon.nettleton@gmail.com>2006-12-16 03:09:40 +0000
committerJon Nettleton <jon.nettleton@gmail.com>2006-12-16 03:09:40 +0000
commit16dec3e005e3e17d188c1256063d5a212fefdaad (patch)
tree66c948cbcf3574a0f84c7a8212c2b6c13034f3a8
parent6d941a5d86781bb1eeebab6374b2fccc3f7212b8 (diff)
cleaned up patch submitting the final XV work that Gabriel did.
-rw-r--r--ChangeLog10
-rw-r--r--unichrome/via.h7
-rw-r--r--unichrome/via_swov.c30
-rw-r--r--unichrome/via_swov.h1
4 files changed, 39 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 5ca0149..d83b338 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2006-12-15 Jon Nettleton <jon-dot-nettleton-at-gmail-dot-com>
+
+ * unichrome/via.h:
+ * unichrome/via_swov.c:
+
+ This is my cleanup committ of the excellent patch that
+ Gabriel Mansi <gabriel-dot-mansi-at-gmail-dot-com> provided
+ which finishes the XVideo work on the VT3336 chipset. Nice
+ Work Gabriel.
+
2006-12-13 Jon Nettleton <jon-dot-nettleton-at-gmail-dot-com>
* unichrome/via_video.c:
diff --git a/unichrome/via.h b/unichrome/via.h
index c638f51..b3dd01c 100644
--- a/unichrome/via.h
+++ b/unichrome/via.h
@@ -259,6 +259,8 @@
#define V1_ON_SND_DISPLAY 0x80000000
#define V1_FIFO_32V1_32V2 0x00000000
#define V1_FIFO_48V1_32V2 0x00200000
+#define V1_PREFETCH_ON_3336 0x40000000 /*V1_PREFETCH_ON*/
+#define V1_GAMMA_ENABLE_3336 0x20000000 /*V1_Gamma_ENABLE*/
/* V12_QWORD_PER_LINE 0x234 */
#define V1_FETCH_COUNT 0x3ff00000
@@ -318,6 +320,11 @@
#define V1_FIFO_PRETHRESHOLD56 0x38000000
#define V1_FIFO_PRETHRESHOLD61 0x3D000000
+#define VIDEO_FIFO_DEPTH_VT3336 225
+#define VIDEO_FIFO_THRESHOLD_VT3336 200
+#define VIDEO_FIFO_PRETHRESHOLD_VT3336 250
+#define VIDEO_EXPIRE_NUM_VT3336 31
+
/* ALPHA_V3_FIFO_CONTROL 0x278
* IA2 has 32 level FIFO for packet mode video format
* 32 level FIFO for planar mode video YV12. with extension reg 230 bit 21 enable
diff --git a/unichrome/via_swov.c b/unichrome/via_swov.c
index 37c0042..07f5eae 100644
--- a/unichrome/via_swov.c
+++ b/unichrome/via_swov.c
@@ -212,12 +212,14 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn)
HWDiff->dwSupportTwoColorKey = VID_HWDIFF_FALSE;
HWDiff->dwHQVInitPatch = VID_HWDIFF_TRUE;
HWDiff->dwHQVDisablePatch = VID_HWDIFF_FALSE;
+ HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE;
} else {
HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE;
HWDiff->dwHQVFetchByteUnit = VID_HWDIFF_TRUE;
HWDiff->dwSupportTwoColorKey = VID_HWDIFF_TRUE;
HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE;
HWDiff->dwHQVDisablePatch = VID_HWDIFF_TRUE;
+ HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE;
}
break;
case VIA_KM400:
@@ -226,6 +228,7 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn)
HWDiff->dwSupportTwoColorKey = VID_HWDIFF_FALSE;
HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE;
HWDiff->dwHQVDisablePatch = VID_HWDIFF_TRUE;
+ HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE;
break;
case VIA_K8M800:
HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE;
@@ -233,6 +236,7 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn)
HWDiff->dwSupportTwoColorKey = VID_HWDIFF_FALSE;
HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE;
HWDiff->dwHQVDisablePatch = VID_HWDIFF_TRUE;
+ HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE;
break;
case VIA_PM800:
HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE;
@@ -240,6 +244,7 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn)
HWDiff->dwSupportTwoColorKey = VID_HWDIFF_TRUE;
HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE;
HWDiff->dwHQVDisablePatch = VID_HWDIFF_FALSE;
+ HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE;
break;
case VIA_VM800:
HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE;
@@ -247,6 +252,7 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn)
HWDiff->dwSupportTwoColorKey = VID_HWDIFF_FALSE;
HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE;
HWDiff->dwHQVDisablePatch = VID_HWDIFF_TRUE;
+ HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE;
break;
case VIA_K8M890:
HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE;
@@ -254,6 +260,7 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn)
HWDiff->dwSupportTwoColorKey = VID_HWDIFF_FALSE;
HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE;
HWDiff->dwHQVDisablePatch = VID_HWDIFF_TRUE;
+ HWDiff->dwNeedV1Prefetch = VID_HWDIFF_TRUE;
break;
default:
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -879,11 +886,6 @@ viaSetColorSpace(VIAPtr pVia, int hue, int saturation, int brightness,
DBG_DD(ErrorF("000002C8 %08lx\n", col2));
break;
case PCI_CHIP_VT3336:
- VIDOutD(V1_ColorSpaceReg_1, col1);
- VIDOutD(V1_ColorSpaceReg_2, col2);
- DBG_DD(ErrorF("00000284 %08lx\n", col1));
- DBG_DD(ErrorF("00000288 %08lx\n", col2));
- break;
case PCI_CHIP_CLE3122:
VIDOutD(V1_ColorSpaceReg_2, col2);
VIDOutD(V1_ColorSpaceReg_1, col1);
@@ -907,8 +909,8 @@ ViaInitVideoStatusFlag(VIAPtr pVia)
case PCI_CHIP_VT3204:
case PCI_CHIP_VT3259:
case PCI_CHIP_VT3314:
- case PCI_CHIP_VT3336:
return VIDEO_HQV_INUSE | SW_USE_HQV | VIDEO_3_INUSE;
+ case PCI_CHIP_VT3336:
case PCI_CHIP_CLE3122:
return VIDEO_HQV_INUSE | SW_USE_HQV | VIDEO_1_INUSE;
default:
@@ -939,8 +941,9 @@ ViaSetVidCtl(VIAPtr pVia, unsigned int videoFlag)
case PCI_CHIP_VT3204:
case PCI_CHIP_VT3259:
case PCI_CHIP_VT3314:
- case PCI_CHIP_VT3336:
return V3_ENABLE | V3_EXPIRE_NUM_3205;
+ case PCI_CHIP_VT3336:
+ return V3_ENABLE | VIDEO_EXPIRE_NUM_VT3336;
case PCI_CHIP_CLE3122:
if (CLE266_REV_IS_CX(pVia->ChipRev))
@@ -1276,13 +1279,15 @@ static void
SetFIFO_V3_64or32or32(VIAPtr pVia)
{
switch (pVia->ChipId) {
+ case PCI_CHIP_VT3336:
+ SetFIFO_V3(pVia, 225, 200, 250);
+ break;
case PCI_CHIP_VT3204:
SetFIFO_V3(pVia, 100, 89, 89);
break;
case PCI_CHIP_VT3314:
SetFIFO_V3(pVia, 64, 61, 61);
break;
- case PCI_CHIP_VT3336:
case PCI_CHIP_VT3205:
case PCI_CHIP_VT3259:
SetFIFO_V3(pVia, 32, 29, 29);
@@ -1304,13 +1309,15 @@ static void
SetFIFO_V3_64or32or16(VIAPtr pVia)
{
switch (pVia->ChipId) {
+ case PCI_CHIP_VT3336:
+ SetFIFO_V3(pVia, 225, 200, 250);
+ break;
case PCI_CHIP_VT3204:
SetFIFO_V3(pVia, 100, 89, 89);
break;
case PCI_CHIP_VT3314:
SetFIFO_V3(pVia, 64, 61, 61);
break;
- case PCI_CHIP_VT3336:
case PCI_CHIP_VT3205:
case PCI_CHIP_VT3259:
SetFIFO_V3(pVia, 32, 29, 29);
@@ -1671,6 +1678,11 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag,
DBG_DD(ErrorF("===srcHeight= %ld \n", srcHeight));
vidCtl = ViaSetVidCtl(pVia, videoFlag);
+
+ if(hwDiff->dwNeedV1Prefetch) {
+ vidCtl |= V1_PREFETCH_ON_3336;
+ }
+
viaOverlayGetV1V3Format(pVia, (videoFlag & VIDEO_1_INUSE) ? 1 : 3,
videoFlag, &vidCtl, &hqvCtl);
diff --git a/unichrome/via_swov.h b/unichrome/via_swov.h
index 6bdbea6..1dcb625 100644
--- a/unichrome/via_swov.h
+++ b/unichrome/via_swov.h
@@ -60,6 +60,7 @@ typedef struct __VIAHWDiff
/*unsigned long dwUpdFlip; *//* Set HQV3D0[15] to flip video */
unsigned long dwHQVDisablePatch; /* Change Video Engine Clock setting for HQV disable bug */
/*unsigned long dwSUBFlip; *//* Set HQV3D0[15] to flip video for sub-picture blending */
+ unsigned long dwNeedV1Prefetch; /*V1 pre-fetch function for K8*/
/*unsigned long dwNeedV3Prefetch; *//* V3 pre-fetch function for K8 */
/*unsigned long dwNeedV4Prefetch; *//* V4 pre-fetch function for K8 */
/*unsigned long dwUseSystemMemory; *//* Use system memory for DXVA compressed data buffers */