xserver-xorg-video-savage: Changes to 'upstream-unstable'
man/savage.man | 17 +++++++--
src/savage_driver.c | 96 +++++++++++++++++++++++++++++++++++++++++++---------
2 files changed, 93 insertions(+), 20 deletions(-)
New commits:
commit b706ffe07fc61281d2dea406f828418f42e3da85
Author: Alex Deucher <alex@botch2.com>
Date: Thu Jul 12 00:03:13 2007 -0400
Unmap mem before freeing driverPrivate
diff --git a/src/savage_driver.c b/src/savage_driver.c
index 84b9fcd..c56edf1 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -766,9 +766,9 @@ static void SavageFreeRec(ScrnInfoPtr pScrn)
TRACE(( "SavageFreeRec(%x)\n", pScrn->driverPrivate ));
if (!pScrn->driverPrivate)
return;
+ SavageUnmapMem(pScrn, 1);
xfree(pScrn->driverPrivate);
pScrn->driverPrivate = NULL;
- SavageUnmapMem(pScrn, 1);
}
commit fab88bce3b9f19918bbf1a2b0f57d34113c8381f
Author: Alex Deucher <alex@botch2.com>
Date: Wed Jul 11 23:40:51 2007 -0400
Add panel native mode automatically.
Based on Henry Zhao's code from nv
diff --git a/src/savage_driver.c b/src/savage_driver.c
index 98ea08e..84b9fcd 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -936,6 +936,63 @@ static void SavageDoDDC(ScrnInfoPtr pScrn)
}
}
+/* Copied from ddc/Property.c via nv */
+static DisplayModePtr
+SavageModesAdd(DisplayModePtr Modes, DisplayModePtr Additions)
+{
+ if (!Modes) {
+ if (Additions)
+ return Additions;
+ else
+ return NULL;
+ }
+
+ if (Additions) {
+ DisplayModePtr Mode = Modes;
+
+ while (Mode->next)
+ Mode = Mode->next;
+
+ Mode->next = Additions;
+ Additions->prev = Mode;
+ }
+
+ return Modes;
+}
+
+/* borrowed from nv */
+static void
+SavageAddPanelMode(ScrnInfoPtr pScrn)
+{
+ SavagePtr psav= SAVPTR(pScrn);
+ DisplayModePtr Mode = NULL;
+
+ Mode = xf86CVTMode(psav->PanelX, psav->PanelY, 60.00, TRUE, FALSE);
+ Mode->type = M_T_DRIVER | M_T_PREFERRED;
+ pScrn->monitor->Modes = SavageModesAdd(pScrn->monitor->Modes, Mode);
+
+ if ((pScrn->monitor->nHsync == 0) &&
+ (pScrn->monitor->nVrefresh == 0)) {
+ if (!Mode->HSync)
+ Mode->HSync = ((float) Mode->Clock ) / ((float) Mode->HTotal);
+ if (!Mode->VRefresh)
+ Mode->VRefresh = (1000.0 * ((float) Mode->Clock)) /
+ ((float) (Mode->HTotal * Mode->VTotal));
+
+ if (Mode->HSync < pScrn->monitor->hsync[0].lo)
+ pScrn->monitor->hsync[0].lo = Mode->HSync;
+ if (Mode->HSync > pScrn->monitor->hsync[0].hi)
+ pScrn->monitor->hsync[0].hi = Mode->HSync;
+ if (Mode->VRefresh < pScrn->monitor->vrefresh[0].lo)
+ pScrn->monitor->vrefresh[0].lo = Mode->VRefresh;
+ if (Mode->VRefresh > pScrn->monitor->vrefresh[0].hi)
+ pScrn->monitor->vrefresh[0].hi = Mode->VRefresh;
+
+ pScrn->monitor->nHsync = 1;
+ pScrn->monitor->nVrefresh = 1;
+ }
+}
+
static void SavageGetPanelInfo(ScrnInfoPtr pScrn)
{
SavagePtr psav= SAVPTR(pScrn);
@@ -1952,6 +2009,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
if(psav->DisplayType == MT_LCD)
{
SavageGetPanelInfo(pScrn);
+ SavageAddPanelMode(pScrn);
}
#if 0
commit b126b204d3465700e8c6a1fcc4770f322c8bb7db
Author: Tormod Volden <bugzi06.fdo.tormod@xoxy.net>
Date: Wed Jul 11 21:25:30 2007 -0400
Add "DRI" option to enable/disable DRI support
fixes bug 10746
diff --git a/man/savage.man b/man/savage.man
index 9e8dd27..e5d3d27 100644
--- a/man/savage.man
+++ b/man/savage.man
@@ -221,6 +221,10 @@ on an AGP card the AGP bus speed is not set and no AGP aperture is
allocated. This implies
.BI DmaType
\*qPCI\*q.
+.TP
+.BI "Option \*qDRI\*q \*q" boolean \*q
+Enable DRI support. This option allows you to enable or disable the DRI.
+Default: \*qon\*q (enable DRI).
.SH FILES
savage_drv.o
.SH "SEE ALSO"
diff --git a/src/savage_driver.c b/src/savage_driver.c
index 1ed7782..98ea08e 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -245,6 +245,7 @@ typedef enum {
,OPTION_DMA_MODE
,OPTION_AGP_MODE
,OPTION_AGP_SIZE
+ ,OPTION_DRI
} SavageOpts;
@@ -277,6 +278,7 @@ static const OptionInfoRec SavageOptions[] =
{ OPTION_DMA_MODE, "DmaMode", OPTV_ANYSTR, {0}, FALSE },
{ OPTION_AGP_MODE, "AGPMode", OPTV_INTEGER, {0}, FALSE },
{ OPTION_AGP_SIZE, "AGPSize", OPTV_INTEGER, {0}, FALSE },
+ { OPTION_DRI, "DRI", OPTV_BOOLEAN, {0}, TRUE },
#endif
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
@@ -3120,8 +3122,12 @@ static Bool SavageScreenInit(int scrnIndex, ScreenPtr pScreen,
vgaHWBlankScreen(pScrn, TRUE);
#ifdef XF86DRI
- if (psav->IsSecondary) {
- psav->directRenderingEnabled = FALSE;
+ if (!xf86ReturnOptValBool(psav->Options, OPTION_DRI, TRUE)) {
+ psav->directRenderingEnabled = FALSE;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Direct rendering forced off\n");
+ } else if (psav->IsSecondary) {
+ psav->directRenderingEnabled = FALSE;
} else if (xf86IsEntityShared(psav->pEnt->index)) {
/* Xinerama has sync problem with DRI, disable it for now */
psav->directRenderingEnabled = FALSE;
commit 90692b3a123861ca02100f86b4c80f070fd4196d
Author: Alex Deucher <alex@botch2.com>
Date: Wed Jul 11 21:07:47 2007 -0400
fix segfault in SavageDoAdjustFrame() on server 1.3
tracked down by Tormod Volden, fixes bug 10934
diff --git a/src/savage_driver.c b/src/savage_driver.c
index 27cf8ad..1ed7782 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -3911,7 +3911,6 @@ void
SavageDoAdjustFrame(ScrnInfoPtr pScrn, int x, int y, int crtc2)
{
SavagePtr psav = SAVPTR(pScrn);
- DisplayModePtr currentMode = pScrn->currentMode;
int address=0,top=0,left=0,tile_height,tile_size;
TRACE(("SavageDoAdjustFrame(%d,%d,%x)\n", x, y, flags));
@@ -3942,15 +3941,6 @@ SavageDoAdjustFrame(ScrnInfoPtr pScrn, int x, int y, int crtc2)
address += pScrn->fbOffset;
- /*
- * because we align the viewport to the width and height of one tile
- * we should update the locate of frame
- */
- pScrn->frameX0 = left;
- pScrn->frameY0 = top;
- pScrn->frameX1 = left + currentMode->HDisplay - 1;
- pScrn->frameY1 = top + currentMode->VDisplay - 1;
-
if (psav->Chipset == S3_SAVAGE_MX) {
if (!crtc2) {
OUTREG32(PRI_STREAM_FBUF_ADDR0, address & 0xFFFFFFFC);
commit 7832dcd82046238d5accb55468c65241f0edc6d0
Author: Alex Deucher <alex@botch2.com>
Date: Wed Jul 11 21:01:03 2007 -0400
fix console corruption due to invalid shadow status
tracked down by Tormod Volden, fixes bug 11237
diff --git a/src/savage_driver.c b/src/savage_driver.c
index 6ffe772..27cf8ad 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -3834,6 +3834,8 @@ static Bool SavageCloseScreen(int scrnIndex, ScreenPtr pScreen)
#ifdef XF86DRI
if (psav->directRenderingEnabled) {
SAVAGEDRICloseScreen(pScreen);
+ /* reset shadow values */
+ SavageInitShadowStatus(pScrn);
psav->directRenderingEnabled=FALSE;
}
#endif
commit 8dd310538df11cc5ff4e8e84920218b819bbae47
Author: David Nusinow <dnusinow@debian.org>
Date: Wed Jul 11 20:00:25 2007 -0400
disable randr when savage rotation is enabled
fixes bug 7899
diff --git a/man/savage.man b/man/savage.man
index 721c6b8..9e8dd27 100644
--- a/man/savage.man
+++ b/man/savage.man
@@ -95,13 +95,18 @@ possibly unstable. The default is
.BI "Option \*qRotate\*q \*qCW\*q"
.TP
.BI "Option \*qRotate\*q \*qCCW\*q"
-Rotate the desktop 90 degrees clockwise or counterclockwise. This option
-forces the ShadowFB option on, and disables acceleration.
+Rotate the desktop 90 degrees clockwise or counterclockwise.
+This option forces the ShadowFB option on, and disables acceleration and
+the RandR extension.
Default: no rotation.
.TP
.BI "Option \*qShadowFB\*q \*q" boolean \*q
-Enable or disable use of the shadow framebuffer layer. This option
-disables acceleration. Default: off.
+Enable or disable use of the shadow framebuffer layer.
+.\" See
+.\" .BR shadowfb (__drivermansuffix__)
+.\" for further information.
+This option disables acceleration.
+Default: off.
.TP
.BI "Option \*qLCDClock\*q \*q" frequency \*q
Override the maximum dot clock. Some LCD panels produce incorrect results if
diff --git a/src/savage_driver.c b/src/savage_driver.c
index 2c51770..6ffe772 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -1165,15 +1165,23 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
if ((s = xf86GetOptValString(psav->Options, OPTION_ROTATE))) {
if(!xf86NameCmp(s, "CW")) {
/* accel is disabled below for shadowFB */
+ /* RandR is disabled when the Rotate option is used (does
+ * not work well together and scrambles the screen) */
+
psav->shadowFB = TRUE;
psav->rotate = 1;
+ xf86DisableRandR();
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
- "Rotating screen clockwise - acceleration disabled\n");
+ "Rotating screen clockwise"
+ "- acceleration and RandR disabled\n");
} else if(!xf86NameCmp(s, "CCW")) {
psav->shadowFB = TRUE;
psav->rotate = -1;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen"
- "counter clockwise - acceleration disabled\n");
+ xf86DisableRandR();
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ "Rotating screen counter clockwise"
+ " - acceleration and RandR disabled\n");
+
} else {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"%s\" is not a valid"
"value for Option \"Rotate\"\n", s);
Reply to: