Commit 8bbfca79 authored by Alex Deucher's avatar Alex Deucher

- small fixups for old streams

- more work on Xv support for savage2000 (still not working 100%)
parent 689e9535
......@@ -145,6 +145,8 @@ void SavageInitStreamsOld(ScrnInfoPtr pScrn)
OUTREG(PSTREAM_FBSIZE_REG,
pScrn->virtualY * pScrn->virtualX * (pScrn->bitsPerPixel >> 3));
}
OUTREG(FIFO_CONTROL, 0x18ffeL);
OUTREG( PSTREAM_WINDOW_START_REG, OS_XY(0,0) );
OUTREG( PSTREAM_WINDOW_SIZE_REG, OS_WH(pScrn->displayWidth, pScrn->virtualY) );
......@@ -319,10 +321,11 @@ void SavageInitStreams2000(ScrnInfoPtr pScrn)
}
OUTREG( SEC_STREAM_CKEY_LOW, 0 );
OUTREG( SEC_STREAM_CKEY_LOW, (4L << 29) );
OUTREG( SEC_STREAM_CKEY_UPPER, 0 );
OUTREG( SEC_STREAM_HSCALING, 0 );
OUTREG( SEC_STREAM_VSCALING, 0 );
OUTREG(SEC_STREAM2_STRIDE_LPB, 0);
OUTREG( BLEND_CONTROL, 0 );
OUTREG( SEC_STREAM_FBUF_ADDR0, 0 );
OUTREG( SEC_STREAM_FBUF_ADDR1, 0 );
......@@ -334,11 +337,22 @@ void SavageInitStreams2000(ScrnInfoPtr pScrn)
OUTREG( SEC_STREAM_OPAQUE_OVERLAY, 0 );
OUTREG( SEC_STREAM_STRIDE, 0 );
/* FIFO related regs */
OUTREG8(CRT_ADDRESS_REG,0x86);
OUTREG8(CRT_DATA_REG,0x2c);
OUTREG8(CRT_ADDRESS_REG,0x87);
OUTREG8(CRT_DATA_REG,0xf8);
OUTREG8(CRT_ADDRESS_REG,0x89);
OUTREG8(CRT_DATA_REG,0x40);
/* These values specify brightness, contrast, saturation and hue. */
OUTREG( SEC_STREAM_COLOR_CONVERT0_2000, 0x0000C892 );
OUTREG( SEC_STREAM_COLOR_CONVERT1_2000, 0x00033400 );
OUTREG( SEC_STREAM_COLOR_CONVERT2_2000, 0x000001CF );
OUTREG( SEC_STREAM_COLOR_CONVERT3_2000, 0x01F1547E );
OUTREG( SEC_STREAM_COLOR_CONVERT0_2000, 0x640092 /*0x0000C892*/ );
OUTREG( SEC_STREAM_COLOR_CONVERT1_2000, 0x19a0000 /*0x00033400*/ );
OUTREG( SEC_STREAM_COLOR_CONVERT2_2000, 0x001cf /*0x000001CF*/ );
OUTREG( SEC_STREAM_COLOR_CONVERT3_2000, 0xF8CA007E /*0x01F1547E*/ );
}
......@@ -384,10 +398,10 @@ void PatchEnableSPofPanel(ScrnInfoPtr pScrn)
}
VerticalRetraceWait();
OUTREG8(CRT_ADDRESS_REG,0x67);
OUTREG8(CRT_DATA_REG,(INREG8(CRT_DATA_REG)&0xf3)|0x04);
OUTREG8(CRT_ADDRESS_REG,0x65);
OUTREG8(CRT_DATA_REG,INREG8(CRT_DATA_REG)|0xC0);
......@@ -396,8 +410,10 @@ void PatchEnableSPofPanel(ScrnInfoPtr pScrn)
} else {
OUTREG32(PSTREAM_CONTROL_REG,0x02000000);
}
OUTREG32(PSTREAM_WINDOW_SIZE_REG, 0x0);
/*OUTREG32(PSTREAM_WINDOW_SIZE_REG, OS_WH(pScrn->displayWidth, pScrn->virtualY));*/
}
......
......@@ -197,6 +197,19 @@
#define SEC_STREAM_COLOR_CONVERT1_2000 0x819c
#define SEC_STREAM_COLOR_CONVERT2_2000 0x81e0
#define SEC_STREAM_COLOR_CONVERT3_2000 0x81e4
#define SEC_STREAM_SRC_START_2000 0x818c
#define SEC_STREAM_SRC_SIZE_2000 0x81a8
#define SEC_STREAM_BUFFERSIZE_2000 0x81a4
#define S_SRC_H_Mask 0x00000fff
#define S_SRC_W_Shift 16
#define S_SRC_W_Mask 0x0fff0000
#define SRCSIZE(w,h) (((w <<S_SRC_W_Shift) & S_SRC_W_Mask) | (h & S_SRC_H_Mask))
#define SRCSTART(x,y) (((x <<S_SRC_W_Shift) & 0x7ff0000) | (y & 0x000007ff))
#define VSCALING_2000(h0,h1) ((unsigned int) (((float)h0/(float)h1) * (float)(65536.0) ))
#define HSCALING_NORMALIZE(h0,h1) ((unsigned int) ((float)2048.0 * ((float)h0/ (float)h1))) << 16
#define HSCALING_2000(w0,w1) ((unsigned int) (((float)w0/ (float)w1) * (float)(65536.0)))
#define XY_2000(x,y) ((((x)<<X_Shift)&X_Mask) | (((y)<<Y_Shift)&Y_Mask))
#define WH_2000(w,h) ((((w)<<W_Shift)&W_Mask) | (((h)<<H_Shift)&H_Mask))
#define BASE_PAD 0xf
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment