Commit 5a253b1f authored by Thomas Winischhofer's avatar Thomas Winischhofer

SiS driver:

- Fix off-by-one error in setting up offscreen-images
- Fix for retrieval of mode timing from BIOS for LCD
- Fix for DGA in MergedFB mode
- Code size reduction by more calculations, less tables
- ShadowFB uses fast memcpy (correctly) now
- Prefer user given modes over default ones
- Add ForcePanelRGB option
parent 4f367164
......@@ -2,8 +2,8 @@
.\" $XdotOrg$
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
#ifdef __servername__
#define __myservername__ __servername__
#ifdef __xservername__
#define __myservername__ __xservername__
#else
#define __myservername__ XFree86
#endif
......@@ -43,7 +43,7 @@ driver supports PCI and AGP video cards based on the following chipsets:
.B SiS550/551/552
.B SiS650/651/M650/661FX/M661FX/M661MX/740/741/741GX/M741
.B SiS330 (Xabre)
.B SiS760/M760
.B SiS760/760GX/M760
.PP
In the following text, the following terms are used:
.PP
......@@ -54,7 +54,7 @@ for SiS5597/5598, 530/620 and 6326/AGP/DVD
for SiS300/305, 540 and 630/730
.PP
.B 315/330 series
for SiS315, 55x and (M)65x/(M)661xX/74x(GX), 330, 760
for SiS315, 55x and (M)65x/(M)661xX/74x(GX), 330, (M)760(GX)
.PP
.SH CONFIGURATION DETAILS
Please refer to __myxconfigfile__(__filemansuffix__) for general configuration
......@@ -436,5 +436,6 @@ XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscma
.B "http://www.winischhofer.net/linuxsisvga.shtml"
for more information and updates
.SH AUTHORS
Authors include: Alan Hourihane, Mike Chapman, Juanjo Santamarta, Mitani
Hiroshi, David Thomas, Sung-Ching Lin, Ademar Reis, Thomas Winischhofer
Author: Thomas Winischhofer. Formerly based on code by Alan Hourihane,
Mike Chapman, Juanjo Santamarta, Mitani Hiroshi, David Thomas, Sung-Ching Lin,
Ademar Reis.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -3,7 +3,7 @@
/*
* Data and prototypes for init301.c
*
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
* Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
*
* If distributed as part of the Linux kernel, the following license terms
* apply:
......@@ -400,7 +400,9 @@ extern USHORT SiS_GetOffset(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdI
USHORT RefreshRateTableIndex, PSIS_HW_INFO HwInfo);
extern void SiS_LoadDAC(SiS_Private *SiS_Pr, PSIS_HW_INFO, USHORT ModeNo,
USHORT ModeIdIndex);
extern void SiS_CalcLCDACRT1Timing(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex);
extern void SiS_CalcLCDACRT1Timing(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
PSIS_HW_INFO HwInfo);
extern void SiS_CalcCRRegisters(SiS_Private *SiS_Pr, int depth);
#ifdef LINUX_XF86
extern void SiS_MakeClockRegs(ScrnInfoPtr pScrn, int clock, UCHAR *p2b, UCHAR *p2c);
extern int SiS_FindPanelFromDB(SISPtr pSiS, USHORT panelvendor, USHORT panelproduct,
......
......@@ -3,7 +3,7 @@
/*
* Global definitions for init.c and init301.c
*
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
* Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
*
* If distributed as part of the Linux kernel, the following license terms
* apply:
......@@ -91,6 +91,7 @@
#define VB_SISLCDA (VB_SIS302B|VB_SIS301C|VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV)
#define VB_SISYPBPR (VB_SIS301C|VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV)
#define VB_SISHIVISION (VB_SIS301|VB_SIS301B|VB_SIS302B)
#define VB_SISTMDSLCDA (VB_SIS301C)
/* VBInfo */
#define SetSimuScanMode 0x0001 /* CR 30 */
......@@ -483,16 +484,17 @@
#define VCLK34_300 0x3d /* Index in VCLKData table (300) */
#define VCLK_CUSTOM_300 0x47
#define VCLK65_315 0x0b /* Index in (VB)VCLKData table (315) */
#define VCLK108_2_315 0x19 /* Index in (VB)VCLKData table (315) */
#define VCLK81_315 0x5b /* Index in (VB)VCLKData table (315) */
#define VCLK162_315 0x5e /* Index in (VB)VCLKData table (315) */
#define VCLK108_3_315 0x45 /* Index in VBVCLKData table (315) */
#define VCLK100_315 0x46 /* Index in VBVCLKData table (315) */
#define VCLK65_315 0x0b /* Indices in (VB)VCLKData table (315) */
#define VCLK108_2_315 0x19
#define VCLK81_315 0x5b
#define VCLK162_315 0x5e
#define VCLK108_3_315 0x45
#define VCLK100_315 0x46
#define VCLK34_315 0x55
#define VCLK68_315 0x0d
#define VCLK_1280x800_315_2 0x5c /* Index in VBVCLKData table (315) */
#define VCLK121_315 0x5d /* Index in VBVCLKData table (315) */
#define VCLK_1280x800_315_2 0x5c
#define VCLK121_315 0x5d
#define VCLK130_315 0x72
#define VCLK_1280x720 0x5f
#define VCLK_1280x768_2 0x60
#define VCLK_1280x768_3 0x61 /* (unused?) */
......
......@@ -3,7 +3,7 @@
/*
* OEM Data for 300 series
*
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
* Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
*
* If distributed as part of the Linux kernel, the following license terms
* apply:
......
......@@ -3,7 +3,7 @@
/*
* OEM Data for 315/330 series
*
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
* Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
*
* If distributed as part of the Linux kernel, the following license terms
* apply:
......
......@@ -3,7 +3,7 @@
/*
* OS depending defines
*
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
* Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
*
* If distributed as part of the Linux kernel, the following license terms
* apply:
......@@ -87,6 +87,7 @@
/**********************************************************************/
#ifdef LINUX_KERNEL
#include <linux/config.h>
#ifdef CONFIG_FB_SIS_300
......@@ -109,6 +110,7 @@
#define InPortWord(p) inw((IOADDRESS)(p))
#define InPortLong(p) inl((IOADDRESS)(p))
#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset_io(MemoryAddress, value, MemorySize)
#endif
/**********************************************************************/
......@@ -116,6 +118,7 @@
/**********************************************************************/
#ifdef LINUX_XF86
#define SIS300
#define SIS315H
......@@ -126,6 +129,7 @@
#define InPortWord(p) inSISREGW((IOADDRESS)(p))
#define InPortLong(p) inSISREGL((IOADDRESS)(p))
#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
#endif
#endif /* XF86 */
#endif /* _OSDEF_H_ */
This diff is collapsed.
......@@ -3,7 +3,7 @@
/*
* 2D Acceleration for SiS 530, 620, 300, 540, 630, 730.
*
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
* Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -37,9 +37,9 @@
#endif
#include "sis.h"
#include "sis_regs.h"
#include "xaarop.h"
#include "sis300_accel.h"
#ifdef SISDUALHEAD
......@@ -139,7 +139,7 @@ extern UChar SiSGetPatternROP(int rop);
static void
SiSInitializeAccelerator(ScrnInfoPtr pScrn)
{
SISPtr pSiS = SISPTR(pScrn);
SISPtr pSiS = SISPTR(pScrn);
pSiS->DoColorExpand = FALSE;
}
......@@ -352,10 +352,9 @@ SiS300AccelInit(ScreenPtr pScreen)
return TRUE;
} else {
return(XAAInit(pScreen, infoPtr));
}
}
}
static void
SiSSync(ScrnInfoPtr pScrn)
{
......@@ -1132,7 +1131,7 @@ SiSSetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
/* TW: Make sure that current CPU-driven BitBlt buffer stage is 0
* This is required!!! (Otherwise -> drawing errors)
*/
while((MMIO_IN16(pSiS->IOBase, 0x8242) & 0x1F00) != 0) {} /* WDR: == 0x10 */
while((SIS_MMIO_IN16(pSiS->IOBase, 0x8242) & 0x1F00) != 0) {} /* WDR: == 0x10 */
SiSSetupSRCXY(0,0);
SiSSetupROP(SiSGetCopyROP(rop));
......@@ -1181,8 +1180,8 @@ SiSSubsequentScanlineCPUToScreenColorExpandFill(
* action, this bit never gets cleared again. So do
* SiSIdle instead.
*/
if((MMIO_IN16(pSiS->IOBase, 0x8242) & 0xe000) != 0xe000) {
/* while ((MMIO_IN16(pSiS->IOBase, 0x8242) & 0x0080) != 0) {} */
if((SIS_MMIO_IN16(pSiS->IOBase, 0x8242) & 0xe000) != 0xe000) {
/* while ((SIS_MMIO_IN16(pSiS->IOBase, 0x8242) & 0x0080) != 0) {} */
SiSIdle
}
......@@ -1230,8 +1229,8 @@ SiSSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
* action, this bit never gets cleared again. So do
* SiSIdle instead.
*/
if((MMIO_IN16(pSiS->IOBase, 0x8242) & 0xe000) != 0xe000) {
/* while ((MMIO_IN16(pSiS->IOBase, 0x8242) & 0x0080) != 0) {} */
if((SIS_MMIO_IN16(pSiS->IOBase, 0x8242) & 0xe000) != 0xe000) {
/* while ((SIS_MMIO_IN16(pSiS->IOBase, 0x8242) & 0x0080) != 0) {} */
SiSIdle
}
......@@ -1244,9 +1243,7 @@ SiSSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
pSiS->ycurrent++;
if(pSiS->VGAEngine == SIS_530_VGA) {
while(MMIO_IN8(pSiS->IOBase, 0x8242) & 0x80) {}
while(SIS_MMIO_IN8(pSiS->IOBase, 0x8242) & 0x80) {}
}
}
......@@ -4,7 +4,7 @@
* 2D Acceleration for SiS 530, 620, 300, 540, 630, 730.
* Definitions for the SIS engine communication
*
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
* Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -113,73 +113,73 @@
#define SiSIdle \
{ \
while( (MMIO_IN16(pSiS->IOBase, BR(16)+2) & 0xE000) != 0xE000){}; \
while( (MMIO_IN16(pSiS->IOBase, BR(16)+2) & 0xE000) != 0xE000){}; \
while( (MMIO_IN16(pSiS->IOBase, BR(16)+2) & 0xE000) != 0xE000){}; \
CmdQueLen = (MMIO_IN16(pSiS->IOBase, 0x8240) & pSiS->CmdQueLenMask) - pSiS->CmdQueLenFix; \
while( (SIS_MMIO_IN16(pSiS->IOBase, BR(16)+2) & 0xE000) != 0xE000){}; \
while( (SIS_MMIO_IN16(pSiS->IOBase, BR(16)+2) & 0xE000) != 0xE000){}; \
while( (SIS_MMIO_IN16(pSiS->IOBase, BR(16)+2) & 0xE000) != 0xE000){}; \
CmdQueLen = (SIS_MMIO_IN16(pSiS->IOBase, 0x8240) & pSiS->CmdQueLenMask) - pSiS->CmdQueLenFix; \
}
/* (do three times, because 2D engine seems quite unsure about whether or not it's idle) */
#define SiSSetupSRCBase(base) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, BR(0), base);\
SIS_MMIO_OUT32(pSiS->IOBase, BR(0), base);\
CmdQueLen--;
#define SiSSetupSRCPitch(pitch) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT16(pSiS->IOBase, BR(1), pitch);\
SIS_MMIO_OUT16(pSiS->IOBase, BR(1), pitch);\
CmdQueLen--;
#define SiSSetupSRCXY(x,y) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, BR(2), (x)<<16 | (y) );\
SIS_MMIO_OUT32(pSiS->IOBase, BR(2), (x)<<16 | (y) );\
CmdQueLen--;
#define SiSSetupDSTBase(base) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, BR(4), base);\
SIS_MMIO_OUT32(pSiS->IOBase, BR(4), base);\
CmdQueLen--;
#define SiSSetupDSTXY(x,y) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, BR(3), (x)<<16 | (y) );\
SIS_MMIO_OUT32(pSiS->IOBase, BR(3), (x)<<16 | (y) );\
CmdQueLen--;
#define SiSSetupDSTRect(x,y) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, BR(5), (y)<<16 | (x) );\
SIS_MMIO_OUT32(pSiS->IOBase, BR(5), (y)<<16 | (x) );\
CmdQueLen--;
#define SiSSetupDSTColorDepth(bpp) \
if(pSiS->VGAEngine != SIS_530_VGA) { \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT16(pSiS->IOBase, BR(1)+2, bpp);\
SIS_MMIO_OUT16(pSiS->IOBase, BR(1)+2, bpp);\
CmdQueLen--; \
}
#define SiSSetupRect(w,h) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, BR(6), (h)<<16 | (w) );\
SIS_MMIO_OUT32(pSiS->IOBase, BR(6), (h)<<16 | (w) );\
CmdQueLen--;
#define SiSSetupPATFG(color) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, BR(7), color);\
SIS_MMIO_OUT32(pSiS->IOBase, BR(7), color);\
CmdQueLen--;
#define SiSSetupPATBG(color) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, BR(8), color);\
SIS_MMIO_OUT32(pSiS->IOBase, BR(8), color);\
CmdQueLen--;
#define SiSSetupSRCFG(color) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, BR(9), color);\
SIS_MMIO_OUT32(pSiS->IOBase, BR(9), color);\
CmdQueLen--;
#define SiSSetupSRCBG(color) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, BR(10), color);\
SIS_MMIO_OUT32(pSiS->IOBase, BR(10), color);\
CmdQueLen--;
/* 0x8224 src colorkey high */
......@@ -188,30 +188,30 @@
/* 0x8220 dest colorkey low */
#define SiSSetupSRCTrans(color) \
if (CmdQueLen <= 1) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, 0x8224, color);\
MMIO_OUT32(pSiS->IOBase, 0x8228, color);\
SIS_MMIO_OUT32(pSiS->IOBase, 0x8224, color);\
SIS_MMIO_OUT32(pSiS->IOBase, 0x8228, color);\
CmdQueLen -= 2;
#define SiSSetupDSTTrans(color) \
if (CmdQueLen <= 1) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, 0x821C, color); \
MMIO_OUT32(pSiS->IOBase, 0x8220, color); \
SIS_MMIO_OUT32(pSiS->IOBase, 0x821C, color); \
SIS_MMIO_OUT32(pSiS->IOBase, 0x8220, color); \
CmdQueLen -= 2;
#define SiSSetupMONOPAT(p0,p1) \
if (CmdQueLen <= 1) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, BR(11), p0);\
MMIO_OUT32(pSiS->IOBase, BR(12), p1);\
SIS_MMIO_OUT32(pSiS->IOBase, BR(11), p0);\
SIS_MMIO_OUT32(pSiS->IOBase, BR(12), p1);\
CmdQueLen -= 2;
#define SiSSetupClipLT(left,top) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, BR(13), ((left) & 0xFFFF) | (top)<<16 );\
SIS_MMIO_OUT32(pSiS->IOBase, BR(13), ((left) & 0xFFFF) | (top)<<16 );\
CmdQueLen--;
#define SiSSetupClipRB(right,bottom) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, BR(14), ((right) & 0xFFFF) | (bottom)<<16 );\
SIS_MMIO_OUT32(pSiS->IOBase, BR(14), ((right) & 0xFFFF) | (bottom)<<16 );\
CmdQueLen--;
/* General */
......@@ -223,84 +223,84 @@
#define SiSDoCMD \
if (CmdQueLen <= 1) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, BR(15), pSiS->CommandReg); \
SIS_MMIO_OUT32(pSiS->IOBase, BR(15), pSiS->CommandReg); \
CmdQueLen--; \
if(pSiS->VGAEngine != SIS_530_VGA) { \
MMIO_OUT32(pSiS->IOBase, BR(16), 0);\
SIS_MMIO_OUT32(pSiS->IOBase, BR(16), 0);\
CmdQueLen--; \
} else { \
unsigned long temp; \
temp = MMIO_IN32(pSiS->IOBase, BR(16)); \
temp = SIS_MMIO_IN32(pSiS->IOBase, BR(16)); \
(void) temp; \
} \
/* Line */
#define SiSSetupX0Y0(x,y) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, BR(2), (y)<<16 | (x) );\
SIS_MMIO_OUT32(pSiS->IOBase, BR(2), (y)<<16 | (x) );\
CmdQueLen--;
#define SiSSetupX1Y1(x,y) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, BR(3), (y)<<16 | (x) );\
SIS_MMIO_OUT32(pSiS->IOBase, BR(3), (y)<<16 | (x) );\
CmdQueLen--;
#define SiSSetupLineCount(c) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT16(pSiS->IOBase, BR(6), c);\
SIS_MMIO_OUT16(pSiS->IOBase, BR(6), c);\
CmdQueLen--;
#define SiSSetupStylePeriod(p) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT16(pSiS->IOBase, BR(6)+2, p);\
SIS_MMIO_OUT16(pSiS->IOBase, BR(6)+2, p);\
CmdQueLen--;
#define SiSSetupStyleLow(ls) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, BR(11), ls);\
SIS_MMIO_OUT32(pSiS->IOBase, BR(11), ls);\
CmdQueLen--;
#define SiSSetupStyleHigh(ls) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, BR(12), ls);\
SIS_MMIO_OUT32(pSiS->IOBase, BR(12), ls);\
CmdQueLen--;
/* Trapezoid */
#define SiSSetupYH(y,h) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, 0x8208, (y)<<16 | (h) );\
SIS_MMIO_OUT32(pSiS->IOBase, 0x8208, (y)<<16 | (h) );\
CmdQueLen--;
#define SiSSetupLR(left,right) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, 0x820C, (right)<<16 | (left) );\
SIS_MMIO_OUT32(pSiS->IOBase, 0x820C, (right)<<16 | (left) );\
CmdQueLen--;
#define SiSSetupdL(dxL,dyL) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, 0x8244, (dyL)<<16 | (dxL) );\
SIS_MMIO_OUT32(pSiS->IOBase, 0x8244, (dyL)<<16 | (dxL) );\
CmdQueLen--;
#define SiSSetupdR(dxR,dyR) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, 0x8248, (dyR)<<16 | (dxR) );\
SIS_MMIO_OUT32(pSiS->IOBase, 0x8248, (dyR)<<16 | (dxR) );\
CmdQueLen--;
#define SiSSetupEL(eL) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, 0x824C, eL);\
SIS_MMIO_OUT32(pSiS->IOBase, 0x824C, eL);\
CmdQueLen--;
#define SiSSetupER(eR) \
if (CmdQueLen <= 0) SiSIdle;\
MMIO_OUT32(pSiS->IOBase, 0x8250, eR);\
SIS_MMIO_OUT32(pSiS->IOBase, 0x8250, eR);\
CmdQueLen--;
/* Set Pattern register */
#define SiSSetPattern(num, value) \
if (CmdQueLen <= 0) SiSIdle; \
MMIO_OUT32(pSiS->IOBase, (PATTERN_REG + (num * 4)), value); \
SIS_MMIO_OUT32(pSiS->IOBase, (PATTERN_REG + (num * 4)), value); \
CmdQueLen--;
......@@ -1179,7 +1179,7 @@
#define SiSWait3DCmdQueue(wLen)\
do{ \
while ( CmdQueLen < (int)(wLen)) { \
CmdQueLen = (MMIO_IN16(pSiS->IOBase, 0x8240) & pSiS->CmdQueLenMask) - pSiS->CmdQueLenFix; \
CmdQueLen = (SIS_MMIO_IN16(pSiS->IOBase, 0x8240) & pSiS->CmdQueLenMask) - pSiS->CmdQueLenFix; \
} \
CmdQueLen -= (int)(wLen); \
} while(0)
......
......@@ -3,7 +3,7 @@
/*
* 2D Acceleration for SiS 315 and 330 series
*
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
* Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -35,9 +35,10 @@
*/
#include "sis.h"
#define SIS_NEED_MYMMIO
#define SIS_NEED_ACCELBUF
#include "sis_regs.h"
#include "xaarop.h"
#include "sis310_accel.h"
#if 0
......@@ -231,6 +232,10 @@ static CARD32 SiSDstTextureFormats32[3] = { PICT_x8r8g8b8, PICT_a8r8g8b8, 0 };
static void SiSRestoreAccelState(ScrnInfoPtr pScrn);
#endif
#ifdef INCL_YUV_BLIT_ADAPTOR
void SISWriteBlitPacket(SISPtr pSiS, CARD32 *packet);
#endif
extern unsigned char SiSGetCopyROP(int rop);
extern unsigned char SiSGetPatternROP(int rop);
......@@ -1452,7 +1457,7 @@ SiSSubsequentScanlineCPUToScreenColorExpandFill(
#endif
#ifndef SISVRAMQ
if((MMIO_IN16(pSiS->IOBase, Q_STATUS+2) & 0x8000) != 0x8000) {
if((SIS_MMIO_IN16(pSiS->IOBase, Q_STATUS+2) & 0x8000) != 0x8000) {
SiSIdle;
}
#endif
......@@ -1493,7 +1498,7 @@ SiSSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
#endif
#ifndef SISVRAMQ
if((MMIO_IN16(pSiS->IOBase, Q_STATUS+2) & 0x8000) != 0x8000) {
if((SIS_MMIO_IN16(pSiS->IOBase, Q_STATUS+2) & 0x8000) != 0x8000) {
SiSIdle;
}
#endif
......@@ -2053,3 +2058,19 @@ SiSSubsequentCPUToScreenTexture(ScrnInfoPtr pScrn,
#endif
#endif
/* Helper for xv video blitter */
#ifdef INCL_YUV_BLIT_ADAPTOR
void
SISWriteBlitPacket(SISPtr pSiS, CARD32 *packet)
{
CARD32 dummybuf;
SiSWritePacketPart(packet[0], packet[1], packet[2], packet[3]);
SiSWritePacketPart(packet[4], packet[5], packet[6], packet[7]);
SiSWritePacketPart(packet[8], packet[9], packet[10], packet[11]);
SiSWritePacketPart(packet[12], packet[13], packet[14], packet[15]);
SiSWritePacketPart(packet[16], packet[17], packet[18], packet[19]);
SiSSyncWP;
(void)dummybuf; /* Suppress compiler warning */
}
#endif
This diff is collapsed.
......@@ -3,7 +3,7 @@
/*
* Xv driver for SiS 5597/5598, 6236 and 530/620.
*
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria.
* Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -37,10 +37,13 @@
#include "xf86xv.h"
#include "regionstr.h"
#include "Xv.h"
#include "xaa.h"
#include "dixstruct.h"
#include "fourcc.h"
#define SIS_NEED_inSISREG
#define SIS_NEED_outSISREG
#define SIS_NEED_inSISIDXREG
#define SIS_NEED_outSISIDXREG
#include "sis_regs.h"
#define OFF_DELAY 200 /* milliseconds */
......@@ -147,19 +150,15 @@ static CARD32 get_scanline_CRT1(SISPtr pSiS)
void SIS6326InitVideo(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
SISPtr pSiS = SISPTR(pScrn);
XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL;
XF86VideoAdaptorPtr newAdaptor = NULL;
int num_adaptors;
if(!pSiS->SiSFastVidCopy) {
pSiS->SiSFastVidCopy = SiSVidCopyInit(pScreen);
}
newAdaptor = SIS6326SetupImageVideo(pScreen);
if(newAdaptor)
if(newAdaptor) {
SIS6326InitOffscreenImages(pScreen);
}
num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors);
if(newAdaptor) {
......@@ -1338,11 +1337,7 @@ SIS6326PutImage(
/* copy data */
if((pSiS->XvUseMemcpy) || (totalSize < 16)) {
if((totalSize < 64) || (!pSiS->SiSFastVidCopy)) {
memcpy(pSiS->FbBase + pPriv->bufAddr[pPriv->currentBuf], buf, totalSize);
} else {
(*pSiS->SiSFastVidCopy)(pSiS->FbBase + pPriv->bufAddr[pPriv->currentBuf], buf, totalSize);
}
SiSMemCopyToVideoRam(pSiS, pSiS->FbBase + pPriv->bufAddr[pPriv->currentBuf], buf, totalSize);
} else {
dest = (CARD32 *)(pSiS->FbBase + pPriv->bufAddr[pPriv->currentBuf]);
src = (CARD32 *)buf;
......@@ -1445,7 +1440,7 @@ SIS6326QueryImageAttributes(
}
static void
SIS6326VideoTimerCallback (ScrnInfoPtr pScrn, Time now)
SIS6326VideoTimerCallback(ScrnInfoPtr pScrn, Time now)
{
SISPtr pSiS = SISPTR(pScrn);
SISPortPrivPtr pPriv = NULL;
......@@ -1678,3 +1673,5 @@ SIS6326InitOffscreenImages(ScreenPtr pScrn)
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -4,7 +4,7 @@
* DAC helper functions (Save/Restore, MemClk, etc)
* Definitions and prototypes
*
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria.
* Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......
......@@ -4,7 +4,7 @@
* SiS DGA handling
*
* Copyright (C) 2000 by Alan Hourihane, Sychdyn, North Wales, UK.
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
* Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
*
* Portions from radeon_dga.c which is
* Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
......@@ -35,14 +35,18 @@
*/
#include "sis.h"
#include "xaa.h"
#include "dgaproc.h"
#include "sis_regs.h"
#ifndef NEW_DGAOPENFRAMEBUFFER
static Bool SIS_OpenFramebuffer(ScrnInfoPtr, char **, UChar **,
int *, int *, int *);
#else
static Bool SIS_OpenFramebuffer(ScrnInfoPtr, char **, unsigned int *,
unsigned int *, unsigned int *, unsigned int *);
#endif
static Bool SIS_SetMode(ScrnInfoPtr, DGAModePtr);
static void SIS_Sync(ScrnInfoPtr);
static int SIS_GetViewport(ScrnInfoPtr);
......@@ -196,7 +200,6 @@ SECOND_PASS:
return modes;
}
Bool
SISDGAInit(ScreenPtr pScreen)
{
......@@ -261,10 +264,9 @@ SISDGAInit(ScreenPtr pScreen)
return DGAInit(pScreen, &SISDGAFuncs3xx, modes, num);
} else {
return DGAInit(pScreen, &SISDGAFuncs, modes, num);
}
}
}
static Bool
SIS_SetMode(
ScrnInfoPtr pScrn,
......@@ -406,18 +408,34 @@ static Bool
SIS_OpenFramebuffer(
ScrnInfoPtr pScrn,
char **name,
#ifndef NEW_DGAOPENFRAMEBUFFER
UChar **mem,
int *size,
int *offset,
int *flags
#else
unsigned int *mem,
unsigned int *size,
unsigned int *offset,
unsigned int *flags
#endif
){
SISPtr pSiS = SISPTR(pScrn);
*name = NULL; /* no special device */
#ifndef NEW_DGAOPENFRAMEBUFFER
*mem = (UChar *)pSiS->FbAddress;
#else
*mem = pSiS->FbAddress;
#endif
*size = pSiS->maxxfbmem;
*offset = 0;
#ifndef NEW_DGAOPENFRAMEBUFFER
*flags = DGA_NEED_ROOT;
#else
*flags = 0;
#endif
return TRUE;
}
This diff is collapsed.
......@@ -3,7 +3,7 @@
/*
* SiS DRI wrapper
*
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
* Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
*
* Licensed under the following terms:
*
......
This diff is collapsed.
This diff is collapsed.