xserver-xorg-video-intel: Changes to 'debian-experimental'
ChangeLog | 415 ++++++++++++++++++++++++++++++++++++++++++
NEWS | 28 ++
configure.ac | 16 +
debian/changelog | 4
src/compat-api.h | 1
src/intel.h | 7
src/intel_display.c | 30 +--
src/intel_dri.c | 13 +
src/intel_driver.c | 5
src/intel_module.c | 18 +
src/intel_options.h | 3
src/legacy/i810/i810_driver.c | 2
src/sna/blt.c | 117 +++++++++++
src/sna/fb/fb.h | 1
src/sna/fb/fbgc.c | 6
src/sna/gen3_render.c | 8
src/sna/gen5_render.c | 12 -
src/sna/gen6_render.c | 8
src/sna/gen7_render.c | 13 -
src/sna/kgem.c | 67 ++++++
src/sna/kgem.h | 11 -
src/sna/sna.h | 8
src/sna/sna_accel.c | 148 ++++----------
src/sna/sna_blt.c | 29 +-
src/sna/sna_composite.c | 6
src/sna/sna_display.c | 42 +++-
src/sna/sna_dri.c | 167 ++++++++--------
src/sna/sna_driver.c | 5
src/sna/sna_io.c | 98 +++++++++
src/sna/sna_render_inline.h | 19 +
src/sna/sna_video.c | 33 +--
uxa/uxa-priv.h | 1
32 files changed, 1050 insertions(+), 291 deletions(-)
New commits:
commit ea6022adbe3ad28b7f52126f92d74cf1a9f6d07d
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date: Sat Sep 29 16:42:59 2012 +0300
update the changelog
diff --git a/ChangeLog b/ChangeLog
index e0c1dac..9f7f945 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,418 @@
+commit a192f8cbc238d84e058b01b7682abe7ef09d3508
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sat Sep 29 10:51:00 2012 +0100
+
+ 2.20.9 release
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 16860d448f11ba405050bd1ff02dc63a4b26280c
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sat Sep 29 10:40:51 2012 +0100
+
+ uxa: Only destroy the bufmgr if it exists
+
+ Be wary in case the Screen is destroy before we initialise bufmgr.
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 13f7a9e267fbefd3326569e89b840bef31d77996
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Fri Sep 28 09:25:12 2012 +0100
+
+ sna: Restore LLC cache level after using a buffer for scanout (uncached)
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 8bfd31e9bb13bcb7f12e4147bec0da87b8e87dde
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu Sep 27 18:12:11 2012 +0100
+
+ sna/dri: Improve handling of flipping with no outputs
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit dddb6e4e63d5cc8b2a1f2ae3ff287922d30460b9
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu Sep 27 17:17:30 2012 +0100
+
+ sna: Attempt to restore the current mode if pipe is disabled on DPMS on
+
+ If we attempt to power up the pipe through a DPMS request, but it was
+ previously disabled due to an error, first try re-enabling.
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 88cfd23379950d1fe4e682519c48ef6e3091c2f3
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu Sep 27 16:16:39 2012 +0100
+
+ uxa: Update mode->fb_id after completing pageflips
+
+ As intel_crtc_on() depends upon the current value for determining if the
+ pipe is active, we can only change the value afterwards.
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 83990c649cbd3cb563d08f04e1c02232c44997aa
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu Sep 27 14:58:26 2012 +0100
+
+ Remove the last couple of references to mibstore
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit cb0b72c4fbb7b1bc941522d8679fef856f2f8936
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu Sep 27 14:53:46 2012 +0100
+
+ uxa: Fixup the last couple of commits after realising I didn't have uxa enabled
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit feef53005b57d6b4489a15f8d0db8245dcb0cfaa
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu Sep 27 13:36:55 2012 +0100
+
+ uxa: Do not attempt to pageflip whilst not master
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 5a45cbacb777e478d8fbda9223b0fb5c705d7249
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu Sep 27 13:31:27 2012 +0100
+
+ uxa: Confirm the pipe is alive before flipping
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit edc5b7f741a4bb8e9a58b5eb2201fa9304f94ef7
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu Sep 27 13:27:20 2012 +0100
+
+ uxa/dri: Confirm Drawable is still attached to an active pipe before flipping
+
+ If we schedule a flip to happen on a far distant vblank, it is possible
+ for us to disable the pipes with a modeset, whilst maintaining the fb
+ size, or with a DPMS command. If the pipe is disabled and we still try
+ to flip, then we trigger an EINVAL error from the kernel.
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit eb667378543f97d7c7e7767daddbd9b39e07c1f8
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Wed Sep 26 15:12:57 2012 +0100
+
+ sna: Typo in DBG
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 557ad78d02dfff3db9e7fc21f05230a8fe482f7c
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Wed Sep 26 15:02:17 2012 +0100
+
+ Kill mibstore pretend backwards compatibility
+
+ Adam Jackson was kind enough to point out that mibstore had been a no-op
+ since xorg-1.4 and the earliest we claim to support is xorg-1.6.
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 367f57faf2c422da026a25c099426dc750cf3759
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Wed Sep 26 14:06:18 2012 +0100
+
+ sna/video: Force integer promotion to avoid u16 overflow for frame size
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 34772cb0e724a880a8c6db936c0bb5dd129398f2
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Wed Sep 26 12:09:39 2012 +0100
+
+ sna/dri: Handle pending flips when drawable disappears.
+
+ The async case needs special handling as the current front buffer may be
+ pending a flip onto the scanout which needs to be completed even if the
+ Drawable is destroyed.
+
+ Fixes regression from commit ad877abdc70b842afd202b2f97892d97a0b8d151
+ Author: Chris Wilson <chris@chris-wilson.co.uk>
+ Date: Sat Jul 7 17:48:52 2012 +0100
+
+ sna/dri: Attach the chain of frame events to the Window, not pixmap
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit addfa653cf51fa45c7eae49be1fd722aaadf97d6
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Wed Sep 26 08:59:18 2012 +0100
+
+ uxa: Prevent attempting to call intel_mode_fini() before PreInit runs
+
+ In the Ubuntu xserver it is apparently possible for the Screen to be
+ deleted prior to being fully initialised. Make sure we don't crash in
+ that situation!
+
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55346
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit b880d8e0a9a32acd50333f72d695268c4819c29e
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue Sep 25 16:59:20 2012 +0100
+
+ sna/gen5: Add WA reference
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 74f930fd80c3f97a1b6213e9e79e02f8f51c64b9
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue Sep 25 15:41:51 2012 +0100
+
+ sna: Make sure the batch is flushed before setting DPMS
+
+ Just in case on the off-chance that the kernel modifies the pipe and we
+ had a pipe-dependent operation in the batch.
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 0a00c3765c3ba464bb4e9cde12e964c979421ed6
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue Sep 25 13:50:33 2012 +0100
+
+ sna: Accommodate changes to the Damage extension not unwrapping the GC
+
+ commit 4dc2a76740d921c824a4d8193f39dd373475f02a
+ Author: Adam Jackson <ajax@redhat.com>
+ Date: Thu Sep 20 17:57:00 2012 -0400
+
+ miext/damage: Only wrap into the GC ops chain if there's a listener (v3)
+
+ leaves the GC->funcs still pointing to the damage layer as it calls into
+ the driver functions, so we need to be careful to restore the correct
+ function table after we manipulate the GC for fallbacks.
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 8f5a6d107bb30fa218ff3c1d07532ca834b82edc
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue Sep 25 13:36:12 2012 +0100
+
+ Add miInitializeBackingStore() to compat-api.h
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit dee133a722fb137767a78b244a312620f52a51b1
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue Sep 25 13:22:40 2012 +0100
+
+ sna: Remove unused reference to mibstore.h, removed in future Xorg
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit f0dbfc20aaa9b47329438ce42150770d4d7934c3
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue Sep 25 13:22:21 2012 +0100
+
+ sna/dri: Fixup a DBG statement not to print gibberish
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit c6008068372709c73034163eddc902b47bf87d24
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sun Sep 23 21:42:31 2012 +0100
+
+ sna: Check against op->dst.bo rather than priv->cpu_bo for composite upload
+
+ In this case, we may also be handling an unattached pixmap, so avoid the
+ deferences of the sna_pixmap unless we are sure it will exist.
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 5ed840881c26e90eb8e00521b6d77b0ea514de5e
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sun Sep 23 20:29:21 2012 +0100
+
+ sna: Check that the CPU bo exists before declaring it is busy along upload
+
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55251
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit a858afc66c1fa2eec65a7041e991f2266f82deca
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sun Sep 23 13:49:40 2012 +0100
+
+ Silence a couple of potential compiler warnings
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 9326acc2917109f06dda809107c8fa5a2273c3d2
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sun Sep 23 13:40:04 2012 +0100
+
+ Allow compilation of a separate i810 driver
+
+ Allow --enable-ums-only as a counter-option to --enable-kms-only in case
+ the distribution wishes to enable a non-root KMS driver but also offer
+ a separate UMS driver for i81x.
+
+ On the second pass, use "--enable-ums-only --disable-uxa --disable-sna"
+ to get the trimmed down unaccelerated i810 support.
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 0afb7efe8c48b5fc839e2137e870bea0f5fb3c9c
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sun Sep 23 09:41:59 2012 +0100
+
+ sna: Avoid overflows when translating the box16 extents during a copy
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 0fc6e5820e4543d52bcf8d0285ca6f69b5213831
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sun Sep 23 09:32:49 2012 +0100
+
+ sna: Add missing protection against int16 overflow when copying
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit c2ca1c5abca687adb08d6e137bc3b70bdecb083d
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sun Sep 23 08:56:50 2012 +0100
+
+ Reorder INTEL_XVMC define so that we pick up Option "XvMC"
+
+ Otherwise it will remain disabled.
+
+ Reported-by: Giacomo Comes <comes@naic.edu>
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 92dbedc6138b923aa473935013ecb0346280c4d3
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sat Sep 22 08:56:49 2012 +0100
+
+ sna: Force the stall before trying to upload into a busy CPU bo
+
+ Under the circumstances where we can not instead stream the write into
+ the GPU bo, we need to use the busy CPU bo.
+
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54978
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 3e1be265cf950976b5929b14a9dad0664deaa2c1
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Fri Sep 21 17:37:58 2012 +0100
+
+ sna: Force an inplace upload if already wedged
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit b8967aff382c1b6bef2335dea51c979a3f0800c7
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Fri Sep 21 12:16:27 2012 +0100
+
+ sna: Do not query for the NULL edid property
+
+ If the EDID blob id is set to 0, that means that it does not exist and
+ so we can safely skip it.
+
+ References: https://bugs.freedesktop.org/show_bug.cgi?id=55193
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 0be1d964713ca407f029278a8256d02d925dc9da
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue Sep 11 21:48:24 2012 +0100
+
+ sna: Use inplace X tiling for LLC uploads
+
+ Based on a suggestion by Chad Versace (taken from a patch for mesa).
+
+ This allows for a faster upload of pixel data through a ShmImage, or for
+ complete replacement of a GPU bo.
+
+ Using a modified version of x11perf to upload to a pixmap rather than
+ scanout on an IVB i7-3720qm:
+
+ Before:
+ 40000000 trep @ 0.0007 msec (1410000.0/sec): ShmPutImage 10x10 square
+ 4000000 trep @ 0.0110 msec ( 90700.0/sec): ShmPutImage 100x100 square
+ 160000 trep @ 0.1689 msec ( 5920.0/sec): ShmPutImage 500x500 square
+
+ After:
+ 40000000 trep @ 0.0007 msec (1450000.0/sec): ShmPutImage 10x10 square
+ 6000000 trep @ 0.0061 msec ( 164000.0/sec): ShmPutImage 100x100 square
+ 400000 trep @ 0.1126 msec ( 8880.0/sec): ShmPutImage 500x500 square
+
+ However, the real takeaway from this is that the overheads for
+ ShmPutImage are substantial, only hitting around 70% expected efficiency,
+ and overshadowed by PutImage, which for reference is
+
+ 60000000 trep @ 0.0006 msec (1800000.0/sec): PutImage 10x10 square
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit d853064e7eebc5719645c12605782f995131a6fe
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu Sep 20 22:43:26 2012 +0100
+
+ sna/gen3+: Trim the target extents to the CompositeClip
+
+ When computing the active region with of a composite operation with
+ unknown extents we try to simply use the whole Drawable. However, this
+ needs to be clipped otherwise it may trigger assertion failure with an
+ offscreen pixmap.
+
+ References: https://bugs.freedesktop.org/show_bug.cgi?id=55164
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 853beff4306d5a168e310af82d0ddf9db319fdce
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Wed Sep 19 08:30:59 2012 +0100
+
+ sna/dri:Add some DBG and assertions to validate names passed back to clients
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 8c1e60a15431b193b57d94a27b8e8de7c5a7e683
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue Sep 18 15:01:52 2012 +0100
+
+ sna: Add some asserts useful for tracking an xserver drawing bug
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit cd23ac69ffb670468b2993242ce0d596081bbca4
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue Sep 18 13:39:33 2012 +0100
+
+ sna/gen7: Add some ring switching sanity checks
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 22c84d02ade83c39940d76fc616a9122e535606a
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue Sep 18 12:01:49 2012 +0100
+
+ sna: Remove special casing of drawing depth=1 glyphs
+
+ It turns out that they were not so special after all, and the "fast
+ path" was missing the important handling such as validating the GC. As a
+ result we ended up trying to render the glyphs through a planemask of 0
+ and similar garbage resulting in corruption. An example given by Kaus
+ Dittrich was the use of rotated glyphs in gnuplot.
+
+ Reported-by: Klaus Dittrich
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 71fa350325bb06a6141f89ef14431d96f0c4956a
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Mon Sep 17 13:40:24 2012 +0100
+
+ sna: Check that we do not keep a GPU bo around after flushing a ShmPixmap
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
commit 88502b32d5d2b826fc08344392c98300341410e1
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Sun Sep 16 09:02:46 2012 +0100
diff --git a/debian/changelog b/debian/changelog
index e6479df..befb455 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
-xserver-xorg-video-intel (2:2.20.8-1) UNRELEASED; urgency=low
+xserver-xorg-video-intel (2:2.20.9-1) UNRELEASED; urgency=low
* New upstream bugfix release.
+ - Fixes a long-standing bug in UXA pageflip code that was the
+ source of many GPU and application crashes.
-- Timo Aaltonen <tjaalton@ubuntu.com> Wed, 05 Sep 2012 17:07:07 +0300
commit a192f8cbc238d84e058b01b7682abe7ef09d3508
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Sat Sep 29 10:51:00 2012 +0100
2.20.9 release
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/NEWS b/NEWS
index 62ec266..2cc2353 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,31 @@
+Release 2.20.9 (2012-09-29)
+===========================
+And so it came to pass that a critical bug was uncovered in UXA. The
+kernel does not like to pageflip when the pipe is off, yet due to the
+delayed nature of a pageflip and the relaxed checking performed by UXA,
+we could request a pageflip after turning off the display (DPMS). The
+kernel rejected that pageflip and the error handling path failed to
+restore sanity, and when the screen came back it was stuck on the image
+seen before it went to sleep. (Note that there are also some related
+kernel bugs, but this update should prevent the most conspicious of the
+freezes.) Many thanks to Timo Aaltonen for his efforts in tracking down
+the issue.
+
+In other news:
+
+ * Prepare for xorg-1.4, the api is being tweaked again.
+
+ * Handle early FreeScreen in UXA.
+ https://bugs.freedesktop.org/show_bug.cgi?id=55346
+
+ * Reenable XvMC support
+
+ * Do not replace the GPU bo when uploading into the shadow/CPU copy
+ https://bugs.freedesktop.org/show_bug.cgi?id=54978
+
+ * Fix use of an uninitialised GC when drawing glyphs to a depth=1 pixmap
+
+
Release 2.20.8 (2012-09-16)
===========================
Another new small feature, another new release. And a few more bugs
diff --git a/configure.ac b/configure.ac
index 1cd5a92..c961d85 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-video-intel],
- [2.20.8],
+ [2.20.9],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-video-intel])
AC_CONFIG_SRCDIR([Makefile.am])
commit 16860d448f11ba405050bd1ff02dc63a4b26280c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Sat Sep 29 10:40:51 2012 +0100
uxa: Only destroy the bufmgr if it exists
Be wary in case the Screen is destroy before we initialise bufmgr.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/src/intel_driver.c b/src/intel_driver.c
index f338a36..65a5008 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -328,6 +328,9 @@ static int intel_init_bufmgr(intel_screen_private *intel)
static void intel_bufmgr_fini(intel_screen_private *intel)
{
+ if (intel->bufmgr == NULL)
+ return;
+
drm_intel_bo_unreference(intel->wa_scratch_bo);
drm_intel_bufmgr_destroy(intel->bufmgr);
}
commit 13f7a9e267fbefd3326569e89b840bef31d77996
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Sep 28 09:25:12 2012 +0100
sna: Restore LLC cache level after using a buffer for scanout (uncached)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 0ea14f0..7826aad 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1354,6 +1354,10 @@ static void kgem_bo_clear_scanout(struct kgem *kgem, struct kgem_bo *bo)
bo->needs_flush = true;
bo->flush = false;
bo->reusable = true;
+
+ if (kgem->has_llc &&
+ gem_set_cacheing(kgem->fd, bo->handle, SNOOPED))
+ bo->reusable = false;
}
static void _kgem_bo_delete_buffer(struct kgem *kgem, struct kgem_bo *bo)
commit 8bfd31e9bb13bcb7f12e4147bec0da87b8e87dde
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Sep 27 18:12:11 2012 +0100
sna/dri: Improve handling of flipping with no outputs
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 88dec3a..676636a 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -87,7 +87,7 @@ struct sna_dri_frame_event {
unsigned int fe_tv_sec;
unsigned int fe_tv_usec;
- struct {
+ struct dri_bo {
struct kgem_bo *bo;
uint32_t name;
} old_front, next_front, cache;
@@ -956,7 +956,7 @@ sna_dri_frame_event_info_free(struct sna *sna,
free(info);
}
-static bool
+static void
sna_dri_page_flip(struct sna *sna, struct sna_dri_frame_event *info)
{
struct kgem_bo *bo = get_private(info->back)->bo;
@@ -964,10 +964,9 @@ sna_dri_page_flip(struct sna *sna, struct sna_dri_frame_event *info)
DBG(("%s()\n", __FUNCTION__));
assert(sna_pixmap_get_buffer(sna->front) == info->front);
+ assert(get_drawable_pixmap(info->draw)->drawable.height * bo->pitch <= kgem_bo_size(bo));
info->count = sna_page_flip(sna, bo, info, info->pipe);
- if (info->count == 0)
- return false;
info->old_front.name = info->front->name;
info->old_front.bo = get_private(info->front)->bo;
@@ -976,7 +975,6 @@ sna_dri_page_flip(struct sna *sna, struct sna_dri_frame_event *info)
info->front->name = info->back->name;
get_private(info->front)->bo = bo;
- return true;
}
static bool
@@ -1261,8 +1259,8 @@ void sna_dri_vblank_handler(struct sna *sna, struct drm_event_vblank *event)
switch (info->type) {
case DRI2_FLIP:
/* If we can still flip... */
- if (can_flip(sna, draw, info->front, info->back) &&
- sna_dri_page_flip(sna, info)) {
+ if (can_flip(sna, draw, info->front, info->back)) {
+ sna_dri_page_flip(sna, info);
info->back->name = info->old_front.name;
get_private(info->back)->bo = info->old_front.bo;
info->old_front.bo = NULL;
@@ -1321,40 +1319,23 @@ done:
sna_dri_frame_event_info_free(sna, draw, info);
}
-static int
+static void
sna_dri_flip_continue(struct sna *sna, struct sna_dri_frame_event *info)
{
- struct kgem_bo *bo;
- int name;
+ struct dri_bo tmp;
DBG(("%s()\n", __FUNCTION__));
assert(sna_pixmap_get_buffer(get_drawable_pixmap(info->draw)) == info->front);
- name = info->back->name;
- bo = get_private(info->back)->bo;
- assert(get_drawable_pixmap(info->draw)->drawable.height * bo->pitch <= kgem_bo_size(bo));
+ tmp = info->old_front;
- info->count = sna_page_flip(sna, bo, info, info->pipe);
- if (info->count == 0)
- return false;
+ sna_dri_page_flip(sna, info);
- set_bo(sna->front, bo);
-
- get_private(info->back)->bo = info->old_front.bo;
- info->back->name = info->old_front.name;
-
- info->old_front.name = info->front->name;
- info->old_front.bo = get_private(info->front)->bo;
-
- info->front->name = name;
- get_private(info->front)->bo = bo;
+ get_private(info->back)->bo = tmp.bo;
+ info->back->name = tmp.name;
info->next_front.name = 0;
-
- sna->dri.flip_pending = info;
-
- return true;
}
static void sna_dri_flip_event(struct sna *sna,
@@ -1392,13 +1373,17 @@ static void sna_dri_flip_event(struct sna *sna,
DBG(("%s: flip chain complete\n", __FUNCTION__));
sna_dri_frame_event_info_free(sna, flip->draw, flip);
} else if (flip->draw &&
- can_flip(sna, flip->draw, flip->front, flip->back) &&
- sna_dri_flip_continue(sna, flip)) {
+ can_flip(sna, flip->draw, flip->front, flip->back)) {
+ sna_dri_flip_continue(sna, flip);
DRI2SwapComplete(flip->client, flip->draw,
0, 0, 0,
DRI2_FLIP_COMPLETE,
flip->client ? flip->event_complete : NULL,
flip->event_data);
+ if (flip->count)
+ sna->dri.flip_pending = flip;
+ else
+ sna_dri_frame_event_info_free(sna, flip->draw, flip);
} else {
DBG(("%s: no longer able to flip\n", __FUNCTION__));
@@ -1513,8 +1498,16 @@ sna_dri_schedule_flip(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
VG_CLEAR(vbl);
pipe = sna_dri_get_pipe(draw);
- if (pipe == -1)
- return false;
+ if (pipe == -1) {
+ /* XXX WARN_ON(sna->dri.flip_pending) ? */
+ if (sna->dri.flip_pending == NULL) {
+ sna_dri_exchange_buffers(draw, front, back);
+ DRI2SwapComplete(client, draw, 0, 0, 0,
+ DRI2_EXCHANGE_COMPLETE, func, data);
+ return true;
+ } else
+ return false;
+ }
/* Truncate to match kernel interfaces; means occasional overflow
* misses, but that's generally not a big deal */
@@ -1560,13 +1553,19 @@ sna_dri_schedule_flip(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
sna_dri_reference_buffer(front);
sna_dri_reference_buffer(back);
- if (!sna_dri_page_flip(sna, info)) {
- DBG(("%s: failed to queue page flip\n", __FUNCTION__));
- sna_dri_frame_event_info_free(sna, draw, info);
- return false;
- }
+ sna_dri_page_flip(sna, info);
+
+ if (info->count == 0) {
+ info->back->name = info->old_front.name;
+ get_private(info->back)->bo = info->old_front.bo;
+ info->old_front.bo = NULL;
- if (type != DRI2_FLIP) {
+ DRI2SwapComplete(info->client, draw, 0, 0, 0,
+ DRI2_EXCHANGE_COMPLETE,
+ info->event_complete,
+ info->event_data);
+ sna_dri_frame_event_info_free(sna, draw, info);
+ } else if (type != DRI2_FLIP) {
get_private(info->back)->bo =
kgem_create_2d(&sna->kgem,
draw->width,
@@ -2011,10 +2010,7 @@ blit:
sna_dri_reference_buffer(front);
sna_dri_reference_buffer(back);
- if (!sna_dri_page_flip(sna, info)) {
- sna_dri_frame_event_info_free(sna, draw, info);
- goto blit;
- }
+ sna_dri_page_flip(sna, info);
info->next_front.name = info->front->name;
info->next_front.bo = get_private(info->front)->bo;
commit dddb6e4e63d5cc8b2a1f2ae3ff287922d30460b9
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Sep 27 17:17:30 2012 +0100
sna: Attempt to restore the current mode if pipe is disabled on DPMS on
If we attempt to power up the pipe through a DPMS request, but it was
previously disabled due to an error, first try re-enabling.
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 3c41a2a..61d1a9f 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -787,6 +787,8 @@ sna_crtc_disable(xf86CrtcPtr crtc)
kgem_bo_destroy(&sna->kgem, sna_crtc->bo);
sna_crtc->bo = NULL;
}
+
+ sna_crtc->dpms_mode = DPMSModeOff;
}
static void update_flush_interval(struct sna *sna)
@@ -824,15 +826,6 @@ static void update_flush_interval(struct sna *sna)
max_vrefresh, sna->vblank_interval));
}
-static void
-sna_crtc_dpms(xf86CrtcPtr crtc, int mode)
-{
- DBG(("%s(pipe %d, dpms mode -> %d):= active=%d\n",
- __FUNCTION__, to_sna_crtc(crtc)->pipe, mode, mode == DPMSModeOn));
- to_sna_crtc(crtc)->dpms_mode = mode;
- update_flush_interval(to_sna(crtc->scrn));
-}
-
void sna_mode_disable_unused(struct sna *sna)
{
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(sna->scrn);
@@ -1289,6 +1282,28 @@ retry: /* Attach per-crtc pixmap or direct */
return TRUE;
}
+static void
+sna_crtc_dpms(xf86CrtcPtr crtc, int mode)
+{
+ struct sna_crtc *priv = to_sna_crtc(crtc);
+
+ DBG(("%s(pipe %d, dpms mode -> %d):= active=%d\n",
+ __FUNCTION__, priv->pipe, mode, mode == DPMSModeOn));
+ if (mode == DPMSModeOn) {
+ if (priv->bo == NULL &&
+ !sna_crtc_set_mode_major(crtc,
+ &crtc->mode, crtc->rotation,
+ crtc->x, crtc->y))
+ sna_crtc_disable(crtc);
+ } else
+ sna_crtc_disable(crtc);
+
+ if (priv->bo != NULL) {
+ priv->dpms_mode = mode;
+ update_flush_interval(to_sna(crtc->scrn));
+ }
+}
+
void sna_mode_adjust_frame(struct sna *sna, int x, int y)
{
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
@@ -1497,6 +1512,7 @@ sna_crtc_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num)
return;
sna_crtc->id = mode->kmode->crtcs[num];
+ sna_crtc->dpms_mode = DPMSModeOff;
VG_CLEAR(get_pipe);
get_pipe.pipe = 0;
commit 88cfd23379950d1fe4e682519c48ef6e3091c2f3
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Sep 27 16:16:39 2012 +0100
uxa: Update mode->fb_id after completing pageflips
As intel_crtc_on() depends upon the current value for determining if the
pipe is active, we can only change the value afterwards.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/src/intel_display.c b/src/intel_display.c
index ab73e24..b2a5904 100644
--- a/src/intel_display.c
+++ b/src/intel_display.c
@@ -705,7 +705,6 @@ intel_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
ScrnInfoPtr scrn = crtc->scrn;
intel_screen_private *intel = intel_get_screen_private(scrn);
dri_bo *bo;
- int ret;
if (ppix == intel_crtc->scanout_pixmap)
return TRUE;
@@ -725,11 +724,10 @@ intel_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
}
intel_crtc->scanout_pixmap = ppix;
- ret = drmModeAddFB(intel->drmSubFD, ppix->drawable.width,
+ return drmModeAddFB(intel->drmSubFD, ppix->drawable.width,
ppix->drawable.height, ppix->drawable.depth,
ppix->drawable.bitsPerPixel, ppix->devKind,
- bo->handle, &intel_crtc->scanout_fb_id);
- return TRUE;
+ bo->handle, &intel_crtc->scanout_fb_id) == 0;
}
#endif
@@ -1547,15 +1545,15 @@ intel_do_pageflip(intel_screen_private *intel,
struct intel_mode *mode = crtc->mode;
unsigned int pitch = scrn->displayWidth * intel->cpp;
struct intel_pageflip *flip;
- int i, old_fb_id;
+ uint32_t new_fb_id;
+ int i;
/*
* Create a new handle for the back buffer
*/
- old_fb_id = mode->fb_id;
if (drmModeAddFB(mode->fd, scrn->virtualX, scrn->virtualY,
scrn->depth, scrn->bitsPerPixel, pitch,
- new_front->handle, &mode->fb_id))
+ new_front->handle, &new_fb_id))
goto error_out;
intel_glamor_flush(intel);
@@ -1598,7 +1596,7 @@ intel_do_pageflip(intel_screen_private *intel,
if (drmModePageFlip(mode->fd,
crtc_id(crtc),
- mode->fb_id,
+ new_fb_id,
DRM_MODE_PAGE_FLIP_EVENT, flip)) {
xf86DrvMsg(scrn->scrnIndex, X_WARNING,
"flip queue failed: %s\n", strerror(errno));
@@ -1607,12 +1605,16 @@ intel_do_pageflip(intel_screen_private *intel,
}
}
- mode->old_fb_id = old_fb_id;
+ mode->old_fb_id = mode->fb_id;
+ mode->fb_id = new_fb_id;
return TRUE;
error_undo:
- drmModeRmFB(mode->fd, mode->fb_id);
- mode->fb_id = old_fb_id;
+ drmModeRmFB(mode->fd, new_fb_id);
+ for (i = 0; i < config->num_crtc; i++) {
+ if (config->crtc[i]->enabled)
+ intel_crtc_apply(config->crtc[i]);
+ }
error_out:
xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Page flip failed: %s\n",
commit 83990c649cbd3cb563d08f04e1c02232c44997aa
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Sep 27 14:58:26 2012 +0100
Remove the last couple of references to mibstore
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/src/legacy/i810/i810_driver.c b/src/legacy/i810/i810_driver.c
index fc6369e..9f684d2 100644
--- a/src/legacy/i810/i810_driver.c
+++ b/src/legacy/i810/i810_driver.c
@@ -58,7 +58,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "xf86cmap.h"
#include "compiler.h"
-#include "mibstore.h"
#include "vgaHW.h"
#include "mipointer.h"
#include "micmap.h"
@@ -1675,7 +1674,6 @@ I810ScreenInit(SCREEN_INIT_ARGS_DECL)
I810EmitFlush(scrn);
}
- miInitializeBackingStore(screen);
xf86SetBackingStore(screen);
xf86SetSilkenMouse(screen);
diff --git a/uxa/uxa-priv.h b/uxa/uxa-priv.h
index 91ef4e0..3f639e7 100644
--- a/uxa/uxa-priv.h
+++ b/uxa/uxa-priv.h
@@ -44,7 +44,6 @@
#include "pixmapstr.h"
#include "windowstr.h"
#include "servermd.h"
-#include "mibstore.h"
#include "colormapst.h"
#include "gcstruct.h"
#include "input.h"
commit cb0b72c4fbb7b1bc941522d8679fef856f2f8936
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Sep 27 14:53:46 2012 +0100
uxa: Fixup the last couple of commits after realising I didn't have uxa enabled
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/src/intel_dri.c b/src/intel_dri.c
index b0e4830..64cb567 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -924,7 +924,8 @@ I830DRI2ScheduleFlip(struct intel_screen_private *intel,
static Bool
can_exchange(DrawablePtr drawable, DRI2BufferPtr front, DRI2BufferPtr back)
{
- struct intel_screen_private *intel = intel_get_screen_private(xf86ScreenToScrn(drawable->pScreen));
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(drawable->pScreen);
+ struct intel_screen_private *intel = intel_get_screen_private(pScrn);
I830DRI2BufferPrivatePtr front_priv = front->driverPrivate;
I830DRI2BufferPrivatePtr back_priv = back->driverPrivate;
PixmapPtr front_pixmap = front_priv->pixmap;
@@ -935,7 +936,7 @@ can_exchange(DrawablePtr drawable, DRI2BufferPtr front, DRI2BufferPtr back)
Reply to: