[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-video-nouveau: Changes to 'ubuntu'



 ChangeLog                                  |   54 +++++++++++++++++++++++++++++
 configure.ac                               |    2 -
 debian/changelog                           |   35 +++++++++++++++++-
 debian/control                             |    5 +-
 debian/patches/02-kms-edid-block-fix.patch |   30 ----------------
 debian/patches/series                      |    1 
 debian/source/lintian-overrides            |    2 +
 src/drmmode_display.c                      |    9 +++-
 src/nv_driver.c                            |    3 +
 src/nvc0_shader.h                          |    4 +-
 src/nve0_shader.h                          |    4 +-
 11 files changed, 104 insertions(+), 45 deletions(-)

New commits:
commit fae3255aef04f209ce53f196e47028af5e043558
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Mon Jan 7 14:33:26 2013 +0100

    release to raring

diff --git a/debian/changelog b/debian/changelog
index b6167ad..bf53fa1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-xserver-xorg-video-nouveau (1:1.0.6-0ubuntu1) UNRELEASED; urgency=low
+xserver-xorg-video-nouveau (1:1.0.6-0ubuntu1) raring; urgency=low
 
   * Sync from unreleased debian experimental git.
   * Remaining differences:

commit f50aff8ea4531826e0807339f83a21217c27c67a
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Mon Jan 7 14:22:55 2013 +0100

    Remove 02-kms-edid-block-fix.patch, upstreamed.

diff --git a/debian/changelog b/debian/changelog
index d27dac3..7d948a9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,7 @@ xserver-xorg-video-nouveau (1:1.0.6-1) UNRELEASED; urgency=low
 
   [ Maarten Lankhorst ]
   * New upstream release.
+  * Remove 02-kms-edid-block-fix.patch, upstreamed.
 
  -- Sven Joachim <svenjoac@gmx.de>  Sun, 06 Jan 2013 14:56:59 +0100
 
diff --git a/debian/patches/02-kms-edid-block-fix.patch b/debian/patches/02-kms-edid-block-fix.patch
deleted file mode 100644
index ea7aa15..0000000
--- a/debian/patches/02-kms-edid-block-fix.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-commit 3b33a0b426b8915f302247dcd40c64fb1a6dcdd2
-Author: Emil Velikov <emil.l.velikov@gmail.com>
-Date:   Sun Nov 4 18:06:18 2012 +0000
-
-    kms: Let the server know if we got more than 1 EDID block
-    
-    Verbatim copy from xf86-video-radeon commit 809cacb
-    
-    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32341
-    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
-    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-
-diff --git a/src/drmmode_display.c b/src/drmmode_display.c
-index 803785d..8ec69f5 100644
---- a/src/drmmode_display.c
-+++ b/src/drmmode_display.c
-@@ -640,9 +640,12 @@ drmmode_output_get_modes(xf86OutputPtr output)
- 		drmModeFreeProperty(props);
- 	}
- 
--	if (drmmode_output->edid_blob)
-+	if (drmmode_output->edid_blob) {
- 		ddc_mon = xf86InterpretEDID(output->scrn->scrnIndex,
- 					    drmmode_output->edid_blob->data);
-+		if (ddc_mon && drmmode_output->edid_blob->length > 128)
-+			ddc_mon->flags |= MONITOR_EDID_COMPLETE_RAWDATA;
-+	}
- 	xf86OutputSetEDID(output, ddc_mon);
- 
- 	/* modes should already be available */
diff --git a/debian/patches/series b/debian/patches/series
index b256273..d6892cf 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1 @@
 01-set-NV_DRIVER_DATE-from-ChangeLog.diff
-02-kms-edid-block-fix.patch

commit b5324fccf484cc468ab2dc6871c53b997af0750e
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Mon Jan 7 14:20:07 2013 +0100

    Sync from unreleased debian experimental git.
    
    * Sync from unreleased debian experimental git.
    * Remaining differences:
      - Try to enable vblank if available (LP: #1019131)
        - 100-vblank-on.diff

diff --git a/debian/changelog b/debian/changelog
index 4c8f5cb..c3fb7da 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+xserver-xorg-video-nouveau (1:1.0.6-0ubuntu1) raring; urgency=low
+
+  * Sync from unreleased debian experimental git.
+  * Remaining differences:
+    - Try to enable vblank if available (LP: #1019131)
+      - 100-vblank-on.diff
+
+ -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Mon, 07 Jan 2013 14:16:08 +0100
+
 xserver-xorg-video-nouveau (1:1.0.6-1) UNRELEASED; urgency=low
 
   [ Sven Joachim ]

commit 74d397e6bbd88e778ba4f4b7608f8fee00a62682
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Mon Jan 7 14:15:14 2013 +0100

    New upstream release.

diff --git a/ChangeLog b/ChangeLog
index 5ea835d..ea92c08 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,57 @@
+commit 8f934fad5d4934936b3265f272ca81e73c60d7dc
+Author: Dave Airlie <airlied@redhat.com>
+Date:   Mon Jan 7 14:13:10 2013 +1000
+
+    bump to 1.0.6
+    
+    Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit 00834273e22f7234a3755269100ea3f10b521e35
+Author: Dave Airlie <airlied@redhat.com>
+Date:   Mon Jan 7 14:04:40 2013 +1000
+
+    nouveau: fix dirty redisplay damage handling
+    
+    This processes the damage in the correct order.
+    
+    Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit 389b8a8dd91a48dee524eac96e60813c507f1a82
+Author: Ben Skeggs <bskeggs@redhat.com>
+Date:   Mon Jan 7 14:05:06 2013 +1000
+
+    bump to 1.0.5
+    
+    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+
+commit efe9c57af6ff4c12936e49ac3e188c54b8b2d5bd
+Author: Ben Skeggs <bskeggs@redhat.com>
+Date:   Mon Jan 7 11:35:56 2013 +1000
+
+    nvc0-/exa: fix typo which caused breakage in rendercheck tmcoords test
+    
+    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+
+commit 5cd86445272818ec2f598f4685a5d7f24e403d07
+Author: Marcin Slusarz <marcin.slusarz@gmail.com>
+Date:   Sun Nov 25 22:59:49 2012 +0100
+
+    add some missing newlines in error messages
+    
+    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+
+commit 3b33a0b426b8915f302247dcd40c64fb1a6dcdd2
+Author: Emil Velikov <emil.l.velikov@gmail.com>
+Date:   Sun Nov 4 18:06:18 2012 +0000
+
+    kms: Let the server know if we got more than 1 EDID block
+    
+    Verbatim copy from xf86-video-radeon commit 809cacb
+    
+    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32341
+    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
+    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+
 commit 018ab2d4634f3c8923038337ce9600973e2f0002
 Author: Ben Skeggs <bskeggs@redhat.com>
 Date:   Fri Nov 9 12:16:00 2012 +1000
diff --git a/debian/changelog b/debian/changelog
index 3f3693c..d27dac3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,12 @@
-xserver-xorg-video-nouveau (1:1.0.4-2) UNRELEASED; urgency=low
+xserver-xorg-video-nouveau (1:1.0.6-1) UNRELEASED; urgency=low
 
+  [ Sven Joachim ]
   * Bump build-dependency on libdrm-dev to (>= 2.4.40-1) and add an
     override for the resulting lintian warning.
 
+  [ Maarten Lankhorst ]
+  * New upstream release.
+
  -- Sven Joachim <svenjoac@gmx.de>  Sun, 06 Jan 2013 14:56:59 +0100
 
 xserver-xorg-video-nouveau (1:1.0.4-1) experimental; urgency=low

commit 8f934fad5d4934936b3265f272ca81e73c60d7dc
Author: Dave Airlie <airlied@redhat.com>
Date:   Mon Jan 7 14:13:10 2013 +1000

    bump to 1.0.6
    
    Signed-off-by: Dave Airlie <airlied@redhat.com>

diff --git a/configure.ac b/configure.ac
index 3428be1..7535bfe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-nouveau],
-        [1.0.5],
+        [1.0.6],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-nouveau])
 

commit 00834273e22f7234a3755269100ea3f10b521e35
Author: Dave Airlie <airlied@redhat.com>
Date:   Mon Jan 7 14:04:40 2013 +1000

    nouveau: fix dirty redisplay damage handling
    
    This processes the damage in the correct order.
    
    Signed-off-by: Dave Airlie <airlied@redhat.com>

diff --git a/src/nv_driver.c b/src/nv_driver.c
index de09f53..f14c847 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -454,9 +454,10 @@ redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty)
 
 	PixmapRegionInit(&pixregion, dirty->slave_dst->master_pixmap);
 
+	DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion);
 	PixmapSyncDirtyHelper(dirty, &pixregion);
 
-	DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion);
+	DamageRegionProcessPending(&dirty->slave_dst->drawable);
 	RegionUninit(&pixregion);
 }
 

commit 389b8a8dd91a48dee524eac96e60813c507f1a82
Author: Ben Skeggs <bskeggs@redhat.com>
Date:   Mon Jan 7 14:05:06 2013 +1000

    bump to 1.0.5
    
    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

diff --git a/configure.ac b/configure.ac
index ff9c337..3428be1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-nouveau],
-        [1.0.4],
+        [1.0.5],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-nouveau])
 

commit efe9c57af6ff4c12936e49ac3e188c54b8b2d5bd
Author: Ben Skeggs <bskeggs@redhat.com>
Date:   Mon Jan 7 11:35:56 2013 +1000

    nvc0-/exa: fix typo which caused breakage in rendercheck tmcoords test
    
    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

diff --git a/src/nvc0_shader.h b/src/nvc0_shader.h
index 4d1679e..41bc065 100644
--- a/src/nvc0_shader.h
+++ b/src/nvc0_shader.h
@@ -73,8 +73,8 @@ NVC0VP_Transform2[] = {
 	0x58004000,
 	0x10011c40,
 	0x58004001,
-	0x00109c40,
-	0x30044001,
+	0xc0109c40,
+	0x30044000,
 	0xf010dc40,
 	0x30064000,
 	0x20111c40,
diff --git a/src/nve0_shader.h b/src/nve0_shader.h
index 4705075..5d8e9dd 100644
--- a/src/nve0_shader.h
+++ b/src/nve0_shader.h
@@ -67,8 +67,8 @@ NVE0VP_Transform2[] = {
 	0x58004000,
 	0x10011c40,
 	0x58004001,
-	0x00109c40,
-	0x30044001,
+	0xc0109c40,
+	0x30044000,
 	0xf010dc40,
 	0x30064000,
 	0x20111c40,

commit 4fe6194614d07600181f8d3d61e1922c9a3b3d84
Author: Sven Joachim <svenjoac@gmx.de>
Date:   Sun Jan 6 15:15:25 2013 +0100

    Bump build-dependency on libdrm-dev to (>= 2.4.40-1)
    
    Necessary, since 2.4.40-1~ with an incompatible Nouveau API landed in
    unstable. Lintian does not like this, add an override.

diff --git a/debian/changelog b/debian/changelog
index 6a03b06..3f3693c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+xserver-xorg-video-nouveau (1:1.0.4-2) UNRELEASED; urgency=low
+
+  * Bump build-dependency on libdrm-dev to (>= 2.4.40-1) and add an
+    override for the resulting lintian warning.
+
+ -- Sven Joachim <svenjoac@gmx.de>  Sun, 06 Jan 2013 14:56:59 +0100
+
 xserver-xorg-video-nouveau (1:1.0.4-1) experimental; urgency=low
 
   [ Maarten Lankhorst ]
diff --git a/debian/control b/debian/control
index 210cee9..4975203 100644
--- a/debian/control
+++ b/debian/control
@@ -14,7 +14,7 @@ Build-Depends:
  x11proto-randr-dev (>= 1.2),
  x11proto-render-dev,
  x11proto-xext-dev,
- libdrm-dev (>= 2.4.34),
+ libdrm-dev (>= 2.4.40-1),
  x11proto-xf86dri-dev,
  x11proto-gl-dev,
  mesa-common-dev,
diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides
new file mode 100644
index 0000000..07e073a
--- /dev/null
+++ b/debian/source/lintian-overrides
@@ -0,0 +1,2 @@
+# Actually needed, Wheezy has 2.4.40-1~ with an incompatible API
+xserver-xorg-video-nouveau source: build-depends-on-1-revision build-depends: libdrm-dev (>= 2.4.40-1)

commit 5cd86445272818ec2f598f4685a5d7f24e403d07
Author: Marcin Slusarz <marcin.slusarz@gmail.com>
Date:   Sun Nov 25 22:59:49 2012 +0100

    add some missing newlines in error messages
    
    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 8ec69f5..429e9cc 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -357,7 +357,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 
 	if (ret) {
 		xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
-			   "failed to set mode: %s", strerror(-ret));
+			   "failed to set mode: %s\n", strerror(-ret));
 		return FALSE;
 	}
 
@@ -532,7 +532,7 @@ drmmode_gamma_set(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue,
 				  size, red, green, blue);
 	if (ret != 0) {
 		xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
-			   "failed to set gamma: %s", strerror(-ret));
+			   "failed to set gamma: %s\n", strerror(-ret));
 	}
 }
 

commit 6ed3a485149910ddae372da8a650a58eda509e14
Author: Sven Joachim <svenjoac@gmx.de>
Date:   Mon Nov 26 20:25:01 2012 +0100

    Upload to experimental

diff --git a/debian/changelog b/debian/changelog
index ccc52b1..6a03b06 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-xserver-xorg-video-nouveau (1:1.0.4-1) UNRELEASED; urgency=low
+xserver-xorg-video-nouveau (1:1.0.4-1) experimental; urgency=low
 
   [ Maarten Lankhorst ]
   * New upstream release.
@@ -8,7 +8,7 @@ xserver-xorg-video-nouveau (1:1.0.4-1) UNRELEASED; urgency=low
   [ Timo Aaltonen ]
   * watch: Use the .gz tarball, and update the url.
 
- -- Maarten Lankhorst <maarten.lankhorst@canonical.com>  Mon, 16 Jul 2012 15:22:19 +0200
+ -- Sven Joachim <svenjoac@gmx.de>  Mon, 26 Nov 2012 19:18:41 +0100
 
 xserver-xorg-video-nouveau (1:1.0.1-4) unstable; urgency=low
 

commit 6a0e558f463fe551b221f4f3729d9e3128d305df
Author: Sven Joachim <svenjoac@gmx.de>
Date:   Mon Nov 26 19:07:51 2012 +0100

    Remove DM-Upload-Allowed field
    
    The field is obsolete as per
    http://lists.debian.org/debian-devel-announce/2012/11/msg00006.html.

diff --git a/debian/control b/debian/control
index bdacd2e..210cee9 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,6 @@ Section: x11
 Priority: optional
 Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
 Uploaders: Cyril Brulebois <kibi@debian.org>, Sven Joachim <svenjoac@gmx.de>
-Dm-Upload-Allowed: yes
 Build-Depends:
  debhelper (>= 8),
  dh-autoreconf,

commit cdb28bc45ca613855b525e061ad0964527f67818
Author: Sven Joachim <svenjoac@gmx.de>
Date:   Thu Nov 22 18:01:06 2012 +0100

    Revert "Bump minimum X to 1.13rc1"
    
    This reverts commit 63ebddd8af502533cab826a2599f9d903ff1bddf.
    
    The Xserver version in question does not exist in Debian, and I would
    like to actually upload a package some day.

diff --git a/debian/control b/debian/control
index 3607c94..bdacd2e 100644
--- a/debian/control
+++ b/debian/control
@@ -8,7 +8,7 @@ Build-Depends:
  debhelper (>= 8),
  dh-autoreconf,
  pkg-config,
- xserver-xorg-dev (>= 2:1.12.99),
+ xserver-xorg-dev (>= 2:1.9.4),
  x11proto-video-dev,
  x11proto-core-dev,
  x11proto-fonts-dev,

commit 087c225fb288e753463c4253cce0484bce6435c8
Author: Sven Joachim <svenjoac@gmx.de>
Date:   Sat Nov 17 11:04:53 2012 +0100

    Upload to unstable

diff --git a/debian/changelog b/debian/changelog
index 1d196e0..b6d637e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-xserver-xorg-video-nouveau (1:1.0.1-4) UNRELEASED; urgency=low
+xserver-xorg-video-nouveau (1:1.0.1-4) unstable; urgency=low
 
   * Cherry-pick some bugfixes from upstream:
     - exa: use CLAMP_TO_EDGE for RepeatPad.
@@ -6,7 +6,7 @@ xserver-xorg-video-nouveau (1:1.0.1-4) UNRELEASED; urgency=low
     - dri2: Fix potential race and crash for swap at next vblank.
       (Closes: #686474)
 
- -- Sven Joachim <svenjoac@gmx.de>  Wed, 07 Nov 2012 19:01:51 +0100
+ -- Sven Joachim <svenjoac@gmx.de>  Sat, 17 Nov 2012 11:04:13 +0100
 
 xserver-xorg-video-nouveau (1:1.0.1-3) unstable; urgency=low
 

commit 3b33a0b426b8915f302247dcd40c64fb1a6dcdd2
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Sun Nov 4 18:06:18 2012 +0000

    kms: Let the server know if we got more than 1 EDID block
    
    Verbatim copy from xf86-video-radeon commit 809cacb
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32341
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 803785d..8ec69f5 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -640,9 +640,12 @@ drmmode_output_get_modes(xf86OutputPtr output)
 		drmModeFreeProperty(props);
 	}
 
-	if (drmmode_output->edid_blob)
+	if (drmmode_output->edid_blob) {
 		ddc_mon = xf86InterpretEDID(output->scrn->scrnIndex,
 					    drmmode_output->edid_blob->data);
+		if (ddc_mon && drmmode_output->edid_blob->length > 128)
+			ddc_mon->flags |= MONITOR_EDID_COMPLETE_RAWDATA;
+	}
 	xf86OutputSetEDID(output, ddc_mon);
 
 	/* modes should already be available */

commit 095415b8cdbc9fb80c4be28a0873c38715d2e76d
Author: Sven Joachim <svenjoac@gmx.de>
Date:   Wed Nov 7 19:02:10 2012 +0100

    Document the cherry-picks

diff --git a/debian/changelog b/debian/changelog
index 0c1344e..1d196e0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+xserver-xorg-video-nouveau (1:1.0.1-4) UNRELEASED; urgency=low
+
+  * Cherry-pick some bugfixes from upstream:
+    - exa: use CLAMP_TO_EDGE for RepeatPad.
+    - shadowfb: fix segfault due to reading outside of shadow buffer.
+    - dri2: Fix potential race and crash for swap at next vblank.
+      (Closes: #686474)
+
+ -- Sven Joachim <svenjoac@gmx.de>  Wed, 07 Nov 2012 19:01:51 +0100
+
 xserver-xorg-video-nouveau (1:1.0.1-3) unstable; urgency=low
 
   * Update NEWS.Debian, Debian kernels from 3.2.23-1 onward are

commit 97b056bdf96b933f54b45fb8a97e6853edbe1097
Author: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Date:   Tue Oct 9 09:06:59 2012 +0200

    dri2: Fix potential race and crash for swap at next vblank.
    
    This fixes a potential race + crash that wasn't properly
    handled by commit 248de8cdbd6d0bc062633b49896fa4791148cd3b
    and happened at least on one users machine.
    
    That commit wrongly assumed no special action would be needed
    for swaps at next vblank while triple-buffering is enabled on
    XOrg server 1.12 or later.
    
    Closer inspection of the x-server main dispatch loop shows
    it is possible that the client manages to get the server
    to dispatch a new DRI2GetBuffersWithFormat() call before
    the server calls the vblank event handler and executes
    the nouveau_dri2_finish_swap() routine. Such a race would
    cause a crash, as described in above commit.
    
    This commit handles the "swap at next vblank" case by
    calling nouveau_dri2_finish_swap() immediately without
    the roundtrip (queue vblank_event -> kernel -> deliver event
    -> x-server processes event -> nouveau vblank event handler),
    before control gets returned to the client.
    
    This avoids the race while retaining triple-buffering. As
    a bonus, time-critical swaps at next vblank get processed
    without roundtrip delay, increasing the chance of not
    skipping a frame due to vblank miss while sync to vblank is
    on.
    
    Thanks to Anssi for reporting this problem on the nouveau
    mailing list at 12th July 2012 and for testing this patch.
    
    Reported-by: Anssi Hannula <anssi.hannula@iki.fi>
    Tested-by: Anssi Hannula <anssi.hannula@iki.fi>
    Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
    (cherry picked from commit b4231dd715a8a7f86b04519b5f4e8a8d93c2f561)

diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
index 0b3cc38..44fa255 100644
--- a/src/nouveau_dri2.c
+++ b/src/nouveau_dri2.c
@@ -412,6 +412,7 @@ nouveau_dri2_schedule_swap(ClientPtr client, DrawablePtr draw,
 {
 	struct nouveau_dri2_vblank_state *s;
 	CARD64 current_msc, expect_msc;
+	CARD64 current_ust;
 	int ret;
 
 	/* Initialize a swap structure */
@@ -423,9 +424,9 @@ nouveau_dri2_schedule_swap(ClientPtr client, DrawablePtr draw,
 		{ SWAP, client, draw->id, dst, src, func, data, 0 };
 
 	if (can_sync_to_vblank(draw)) {
-		/* Get current sequence */
+		/* Get current sequence and vblank time*/
 		ret = nouveau_wait_vblank(draw, DRM_VBLANK_RELATIVE, 0,
-					  &current_msc, NULL, NULL);
+					  &current_msc, &current_ust, NULL);
 		if (ret)
 			goto fail;
 
@@ -445,24 +446,48 @@ nouveau_dri2_schedule_swap(ClientPtr client, DrawablePtr draw,
 		if (*target_msc == 0)
 			*target_msc = 1;
 
+		/* Swap at next possible vblank requested? */
+		if (current_msc >= *target_msc - 1) {
+			/* Special case: Need to swap at next vblank.
+			 * Schedule swap immediately, bypassing the kernel
+			 * vblank event mechanism to avoid a dangerous race
+			 * between the client and the x-server vblank event
+			 * dispatch in the main x-server dispatch loop when
+			 * the swap_limit is set to 2 for triple-buffering.
+			 *
+			 * This also optimizes for the common case of swap
+			 * at next vblank, avoiding vblank dispatch delay.
+			 */
+			s->frame = 1 + ((unsigned int) current_msc & 0xffffffff);
+			*target_msc = 1 + current_msc;
+			nouveau_dri2_finish_swap(draw, current_msc,
+						 (unsigned int) (current_ust / 1000000),
+						 (unsigned int) (current_ust % 1000000),
+						 s);
+			return TRUE;
+		}
+
+		/* This is a swap in the future, ie. the vblank event will
+		 * only get dispatched at least 2 vblanks into the future.
+		 */
+
 #if DRI2INFOREC_VERSION >= 6
-		/* Is this a swap in the future, ie. the vblank event will
-		 * not be immediately dispatched, but only at a future vblank?
-		 * If so, we need to temporarily lower the swaplimit to 1, so
-		 * that DRI2GetBuffersWithFormat() requests from the client get
+		/* On XOrg 1.12+ we need to temporarily lower the swaplimit to 1,
+		 * so that DRI2GetBuffersWithFormat() requests from the client get
 		 * deferred in the x-server until the vblank event has been
 		 * dispatched to us and nouveau_dri2_finish_swap() is done. If
 		 * we wouldn't do this, DRI2GetBuffersWithFormat() would operate
 		 * on wrong (pre-swap) buffers, and cause a segfault later on in
-		 * nouveau_dri2_finish_swap(). Our vblank event handler restores
+		 * nouveau_dri2_finish_swap(). Our vblank event handler will restore
 		 * the old swaplimit immediately after nouveau_dri2_finish_swap()
-		 * is done, so we still get 1 video refresh cycle worth of
-		 * triple-buffering. For a swap at next vblank, dispatch of the
-		 * vblank event happens immediately, so there isn't any need
-		 * for this lowered swaplimit.
+		 * is done, so we still get 1 video refresh cycle worth of triple-
+		 * buffering, because the client can start rendering again 1 cycle
+		 * before the pending swap is completed.
+		 *
+		 * The same race would happen for the "swap at next vblank" case,
+		 * but the special case "swap immediately" code above prevents this.
 		 */
-		if (current_msc < *target_msc - 1)
-			DRI2SwapLimit(draw, 1);
+		DRI2SwapLimit(draw, 1);
 #endif
 
 		/* Request a vblank event one frame before the target */

commit 16b243ea7cd3a3c0ef487c272d8b22ee17a108c2
Author: Ben Skeggs <bskeggs@redhat.com>
Date:   Thu Oct 18 18:38:21 2012 +1000

    shadowfb: fix segfault due to reading outside of shadow buffer
    
    Probably caused by the new libdrm port, the new libdrm sets the bo
    size field to the *allocated* size and not the *requested* size,
    making the max_height calculation here invalid.
    
    Switched to using virtualX/virtualY as the bounds, which should
    hopefully do the right thing..
    
    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
    (cherry picked from commit 01c9a9cff7d6232ca6eafa59dd60833a0d9cdc5b)

diff --git a/src/nv_shadow.c b/src/nv_shadow.c
index 67d9ea5..4ad2357 100644
--- a/src/nv_shadow.c
+++ b/src/nv_shadow.c
@@ -32,19 +32,18 @@ void
 NVRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
 {
 	NVPtr pNv = NVPTR(pScrn);
-	int x1, y1, x2, y2, width, height, cpp, FBPitch, max_height;
+	int x1, y1, x2, y2, width, height, cpp, FBPitch;
 	unsigned char *src, *dst;
    
 	cpp = pScrn->bitsPerPixel >> 3;
 	FBPitch = pScrn->displayWidth * cpp;
-	max_height = pNv->scanout->size/FBPitch;
 
 	nouveau_bo_map(pNv->scanout, NOUVEAU_BO_WR, pNv->client);
 	while(num--) {
 		x1 = MAX(pbox->x1, 0);
 		y1 = MAX(pbox->y1, 0);
-		x2 = MIN(pbox->x2, pScrn->displayWidth);
-		y2 = MIN(pbox->y2, max_height);
+		x2 = MIN(pbox->x2, pScrn->virtualX);
+		y2 = MIN(pbox->y2, pScrn->virtualY);
 		width = (x2 - x1) * cpp;
 		height = y2 - y1;
 

commit 62f96347f0f9e4aced6f332dd4e35c47dd32d29e
Author: Sebastian Keller <sebastian-keller@gmx.de>
Date:   Tue Sep 25 11:35:35 2012 +0200

    exa: use CLAMP_TO_EDGE for RepeatPad
    
    This fixes border rendering in some gtk3 themes.
    https://bugs.freedesktop.org/show_bug.cgi?id=55310
    
    v2 (Ben Skeggs): implement same fix for fermi/kepler too
    
    Signed-off-by: Sebastian Keller <sebastian-keller@gmx.de>
    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
    (cherry picked from commit 5c9379b14cdabc81fd5d4c916dcd93dc77c4f683)

diff --git a/src/nv40_exa.c b/src/nv40_exa.c
index 87ed5b2..c9e99e0 100644
--- a/src/nv40_exa.c
+++ b/src/nv40_exa.c
@@ -260,9 +260,9 @@ NV40EXAPictTexture(NVPtr pNv, PixmapPtr pPix, PicturePtr pPict, int unit)
 	if (pPict->repeat) {
 		switch(pPict->repeatType) {
 		case RepeatPad:
-			PUSH_DATA (push, NV30_3D_TEX_WRAP_S_CLAMP | 
-					 NV30_3D_TEX_WRAP_T_CLAMP |
-					 NV30_3D_TEX_WRAP_R_CLAMP);
+			PUSH_DATA (push, NV30_3D_TEX_WRAP_S_CLAMP_TO_EDGE |
+					 NV30_3D_TEX_WRAP_T_CLAMP_TO_EDGE |
+					 NV30_3D_TEX_WRAP_R_CLAMP_TO_EDGE);
 			break;
 		case RepeatReflect:
 			PUSH_DATA (push, NV30_3D_TEX_WRAP_S_MIRRORED_REPEAT |
diff --git a/src/nv50_exa.c b/src/nv50_exa.c
index 2a25e74..1ce081a 100644
--- a/src/nv50_exa.c
+++ b/src/nv50_exa.c
@@ -664,9 +664,9 @@ NV50EXAPictTexture(NVPtr pNv, PixmapPtr ppix, PicturePtr ppict, unsigned unit)
 	if (ppict->repeat) {
 		switch (ppict->repeatType) {
 		case RepeatPad:
-			PUSH_DATA (push, NV50TSC_1_0_WRAPS_CLAMP |
-				 NV50TSC_1_0_WRAPT_CLAMP |
-				 NV50TSC_1_0_WRAPR_CLAMP | 0x00024000);
+			PUSH_DATA (push, NV50TSC_1_0_WRAPS_CLAMP_TO_EDGE |
+				 NV50TSC_1_0_WRAPT_CLAMP_TO_EDGE |
+				 NV50TSC_1_0_WRAPR_CLAMP_TO_EDGE | 0x00024000);
 			break;
 		case RepeatReflect:
 			PUSH_DATA (push, NV50TSC_1_0_WRAPS_MIRROR_REPEAT |
diff --git a/src/nvc0_exa.c b/src/nvc0_exa.c
index 6a8f1a1..a75fdee 100644
--- a/src/nvc0_exa.c
+++ b/src/nvc0_exa.c
@@ -658,9 +658,9 @@ NVC0EXAPictTexture(NVPtr pNv, PixmapPtr ppix, PicturePtr ppict, unsigned unit)
 		switch (ppict->repeatType) {
 		case RepeatPad:
 			PUSH_DATA (push, 0x00024000 |
-					 NV50TSC_1_0_WRAPS_CLAMP |
-					 NV50TSC_1_0_WRAPT_CLAMP |
-					 NV50TSC_1_0_WRAPR_CLAMP);
+					 NV50TSC_1_0_WRAPS_CLAMP_TO_EDGE |
+					 NV50TSC_1_0_WRAPT_CLAMP_TO_EDGE |
+					 NV50TSC_1_0_WRAPR_CLAMP_TO_EDGE);
 			break;
 		case RepeatReflect:
 			PUSH_DATA (push, 0x00024000 |


Reply to: