summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2004-02-23 21:36:24 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2004-02-23 21:36:24 +0000
commitd6d8813f6b8c67ba6bcbf68690814663a4145547 (patch)
tree49e58d09a314b36885e66f4b368271e73e769cc4
parenta465c54ca726966c7eb5f4a33b72c10ff9cc0284 (diff)
merge most of XFree86 RC3 (4.3.99.903) from vendor branch. bug #214XORG-RELEASE-1-BASEXEVIE-MERGEXINERAMA_2
-rw-r--r--src/blade_accel.c10
-rw-r--r--src/image_accel.c17
-rw-r--r--src/trident_accel.c16
-rw-r--r--src/trident_dac.c6
-rw-r--r--src/trident_driver.c11
-rw-r--r--src/trident_regs.h9
-rw-r--r--src/trident_video.c10
-rw-r--r--src/xp_accel.c12
8 files changed, 79 insertions, 12 deletions
diff --git a/src/blade_accel.c b/src/blade_accel.c
index cf4ccf2..b52a718 100644
--- a/src/blade_accel.c
+++ b/src/blade_accel.c
@@ -23,7 +23,7 @@
*
* Trident Blade3D accelerated options.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/blade_accel.c,v 1.21 2003/10/30 13:38:01 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/blade_accel.c,v 1.22 2004/01/21 22:31:54 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -277,6 +277,8 @@ BladeSetupForScreenToScreenCopy(ScrnInfoPtr pScrn,
{
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
+ BladeSync(pScrn);
+
pTrident->BltScanDirection = 0;
if ((xdir < 0) || (ydir < 0)) pTrident->BltScanDirection |= 1<<1;
@@ -469,6 +471,8 @@ BladeSetupForFillRectSolid(ScrnInfoPtr pScrn, int color,
{
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
+ BladeSync(pScrn);
+
REPLICATE(color);
BLADE_OUT(0x2160, color);
BLADE_OUT(0x2148, XAACopyROP[rop]);
@@ -537,6 +541,8 @@ BladeSetupForCPUToScreenColorExpand(ScrnInfoPtr pScrn,
{
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
+ BladeSync(pScrn);
+
pTrident->BltScanDirection = 0;
BLADE_OUT(0x2148, XAACopyROP[rop]);
if (bg == -1) {
@@ -677,6 +683,8 @@ static void BladeSetupForImageWrite(
){
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
+ BladeSync(pScrn);
+
BLADE_OUT(0x2148, XAACopyROP[rop]);
pTrident->BltScanDirection = 0;
#if 0
diff --git a/src/image_accel.c b/src/image_accel.c
index 61017b5..e819411 100644
--- a/src/image_accel.c
+++ b/src/image_accel.c
@@ -23,7 +23,7 @@
*
* Trident 3DImage' accelerated options.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/image_accel.c,v 1.26 2003/10/30 13:38:01 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/image_accel.c,v 1.27 2004/01/21 22:57:34 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -292,6 +292,8 @@ ImageSetupForScreenToScreenCopy(ScrnInfoPtr pScrn,
{
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
+ ImageSync(pScrn);
+
pTrident->BltScanDirection = 0;
if ((xdir < 0) || (ydir < 0)) pTrident->BltScanDirection |= 1<<2;
@@ -352,6 +354,8 @@ ImageSetupForSolidLine(ScrnInfoPtr pScrn, int color,
{
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
+ ImageSync(pScrn);
+
REPLICATE(color);
IMAGE_OUT(0x2120, 0x84000000);
IMAGE_OUT(0x2120, 0x90000000 | XAACopyROP[rop]);
@@ -404,6 +408,8 @@ ImageSetupForFillRectSolid(ScrnInfoPtr pScrn, int color,
{
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
+ ImageSync(pScrn);
+
REPLICATE(color);
IMAGE_OUT(0x2120, 0x80000000);
IMAGE_OUT(0x2120, 0x90000000 | XAACopyROP[rop]);
@@ -468,6 +474,8 @@ ImageSetupForMono8x8PatternFill(ScrnInfoPtr pScrn,
{
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
+ ImageSync(pScrn);
+
IMAGE_OUT(0x2120, 0x90000000 | XAAPatternROP[rop]);
if (bg == -1) {
REPLICATE(fg);
@@ -512,6 +520,8 @@ ImageSetupForColor8x8PatternFill(ScrnInfoPtr pScrn,
{
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
+ ImageSync(pScrn);
+
IMAGE_OUT(0x2120, 0x90000000 | XAAPatternROP[rop]);
IMAGE_OUT(0x2120, 0x80000000 | 1<<26);
if (transparency_color != -1) {
@@ -547,6 +557,8 @@ ImageSetupForScanlineCPUToScreenColorExpandFill(
){
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
+ ImageSync(pScrn);
+
IMAGE_OUT(0x2120, 0x80000000);
IMAGE_OUT(0x2120, 0x90000000 | XAACopyROP[rop]);
if (bg == -1) {
@@ -599,6 +611,9 @@ ImageSetupForScanlineImageWrite(ScrnInfoPtr pScrn, int rop,
int bpp, int depth)
{
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
+
+ ImageSync(pScrn);
+
IMAGE_OUT(0x2120, 0x90000000 | XAACopyROP[rop]);
if (transparency_color != -1) {
IMAGE_OUT(0x2120, 0x70000000 | 1<<26 | (transparency_color&0xffffff));
diff --git a/src/trident_accel.c b/src/trident_accel.c
index 280bde2..149c019 100644
--- a/src/trident_accel.c
+++ b/src/trident_accel.c
@@ -23,7 +23,7 @@
*
* Trident accelerated options.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_accel.c,v 1.28 2003/10/30 13:38:01 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_accel.c,v 1.29 2004/01/21 22:57:34 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -276,6 +276,8 @@ TridentSetupForScreenToScreenCopy(ScrnInfoPtr pScrn,
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
int dst = 0;
+ TridentSync(pScrn);
+
pTrident->BltScanDirection = 0;
if (xdir < 0) pTrident->BltScanDirection |= XNEG;
if (ydir < 0) pTrident->BltScanDirection |= YNEG;
@@ -322,6 +324,8 @@ TridentSetupForSolidLine(ScrnInfoPtr pScrn, int color,
{
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
+ TridentSync(pScrn);
+
pTrident->BltScanDirection = 0;
REPLICATE(color);
TGUI_FMIX(XAAPatternROP[rop]);
@@ -383,6 +387,8 @@ TridentSetupForDashedLine(
CARD32 *DashPattern = (CARD32*)pattern;
CARD32 NiceDashPattern = DashPattern[0];
+ TridentSync(pScrn);
+
NiceDashPattern = *((CARD16 *)pattern) & ((1<<length) - 1);
switch(length) {
case 2: NiceDashPattern |= NiceDashPattern << 2;
@@ -444,6 +450,8 @@ TridentSetupForFillRectSolid(ScrnInfoPtr pScrn, int color,
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
int drawflag = 0;
+ TridentSync(pScrn);
+
REPLICATE(color);
TGUI_FMIX(XAAPatternROP[rop]);
if (pTrident->Chipset == PROVIDIA9685 ||
@@ -506,6 +514,8 @@ TridentSetupForMono8x8PatternFill(ScrnInfoPtr pScrn,
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
int drawflag = 0;
+ TridentSync(pScrn);
+
REPLICATE(fg);
if (pTrident->Chipset == PROVIDIA9685 ||
pTrident->Chipset == CYBER9388)
@@ -564,6 +574,8 @@ TridentSetupForColor8x8PatternFill(ScrnInfoPtr pScrn,
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
int drawflag = 0;
+ TridentSync(pScrn);
+
REPLICATE(transparency_color);
if (transparency_color != -1) {
if (pTrident->Chipset == PROVIDIA9685 ||
@@ -607,6 +619,8 @@ TridentSetupForScanlineCPUToScreenColorExpandFill(
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
int drawflag = SRCMONO;
+ TridentSync(pScrn);
+
REPLICATE(fg);
TGUI_FCOLOUR(fg);
if (bg == -1) {
diff --git a/src/trident_dac.c b/src/trident_dac.c
index 0df9f1b..c738842 100644
--- a/src/trident_dac.c
+++ b/src/trident_dac.c
@@ -21,7 +21,7 @@
*
* Author: Alan Hourihane, alanh@fairlite.demon.co.uk
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c,v 1.79 2003/11/03 05:11:42 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c,v 1.80 2004/01/21 22:31:54 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -734,6 +734,10 @@ TridentInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
if (pTrident->Chipset == CYBERBLADEXP4)
pReg->tridentRegs3CE[DisplayEngCont] = 0x08;
+
+ /* Avoid lockup on Blade3D, PCI Retry is permanently on */
+ if (pTrident->Chipset == BLADE3D)
+ pReg->tridentRegs3x4[PCIRetry] = 0x9F;
return(TRUE);
}
diff --git a/src/trident_driver.c b/src/trident_driver.c
index 6b23835..cf05b72 100644
--- a/src/trident_driver.c
+++ b/src/trident_driver.c
@@ -28,7 +28,7 @@
* Massimiliano Ghilardi, max@Linuz.sns.it, some fixes to the
* clockchip programming code.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c,v 1.189 2003/11/06 18:38:09 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c,v 1.191 2004/01/21 22:51:19 alanh Exp $ */
#include "xf1bpp.h"
#include "xf4bpp.h"
@@ -1923,6 +1923,7 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags)
chipset = "Blade3D";
pTrident->NewClockCode = TRUE;
pTrident->frequency = NTSC;
+ pTrident->UsePCIRetry = TRUE; /* To avoid lockups */
break;
case CYBERBLADEI7:
pTrident->ddc1Read = Tridentddc1Read;
@@ -2604,6 +2605,8 @@ TRIDENTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
TRIDENTRegPtr tridentReg;
+ WAITFORVSYNC;
+
TridentFindClock(pScrn,mode->Clock);
switch (pTrident->Chipset) {
@@ -3182,6 +3185,9 @@ TRIDENTLeaveVT(int scrnIndex, int flags)
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
vgaHWPtr hwp = VGAHWPTR(pScrn);
+ if (!pTrident->NoAccel)
+ pTrident->AccelInfoRec->Sync(pScrn);
+
TRIDENTRestore(pScrn);
vgaHWLock(hwp);
@@ -3205,6 +3211,9 @@ TRIDENTCloseScreen(int scrnIndex, ScreenPtr pScreen)
vgaHWPtr hwp = VGAHWPTR(pScrn);
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
+ if (!pTrident->NoAccel)
+ pTrident->AccelInfoRec->Sync(pScrn);
+
if (xf86IsPc98())
PC98TRIDENTDisable(pScrn);
diff --git a/src/trident_regs.h b/src/trident_regs.h
index 0ad747a..0f03180 100644
--- a/src/trident_regs.h
+++ b/src/trident_regs.h
@@ -21,7 +21,7 @@
*
* Author: Alan Hourihane, alanh@fairlite.demon.co.uk
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h,v 1.27 2003/09/05 22:07:29 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h,v 1.28 2004/01/21 22:51:19 alanh Exp $ */
#define DEBUG 1
@@ -200,6 +200,13 @@
#define GER_DSTCLIP_X 0x214C /* Word */
#define GER_DSTCLIP_Y 0x214E /* Word */
+/* Wait for VSync */
+#define WAITFORVSYNC \
+ { \
+ while (hwp->readST01(hwp)&0x8) {}; \
+ while (!(hwp->readST01(hwp)&0x8)) {}; \
+ }
+
/* Defines for IMAGE Graphics Engine */
#define IMAGE_GE_STATUS 0x2164
#define IMAGE_GE_DRAWENV 0x2120
diff --git a/src/trident_video.c b/src/trident_video.c
index 5c426d6..c5a65c6 100644
--- a/src/trident_video.c
+++ b/src/trident_video.c
@@ -21,7 +21,7 @@
*
* Author: Alan Hourihane, alanh@fairlite.demon.co.uk
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c,v 1.45 2003/11/10 18:22:34 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c,v 1.46 2004/01/21 22:51:19 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -884,6 +884,8 @@ TRIDENTPutImage(
pPriv->videoStatus = CLIENT_VIDEO_ON;
+ pTrident->VideoTimerCallback = TRIDENTVideoTimerCallback;
+
return Success;
}
@@ -1306,8 +1308,6 @@ WaitForVBlank(ScrnInfoPtr pScrn)
* full vblank has passed.
* - Alan.
*/
- while (!(hwp->readST01(hwp)&0x8)) {};
- while (hwp->readST01(hwp)&0x8) {};
- while (!(hwp->readST01(hwp)&0x8)) {};
- while (hwp->readST01(hwp)&0x8) {};
+ WAITFORVSYNC;
+ WAITFORVSYNC;
}
diff --git a/src/xp_accel.c b/src/xp_accel.c
index f543d87..44dc407 100644
--- a/src/xp_accel.c
+++ b/src/xp_accel.c
@@ -23,7 +23,7 @@
*
* BladeXP accelerated options.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/xp_accel.c,v 1.6 2003/10/30 13:38:02 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/xp_accel.c,v 1.7 2004/01/21 22:57:34 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -257,6 +257,8 @@ XPSetupForScreenToScreenCopy(ScrnInfoPtr pScrn,
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
int dst = 0;
+ XPSync(pScrn);
+
pTrident->BltScanDirection = 0;
if (xdir < 0) pTrident->BltScanDirection |= XNEG;
if (ydir < 0) pTrident->BltScanDirection |= YNEG;
@@ -299,6 +301,8 @@ XPSetupForSolidLine(ScrnInfoPtr pScrn, int color,
{
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
+ XPSync(pScrn);
+
pTrident->BltScanDirection = 0;
REPLICATE(color);
TGUI_FMIX(XAAPatternROP[rop]);
@@ -336,6 +340,8 @@ XPSubsequentSolidHorVertLine(
){
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
+ XPSync(pScrn);
+
TGUI_DRAWFLAG(SOLIDFILL);
if (dir == DEGREES_0) {
XP_DIM_XY(len,1);
@@ -420,6 +426,8 @@ XPSetupForFillRectSolid(ScrnInfoPtr pScrn, int color,
{
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
+ XPSync(pScrn);
+
REPLICATE(color);
TGUI_FMIX(XAAPatternROP[rop]);
MMIO_OUT32(pTrident->IOBase, 0x2158, color);
@@ -501,6 +509,8 @@ XPSetupForMono8x8PatternFill(ScrnInfoPtr pScrn,
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
int drawflag = 0;
+ XPSync(pScrn);
+
REPLICATE(fg);
MMIO_OUT32(pTrident->IOBase, 0x2158, fg);