[I didn't see anything specific for patches on
http://www.xfree86.org/mailman/listinfo (and I haven't been keeping
track of the recent list changes), so I hope this is ok to post here.]
Here is a patch against XFree86 4.3.0 (from the xf-4_3_0 cvs tag).
The problem is that at high screen resolutions (i.e., with a high
dot-clock), if the ECP divisor is set wrong, images displayed with the
XVideo extension have weird "green" noise in them (vertical green static
that appears to be "over" or "between" the pixels). Alternatively, if
the ECP divisor was somehow set correctly before XFree86 4.3.0 starts
(e.g., with Windows or GATOS), then the symptom is that only the left
half (or third) of the image is displayed when using Xvideo (because
h_inc is computed wrong).
Thanks, Rik Faith
Index: r128_reg.h
===================================================================
RCS file: /cvs/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h,v
retrieving revision 1.15
diff -u -p -r1.15 r128_reg.h
--- r128_reg.h 2002/12/16 16:19:11 1.15
+++ r128_reg.h 2003/03/31 15:40:53
@@ -935,6 +935,7 @@
#define R128_TRAIL_X_SUB 0x1620
#define R128_VCLK_ECP_CNTL 0x0008 /* PLL */
+# define R128_ECP_DIV_MASK (3 << 8)
#define R128_VENDOR_ID 0x0f00 /* PCI */
#define R128_VGA_DDA_CONFIG 0x02e8
#define R128_VGA_DDA_ON_OFF 0x02ec
Index: r128_video.c
===================================================================
RCS file: /cvs/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c,v
retrieving revision 1.26
diff -u -p -r1.26 r128_video.c
--- r128_video.c 2003/02/19 01:19:41 1.26
+++ r128_video.c 2003/03/31 15:40:53
@@ -61,8 +61,21 @@ typedef struct {
CARD32 videoStatus;
Time offTime;
Time freeTime;
+ int ecp_div;
} R128PortPrivRec, *R128PortPrivPtr;
+static void R128ECP(ScrnInfoPtr pScrn, R128PortPrivPtr pPriv)
+{
+ R128InfoPtr info = R128PTR(pScrn);
+ unsigned char *R128MMIO = info->MMIO;
+ int dot_clock = info->ModeReg.dot_clock_freq;
+
+ if (dot_clock < 12500) pPriv->ecp_div = 0;
+ else if (dot_clock < 25000) pPriv->ecp_div = 1;
+ else pPriv->ecp_div = 2;
+
+ OUTPLLP(pScrn, R128_VCLK_ECP_CNTL, pPriv->ecp_div<<8, ~R128_ECP_DIV_MASK);
+}
void R128InitVideo(ScreenPtr pScreen)
{
@@ -196,6 +209,7 @@ R128AllocAdaptor(ScrnInfoPtr pScrn)
pPriv->brightness = 0;
pPriv->saturation = 16;
pPriv->currentBuffer = 0;
+ R128ECP(pScrn, pPriv);
return adapt;
}
@@ -728,12 +742,15 @@ R128DisplayVideo422(
){
R128InfoPtr info = R128PTR(pScrn);
unsigned char *R128MMIO = info->MMIO;
+ R128PortPrivPtr pPriv = info->adaptor->pPortPrivates[0].ptr;
int v_inc, h_inc, step_by, tmp;
int p1_h_accum_init, p23_h_accum_init;
int p1_v_accum_init;
+ R128ECP(pScrn, pPriv);
+
v_inc = (src_h << 20) / drw_h;
- h_inc = (src_w << 12) / drw_w;
+ h_inc = (src_w << (12 + pPriv->ecp_div)) / drw_w;
step_by = 1;
while(h_inc >= (2 << 12)) {
@@ -799,12 +816,13 @@ R128DisplayVideo420(
){
R128InfoPtr info = R128PTR(pScrn);
unsigned char *R128MMIO = info->MMIO;
+ R128PortPrivPtr pPriv = info->adaptor->pPortPrivates[0].ptr;
int v_inc, h_inc, step_by, tmp, leftUV;
int p1_h_accum_init, p23_h_accum_init;
int p1_v_accum_init, p23_v_accum_init;
v_inc = (src_h << 20) / drw_h;
- h_inc = (src_w << 12) / drw_w;
+ h_inc = (src_w << (12 + pPriv->ecp_div)) / drw_w;
step_by = 1;
while(h_inc >= (2 << 12)) {
_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel