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

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



 ChangeLog                   |  371 ++++++++++++++++++++++++++++++++++++++++++++
 NEWS                        |   39 ++++
 configure.ac                |    2 
 debian/changelog            |   81 +--------
 src/intel_driver.c          |    2 
 src/intel_glamor.c          |   37 ++--
 src/sna/compiler.h          |    2 
 src/sna/gen3_render.c       |  124 ++++++--------
 src/sna/gen4_render.c       |    4 
 src/sna/gen4_vertex.c       |   25 --
 src/sna/gen5_render.c       |    4 
 src/sna/gen6_render.c       |    4 
 src/sna/gen7_render.c       |   26 ++-
 src/sna/kgem.c              |   87 ++++++++--
 src/sna/kgem.h              |    2 
 src/sna/sna.h               |   15 +
 src/sna/sna_accel.c         |   68 ++++----
 src/sna/sna_display.c       |   49 +++++
 src/sna/sna_dri.c           |   67 +++++--
 src/sna/sna_glyphs.c        |   14 +
 src/sna/sna_io.c            |   15 -
 src/sna/sna_render.c        |   26 ++-
 src/sna/sna_render_inline.h |   14 -
 src/sna/sna_tiling.c        |   15 -
 src/sna/sna_trapezoids.c    |    4 
 test/Makefile.am            |    1 
 test/dri2-race.c            |  113 +++++++++++++
 27 files changed, 910 insertions(+), 301 deletions(-)

New commits:
commit 97bb2a01ec188df360f350dfb6d8d6a213cf0f8c
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Thu Mar 21 16:07:35 2013 +0200

    release to raring

diff --git a/debian/changelog b/debian/changelog
index 41f79c9..a972581 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+xserver-xorg-video-intel (2:2.21.5-0ubuntu1) raring; urgency=low
+
+  * Merge from unreleased debian git
+    - new upstream release (LP: #1156387, #1156679)
+
+ -- Timo Aaltonen <tjaalton@ubuntu.com>  Thu, 21 Mar 2013 15:51:49 +0200
+
 xserver-xorg-video-intel (2:2.21.5-1) UNRELEASED; urgency=low
 
   [ Timo Aaltonen ]

commit 5a39198cdcdab2475ab88cbf0fd2bdbd167c9b93
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Thu Mar 21 15:48:45 2013 +0200

    bump the changelogs

diff --git a/ChangeLog b/ChangeLog
index 9430f14..b6dbf4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,374 @@
+commit 4adebfed415cf58599b22e873f32e7ce2eaa6542
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Thu Mar 21 08:53:12 2013 +0000
+
+    2.21.5 release
+
+commit 1aca872ee51e10908dcc4979596ae69732e9a02a
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Tue Mar 19 08:26:01 2013 +0000
+
+    sna: Haswell reintroduces MI_LOAD_SCAN_LINES
+    
+    Better late than never? Interestingly only available from the BLT ring,
+    which makes accurate waiting for XVideo (which must use the render ring)
+    impossible in the current form - we need to render to a temporary then
+    do a vsynced blit in this case.
+    
+    References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1156679
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit f132452da14fd09a2a3926cc9c034cb2e8c2f1a9
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Tue Mar 19 07:57:30 2013 +0000
+
+    sna: Ignore vsync waits on tiny scanline ranges
+    
+    If the update is only a couple of lines tall, any tear will not be
+    visible - so just ignore programming the wait into the GPU.
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 308f0208de59620190dd3cb65b3243d2e8a7bd87
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Mon Mar 18 15:04:22 2013 +0000
+
+    sna: Reset operation state between glyphs
+    
+    We are not resetting sufficient state between operations as we presume
+    that all callers of Composite() currently pass in a blank state. In the
+    long run, we want to remove that burden and do a minimal initialisation.
+    
+    References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1156387
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 4a37d57f9633bbd29f308239c1cd956767b277c0
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Mon Mar 18 15:00:01 2013 +0000
+
+    sna: Add a pair of sanity checks before creating the redirection target
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 28371a34fa83f70a7af3c8d3bfd6c7cef9e35073
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Mon Mar 18 14:49:58 2013 +0000
+
+    sna: Skip processing an all-clipped-out glyph
+    
+    Along the slow path, skip all processing of glyphs that are not visible.
+    This is important as the slow path handles the per-glyph redirection
+    case, which is much more expensive.
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 16dac417c8049d65b3641e0f662865772faad61f
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Sun Mar 17 21:56:56 2013 +0000
+
+    sna/dri: Fix stale Pixmap detection
+    
+    NB the back buffer is not associated with the Drawable and so has no
+    pixmap field set. Hence comparing the front->pixmap against the
+    back->pixmap was always rejecting the blit. All we can check is that
+    front->pixmap corresponds with the current Drawable and so reject stale
+    configuration.
+    
+    Reported-by: Jiri Slaby <jirislaby@gmail.com>
+    References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 85213d5d450eec5696496128c1acecb5ca13c53b
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Sun Mar 17 21:42:48 2013 +0000
+
+    sna: Don't remove the flush flag for userptr bo
+    
+    This flag is far too overload with meaning, but for now this prevents us
+    attempting to call free() on a SHM segment.
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit c5b901a635a9c8c74017682d17cfcd93031907b4
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Sat Mar 16 10:54:51 2013 +0000
+
+    sna/dri: Clear flush flag upon bo destroy
+    
+    Fixes sanity checks that we do not leak the flushing status, nor
+    invoke an operation upon an unflushed bo.
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 45d20e9a65bec8d962a4ec20ee35079935f71b91
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Thu Mar 14 22:09:38 2013 +0000
+
+    sna: Add an LLC path for creating snoopable buffers
+    
+    As with LLC we do not actually need to track snoopable as a separate
+    cache state.
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 94cb10c3f2b9bbb6ae3c76faebe9fc88691224a9
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Thu Mar 14 22:02:09 2013 +0000
+
+    sna/gen5+: Add missing float casts in computation of scaled src offsets
+    
+    Without the casts, the division ends up as 0 rather than the fractional
+    offset into the texture.
+    
+    The casts were missed in the claimed fix:
+    
+    commit 89038ddb96aabc4bc1f04402b2aca0ce546e8bf3
+    Author: Chris Wilson <chris@chris-wilson.co.uk>
+    Date:   Thu Feb 28 14:35:54 2013 +0000
+    
+        sna/video: Correct scaling of source offsets
+    
+    Reported-by: Roman Elshin <roman.elshin@gmail.com>
+    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62343
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit dad50881d545da665191c6681f2acd0ebc3ddbfc
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Thu Mar 14 14:53:13 2013 +0000
+
+    sna: Consider placement hints when choosing userptr read path
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 11e2802528aed4ef9ffc8b75045c72ac641e54b1
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Thu Mar 14 14:42:25 2013 +0000
+
+    sna: Add handle info to sync DBG
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 20832494be06da9ebc4801647521f95e092188fc
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Thu Mar 14 14:03:00 2013 +0000
+
+    sna: Use userptr downloads for incomplete GPU damaged pixmaps
+    
+    If the pixmap is not wholly damaged, but still contains the region to be
+    read, then use userptr (if available).
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 92023f39a9c8897e5a978f44b7970773b118f628
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Thu Mar 14 09:42:37 2013 +0000
+
+    sna: Add a few more assertions to track userptr through the caches
+    
+    i.e. make sure they don't end up in any caches.
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 80401f4fe54142c16ea7578b587529610b68cb67
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Wed Mar 13 11:01:45 2013 +0000
+
+    sna/trapezoids: Minimally replace points for TriFan
+    
+    The realisation dawns that it wasn't the ordering of points within the
+    triangle, but simply that I was replacing the wrong one.
+
+commit 716723d655a6ee11b090642b759e2542ad712c17
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Wed Mar 13 10:51:03 2013 +0000
+
+    sna/trapezoids: Correct ordering of points within TriFran
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 49374f2155f0c8c80b1c54e968d510d55df49221
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Tue Mar 12 20:12:51 2013 +0000
+
+    sna/gen4: Tweak compilation flags to avoid mixed settings across functions
+    
+    Confusing gcc with different flags for supposedly inlined functions is
+    not a good idea.
+    
+    References: https://bugs.freedesktop.org/show_bug.cgi?id=62198
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit ee0ed88a09bc2f8ebe49b1d7f7e209a73e02fee0
+Author: Aaron Plattner <aplattner@nvidia.com>
+Date:   Tue Mar 12 12:45:58 2013 -0700
+
+    uxa: don't crash when freeing an uninitialized screen
+    
+    When intel_scrn_create creates a screen, it sets scrn->driverPrivate to
+    (void *)(match_data | 1).  Normally, this is read by I830PreInit and then
+    replaced with a pointer to the intel_screen_private structure.  However, it's
+    possible for the server to delete the screen before initializing it, which leads
+    to a crash in I830FreeScreen when it tries to interpret the unaligned match_data
+    pointer as a pointer to a intel_screen_private.
+    
+    Fix this by checking the low bit of the pointer and skipping the teardown code
+    if it's set.
+    
+    Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
+
+commit b1952e79021759927361d284b157713a651a10b1
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Tue Mar 12 19:58:28 2013 +0000
+
+    sna/gen3: Tweak code generation for gen3_emit_composite_primitive_constant__sse2
+    
+    References: https://bugs.freedesktop.org/show_bug.cgi?id=62198
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit f320e6908f24ff356303c8905c78ac290e24c2e6
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Tue Mar 12 19:53:20 2013 +0000
+
+    sna/gen3: Tweak code generation for gen3_emit_composite_primitive_identity_gradient__sse2
+    
+    References: https://bugs.freedesktop.org/show_bug.cgi?id=62198
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit b1d0ca266cc67df65c81a9dbb9cc83027ff240ea
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Tue Mar 12 19:03:44 2013 +0000
+
+    sna/gen3: Reduce another use of transforms
+    
+    Prefer the slightly cheaper _sna_get_transformed_scaled().
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 50374fb4947e6682b6c8aced639b422110b6ec98
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Tue Mar 12 18:39:07 2013 +0000
+
+    uxa/glamor: Prevent a crash when trying to load a misconfigured glamor
+    
+    Glamor requires that glamoregl is explicitly loaded via Section "Module"
+    or else it currently crashes.
+    
+    Based on a patch by Michel Dänzer for xf86-video-ati.
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit c79a189b6f06a58ddbd92427b6c57a0bdfb1e16c
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Tue Mar 12 15:57:17 2013 +0000
+
+    sna: Missing git-add for 09862a85eba243b
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit a31831bce86745205369faaa297064770f4350f9
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Tue Mar 12 15:26:28 2013 +0000
+
+    sna: Improve asserts that the CPU bo is not busy after synchronisation
+    
+    Taking into account that we may not do a full synchronisation.
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 09862a85eba243babde9ca721ca6521566f5c082
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Tue Mar 12 15:12:59 2013 +0000
+
+    sna: Mark redirect proxies with a unique id
+    
+    This helps gen3 in particular as it uses the unique_id field of a bo to
+    detect changes in render target.
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 4f8fba31d7317248e0d4710ef5553dc1f9593314
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Tue Mar 12 10:12:12 2013 +0000
+
+    sna: Apply the source offset to the transform when fixing up gradients
+    
+    Otherwise pixman will apply the source transform to the offsets.
+    
+    Reported-by: Ognian Tenchev <drJeckyll@Jeckyll.net>
+    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62198
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 0b143fcb2bdeec9abd1c1d2a9dbe707cb9165b65
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Mon Mar 11 18:11:27 2013 +0000
+
+    sna: Improve sna_copy_boxes DBG by printing the bo handles
+    
+    The handles of the bo are easier to track through the DBG as they are
+    more often printed than then their addresses.
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 44d3ffdf534eb1c24ab729b9af31f09a86b82256
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Mon Mar 11 17:14:39 2013 +0000
+
+    sna: Only allocate addition space if we need pixel data
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit b500e30d5dbcf91542c2831ebd3c48b28a01bf28
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Mon Mar 11 17:14:07 2013 +0000
+
+    sna: Mark the userptr as a CPU mapping
+    
+    This helps clarify some recent asserts.
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 17a99f0743836997aa8e4f7eafc0ea4978244f44
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Mon Mar 11 16:41:16 2013 +0000
+
+    sna/dri: Free the event on the impossible error path
+    
+    Just in case we end up with bogus data, don't leak.
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 9d097d5140857fad209ee5c2c8b5461aac54e81e
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Mon Mar 11 16:39:11 2013 +0000
+
+    sna/dri: Free chained swaps upon CloseWindow
+    
+    The assumption that the chained swaps are freed after the next vblank
+    turns out to be wrong, and in effect we would leak the bo if we
+    happened to submit the final swap faster than vrefresh and close the
+    window before the vblank.
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 2f6a9927952e25aa2a1628e66295f0903dcf865c
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Mon Mar 11 14:40:52 2013 +0000
+
+    sna/dri: Reorder assert to avoid NULL dereference
+    
+    Only try to dereference chain->draw after the check to see if it was
+    already destroyed.
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit cffdd1eed0ca344142c165788ce7a31b80f1f55f
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Mon Mar 11 14:16:27 2013 +0000
+
+    test: Try to exercise races between DRI2SwapBuffers and CloseWindow
+    
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
 commit 4fb7be0a0d4bf027ed254399b6b538e979f525f2
 Author: Chris Wilson <chris@chris-wilson.co.uk>
 Date:   Sun Mar 10 14:34:39 2013 +0000
diff --git a/debian/changelog b/debian/changelog
index 9443e79..708320c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-xserver-xorg-video-intel (2:2.21.4-1) UNRELEASED; urgency=low
+xserver-xorg-video-intel (2:2.21.5-1) UNRELEASED; urgency=low
 
   [ Timo Aaltonen ]
   * New upstream release.

commit 4adebfed415cf58599b22e873f32e7ce2eaa6542
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Mar 21 08:53:12 2013 +0000

    2.21.5 release

diff --git a/NEWS b/NEWS
index cb82e52..05a20fa 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,42 @@
+Release 2.21.5 (2013-03-21)
+===========================
+Haswell reintroduces a command to load the scanline window from the
+command stream and so requires its own specialised wait-for-vsync routine
+- failure to do so was then causing hangs when trying to do tearfree video
+or use a compositor.
+
+ * Prevent buffer leak if a non-fullscreen Window is closed with multiple
+   pending swap events.
+
+ * Fix offset transformation for fallback gradient paths.
+   https://bugs.freedesktop.org/show_bug.cgi?id=62198
+
+ * Prevent Glamor from crashing if misconfigured.
+   Thanks to Michel Dänzer.
+
+ * Prevent UXA from crashing if torn down during PreInit.
+   Thanks to Aaron Plattner.
+
+ * Prevent miscompilation with different functional units having different
+   compiler flags. Some functions were expected to be inlined and so
+   recompiled with the current target. However, some compilers were
+   choosing to emit subroutine calls instead without noticing that the
+   ABI was different between the caller and callee - causing corruption.
+   https://bugs.freedesktop.org/show_bug.cgi?id=62198
+
+ * Fix rendering of CompositeTriFan with recent Xorg.
+
+ * Apply the video src-offset fix highlighted in the last release!
+   A typo prevented the fix from working for gen4+.
+   https://bugs.freedesktop.org/show_bug.cgi?id=62343
+
+ * Fix rendering of multiple glyphs to very large destination surfaces
+   https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1156387
+
+ * Fix scanline waits for Haswell
+   https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1156679
+
+
 Release 2.21.4 (2013-03-11)
 ===========================
 More bugs, more fixes, more releases. A minor new feature being introduced
diff --git a/configure.ac b/configure.ac
index 8fea817..de3990d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-intel],
-        [2.21.4],
+        [2.21.5],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-intel])
 AC_CONFIG_SRCDIR([Makefile.am])

commit a2126bbef31d05c508fcdd8b6102f5d1c3d9193d
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Wed Mar 20 16:34:55 2013 +0100

    Add valgrind to build-depends.

diff --git a/debian/changelog b/debian/changelog
index 036c71b..9443e79 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,11 @@
 xserver-xorg-video-intel (2:2.21.4-1) UNRELEASED; urgency=low
 
+  [ Timo Aaltonen ]
   * New upstream release.
 
+  [ Maarten Lankhorst ]
+  * Add valgrind to build-depends.
+
  -- Timo Aaltonen <tjaalton@ubuntu.com>  Fri, 07 Dec 2012 09:33:39 +0200
 
 xserver-xorg-video-intel (2:2.20.14-1) experimental; urgency=low
diff --git a/debian/control b/debian/control
index 772720a..db02f76 100644
--- a/debian/control
+++ b/debian/control
@@ -33,6 +33,7 @@ Build-Depends:
  libudev-dev [linux-any],
  quilt,
  xutils-dev (>= 1:7.5+4),
+ valgrind,
 Standards-Version: 3.9.3
 Vcs-Git: git://git.debian.org/git/pkg-xorg/driver/xserver-xorg-video-intel
 Vcs-Browser: http://git.debian.org/?p=pkg-xorg/driver/xserver-xorg-video-intel.git

commit 1aca872ee51e10908dcc4979596ae69732e9a02a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Mar 19 08:26:01 2013 +0000

    sna: Haswell reintroduces MI_LOAD_SCAN_LINES
    
    Better late than never? Interestingly only available from the BLT ring,
    which makes accurate waiting for XVideo (which must use the render ring)
    impossible in the current form - we need to render to a temporary then
    do a vsynced blit in this case.
    
    References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1156679
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index abb340a..9068df9 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -2806,12 +2806,46 @@ sna_covering_crtc(ScrnInfoPtr scrn,
 	return best_crtc;
 }
 
+static bool sna_emit_wait_for_scanline_hsw(struct sna *sna,
+					   xf86CrtcPtr crtc,
+					   int pipe, int y1, int y2,
+					   bool full_height)
+{
+	uint32_t event;
+	uint32_t *b;
+
+	if (sna->kgem.mode != KGEM_BLT)
+		return false;
+
+	b = kgem_get_batch(&sna->kgem);
+	sna->kgem.nbatch += 5;
+
+	/* The documentation says that the LOAD_SCAN_LINES command
+	 * always comes in pairs. Don't ask me why. */
+	switch (pipe) {
+	case 0: event = 0; break;
+	case 1: event = 1 << 19; break;
+	case 2: event = 4 << 19; break;
+	}
+	b[2] = b[0] = MI_LOAD_SCAN_LINES_INCL | event;
+	b[3] = b[1] = (y1 << 16) | (y2-1);
+
+	switch (pipe) {
+	case 0: event = 0; break;
+	case 1: event = 1 << 8; break;
+	case 2: event = 1 << 14; break;
+	}
+	b[4] = MI_WAIT_FOR_EVENT | event;
+
+	return true;
+}
+
 #define MI_LOAD_REGISTER_IMM			(0x22<<23)
 
-static bool sna_emit_wait_for_scanline_gen7(struct sna *sna,
-					    xf86CrtcPtr crtc,
-					    int pipe, int y1, int y2,
-					    bool full_height)
+static bool sna_emit_wait_for_scanline_ivb(struct sna *sna,
+					   xf86CrtcPtr crtc,
+					   int pipe, int y1, int y2,
+					   bool full_height)
 {
 	uint32_t *b;
 	uint32_t event;
@@ -3022,10 +3056,12 @@ sna_wait_for_scanline(struct sna *sna,
 
 	if (sna->kgem.gen >= 0100)
 		ret = false;
+	else if (sna->kgem.gen >= 075)
+		ret = sna_emit_wait_for_scanline_hsw(sna, crtc, pipe, y1, y2, full_height);
 	else if (sna->kgem.gen == 071)
 		ret =sna_emit_wait_for_scanline_gen6(sna, crtc, pipe, y1, y2, full_height);
 	else if (sna->kgem.gen >= 070)
-		ret = sna_emit_wait_for_scanline_gen7(sna, crtc, pipe, y1, y2, full_height);
+		ret = sna_emit_wait_for_scanline_ivb(sna, crtc, pipe, y1, y2, full_height);
 	else if (sna->kgem.gen >= 060)
 		ret =sna_emit_wait_for_scanline_gen6(sna, crtc, pipe, y1, y2, full_height);
 	else if (sna->kgem.gen >= 040)

commit f132452da14fd09a2a3926cc9c034cb2e8c2f1a9
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Mar 19 07:57:30 2013 +0000

    sna: Ignore vsync waits on tiny scanline ranges
    
    If the update is only a couple of lines tall, any tear will not be
    visible - so just ignore programming the wait into the GPU.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index a80a3c1..abb340a 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -3005,7 +3005,7 @@ sna_wait_for_scanline(struct sna *sna,
 	if (y2 > crtc->bounds.y2 - crtc->bounds.y1)
 		y2 = crtc->bounds.y2 - crtc->bounds.y1;
 	DBG(("%s: clipped range = %d, %d\n", __FUNCTION__, y1, y2));
-	if (y2 <= y1)
+	if (y2 <= y1 + 4)
 		return false;
 
 	full_height = y1 == 0 && y2 == crtc->bounds.y2 - crtc->bounds.y1;

commit 308f0208de59620190dd3cb65b3243d2e8a7bd87
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Mar 18 15:04:22 2013 +0000

    sna: Reset operation state between glyphs
    
    We are not resetting sufficient state between operations as we presume
    that all callers of Composite() currently pass in a blank state. In the
    long run, we want to remove that burden and do a minimal initialisation.
    
    References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1156387
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index 2f44113..3e2d79b 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -673,8 +673,6 @@ glyphs_slow(struct sna *sna,
 	if (NO_GLYPHS_SLOW)
 		return false;
 
-	memset(&tmp, 0, sizeof(tmp));
-
 	DBG(("%s(op=%d, src=(%d, %d), nlist=%d,  dst=(%d, %d)+(%d, %d))\n",
 	     __FUNCTION__, op, src_x, src_y, nlist,
 	     list->xOff, list->yOff, dst->pDrawable->x, dst->pDrawable->y));
@@ -740,7 +738,7 @@ glyphs_slow(struct sna *sna,
 						   y - glyph->info.y,
 						   glyph->info.width,
 						   glyph->info.height,
-						   &tmp))
+						   memset(&tmp, 0, sizeof(tmp))))
 				return false;
 
 			rects = REGION_RECTS(dst->pCompositeClip);

commit 4a37d57f9633bbd29f308239c1cd956767b277c0
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Mar 18 15:00:01 2013 +0000

    sna: Add a pair of sanity checks before creating the redirection target
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index 6a2438f..2e29d95 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -1873,6 +1873,8 @@ sna_render_composite_redirect(struct sna *sna,
 	int bpp = op->dst.pixmap->drawable.bitsPerPixel;
 	struct kgem_bo *bo;
 
+	assert(t->real_bo == NULL);
+
 #if NO_REDIRECT
 	return false;
 #endif
@@ -1954,6 +1956,7 @@ sna_render_composite_redirect(struct sna *sna,
 			t->real_bo = op->dst.bo;
 			t->real_damage = op->damage;
 			if (op->damage) {
+				assert(!DAMAGE_IS_ALL(op->damage));
 				t->damage = sna_damage_create();
 				op->damage = &t->damage;
 			}

commit 28371a34fa83f70a7af3c8d3bfd6c7cef9e35073
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Mar 18 14:49:58 2013 +0000

    sna: Skip processing an all-clipped-out glyph
    
    Along the slow path, skip all processing of glyphs that are not visible.
    This is important as the slow path handles the per-glyph redirection
    case, which is much more expensive.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna.h b/src/sna/sna.h
index a244b97..13a5ce3 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -864,6 +864,21 @@ inline static bool is_clipped(const RegionRec *r,
 		r->extents.y2 - r->extents.y1 != d->height);
 }
 
+inline static bool
+box_intersect(BoxPtr a, const BoxRec *b)
+{
+	if (a->x1 < b->x1)
+		a->x1 = b->x1;
+	if (a->x2 > b->x2)
+		a->x2 = b->x2;
+	if (a->y1 < b->y1)
+		a->y1 = b->y1;
+	if (a->y2 > b->y2)
+		a->y2 = b->y2;
+
+	return a->x1 < a->x2 && a->y1 < a->y2;
+}
+
 unsigned sna_cpu_detect(void);
 char *sna_cpu_features_to_string(unsigned features, char *line);
 
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index f654c1a..a2528f6 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4727,21 +4727,6 @@ typedef void (*sna_copy_func)(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 			      RegionPtr region, int dx, int dy,
 			      Pixel bitPlane, void *closure);
 
-inline static bool
-box_intersect(BoxPtr a, const BoxRec *b)
-{
-	if (a->x1 < b->x1)
-		a->x1 = b->x1;
-	if (a->x2 > b->x2)
-		a->x2 = b->x2;
-	if (a->y1 < b->y1)
-		a->y1 = b->y1;
-	if (a->y2 > b->y2)
-		a->y2 = b->y2;
-
-	return a->x1 < a->x2 && a->y1 < a->y2;
-}
-
 static RegionPtr
 sna_do_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 	    int sx, int sy,
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index 3b1cf37..2f44113 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -692,11 +692,21 @@ glyphs_slow(struct sna *sna,
 			GlyphPtr glyph = *glyphs++;
 			struct sna_glyph priv;
 			BoxPtr rects;
+			BoxRec box;
 			int nrect;
 
 			if (!glyph_valid(glyph))
 				goto next_glyph;
 
+			box.x1 = x - glyph->info.x;
+			box.y1 = y - glyph->info.y;
+			box.x2 = bound(box.x1, glyph->info.width);
+			box.y2 = bound(box.y1, glyph->info.height);
+
+			if (!box_intersect(&box,
+					   &dst->pCompositeClip->extents))
+				goto next_glyph;
+
 			priv = *sna_glyph(glyph);
 			if (priv.atlas == NULL) {
 				if (!glyph_cache(screen, &sna->render, glyph)) {
diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c
index 41322ad..540f3a6 100644
--- a/src/sna/sna_io.c
+++ b/src/sna/sna_io.c
@@ -41,21 +41,6 @@
 
 /* XXX Need to avoid using GTT fenced access for I915_TILING_Y on 855GM */
 
-static bool
-box_intersect(BoxPtr a, const BoxRec *b)
-{
-	if (a->x1 < b->x1)
-		a->x1 = b->x1;
-	if (a->x2 > b->x2)
-		a->x2 = b->x2;
-	if (a->y1 < b->y1)
-		a->y1 = b->y1;
-	if (a->y2 > b->y2)
-		a->y2 = b->y2;
-
-	return a->x1 < a->x2 && a->y1 < a->y2;
-}
-
 static inline bool upload_too_large(struct sna *sna, int width, int height)
 {
 	return width * height * 4 > sna->kgem.max_upload_tile_size;
diff --git a/src/sna/sna_tiling.c b/src/sna/sna_tiling.c
index 019b50a..02ab59d 100644
--- a/src/sna/sna_tiling.c
+++ b/src/sna/sna_tiling.c
@@ -795,21 +795,6 @@ done:
 	return ret;
 }
 
-static bool
-box_intersect(BoxPtr a, const BoxRec *b)
-{
-	if (a->x1 < b->x1)
-		a->x1 = b->x1;
-	if (a->x2 > b->x2)
-		a->x2 = b->x2;
-	if (a->y1 < b->y1)
-		a->y1 = b->y1;
-	if (a->y2 > b->y2)
-		a->y2 = b->y2;
-
-	return a->x1 < a->x2 && a->y1 < a->y2;
-}
-
 bool
 sna_tiling_copy_boxes(struct sna *sna, uint8_t alu,
 		      PixmapPtr src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy,

commit 16dac417c8049d65b3641e0f662865772faad61f
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Mar 17 21:56:56 2013 +0000

    sna/dri: Fix stale Pixmap detection
    
    NB the back buffer is not associated with the Drawable and so has no
    pixmap field set. Hence comparing the front->pixmap against the
    back->pixmap was always rejecting the blit. All we can check is that
    front->pixmap corresponds with the current Drawable and so reject stale
    configuration.
    
    Reported-by: Jiri Slaby <jirislaby@gmail.com>
    References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 2d3a262..1a02449 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -884,8 +884,13 @@ can_blit(struct sna * sna,
 	if (draw->type == DRAWABLE_PIXMAP)
 		return true;
 
-	if (get_private(front)->pixmap != get_private(back)->pixmap)
+	if (get_private(front)->pixmap != get_drawable_pixmap(draw)) {
+		DBG(("%s: reject as front pixmap=%ld, but expecting pixmap=%ld\n",
+		     __FUNCTION__,
+		     get_private(front)->pixmap ? get_private(front)->pixmap->drawable.serialNumber : 0,
+		     get_drawable_pixmap(draw)->drawable.serialNumber));
 		return false;
+	}
 
 	clip = &((WindowPtr)draw)->clipList;
 	w = clip->extents.x2 - draw->x;

commit 85213d5d450eec5696496128c1acecb5ca13c53b
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Mar 17 21:42:48 2013 +0000

    sna: Don't remove the flush flag for userptr bo
    
    This flag is far too overload with meaning, but for now this prevents us
    attempting to call free() on a SHM segment.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index a01da88..e0d864d 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1752,7 +1752,8 @@ static void __kgem_bo_destroy(struct kgem *kgem, struct kgem_bo *bo)
 			kgem_bo_move_to_snoop(kgem, bo);
 		return;
 	}
-	bo->flush = false;
+	if (!IS_USER_MAP(bo->map))
+		bo->flush = false;
 
 	if (bo->scanout) {
 		kgem_bo_move_to_scanout(kgem, bo);

commit c5b901a635a9c8c74017682d17cfcd93031907b4
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Mar 16 10:54:51 2013 +0000

    sna/dri: Clear flush flag upon bo destroy
    
    Fixes sanity checks that we do not leak the flushing status, nor
    invoke an operation upon an unflushed bo.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 31e110e..a01da88 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1515,6 +1515,7 @@ inline static void kgem_bo_move_to_inactive(struct kgem *kgem,
 	assert(!bo->io);
 	assert(!bo->scanout);
 	assert(!bo->snoop);
+	assert(!bo->flush);
 	assert(!bo->needs_flush);
 	assert(list_is_empty(&bo->vma));
 	ASSERT_IDLE(kgem, bo->handle);
@@ -1635,6 +1636,7 @@ static void kgem_bo_move_to_scanout(struct kgem *kgem, struct kgem_bo *bo)
 	assert(bo->refcnt == 0);
 	assert(bo->scanout);
 	assert(bo->delta);
+	assert(!bo->flush);
 	assert(!bo->snoop);
 	assert(!bo->io);
 
@@ -1750,6 +1752,7 @@ static void __kgem_bo_destroy(struct kgem *kgem, struct kgem_bo *bo)
 			kgem_bo_move_to_snoop(kgem, bo);
 		return;
 	}
+	bo->flush = false;
 
 	if (bo->scanout) {
 		kgem_bo_move_to_scanout(kgem, bo);
@@ -1769,6 +1772,7 @@ static void __kgem_bo_destroy(struct kgem *kgem, struct kgem_bo *bo)
 
 	assert(list_is_empty(&bo->vma));
 	assert(list_is_empty(&bo->list));
+	assert(bo->flush == false);
 	assert(bo->snoop == false);
 	assert(bo->io == false);
 	assert(bo->scanout == false);
@@ -3554,6 +3558,7 @@ struct kgem_bo *kgem_create_2d(struct kgem *kgem,
 			assert(bo->scanout);
 			assert(bo->delta);
 			assert(!bo->purged);
+			assert(!bo->flush);
 
 			if (size > num_pages(bo) || num_pages(bo) > 2*size)
 				continue;
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 19fe1e3..f654c1a 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2442,6 +2442,9 @@ static inline struct sna_pixmap *
 sna_pixmap_mark_active(struct sna *sna, struct sna_pixmap *priv)
 {
 	assert(priv->gpu_bo);
+	DBG(("%s: pixmap=%ld, handle=%u\n", __FUNCTION__,
+	     priv->pixmap->drawable.serialNumber,
+	     priv->gpu_bo->handle));
 	return priv;
 }
 
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c


Reply to: