summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2007-09-30 15:02:14 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2007-09-30 15:02:14 +0000
commit71967512e70a0bc05024d9a855a43b1f2f1369f0 (patch)
treed9bfa542905c36eef3d56c4b4e0b672c105cda51 /driver
parent1044abb27307faf658d73c67b4472bfcfa980200 (diff)
merge xf86-video-savage 2.1.3
Diffstat (limited to 'driver')
-rw-r--r--driver/xf86-video-savage/configure20
-rw-r--r--driver/xf86-video-savage/src/savage_driver.c102
2 files changed, 93 insertions, 29 deletions
diff --git a/driver/xf86-video-savage/configure b/driver/xf86-video-savage/configure
index 3c99b4e1b..615a41b1a 100644
--- a/driver/xf86-video-savage/configure
+++ b/driver/xf86-video-savage/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for xf86-video-savage 2.1.2.
+# Generated by GNU Autoconf 2.59 for xf86-video-savage 2.1.3.
#
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
#
@@ -423,8 +423,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='xf86-video-savage'
PACKAGE_TARNAME='xf86-video-savage'
-PACKAGE_VERSION='2.1.2'
-PACKAGE_STRING='xf86-video-savage 2.1.2'
+PACKAGE_VERSION='2.1.3'
+PACKAGE_STRING='xf86-video-savage 2.1.3'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
ac_unique_file="Makefile.am"
@@ -974,7 +974,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures xf86-video-savage 2.1.2 to adapt to many kinds of systems.
+\`configure' configures xf86-video-savage 2.1.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1040,7 +1040,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of xf86-video-savage 2.1.2:";;
+ short | recursive ) echo "Configuration of xf86-video-savage 2.1.3:";;
esac
cat <<\_ACEOF
@@ -1192,7 +1192,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-xf86-video-savage configure 2.1.2
+xf86-video-savage configure 2.1.3
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1206,7 +1206,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by xf86-video-savage $as_me 2.1.2, which was
+It was created by xf86-video-savage $as_me 2.1.3, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1854,7 +1854,7 @@ fi
# Define the identity of the package.
PACKAGE='xf86-video-savage'
- VERSION='2.1.2'
+ VERSION='2.1.3'
cat >>confdefs.h <<_ACEOF
@@ -20835,7 +20835,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
-This file was extended by xf86-video-savage $as_me 2.1.2, which was
+This file was extended by xf86-video-savage $as_me 2.1.3, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -20898,7 +20898,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-xf86-video-savage config.status 2.1.2
+xf86-video-savage config.status 2.1.3
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/driver/xf86-video-savage/src/savage_driver.c b/driver/xf86-video-savage/src/savage_driver.c
index 5e1cde5c4..32b2188b3 100644
--- a/driver/xf86-video-savage/src/savage_driver.c
+++ b/driver/xf86-video-savage/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 }
};
@@ -764,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);
}
@@ -934,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);
@@ -1165,15 +1224,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);
@@ -1942,6 +2009,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
if(psav->DisplayType == MT_LCD)
{
SavageGetPanelInfo(pScrn);
+ SavageAddPanelMode(pScrn);
}
#if 0
@@ -3088,6 +3156,9 @@ static Bool SavageScreenInit(int scrnIndex, ScreenPtr pScreen,
SavageEnableMMIO(pScrn);
+ if (!SavageMapMem(pScrn))
+ return FALSE;
+
psav->FBStart2nd = 0;
if (psav->overlayDepth) {
@@ -3109,8 +3180,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;
@@ -3825,6 +3900,8 @@ static Bool SavageCloseScreen(int scrnIndex, ScreenPtr pScreen)
#ifdef XF86DRI
if (psav->directRenderingEnabled) {
SAVAGEDRICloseScreen(pScreen);
+ /* reset shadow values */
+ SavageInitShadowStatus(pScrn);
psav->directRenderingEnabled=FALSE;
}
#endif
@@ -3900,7 +3977,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));
@@ -3931,15 +4007,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);
@@ -4158,9 +4225,6 @@ void SavageLoadPaletteSavage4(ScrnInfoPtr pScrn, int numColors, int *indicies,
}
static void SavageCalcClock(long freq, int min_m, int min_n1, int max_n1,
-
- /* Make sure linear addressing is enabled after the BIOS call. */
- /* Note that we must use an I/O port to do this. */
int min_n2, int max_n2, long freq_min,
long freq_max, unsigned int *mdiv,
unsigned int *ndiv, unsigned int *r)