Hello community,
here is the log from the commit of package xorg-x11-driver-video
checked in at Wed Jun 20 01:15:12 CEST 2007.
--------
--- xorg-x11-driver-video/xorg-x11-driver-video.changes 2007-06-09 13:25:40.000000000 +0200
+++ /mounts/work_src_done/STABLE/xorg-x11-driver-video/xorg-x11-driver-video.changes 2007-06-19 05:57:49.847670000 +0200
@@ -1,0 +2,10 @@
+Tue Jun 19 05:54:53 CEST 2007 - sndirsch@suse.de
+
+- updated nv driver to release 2.1.0
+ * Fix some random colormap corruption on DFPs with certain
+ pre-G80 GPUs.
+ * Fix build. Including xf86DDC.h before we include xf86.h doesn't
+ fly (Benjamin Herrenschmidt)
+- obsoletes xf86-video-nv-g80.diff
+
+-------------------------------------------------------------------
Old:
----
xf86-video-nv-2.0.96.tar.bz2
xf86-video-nv-g80.diff
New:
----
xf86-video-nv-2.1.0.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xorg-x11-driver-video.spec ++++++
--- /var/tmp/diff_new_pack.I24543/_old 2007-06-20 01:14:57.000000000 +0200
+++ /var/tmp/diff_new_pack.I24543/_new 2007-06-20 01:14:57.000000000 +0200
@@ -15,7 +15,7 @@
BuildRequires: Mesa-devel libdrm-devel pkgconfig xorg-x11-proto-devel xorg-x11-server-sdk
URL: http://xorg.freedesktop.org/
Version: 7.2
-Release: 121
+Release: 124
License: X11/MIT
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Group: System/X11/Servers/XF86_4
@@ -40,7 +40,7 @@
Source15: xf86-video-neomagic-X11R7.1-1.1.1.tar.bz2
Source16: xf86-video-newport-0.2.1.tar.bz2
Source17: xf86-video-nsc-2.8.2.tar.bz2
-Source18: xf86-video-nv-2.0.96.tar.bz2
+Source18: xf86-video-nv-2.1.0.tar.bz2
Source19: xf86-video-rendition-4.1.3.tar.bz2
Source20: xf86-video-s3-0.5.0.tar.bz2
Source21: xf86-video-s3virge-X11R7.1-1.9.1.tar.bz2
@@ -74,7 +74,6 @@
Patch1: radeon-xrandr-dotclock.diff
Patch2: radeon_dell.diff
Patch3: ps_nv.diff
-Patch4: xf86-video-nv-g80.diff
Patch5: mga-g200se_pci-fix.diff
Patch9: xf86-video-sunffb.diff
Patch10: xf86-video-tdfx.diff
@@ -121,7 +120,6 @@
popd
pushd xf86-video-nv-*/src
%patch3 -p6
-%patch4 -p2
popd
pushd xf86-video-mga-*/src
tar xzf %{SOURCE44}
@@ -266,6 +264,13 @@
%{_mandir}/man4/*
%changelog
+* Tue Jun 19 2007 - sndirsch@suse.de
+- updated nv driver to release 2.1.0
+ * Fix some random colormap corruption on DFPs with certain
+ pre-G80 GPUs.
+ * Fix build. Including xf86DDC.h before we include xf86.h doesn't
+ fly (Benjamin Herrenschmidt)
+- obsoletes xf86-video-nv-g80.diff
* Sat Jun 09 2007 - sndirsch@suse.de
- xf86-video-nv-g80.diff:
G80: Mode validation. Disable LVDS modes larger than the native
++++++ xf86-video-nv-2.0.96.tar.bz2 -> xf86-video-nv-2.1.0.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-nv-2.0.96/ChangeLog new/xf86-video-nv-2.1.0/ChangeLog
--- old/xf86-video-nv-2.0.96/ChangeLog 2007-05-16 23:46:54.000000000 +0200
+++ new/xf86-video-nv-2.1.0/ChangeLog 2007-06-18 22:10:27.000000000 +0200
@@ -1,3 +1,55 @@
+commit 209c84e788faf3c4d0ce053e5f29ff5f5b798628
+Author: Aaron Plattner
+Date: Mon Jun 18 13:08:31 2007 -0700
+
+ Bump to 2.1.0.
+
+commit 24770ccf880f056bc0db9464249caca10692fb56
+Author: Aaron Plattner
+Date: Mon Jun 18 12:36:29 2007 -0700
+
+ Fix some random colormap corruption on DFPs with certain pre-G80 GPUs.
+
+commit 4e56465a79587c4df6bf1dfd7cc87a4f22707a8f
+Author: Aaron Plattner
+Date: Thu Jun 7 18:28:56 2007 -0700
+
+ G80: Mode validation.
+
+ Disable LVDS modes larger than the native resolution.
+ Disable dual-link TMDS modes for now since they don't work reliably.
+
+commit 6b71721439802bffd715602af3036083ff442449
+Author: Aaron Plattner
+Date: Mon Jun 4 23:15:42 2007 -0700
+
+ G80: LVDS support.
+
+commit 70b304cd0df0af515ce8414559f28a7ca7825517
+Author: Aaron Plattner
+Date: Mon Jun 4 22:38:14 2007 -0700
+
+ G80: Rearrange HW video timing computations.
+
+ Compute the HW parameters in G80CrtcModeFixup and stash them in adjusted_mode.
+ Move some register writes into G80CreateSor.
+
+commit 402b1d1526f0dacd2e3a2564cc89958c32d3100e
+Merge: 1f4790a... 9b8470e...
+Author: Benjamin Herrenschmidt
+Date: Sun Jun 3 11:18:50 2007 +1000
+
+ Merge branch 'master' of git://anongit.freedesktop.org/git/xorg/driver/xf86-video-nv
+
+commit 1f4790adcafd402c84a4a761c870a26a5178a4ff
+Author: Benjamin Herrenschmidt
+Date: Sun Jun 3 11:16:55 2007 +1000
+
+ Fix build. Including xf86DDC.h before we include xf86.h doesn't fly
+ and it's not necessary anyway as it's pulled in by g80_type.h
+
+ Signed-off-by: Benjamin Herrenschmidt
+
commit 9b8470e9c81e6ce2c8cd69942fb2ffd2d4c06102
Author: Aaron Plattner
Date: Wed May 16 14:45:36 2007 -0700
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-nv-2.0.96/compat/modes/xf86Crtc.c new/xf86-video-nv-2.1.0/compat/modes/xf86Crtc.c
--- old/xf86-video-nv-2.0.96/compat/modes/xf86Crtc.c 2007-05-16 23:37:59.000000000 +0200
+++ new/xf86-video-nv-2.1.0/compat/modes/xf86Crtc.c 2007-06-11 22:39:38.000000000 +0200
@@ -1217,8 +1217,15 @@
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
int o;
- if (maxX == 0 || maxY == 0)
- xf86RandR12GetOriginalVirtualSize (scrn, &maxX, &maxY);
+ /* When canGrow was TRUE in the initial configuration we have to
+ * compare against the maximum values so that we don't drop modes.
+ * When canGrow was FALSE, the maximum values would have been clamped
+ * anyway.
+ */
+ if (maxX == 0 || maxY == 0) {
+ maxX = config->maxWidth;
+ maxY = config->maxHeight;
+ }
/* Elide duplicate modes before defaulting code uses them */
xf86PruneDuplicateMonitorModes (scrn->monitor);
@@ -1723,8 +1730,26 @@
xf86SetDesiredModes (ScrnInfoPtr scrn)
{
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- int c;
+ int c, o;
+
+ /*
+ * Turn off everything so mode setting is done
+ * with hardware in a consistent state
+ */
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+ (*output->funcs->dpms)(output, DPMSModeOff);
+ }
+
+ for (c = 0; c < config->num_crtc; c++)
+ {
+ xf86CrtcPtr crtc = config->crtc[c];
+ crtc->funcs->dpms(crtc, DPMSModeOff);
+ memset(&crtc->mode, 0, sizeof(crtc->mode));
+ }
+
for (c = 0; c < config->num_crtc; c++)
{
xf86CrtcPtr crtc = config->crtc[c];
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-nv-2.0.96/compat/modes/xf86Crtc.h new/xf86-video-nv-2.1.0/compat/modes/xf86Crtc.h
--- old/xf86-video-nv-2.0.96/compat/modes/xf86Crtc.h 2007-05-16 23:37:59.000000000 +0200
+++ new/xf86-video-nv-2.1.0/compat/modes/xf86Crtc.h 2007-06-11 22:39:38.000000000 +0200
@@ -562,6 +562,10 @@
OptionInfoPtr options;
Bool debug_modes;
+
+ /* wrap screen BlockHandler for rotation */
+ ScreenBlockHandlerProcPtr BlockHandler;
+
} xf86CrtcConfigRec, *xf86CrtcConfigPtr;
extern int xf86CrtcConfigPrivateIndex;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-nv-2.0.96/compat/modes/xf86EdidModes.c new/xf86-video-nv-2.1.0/compat/modes/xf86EdidModes.c
--- old/xf86-video-nv-2.0.96/compat/modes/xf86EdidModes.c 2007-05-16 23:37:59.000000000 +0200
+++ new/xf86-video-nv-2.1.0/compat/modes/xf86EdidModes.c 2007-06-12 21:37:52.000000000 +0200
@@ -71,7 +71,11 @@
if (memcmp (DDC->vendor.name, "VSC", 4) == 0 &&
DDC->vendor.prod_id == 58653)
return TRUE;
-
+ /* Samsung SyncMaster 205BW */
+ if (memcmp (DDC->vendor.name, "SAM", 4) == 0 &&
+ DDC->vendor.prod_id == 541)
+ return TRUE;
+
return FALSE;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-nv-2.0.96/compat/modes/xf86Rotate.c new/xf86-video-nv-2.1.0/compat/modes/xf86Rotate.c
--- old/xf86-video-nv-2.0.96/compat/modes/xf86Rotate.c 2007-05-16 23:37:59.000000000 +0200
+++ new/xf86-video-nv-2.1.0/compat/modes/xf86Rotate.c 2007-06-11 22:39:38.000000000 +0200
@@ -264,7 +264,7 @@
}
}
-static void
+static Bool
xf86RotateRedisplay(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
@@ -273,7 +273,7 @@
RegionPtr region;
if (!damage)
- return;
+ return FALSE;
xf86RotatePrepare (pScreen);
region = DamageRegion(damage);
if (REGION_NOTEMPTY(pScreen, region))
@@ -317,19 +317,25 @@
pScreen->SourceValidate = SourceValidate;
DamageEmpty(damage);
}
+ return TRUE;
}
static void
-xf86RotateBlockHandler(pointer data, OSTimePtr pTimeout, pointer pRead)
+xf86RotateBlockHandler(int screenNum, pointer blockData,
+ pointer pTimeout, pointer pReadmask)
{
- ScreenPtr pScreen = (ScreenPtr) data;
-
- xf86RotateRedisplay(pScreen);
-}
+ ScreenPtr pScreen = screenInfo.screens[screenNum];
+ ScrnInfoPtr pScrn = xf86Screens[screenNum];
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
-static void
-xf86RotateWakeupHandler(pointer data, int i, pointer LastSelectMask)
-{
+ pScreen->BlockHandler = xf86_config->BlockHandler;
+ (*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask);
+ if (xf86RotateRedisplay(pScreen))
+ {
+ /* Re-wrap if rotation is still happening */
+ xf86_config->BlockHandler = pScreen->BlockHandler;
+ pScreen->BlockHandler = xf86RotateBlockHandler;
+ }
}
static void
@@ -367,10 +373,6 @@
}
DamageDestroy (xf86_config->rotation_damage);
xf86_config->rotation_damage = NULL;
- /* Free block/wakeup handler */
- RemoveBlockAndWakeupHandlers (xf86RotateBlockHandler,
- xf86RotateWakeupHandler,
- (pointer) pScreen);
}
}
@@ -440,20 +442,12 @@
if (!xf86_config->rotation_damage)
goto bail2;
- /* Assign block/wakeup handler */
- if (!RegisterBlockAndWakeupHandlers (xf86RotateBlockHandler,
- xf86RotateWakeupHandler,
- (pointer) pScreen))
- {
- goto bail3;
- }
+ /* Wrap block handler */
+ xf86_config->BlockHandler = pScreen->BlockHandler;
+ pScreen->BlockHandler = xf86RotateBlockHandler;
}
if (0)
{
-bail3:
- DamageDestroy (xf86_config->rotation_damage);
- xf86_config->rotation_damage = NULL;
-
bail2:
if (shadow || shadowData)
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-nv-2.0.96/configure new/xf86-video-nv-2.1.0/configure
--- old/xf86-video-nv-2.0.96/configure 2007-05-16 23:43:12.000000000 +0200
+++ new/xf86-video-nv-2.1.0/configure 2007-06-18 21:37:48.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for xf86-video-nv 2.0.96.
+# Generated by GNU Autoconf 2.61 for xf86-video-nv 2.1.0.
#
# Report bugs to https://bugs.freedesktop.org/enter_bug.cgi?product=xorg.
#
@@ -728,8 +728,8 @@
# Identity of this package.
PACKAGE_NAME='xf86-video-nv'
PACKAGE_TARNAME='xf86-video-nv'
-PACKAGE_VERSION='2.0.96'
-PACKAGE_STRING='xf86-video-nv 2.0.96'
+PACKAGE_VERSION='2.1.0'
+PACKAGE_STRING='xf86-video-nv 2.1.0'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
ac_unique_file="Makefile.am"
@@ -1418,7 +1418,7 @@
# 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-nv 2.0.96 to adapt to many kinds of systems.
+\`configure' configures xf86-video-nv 2.1.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1488,7 +1488,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of xf86-video-nv 2.0.96:";;
+ short | recursive ) echo "Configuration of xf86-video-nv 2.1.0:";;
esac
cat <<\_ACEOF
@@ -1602,7 +1602,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-xf86-video-nv configure 2.0.96
+xf86-video-nv configure 2.1.0
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1616,7 +1616,7 @@
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-nv $as_me 2.0.96, which was
+It was created by xf86-video-nv $as_me 2.1.0, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@@ -2311,7 +2311,7 @@
# Define the identity of the package.
PACKAGE='xf86-video-nv'
- VERSION='2.0.96'
+ VERSION='2.1.0'
cat >>confdefs.h <<_ACEOF
@@ -21554,7 +21554,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by xf86-video-nv $as_me 2.0.96, which was
+This file was extended by xf86-video-nv $as_me 2.1.0, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -21607,7 +21607,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-xf86-video-nv config.status 2.0.96
+xf86-video-nv config.status 2.1.0
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-nv-2.0.96/configure.ac new/xf86-video-nv-2.1.0/configure.ac
--- old/xf86-video-nv-2.0.96/configure.ac 2007-05-16 23:37:36.000000000 +0200
+++ new/xf86-video-nv-2.1.0/configure.ac 2007-06-18 21:37:37.000000000 +0200
@@ -22,7 +22,7 @@
AC_PREREQ(2.57)
AC_INIT([xf86-video-nv],
- 2.0.96,
+ 2.1.0,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-video-nv)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-nv-2.0.96/src/g80_display.c new/xf86-video-nv-2.1.0/src/g80_display.c
--- old/xf86-video-nv-2.0.96/src/g80_display.c 2007-05-16 23:37:10.000000000 +0200
+++ new/xf86-video-nv-2.1.0/src/g80_display.c 2007-06-06 02:01:46.000000000 +0200
@@ -40,6 +40,7 @@
Head head;
int pclk; /* Target pixel clock in kHz */
Bool cursorVisible;
+ Bool skipModeFixup;
} G80CrtcPrivRec, *G80CrtcPrivPtr;
static void G80CrtcShowHideCursor(xf86CrtcPtr crtc, Bool show, Bool update);
@@ -234,14 +235,6 @@
pNv->reg[0x006101D8/4] = pNv->reg[0x0061B000/4];
pNv->reg[0x006101E0/4] = pNv->reg[0x0061C000/4];
pNv->reg[0x006101E4/4] = pNv->reg[0x0061C800/4];
- pNv->reg[0x0061c00c/4] = 0x03010700;
- pNv->reg[0x0061c010/4] = 0x0000152f;
- pNv->reg[0x0061c014/4] = 0x00000000;
- pNv->reg[0x0061c018/4] = 0x00245af8;
- pNv->reg[0x0061c80c/4] = 0x03010700;
- pNv->reg[0x0061c810/4] = 0x0000152f;
- pNv->reg[0x0061c814/4] = 0x00000000;
- pNv->reg[0x0061c818/4] = 0x00245af8;
pNv->reg[0x0061A004/4] = 0x80550000;
pNv->reg[0x0061A010/4] = 0x00000001;
pNv->reg[0x0061A804/4] = 0x80550000;
@@ -308,13 +301,35 @@
pNv->reg[0x00610200/4] = 0;
pNv->reg[0x00610300/4] = 0;
while((pNv->reg[0x00610200/4] & 0x1e0000) != 0);
+ while((pNv->reg[0x61C030/4] & 0x10000000));
+ while((pNv->reg[0x61C830/4] & 0x10000000));
}
static Bool
G80CrtcModeFixup(xf86CrtcPtr crtc,
DisplayModePtr mode, DisplayModePtr adjusted_mode)
{
- // TODO: Fix up the mode here
+ G80CrtcPrivPtr pPriv = crtc->driver_private;
+ int interlaceDiv, fudge;
+
+ if(pPriv->skipModeFixup)
+ return TRUE;
+
+ /* Magic mode timing fudge factor */
+ fudge = ((adjusted_mode->Flags & V_INTERLACE) && (adjusted_mode->Flags & V_DBLSCAN)) ? 2 : 1;
+ interlaceDiv = (adjusted_mode->Flags & V_INTERLACE) ? 2 : 1;
+
+ /* Stash the mode timings in the Crtc fields in adjusted_mode */
+ adjusted_mode->CrtcHBlankStart = mode->CrtcVTotal << 16 | mode->CrtcHTotal;
+ adjusted_mode->CrtcHSyncEnd = ((mode->CrtcVSyncEnd - mode->CrtcVSyncStart) / interlaceDiv - 1) << 16 |
+ (mode->CrtcHSyncEnd - mode->CrtcHSyncStart - 1);
+ adjusted_mode->CrtcHBlankEnd = ((mode->CrtcVBlankEnd - mode->CrtcVSyncStart) / interlaceDiv - fudge) << 16 |
+ (mode->CrtcHBlankEnd - mode->CrtcHSyncStart - 1);
+ adjusted_mode->CrtcHTotal = ((mode->CrtcVTotal - mode->CrtcVSyncStart + mode->CrtcVBlankStart) / interlaceDiv - fudge) << 16 |
+ (mode->CrtcHTotal - mode->CrtcHSyncStart + mode->CrtcHBlankStart - 1);
+ adjusted_mode->CrtcHSkew = ((mode->CrtcVTotal + mode->CrtcVBlankEnd - mode->CrtcVSyncStart) / 2 - 2) << 16 |
+ ((2*mode->CrtcVTotal - mode->CrtcVSyncStart + mode->CrtcVBlankStart) / 2 - 2);
+
return TRUE;
}
@@ -324,36 +339,21 @@
{
ScrnInfoPtr pScrn = crtc->scrn;
G80CrtcPrivPtr pPriv = crtc->driver_private;
- const int HDisplay = mode->HDisplay, VDisplay = mode->VDisplay;
+ const int HDisplay = adjusted_mode->HDisplay, VDisplay = adjusted_mode->VDisplay;
const int headOff = 0x400 * G80CrtcGetHead(crtc);
- int interlaceDiv, fudge;
-
- // TODO: Use adjusted_mode and fix it up in G80CrtcModeFixup
- pPriv->pclk = mode->Clock;
- /* Magic mode timing fudge factor */
- fudge = ((mode->Flags & V_INTERLACE) && (mode->Flags & V_DBLSCAN)) ? 2 : 1;
- interlaceDiv = (mode->Flags & V_INTERLACE) ? 2 : 1;
+ pPriv->pclk = adjusted_mode->Clock;
- C(0x00000804 + headOff, mode->Clock | 0x800000);
- C(0x00000808 + headOff, (mode->Flags & V_INTERLACE) ? 2 : 0);
+ C(0x00000804 + headOff, adjusted_mode->Clock | 0x800000);
+ C(0x00000808 + headOff, (adjusted_mode->Flags & V_INTERLACE) ? 2 : 0);
C(0x00000810 + headOff, 0);
C(0x0000082C + headOff, 0);
- C(0x00000814 + headOff, mode->CrtcVTotal << 16 | mode->CrtcHTotal);
- C(0x00000818 + headOff,
- ((mode->CrtcVSyncEnd - mode->CrtcVSyncStart) / interlaceDiv - 1) << 16 |
- (mode->CrtcHSyncEnd - mode->CrtcHSyncStart - 1));
- C(0x0000081C + headOff,
- ((mode->CrtcVBlankEnd - mode->CrtcVSyncStart) / interlaceDiv - fudge) << 16 |
- (mode->CrtcHBlankEnd - mode->CrtcHSyncStart - 1));
- C(0x00000820 + headOff,
- ((mode->CrtcVTotal - mode->CrtcVSyncStart + mode->CrtcVBlankStart) / interlaceDiv - fudge) << 16 |
- (mode->CrtcHTotal - mode->CrtcHSyncStart + mode->CrtcHBlankStart - 1));
- if(mode->Flags & V_INTERLACE) {
- C(0x00000824 + headOff,
- ((mode->CrtcVTotal + mode->CrtcVBlankEnd - mode->CrtcVSyncStart) / 2 - 2) << 16 |
- ((2*mode->CrtcVTotal - mode->CrtcVSyncStart + mode->CrtcVBlankStart) / 2 - 2));
- }
+ C(0x00000814 + headOff, adjusted_mode->CrtcHBlankStart);
+ C(0x00000818 + headOff, adjusted_mode->CrtcHSyncEnd);
+ C(0x0000081C + headOff, adjusted_mode->CrtcHBlankEnd);
+ C(0x00000820 + headOff, adjusted_mode->CrtcHTotal);
+ if(adjusted_mode->Flags & V_INTERLACE)
+ C(0x00000824 + headOff, adjusted_mode->CrtcHSkew);
C(0x00000868 + headOff, pScrn->virtualY << 16 | pScrn->virtualX);
C(0x0000086C + headOff, pScrn->displayWidth * (pScrn->bitsPerPixel / 8) | 0x100000);
switch(pScrn->depth) {
@@ -362,9 +362,8 @@
case 16: C(0x00000870 + headOff, 0xE800); break;
case 24: C(0x00000870 + headOff, 0xCF00); break;
}
- C(0x000008A0 + headOff, 0);
- if((mode->Flags & V_DBLSCAN) || (mode->Flags & V_INTERLACE) ||
- mode->CrtcHDisplay != HDisplay || mode->CrtcVDisplay != VDisplay) {
+ if((adjusted_mode->Flags & V_DBLSCAN) || (adjusted_mode->Flags & V_INTERLACE) ||
+ adjusted_mode->CrtcHDisplay != HDisplay || adjusted_mode->CrtcVDisplay != VDisplay) {
C(0x000008A4 + headOff, 9);
} else {
C(0x000008A4 + headOff, 0);
@@ -373,8 +372,8 @@
C(0x000008C0 + headOff, y << 16 | x);
C(0x000008C8 + headOff, VDisplay << 16 | HDisplay);
C(0x000008D4 + headOff, 0);
- C(0x000008D8 + headOff, mode->CrtcVDisplay << 16 | mode->CrtcHDisplay);
- C(0x000008DC + headOff, mode->CrtcVDisplay << 16 | mode->CrtcHDisplay);
+ C(0x000008D8 + headOff, adjusted_mode->CrtcVDisplay << 16 | adjusted_mode->CrtcHDisplay);
+ C(0x000008DC + headOff, adjusted_mode->CrtcVDisplay << 16 | adjusted_mode->CrtcHDisplay);
G80CrtcBlankScreen(crtc, FALSE);
}
@@ -458,6 +457,7 @@
G80CrtcPrepare(xf86CrtcPtr crtc)
{
ScrnInfoPtr pScrn = crtc->scrn;
+ G80CrtcPrivPtr pPriv = crtc->driver_private;
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
int i;
@@ -467,6 +467,15 @@
if(!output->crtc)
output->funcs->mode_set(output, NULL, NULL);
}
+
+ pPriv->skipModeFixup = FALSE;
+}
+
+void
+G80CrtcSkipModeFixup(xf86CrtcPtr crtc)
+{
+ G80CrtcPrivPtr pPriv = crtc->driver_private;
+ pPriv->skipModeFixup = TRUE;
}
static void
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-nv-2.0.96/src/g80_display.h new/xf86-video-nv-2.1.0/src/g80_display.h
--- old/xf86-video-nv-2.0.96/src/g80_display.h 2007-05-16 23:37:10.000000000 +0200
+++ new/xf86-video-nv-2.1.0/src/g80_display.h 2007-06-06 02:01:46.000000000 +0200
@@ -11,5 +11,6 @@
void G80CrtcEnableCursor(xf86CrtcPtr, Bool update);
void G80CrtcDisableCursor(xf86CrtcPtr, Bool update);
void G80CrtcSetCursorPosition(xf86CrtcPtr, int x, int y);
+void G80CrtcSkipModeFixup(xf86CrtcPtr);
void G80DispCreateCrtcs(ScrnInfoPtr pScrn);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-nv-2.0.96/src/g80_output.c new/xf86-video-nv-2.1.0/src/g80_output.c
--- old/xf86-video-nv-2.0.96/src/g80_output.c 2007-05-16 23:37:10.000000000 +0200
+++ new/xf86-video-nv-2.1.0/src/g80_output.c 2007-06-08 03:24:42.000000000 +0200
@@ -27,7 +27,6 @@
#endif
#include
-#include
#include "g80_type.h"
#include "g80_output.h"
@@ -86,6 +85,7 @@
"for port %i\n",
or, pNv->i2cMap[port].sor, port);
pNv->i2cMap[port].sor = or;
+ pNv->i2cMap[port].panelType = (type == 2) ? TMDS : LVDS;
break;
}
}
@@ -164,8 +164,10 @@
int
G80OutputModeValid(xf86OutputPtr output, DisplayModePtr mode)
{
- if(mode->Clock > 400000 || mode->Clock < 25000)
- return MODE_CLOCK_RANGE;
+ if(mode->Clock > 400000)
+ return MODE_CLOCK_HIGH;
+ if(mode->Clock < 25000)
+ return MODE_CLOCK_LOW;
return MODE_OK;
}
@@ -318,7 +320,8 @@
if(pNv->i2cMap[i].dac != -1)
dac = G80CreateDac(pScrn, pNv->i2cMap[i].dac);
if(pNv->i2cMap[i].sor != -1)
- sor = G80CreateSor(pScrn, pNv->i2cMap[i].sor);
+ sor = G80CreateSor(pScrn, pNv->i2cMap[i].sor,
+ pNv->i2cMap[i].panelType);
if(dac) {
G80OutputPrivPtr pPriv = dac->driver_private;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-nv-2.0.96/src/g80_output.h new/xf86-video-nv-2.1.0/src/g80_output.h
--- old/xf86-video-nv-2.0.96/src/g80_output.h 2007-05-16 23:37:10.000000000 +0200
+++ new/xf86-video-nv-2.1.0/src/g80_output.h 2007-06-06 02:01:46.000000000 +0200
@@ -1,6 +1,8 @@
typedef struct G80OutputPrivRec {
ORType type;
ORNum or;
+ PanelType panelType;
+ DisplayModePtr nativeMode;
xf86OutputPtr partner;
I2CBusPtr i2c;
@@ -26,4 +28,4 @@
Bool G80DacLoadDetect(xf86OutputPtr);
/* g80_sor.c */
-xf86OutputPtr G80CreateSor(ScrnInfoPtr, ORNum);
+xf86OutputPtr G80CreateSor(ScrnInfoPtr, ORNum, PanelType);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-nv-2.0.96/src/g80_sor.c new/xf86-video-nv-2.1.0/src/g80_sor.c
--- old/xf86-video-nv-2.0.96/src/g80_sor.c 2007-05-16 23:37:10.000000000 +0200
+++ new/xf86-video-nv-2.1.0/src/g80_sor.c 2007-06-08 03:24:20.000000000 +0200
@@ -38,8 +38,9 @@
G80Ptr pNv = G80PTR(output->scrn);
G80OutputPrivPtr pPriv = output->driver_private;
const int orOff = 0x800 * pPriv->or;
+ const int limit = pPriv->panelType == LVDS ? 112000 : 165000;
- pNv->reg[(0x00614300+orOff)/4] = (pclk > 165000) ? 0x101 : 0;
+ pNv->reg[(0x00614300+orOff)/4] = (pclk > limit) ? 0x101 : 0;
}
static void
@@ -61,6 +62,31 @@
tmp &= ~1;
pNv->reg[(0x0061C004+off)/4] = tmp;
+ while((pNv->reg[(0x61C030+off)/4] & 0x10000000));
+}
+
+static int
+G80TMDSModeValid(xf86OutputPtr output, DisplayModePtr mode)
+{
+ // Disable dual-link modes until I can find a way to make them work
+ // reliably.
+ if (mode->Clock > 165000)
+ return MODE_CLOCK_HIGH;
+
+ return G80OutputModeValid(output, mode);
+}
+
+static int
+G80LVDSModeValid(xf86OutputPtr output, DisplayModePtr mode)
+{
+ G80OutputPrivPtr pPriv = output->driver_private;
+ DisplayModePtr native = pPriv->nativeMode;
+
+ // Ignore modes larger than the native res.
+ if (mode->HDisplay > native->HDisplay || mode->VDisplay > native->VDisplay)
+ return MODE_PANEL;
+
+ return G80OutputModeValid(output, mode);
}
static void
@@ -70,6 +96,7 @@
ScrnInfoPtr pScrn = output->scrn;
G80OutputPrivPtr pPriv = output->driver_private;
const int sorOff = 0x40 * pPriv->or;
+ CARD32 type;
if(!adjusted_mode) {
/* Disconnect the SOR */
@@ -77,6 +104,13 @@
return;
}
+ if(pPriv->panelType == LVDS)
+ type = 0;
+ else if(adjusted_mode->Clock > 165000)
+ type = 0x500;
+ else
+ type = 0x100;
+
// This wouldn't be necessary, but the server is stupid and calls
// G80SorDPMSSet after the output is disconnected, even though the hardware
// turns it off automatically.
@@ -84,7 +118,7 @@
C(0x00000600 + sorOff,
(G80CrtcGetHead(output->crtc) == HEAD0 ? 1 : 2) |
- (adjusted_mode->Clock > 165000 ? 0x500 : 0x100) |
+ type |
((adjusted_mode->Flags & V_NHSYNC) ? 0x1000 : 0) |
((adjusted_mode->Flags & V_NVSYNC) ? 0x2000 : 0));
}
@@ -92,7 +126,6 @@
static xf86OutputStatus
G80SorDetect(xf86OutputPtr output)
{
-
G80OutputPrivPtr pPriv = output->driver_private;
/* Assume physical status isn't going to change before the BlockHandler */
@@ -103,20 +136,75 @@
return pPriv->cached_status;
}
+static xf86OutputStatus
+G80SorLVDSDetect(xf86OutputPtr output)
+{
+ /* Assume LVDS is always connected */
+ return XF86OutputStatusConnected;
+}
+
static void
G80SorDestroy(xf86OutputPtr output)
{
+ G80OutputPrivPtr pPriv = output->driver_private;
+
G80OutputDestroy(output);
+ if(pPriv->nativeMode) {
+ if(pPriv->nativeMode->name)
+ xfree(pPriv->nativeMode->name);
+ xfree(pPriv->nativeMode);
+ }
+
xfree(output->driver_private);
output->driver_private = NULL;
}
-static const xf86OutputFuncsRec G80SorOutputFuncs = {
+/******************** LVDS ********************/
+static Bool
+G80SorModeFixupScale(xf86OutputPtr output, DisplayModePtr mode,
+ DisplayModePtr adjusted_mode)
+{
+ G80OutputPrivPtr pPriv = output->driver_private;
+ DisplayModePtr native = pPriv->nativeMode;
+
+ // Stash the saved mode timings in adjusted_mode
+ adjusted_mode->Clock = native->Clock;
+ adjusted_mode->Flags = native->Flags;
+ adjusted_mode->CrtcHDisplay = native->CrtcHDisplay;
+ adjusted_mode->CrtcHBlankStart = native->CrtcHBlankStart;
+ adjusted_mode->CrtcHSyncStart = native->CrtcHSyncStart;
+ adjusted_mode->CrtcHSyncEnd = native->CrtcHSyncEnd;
+ adjusted_mode->CrtcHBlankEnd = native->CrtcHBlankEnd;
+ adjusted_mode->CrtcHTotal = native->CrtcHTotal;
+ adjusted_mode->CrtcHSkew = native->CrtcHSkew;
+ adjusted_mode->CrtcVDisplay = native->CrtcVDisplay;
+ adjusted_mode->CrtcVBlankStart = native->CrtcVBlankStart;
+ adjusted_mode->CrtcVSyncStart = native->CrtcVSyncStart;
+ adjusted_mode->CrtcVSyncEnd = native->CrtcVSyncEnd;
+ adjusted_mode->CrtcVBlankEnd = native->CrtcVBlankEnd;
+ adjusted_mode->CrtcVTotal = native->CrtcVTotal;
+ adjusted_mode->CrtcHAdjusted = native->CrtcHAdjusted;
+ adjusted_mode->CrtcVAdjusted = native->CrtcVAdjusted;
+
+ // This mode is already "fixed"
+ G80CrtcSkipModeFixup(output->crtc);
+
+ return TRUE;
+}
+
+static DisplayModePtr
+G80SorGetLVDSModes(xf86OutputPtr output)
+{
+ G80OutputPrivPtr pPriv = output->driver_private;
+ return xf86DuplicateMode(pPriv->nativeMode);
+}
+
+static const xf86OutputFuncsRec G80SorTMDSOutputFuncs = {
.dpms = G80SorDPMSSet,
.save = NULL,
.restore = NULL,
- .mode_valid = G80OutputModeValid,
+ .mode_valid = G80TMDSModeValid,
.mode_fixup = G80OutputModeFixup,
.prepare = G80OutputPrepare,
.commit = G80OutputCommit,
@@ -126,26 +214,88 @@
.destroy = G80SorDestroy,
};
+static const xf86OutputFuncsRec G80SorLVDSOutputFuncs = {
+ .dpms = G80SorDPMSSet,
+ .save = NULL,
+ .restore = NULL,
+ .mode_valid = G80LVDSModeValid,
+ .mode_fixup = G80SorModeFixupScale,
+ .prepare = G80OutputPrepare,
+ .commit = G80OutputCommit,
+ .mode_set = G80SorModeSet,
+ .detect = G80SorLVDSDetect,
+ .get_modes = G80SorGetLVDSModes,
+ .destroy = G80SorDestroy,
+};
+
+static DisplayModePtr
+GetLVDSNativeMode(G80Ptr pNv)
+{
+ DisplayModePtr mode = xnfcalloc(1, sizeof(DisplayModeRec));
+ const CARD32 size = pNv->reg[0x00610B4C/4];
+ const int width = size & 0x3fff;
+ const int height = (size >> 16) & 0x3fff;
+
+ mode->HDisplay = mode->CrtcHDisplay = width;
+ mode->VDisplay = mode->CrtcVDisplay = height;
+ mode->Clock = pNv->reg[0x610AD4/4] & 0x3fffff;
+ mode->CrtcHBlankStart = pNv->reg[0x610AFC/4];
+ mode->CrtcHSyncEnd = pNv->reg[0x610B04/4];
+ mode->CrtcHBlankEnd = pNv->reg[0x610AE8/4];
+ mode->CrtcHTotal = pNv->reg[0x610AF4/4];
+
+ mode->next = mode->prev = NULL;
+ mode->status = MODE_OK;
+ mode->type = M_T_DRIVER | M_T_PREFERRED;
+
+ xf86SetModeDefaultName(mode);
+
+ return mode;
+}
+
xf86OutputPtr
-G80CreateSor(ScrnInfoPtr pScrn, ORNum or)
+G80CreateSor(ScrnInfoPtr pScrn, ORNum or, PanelType panelType)
{
+ G80Ptr pNv = G80PTR(pScrn);
G80OutputPrivPtr pPriv = xnfcalloc(sizeof(*pPriv), 1);
+ const int off = 0x800 * or;
xf86OutputPtr output;
char orName[5];
+ const xf86OutputFuncsRec *funcs;
if(!pPriv)
return FALSE;
- snprintf(orName, 5, "DVI%i", or);
- output = xf86OutputCreate(pScrn, &G80SorOutputFuncs, orName);
+ if(panelType == LVDS) {
+ strcpy(orName, "LVDS");
+ funcs = &G80SorLVDSOutputFuncs;
+ } else {
+ snprintf(orName, 5, "DVI%d", or);
+ pNv->reg[(0x61C00C+off)/4] = 0x03010700;
+ pNv->reg[(0x61C010+off)/4] = 0x0000152f;
+ pNv->reg[(0x61C014+off)/4] = 0x00000000;
+ pNv->reg[(0x61C018+off)/4] = 0x00245af8;
+ funcs = &G80SorTMDSOutputFuncs;
+ }
+
+ output = xf86OutputCreate(pScrn, funcs, orName);
pPriv->type = SOR;
pPriv->or = or;
+ pPriv->panelType = panelType;
pPriv->cached_status = XF86OutputStatusUnknown;
pPriv->set_pclk = G80SorSetPClk;
output->driver_private = pPriv;
output->interlaceAllowed = TRUE;
output->doubleScanAllowed = TRUE;
+ if(panelType == LVDS) {
+ pPriv->nativeMode = GetLVDSNativeMode(pNv);
+
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s native size %dx%d\n",
+ orName, pPriv->nativeMode->HDisplay,
+ pPriv->nativeMode->VDisplay);
+ }
+
return output;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-nv-2.0.96/src/g80_type.h new/xf86-video-nv-2.1.0/src/g80_type.h
--- old/xf86-video-nv-2.0.96/src/g80_type.h 2007-05-16 23:37:10.000000000 +0200
+++ new/xf86-video-nv-2.1.0/src/g80_type.h 2007-06-06 02:01:46.000000000 +0200
@@ -25,6 +25,11 @@
SOR1 = 1
} ORNum;
+typedef enum PanelType {
+ TMDS,
+ LVDS,
+} PanelType;
+
typedef enum AccelMethod {
XAA,
EXA,
@@ -41,8 +46,9 @@
const unsigned char*table1;
int offscreenHeight;
struct {
- ORNum dac;
- ORNum sor;
+ ORNum dac;
+ ORNum sor;
+ PanelType panelType;
} i2cMap[4];
xf86Int10InfoPtr int10;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-nv-2.0.96/src/nv_dac.c new/xf86-video-nv-2.1.0/src/nv_dac.c
--- old/xf86-video-nv-2.0.96/src/nv_dac.c 2007-05-11 01:24:03.000000000 +0200
+++ new/xf86-video-nv-2.1.0/src/nv_dac.c 2007-06-08 23:39:35.000000000 +0200
@@ -1,6 +1,6 @@
/***************************************************************************\
|* *|
-|* Copyright 2003 NVIDIA, Corporation. All rights reserved. *|
+|* Copyright 2007 NVIDIA, Corporation. All rights reserved. *|
|* *|
|* NOTICE TO USER: The source code is copyrighted under U.S. and *|
|* international laws. Users and possessors of this source code are *|
@@ -221,6 +221,7 @@
}
nvReg->crtcSync = pNv->PRAMDAC[0x0828/4];
nvReg->crtcSync += NVDACPanelTweaks(pNv, nvReg);
+ nvReg->crtcVSync = pNv->fpVTotal - 6;
}
nvReg->vpll = nvReg->pll;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-nv-2.0.96/src/nv_hw.c new/xf86-video-nv-2.1.0/src/nv_hw.c
--- old/xf86-video-nv-2.0.96/src/nv_hw.c 2007-05-16 23:37:10.000000000 +0200
+++ new/xf86-video-nv-2.1.0/src/nv_hw.c 2007-06-08 23:41:22.000000000 +0200
@@ -1501,6 +1501,7 @@
} else {
pNv->PRAMDAC[0x0848/4] = state->scale;
pNv->PRAMDAC[0x0828/4] = state->crtcSync;
+ pNv->PRAMDAC[0x0808/4] = state->crtcVSync;
}
pNv->PRAMDAC[0x0600/4] = state->general;
@@ -1588,6 +1589,7 @@
if(pNv->FlatPanel) {
state->crtcSync = pNv->PRAMDAC[0x0828/4];
+ state->crtcVSync = pNv->PRAMDAC[0x0808/4];
}
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-nv-2.0.96/src/nv_setup.c new/xf86-video-nv-2.1.0/src/nv_setup.c
--- old/xf86-video-nv-2.0.96/src/nv_setup.c 2007-05-11 01:24:03.000000000 +0200
+++ new/xf86-video-nv-2.1.0/src/nv_setup.c 2007-06-08 23:33:41.000000000 +0200
@@ -687,6 +687,7 @@
if(pNv->FlatPanel && !pNv->Television) {
pNv->fpWidth = pNv->PRAMDAC[0x0820/4] + 1;
pNv->fpHeight = pNv->PRAMDAC[0x0800/4] + 1;
+ pNv->fpVTotal = pNv->PRAMDAC[0x804/4] + 1;
pNv->fpSyncs = pNv->PRAMDAC[0x0848/4] & 0x30000033;
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Panel size is %i x %i\n",
pNv->fpWidth, pNv->fpHeight);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-nv-2.0.96/src/nv_type.h new/xf86-video-nv-2.1.0/src/nv_type.h
--- old/xf86-video-nv-2.0.96/src/nv_type.h 2007-05-16 23:37:10.000000000 +0200
+++ new/xf86-video-nv-2.1.0/src/nv_type.h 2007-06-08 23:34:10.000000000 +0200
@@ -70,6 +70,7 @@
U032 timingV;
U032 displayV;
U032 crtcSync;
+ U032 crtcVSync;
} RIVA_HW_STATE, *NVRegPtr;
@@ -161,6 +162,7 @@
Bool fpScaler;
int fpWidth;
int fpHeight;
+ CARD32 fpVTotal;
CARD32 fpSyncs;
Bool usePanelTweak;
int PanelTweak;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org