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

xserver-xorg-video-intel: Changes to 'upstream-experimental'



 Makefile.am                |    2 
 NEWS                       |  106 +++++++++++++++++++++++++++++++++++++++++++++
 configure.ac               |    3 -
 libobj/Makefile.am         |    3 +
 libobj/ignore.c            |    6 ++
 src/intel_module.c         |    6 ++
 src/sna/Makefile.am        |    2 
 src/sna/sna.h              |   23 +++++----
 src/sna/sna_accel.c        |    3 -
 src/sna/sna_display.c      |   87 +++++++++++++++++++++++-------------
 src/sna/sna_dri2.c         |   52 ++++++++++------------
 src/sna/sna_dri3.c         |    5 --
 src/sna/sna_driver.c       |   18 ++++---
 src/sna/sna_video_sprite.c |   15 ++----
 src/uxa/intel_driver.c     |    6 +-
 test/dri2-race.c           |    2 
 test/dri2-swap.c           |    2 
 test/dri2-test.c           |    2 
 test/dri3-test.c           |   26 ++++++++---
 19 files changed, 262 insertions(+), 107 deletions(-)

New commits:
commit 8d95e90b7b4bf5d6bae5443f92d77d30f4443f24
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jul 23 15:45:31 2014 +0100

    2.99.914 snapshot

diff --git a/NEWS b/NEWS
index 72fe0bb..f5e8317 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,10 @@
+Snapshot 2.99.914 (2014-07-23)
+==============================
+And a brown paper bag to hide the rebuilding from the tarball with
+'autoreconf -fi' error that arose from not distributing the libobj/
+directory.
+
+
 Snapshot 2.99.913 (2014-07-23)
 ==============================
 This should be it... A few fixes from testing the new code, we should be
diff --git a/configure.ac b/configure.ac
index fd997fb..5c3dd20 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-intel],
-        [2.99.913],
+        [2.99.914],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-intel])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 57f0e65d5186412835f282af59141626e4a87a00
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jul 23 16:42:46 2014 +0100

    sna/dri2: Compile fix for old xorg/dri2
    
    We have to do conditional compilation as we touch structure members that
    may not exist in older Xserver headers.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index e4f1c84..9388992 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -3253,11 +3253,13 @@ bool sna_dri2_open(struct sna *sna, ScreenPtr screen)
 	driverNames[1] = info.driverName;
 #endif
 
+#if DRI2INFOREC_VERSION >= 6
 	if (xorg_can_triple_buffer(sna)) {
 		info.version = 6;
 		info.SwapLimitValidate = sna_dri2_swap_limit_validate;
 		info.ReuseBufferNotify = sna_dri2_reuse_buffer;
 	}
+#endif
 
 #if USE_ASYNC_SWAP
 	info.version = 10;

commit 4ed0937640b54246440421114b697f75d1b8c835
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jul 23 15:41:29 2014 +0100

    Add automake magic required for libobj/
    
    So libobj/ wasn't included in the tarball, and nor was the compatability
    functions being added to the driver when they were needed. The oddity is
    that using the ./configure script (and thus make distcheck) succeeds. It
    was only when 'autoreconf -fi' was run was the first error encoutered.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Reported-by: Tobias Klausmann

diff --git a/Makefile.am b/Makefile.am
index 6bb4854..418fdc9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,7 +20,7 @@
 
 ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4
 
-SUBDIRS = man xvmc src tools
+SUBDIRS = man libobj xvmc src tools
 
 MAINTAINERCLEANFILES = ChangeLog INSTALL
 
diff --git a/configure.ac b/configure.ac
index 280bfc9..fd997fb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -839,6 +839,7 @@ AC_DEFINE_DIR([LIBEXEC_PATH], libexecdir, [libexec directory])
 AC_CONFIG_FILES([
                 Makefile
                 man/Makefile
+		libobj/Makefile
                 src/Makefile
                 src/legacy/Makefile
                 src/legacy/i810/Makefile
diff --git a/libobj/Makefile.am b/libobj/Makefile.am
new file mode 100644
index 0000000..92c9ac5
--- /dev/null
+++ b/libobj/Makefile.am
@@ -0,0 +1,3 @@
+noinst_LTLIBRARIES = libcompat.la
+libcompat_la_SOURCES = ignore.c # for portability, always build something
+libcompat_la_LIBADD = $(LIBOBJS) $(ALLOCA)
diff --git a/libobj/ignore.c b/libobj/ignore.c
new file mode 100644
index 0000000..3c56f2f
--- /dev/null
+++ b/libobj/ignore.c
@@ -0,0 +1,6 @@
+extern void ignore(void);
+
+void ignore(void)
+{
+	/* libcompat.a cannot be empty therefore I exist */
+}
diff --git a/src/sna/Makefile.am b/src/sna/Makefile.am
index a299ea2..7ec1c36 100644
--- a/src/sna/Makefile.am
+++ b/src/sna/Makefile.am
@@ -35,7 +35,7 @@ endif
 
 noinst_LTLIBRARIES = libsna.la
 libsna_la_LDFLAGS = -pthread
-libsna_la_LIBADD = $(UDEV_LIBS) -lm $(DRM_LIBS) brw/libbrw.la fb/libfb.la
+libsna_la_LIBADD = $(UDEV_LIBS) -lm $(DRM_LIBS) brw/libbrw.la fb/libfb.la ../../libobj/libcompat.la
 
 libsna_la_SOURCES = \
 	atomic.h \

commit dcf9ce4a9f16c01f58797e4f899d51e23506aa6c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jul 23 14:19:44 2014 +0000

    Fix compile failure on old Xorg with XF86_ALLOCATE_GPU_SCREEN
    
    Sigh, a late fix was not compile checked against xorg-1.7.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/intel_module.c b/src/intel_module.c
index 969f2a7..d6a0d3c 100644
--- a/src/intel_module.c
+++ b/src/intel_module.c
@@ -50,6 +50,10 @@
 #include <xf86platformBus.h>
 #endif
 
+#ifndef XF86_ALLOCATE_GPU_SCREEN
+#define XF86_ALLOCATE_GPU_SCREEN 0
+#endif
+
 static const struct intel_device_info intel_generic_info = {
 	.gen = -1,
 };

commit 1c5e20716f192f0c38b4edd879d28e11126f7f01
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Jul 5 08:47:16 2014 +0100

    2.99.913 snapshot

diff --git a/NEWS b/NEWS
index f49ea51..72fe0bb 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,102 @@
+Snapshot 2.99.913 (2014-07-23)
+==============================
+This should be it... A few fixes from testing the new code, we should be
+ready for the final release. However, we do have one standout feature in
+this snapshot, we now officially recognise HD Graphics 5300/5500/5600,
+Iris Graphics 6100 and Iris Pro Graphics 6200/P6300 (formerly known as
+Broadwell).
+
+ * Check the window actually covers the CRTC before doing a single CRTC flip,
+   and then restore the right framebuffer after completing CRTC flips.
+   Otherwise we would detect an error and disable an output under TearFree
+   Regression in 2.99.912
+   https://bugs.freedesktop.org/show_bug.cgi?id=80191
+
+ * Fix framebuffer creation on kernels older than 3.11
+   Regression in 2.99.912
+
+ * Check that the damage still exists after implicit reduction
+   Regression in 2.99.912
+   https://bugs.freedesktop.org/show_bug.cgi?id=77436
+
+ * Fix direction flags for fallback composited CopyAreas which
+   caused scrolling corruption in a few configurations
+   Regression from 2.20.0
+   https://bugs.freedesktop.org/show_bug.cgi?id=79843
+
+ * Do not throw away damage if there is no redundant copy
+   https://bugs.freedesktop.org/show_bug.cgi?id=79992
+
+ * Check clipping on PolyRect before discarding the clipped damage
+   Regression from 2.99.903
+   https://bugs.freedesktop.org/show_bug.cgi?id=79992
+
+ * Fix hints for GLXPixmapa, as these are never swapped and so
+   miss invalidating the hints on SwapBuffers with the result
+   that they are often presumed blank
+   Regression in 2.99.912
+   https://bugs.freedesktop.org/show_bug.cgi?id=79999
+
+ * Fix incoherent choice of source bo when constructing 8x8 tiles,
+   incorrect pattern origin when extracting, and then fix the
+   alignment of colour patterns for BLT operations
+   https://bugs.freedesktop.org/show_bug.cgi?id=80033
+
+ * Disable blending with the render engine on snoopable buffers
+   https://bugs.freedesktop.org/show_bug.cgi?id=80253
+
+ * Restore throttling to prevent client lag under heavy GPU load
+   Regression from 2.21.10
+   https://bugs.freedesktop.org/show_bug.cgi?id=77436
+
+ * Use ClientGone for notifications on shared DRI2 windows to prevent
+   rare crashes due to use-after-free of the swap requests
+   https://bugs.freedesktop.org/show_bug.cgi?id=80157
+
+ * Ensure the mmaped CPU bo is idle before migrating damage
+   https://bugs.freedesktop.org/show_bug.cgi?id=80560
+
+ * Fix incorrect clipping by the render engine for large DRI2 windows
+
+ * Ensure that the aperture tiling fallbacks are bounded
+
+ * Validate parameter to xf86-video-intel-backlight-helper more carefully
+   (CVE-2014-4910)
+
+ * Fix slaved scanouts for reverse optimus, though rotated slaves will
+   require further patches to Xorg.
+   https://bugs.freedesktop.org/show_bug.cgi?id=81383
+
+ * Fix build without Composite extension.
+
+ * Fix build without gettline().
+
+ * UXA: Allocate and resize frontbuffer consistently to pass sanity checks
+   https://bugs.freedesktop.org/show_bug.cgi?id=80088
+
+ * UXA: Report cached backlight value when the output is off (like sna)
+   https://bugzilla.redhat.com/show_bug.cgi?id=1032978
+
+ * UXA: Mark outputs as off before the kernel does (like sna)
+   This will prevent the internal panel from starting up blank in some
+   multi-monitor configurations
+   https://bugzilla.redhat.com/show_bug.cgi?id=1103806
+
+Note that the DRI2 exchange mechanism introduced in 2.99.912 exposes bugs
+in some compositors, at least kwin and comptom, which discard DRI2 buffer
+invalidates rather than resourcing their texture. For example,
+https://bugs.kde.org/show_bug.cgi?id=336589
+
+Note that the improved triple buffering introduced in DRI2 requires a patch
+to Xorg (now released upstream) to prevent crashes with DRI_PRIME.
+https://bugs.freedesktop.org/show_bug.cgi?id=80001
+
+Note that DRI3/Present require tracking the relevant development trees for
+mesa and the xserver as they are very much still under early testing. Also
+be aware that Mesa provides no support for explicit fencing so Damage
+tracking between compositors and clients is unserialised.
+
+
 Snapshot 2.99.912 (2014-06-10)
 ==============================
 A final round of features. We have everything from support for variable
diff --git a/configure.ac b/configure.ac
index 953f09c..280bfc9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-intel],
-        [2.99.912],
+        [2.99.913],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-intel])
 AC_CONFIG_SRCDIR([Makefile.am])

commit d242965979cf251383a6230dbd65cdc1d9e231ea
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jul 23 14:25:25 2014 +0100

    sna: Skip performing an async flip after fixup
    
    After the first async failure and we fix up the CRTC, ordinary we queue
    a no-op flip in order to queue the event. For async flips, we do not
    want that event so just skip the flip.
    
    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 0600a8c..ffb8bb9 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -4892,14 +4892,13 @@ sna_crtc_flip(struct sna *sna, struct sna_crtc *crtc, struct kgem_bo *bo, int x,
 	arg.mode = crtc->kmode;
 	arg.mode_valid = 1;
 
-	DBG(("%s: applying crtc [%d, pipe=%d] mode=%dx%d+%d+%d@%d, fb=%d%s update to %d outputs [%d...]\n",
+	DBG(("%s: applying crtc [%d, pipe=%d] mode=%dx%d+%d+%d@%d, fb=%d across %d outputs [%d...]\n",
 	     __FUNCTION__, crtc->id, crtc->pipe,
 	     arg.mode.hdisplay,
 	     arg.mode.vdisplay,
 	     arg.x, arg.y,
 	     arg.mode.clock,
 	     arg.fb_id,
-	     bo != crtc->bo ? " [shadow]" : "",
 	     output_count, output_count ? output_ids[0] : 0));
 
 	if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_SETCRTC, &arg))
@@ -4973,6 +4972,11 @@ fixup_flip:
 
 				crtc->bo = kgem_bo_reference(bo);
 				crtc->bo->active_scanout++;
+
+				if (data == NULL)
+					goto next_crtc;
+
+				/* queue a flip in order to send the event */
 			} else {
 				if (count && !xf86SetDesiredModes(sna->scrn)) {
 					xf86DrvMsg(sna->scrn->scrnIndex, X_ERROR,
@@ -5044,6 +5048,7 @@ retry_flip:
 			sna->mode.flip_active++;
 		}
 
+next_crtc:
 		count++;
 	}
 

commit 4153d4b43004cd90c0d9a7a7db399dac4d30721e
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jul 23 13:54:19 2014 +0100

    sna/dri2: Tidy freeing the queued frame events
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index d4d099d..e4f1c84 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -1481,14 +1481,7 @@ void sna_dri2_destroy_window(WindowPtr win)
 
 		DBG(("%s: freeing chain\n", __FUNCTION__));
 
-		info = priv->chain;
-		info->draw = NULL;
-		info->client = NULL;
-
-		chain = info->chain;
-		info->chain = NULL;
-
-		assert(info->queued);
+		chain = priv->chain;
 		while ((info = chain)) {
 			info->draw = NULL;
 			info->client = NULL;

commit f2b2b6eda009924e5ec6974bb31be9d3749c9cf8
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jul 23 13:45:27 2014 +0100

    test/dri2: Use the right device node
    
    Use the device node as instructed by Xorg.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/test/dri2-race.c b/test/dri2-race.c
index 01b023a..8862c84 100644
--- a/test/dri2-race.c
+++ b/test/dri2-race.c
@@ -28,7 +28,7 @@ static int dri2_open(Display *dpy)
 
 	printf ("Connecting to %s driver on %s\n", driver, device);
 
-	fd = open("/dev/dri/card0", O_RDWR);
+	fd = open(device, O_RDWR);
 	if (fd < 0)
 		return -1;
 
diff --git a/test/dri2-swap.c b/test/dri2-swap.c
index ba6b237..1bfb7d1 100644
--- a/test/dri2-swap.c
+++ b/test/dri2-swap.c
@@ -28,7 +28,7 @@ static int dri2_open(Display *dpy)
 
 	printf ("Connecting to %s driver on %s\n", driver, device);
 
-	fd = open("/dev/dri/card0", O_RDWR);
+	fd = open(device, O_RDWR);
 	if (fd < 0)
 		return -1;
 
diff --git a/test/dri2-test.c b/test/dri2-test.c
index 51b3da9..dd4179f 100644
--- a/test/dri2-test.c
+++ b/test/dri2-test.c
@@ -52,7 +52,7 @@ static int dri2_open(Display *dpy)
 
 	printf ("Connecting to %s driver on %s\n", driver, device);
 
-	fd = open("/dev/dri/card0", O_RDWR);
+	fd = open(device, O_RDWR);
 	if (fd < 0)
 		return -1;
 

commit 65c2376730e86d7502d8c47d49386be5f51e47ba
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jul 23 12:12:03 2014 +0100

    sna: Add a DBG message for slave damage propagation
    
    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 d479c4a..0600a8c 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1320,6 +1320,12 @@ static void sna_crtc_slave_damage(DamagePtr damage, RegionPtr region, void *clos
 	struct sna *sna = to_sna(crtc->base->scrn);
 	RegionPtr scr;
 
+	DBG(("%s: pushing damage [(%d, %d), (%d, %d) x %d] to CRTC [pipe=%d] (%d, %d)\n",
+	     __FUNCTION__,
+	     region->extents.x1, region->extents.y1, region->extents.x2, region->extents.y2,
+	     region_num_rects(region),
+	     crtc->pipe, crtc->base->x, crtc->base->y));
+
 	assert(crtc->slave_damage == damage);
 	assert(sna->mode.shadow_damage);
 

commit 95c059b330e705ecd0e575e98d8edf5707e84a05
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jul 23 11:01:07 2014 +0100

    sna: Reorder disabling scanout pixmap when updating slave
    
    The assertion caught that we would unregister an invalid drawable on
    older Xorg.
    
    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 6952d55..d479c4a 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -2178,13 +2178,17 @@ sna_crtc_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr pixmap)
 	if (sna_crtc == NULL)
 		return FALSE;
 
+	if (pixmap == sna_crtc->slave_pixmap)
+		return TRUE;
+
 	DBG(("%s: CRTC:%d, pipe=%d setting scanout pixmap=%ld\n",
 	     __FUNCTION__, sna_crtc->id,  sna_crtc->pipe,
 	     pixmap ? pixmap->drawable.serialNumber : 0));
 
+	/* Disable first so that we can unregister the damage tracking */
+	sna_crtc_disable_shadow(to_sna(crtc->scrn), sna_crtc);
+
 	sna_crtc->slave_pixmap = pixmap;
-	if (pixmap == NULL)
-		sna_crtc_disable(crtc);
 
 	return TRUE;
 }

commit d6830190bc9956f485db6c3420f7a4a79793a693
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jul 23 10:53:40 2014 +0100

    sna: Disable all outputs when initializing as a slaved output provider
    
    When we are constructed as a slaved device, we need to disable all
    outputs or else they are not correctly hooked into the master device
    upon startup.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/intel_module.c b/src/intel_module.c
index c884603..969f2a7 100644
--- a/src/intel_module.c
+++ b/src/intel_module.c
@@ -543,7 +543,7 @@ intel_scrn_create(DriverPtr		driver,
 	scrn->driverVersion = INTEL_VERSION;
 	scrn->driverName = (char *)INTEL_DRIVER_NAME;
 	scrn->name = (char *)INTEL_NAME;
-	scrn->driverPrivate = (void *)(match_data | 1);
+	scrn->driverPrivate = (void *)(match_data | (flags & XF86_ALLOCATE_GPU_SCREEN) | 2);
 	scrn->Probe = NULL;
 
 	if (xf86IsEntitySharable(entity_num))
diff --git a/src/sna/sna.h b/src/sna/sna.h
index 6e70c56..281418b 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -241,17 +241,18 @@ struct sna {
 	ScrnInfoPtr scrn;
 
 	unsigned flags;
-#define SNA_NO_WAIT		0x1
-#define SNA_NO_FLIP		0x2
-#define SNA_NO_VSYNC		0x4
-#define SNA_TRIPLE_BUFFER	0x8
-#define SNA_TEAR_FREE		0x10
-#define SNA_FORCE_SHADOW	0x20
-#define SNA_FLUSH_GTT		0x40
-#define SNA_IS_HOSTED		0x80
-#define SNA_PERFORMANCE		0x100
-#define SNA_POWERSAVE		0x200
-#define SNA_REMOVE_OUTPUTS	0x400
+#define SNA_IS_SLAVED		0x1
+#define SNA_IS_HOSTED		0x2
+#define SNA_NO_WAIT		0x10
+#define SNA_NO_FLIP		0x20
+#define SNA_NO_VSYNC		0x40
+#define SNA_TRIPLE_BUFFER	0x80
+#define SNA_TEAR_FREE		0x100
+#define SNA_FORCE_SHADOW	0x200
+#define SNA_FLUSH_GTT		0x400
+#define SNA_PERFORMANCE		0x1000
+#define SNA_POWERSAVE		0x2000
+#define SNA_REMOVE_OUTPUTS	0x4000
 #define SNA_HAS_FLIP		0x10000
 #define SNA_HAS_ASYNC_FLIP	0x20000
 #define SNA_LINEAR_FB		0x40000
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index af884c4..6952d55 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -5189,36 +5189,38 @@ static bool sna_probe_initial_configuration(struct sna *sna)
 {
 	ScrnInfoPtr scrn = sna->scrn;
 	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
-	const int user_overrides[] = {
-		OPTION_POSITION,
-		OPTION_BELOW,
-		OPTION_RIGHT_OF,
-		OPTION_ABOVE,
-		OPTION_LEFT_OF,
-		OPTION_ROTATE,
-		OPTION_PANNING,
-	};
 	int width, height;
 	int i, j;
 
 	assert((sna->flags & SNA_IS_HOSTED) == 0);
 
-	if (xf86ReturnOptValBool(sna->Options, OPTION_REPROBE, FALSE)) {
-		DBG(("%s: user requests reprobing\n", __FUNCTION__));
-		return false;
-	}
+	if ((sna->flags & SNA_IS_SLAVED) == 0) {
+		const int user_overrides[] = {
+			OPTION_POSITION,
+			OPTION_BELOW,
+			OPTION_RIGHT_OF,
+			OPTION_ABOVE,
+			OPTION_LEFT_OF,
+			OPTION_ROTATE,
+			OPTION_PANNING,
+		};
+		if (xf86ReturnOptValBool(sna->Options, OPTION_REPROBE, FALSE)) {
+			DBG(("%s: user requests reprobing\n", __FUNCTION__));
+			return false;
+		}
 
-	/* First scan through all outputs and look for user overrides */
-	for (i = 0; i < sna->mode.num_real_output; i++) {
-		xf86OutputPtr output = config->output[i];
+		/* First scan through all outputs and look for user overrides */
+		for (i = 0; i < sna->mode.num_real_output; i++) {
+			xf86OutputPtr output = config->output[i];
 
-		for (j = 0; j < ARRAY_SIZE(user_overrides); j++) {
-			if (xf86GetOptValString(output->options, user_overrides[j])) {
-				DBG(("%s: user placement [%d] for %s\n",
-				     __FUNCTION__,
-				     user_overrides[j],
-				     output->name));
-				return false;
+			for (j = 0; j < ARRAY_SIZE(user_overrides); j++) {
+				if (xf86GetOptValString(output->options, user_overrides[j])) {
+					DBG(("%s: user placement [%d] for %s\n",
+					     __FUNCTION__,
+					     user_overrides[j],
+					     output->name));
+					return false;
+				}
 			}
 		}
 	}
@@ -5263,6 +5265,8 @@ static bool sna_probe_initial_configuration(struct sna *sna)
 
 		crtc_id = (uintptr_t)output->crtc;
 		output->crtc = NULL;
+		if (sna->flags & SNA_IS_SLAVED)
+			continue;
 
 		if (crtc_id == 0) {
 			DBG(("%s: not using output %s, disconnected\n",
@@ -5331,7 +5335,7 @@ static bool sna_probe_initial_configuration(struct sna *sna)
 	}
 
 	width = height = 0;
-	for (i = 0; i < config->num_crtc; i++) {
+	for (i = 0; i < sna->mode.num_real_crtc; i++) {
 		xf86CrtcPtr crtc = config->crtc[i];
 		int w, h;
 
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index e5e7783..7f4540d 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -540,7 +540,7 @@ done:
  * As a result, we want to set up that server initialization once rather
  * that doing it per generation.
  */
-static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
+static Bool sna_pre_init(ScrnInfoPtr scrn, int probe)
 {
 	struct sna *sna;
 	char buf[1024];
@@ -550,7 +550,7 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
 	int fd;
 
 	DBG(("%s flags=%x, numEntities=%d\n",
-	     __FUNCTION__, flags, scrn->numEntities));
+	     __FUNCTION__, probe, scrn->numEntities));
 
 	if (scrn->numEntities != 1)
 		return FALSE;
@@ -566,17 +566,19 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
 		)
 		return FALSE;
 
-	if (flags & PROBE_DETECT)
+	if (probe & PROBE_DETECT)
 		return TRUE;
 
 	sna_selftest();
 
-	if (((uintptr_t)scrn->driverPrivate) & 1) {
+	probe = 0;
+	if (((uintptr_t)scrn->driverPrivate) & 3) {
 		if (posix_memalign((void **)&sna, 4096, sizeof(*sna)))
 			return FALSE;
 
 		memset(sna, 0, sizeof(*sna)); /* should be unnecessary */
-		sna->info = (void *)((uintptr_t)scrn->driverPrivate & ~1);
+		probe = (uintptr_t)scrn->driverPrivate & 1;
+		sna->info = (void *)((uintptr_t)scrn->driverPrivate & ~3);
 		scrn->driverPrivate = sna;
 
 		sna->cpu_features = sna_cpu_detect();
@@ -585,7 +587,7 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
 	sna = to_sna(scrn);
 	sna->scrn = scrn;
 	sna->pEnt = pEnt;
-	sna->flags = 0;
+	sna->flags = probe;
 
 	scrn->displayWidth = 640;	/* default it */
 
@@ -710,7 +712,7 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
 	return TRUE;
 
 cleanup:
-	scrn->driverPrivate = (void *)((uintptr_t)sna->info | 1);
+	scrn->driverPrivate = (void *)((uintptr_t)sna->info | (sna->flags & SNA_IS_SLAVED) | 2);
 	free(sna);
 	return FALSE;
 }
@@ -1180,7 +1182,7 @@ static void sna_free_screen(FREE_SCREEN_ARGS_DECL)
 	if ((uintptr_t)sna & 1)
 		return;
 
-	scrn->driverPrivate = (void *)((uintptr_t)sna->info | 1);
+	scrn->driverPrivate = (void *)((uintptr_t)sna->info | (sna->flags & SNA_IS_SLAVED) | 2);
 
 	sna_mode_fini(sna);
 	sna_acpi_fini(sna);
diff --git a/src/uxa/intel_driver.c b/src/uxa/intel_driver.c
index c73d831..a7ca906 100644
--- a/src/uxa/intel_driver.c
+++ b/src/uxa/intel_driver.c
@@ -447,12 +447,12 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int flags)
 	if (flags & PROBE_DETECT)
 		return TRUE;
 
-	if (((uintptr_t)scrn->driverPrivate) & 1) {
+	if (((uintptr_t)scrn->driverPrivate) & 3) {
 		intel = xnfcalloc(sizeof(*intel), 1);
 		if (intel == NULL)
 			return FALSE;
 
-		intel->info = (void *)((uintptr_t)scrn->driverPrivate & ~1);
+		intel->info = (void *)((uintptr_t)scrn->driverPrivate & ~3);
 		scrn->driverPrivate = intel;
 	}
 	intel = intel_get_screen_private(scrn);
@@ -1069,7 +1069,7 @@ static void I830FreeScreen(FREE_SCREEN_ARGS_DECL)
 	SCRN_INFO_PTR(arg);
 	intel_screen_private *intel = intel_get_screen_private(scrn);
 
-	if (intel && !((uintptr_t)intel & 1)) {
+	if (intel && !((uintptr_t)intel & 3)) {
 		intel_mode_fini(intel);
 		intel_bufmgr_fini(intel);
 		intel_put_device(scrn);

commit 70868c7aa881b15b7478f7ee4543fde0268a4ba6
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jul 23 08:37:46 2014 +0100

    sna/dri2: Recreate buffer in reuse rather than force recreate
    
    By marking the buffer->attachment as invalid we forced the recreation of
    the buffer on the next DRI2GetBuffers. The only small problem with that
    was that the client didn't always immediately call DRI2GetBuffers after
    the invalidation - and if they did a DRI2CopyRegion with its stale
    buffers the unfound attachment would generate a BadValue and kill the
    client. So instead of messing around with the attachment, explicitly
    recreate the buffer if we attempt to reuse a buffer of the wrong size.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index 69496c3..d4d099d 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -142,19 +142,19 @@ sna_dri2_get_back(struct sna *sna,
 {
 	struct kgem_bo *bo;
 	uint32_t name;
-
-	if ((draw->height << 16 | draw->width) != get_private(back)->size)
-		return;
-
-	get_private(back)->stale = false;
-
-	bo = get_private(back)->bo;
-	assert(bo->refcnt);
-	DBG(("%s: back buffer handle=%d, scanout?=%d, refcnt=%d\n",
-	     __FUNCTION__, bo->handle, bo->active_scanout, get_private(back)->refcnt));
-	if (bo->active_scanout == 0) {
-		DBG(("%s: reuse unattached back\n", __FUNCTION__));
-		return;
+	bool reuse;
+
+	reuse = (draw->height << 16 | draw->width) == get_private(back)->size;
+	if (reuse) {
+		bo = get_private(back)->bo;
+		assert(bo->refcnt);
+		DBG(("%s: back buffer handle=%d, scanout?=%d, refcnt=%d\n",
+					__FUNCTION__, bo->handle, bo->active_scanout, get_private(back)->refcnt));
+		if (bo->active_scanout == 0) {
+			DBG(("%s: reuse unattached back\n", __FUNCTION__));
+			get_private(back)->stale = false;
+			return;
+		}
 	}
 
 	bo = NULL;
@@ -187,7 +187,7 @@ sna_dri2_get_back(struct sna *sna,
 	}
 	assert(bo->active_scanout == 0);
 
-	if (info) {
+	if (info && reuse) {
 		bool found = false;
 		struct dri_bo *c;
 
@@ -210,8 +210,13 @@ sna_dri2_get_back(struct sna *sna,
 
 	assert(bo != get_private(back)->bo);
 	kgem_bo_destroy(&sna->kgem, get_private(back)->bo);
+
 	get_private(back)->bo = bo;
+	get_private(back)->size = draw->height << 16 | draw->width;
+	back->pitch = bo->pitch;
 	back->name = name;
+
+	get_private(back)->stale = false;
 }
 
 struct dri2_window {
@@ -1935,11 +1940,9 @@ static void sna_dri2_xchg_crtc(struct sna *sna, DrawablePtr draw, xf86CrtcPtr cr
 	sna_shadow_set_crtc(sna, crtc, get_private(back)->bo);
 	DamageRegionProcessPending(&win->drawable);
 
-	if (get_private(front)->size == (draw->height << 16 | draw->width)) {
-		front->attachment = DRI2BufferBackLeft;
-		get_private(front)->stale = true;
-	} else
-		front->attachment = -1;
+	front->attachment = DRI2BufferBackLeft;
+	get_private(front)->stale = true;
+
 	back->attachment = DRI2BufferFrontLeft;
 	if (get_private(back)->proxy == NULL) {
 		get_private(back)->proxy = sna_dri2_reference_buffer(sna_pixmap_get_buffer(pixmap));

commit aa5351dbbe0a50080efee35a3d494b3a20b7c9f6
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Jul 22 09:40:14 2014 +0100

    sna: Ensure errno is set after failure before reporting a modeset failure
    
    A few paths we report a sanity check failure which do not set errno, but
    we then print out the errno as part of our message to the user. Set it
    to a sane value in those cases.
    
    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 fbd7cff..af884c4 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -869,8 +869,10 @@ rotation_set(struct sna *sna, struct plane *p, uint32_t desired)
 	if (desired == p->rotation.current)
 		return true;
 
-	if ((desired & p->rotation.supported) == 0)
+	if ((desired & p->rotation.supported) == 0) {
+		errno = EINVAL;
 		return false;
+	}
 
 	DBG(("%s: obj=%d, type=%x prop=%d set-rotation=%x\n",
 	     __FUNCTION__, p->id, LOCAL_MODE_OBJECT_PLANE, p->rotation.prop, desired));
@@ -961,8 +963,10 @@ sna_crtc_apply(xf86CrtcPtr crtc)
 		       xf86IsEntityShared(crtc->scrn->entityList[0]));
 
 		output_ids[output_count] = to_connector_id(output);
-		if (++output_count == ARRAY_SIZE(output_ids))
+		if (++output_count == ARRAY_SIZE(output_ids)) {
+			errno = EINVAL;
 			return false;
+		}
 	}
 
 	VG_CLEAR(arg);
@@ -2055,6 +2059,8 @@ retry: /* Attach per-crtc pixmap or direct */
 	sna_crtc->bo = bo;
 	mode_to_kmode(&sna_crtc->kmode, mode);
 	if (!sna_crtc_apply(crtc)) {
+		int err = errno;
+
 		kgem_bo_destroy(&sna->kgem, bo);
 
 		if (!sna_crtc->shadow) {
@@ -2063,7 +2069,7 @@ retry: /* Attach per-crtc pixmap or direct */
 		}
 
 		xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
-			   "failed to set mode: %s\n", strerror(errno));
+			   "failed to set mode: %s [%d]\n", strerror(err), err);
 
 		sna_crtc->offset = saved_offset;
 		sna_crtc->transform = saved_transform;

commit feba651db8dd61356fb6296b55d46168bd4d7011
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Jul 22 09:15:01 2014 +0100

    sna: Remove %# from DBG messages
    
    LogF doesn't support the 0x-prefix instruction.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index dd37396..222c8b5 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -14715,7 +14715,7 @@ sna_poly_fill_rect(DrawablePtr draw, GCPtr gc, int n, xRectangle *rect)
 	}
 
 	if (!PM_IS_SOLID(draw, gc->planemask)) {
-		DBG(("%s: fallback -- planemask=%#lx (not-solid)\n",
+		DBG(("%s: fallback -- planemask=0x%lx (not-solid)\n",
 		     __FUNCTION__, gc->planemask));
 		goto fallback;
 	}

commit 13e20c7f61d8b21b33c02d8b737cf9c06bf50f17
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Jul 22 08:52:10 2014 +0100

    sna: Assert that we do not overwrite an earlier COW entry
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 97bcdcf..dd37396 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1979,6 +1979,7 @@ sna_pixmap_make_cow(struct sna *sna,
 
 	assert(dst_priv->move_to_gpu == NULL);
 	assert(!dst_priv->flush);
+	assert(list_is_empty(&dst_priv->cow_list));
 
 	cow = COW(src_priv->cow);
 	if (cow == NULL) {

commit d8b0a8fa033848543e0b39566b531fdfdd078087
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Jul 22 08:48:58 2014 +0100

    sna/dri3: Don't forget to add SHM pixmaps to the list of exported DRI3 bo
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_dri3.c b/src/sna/sna_dri3.c
index 5d51b41..cd4c174 100644
--- a/src/sna/sna_dri3.c
+++ b/src/sna/sna_dri3.c
@@ -333,10 +333,9 @@ static int sna_dri3_fd_from_pixmap(ScreenPtr screen,
 		return -1;
 	}
 
-	if (bo == priv->gpu_bo && (priv->pinned & PIN_DRI3) == 0) {
-		list_add(&priv->cow_list, &sna->dri3.pixmaps);
+	if (bo == priv->gpu_bo)
 		priv->pinned |= PIN_DRI3;
-	}
+	list_move(&priv->cow_list, &sna->dri3.pixmaps);
 
 	*stride = (priv->pinned & PIN_DRI3) ? priv->gpu_bo->pitch : priv->cpu_bo->pitch;
 	*size = kgem_bo_size((priv->pinned & PIN_DRI3) ? priv->gpu_bo : priv->cpu_bo);

commit bfccacf745d054756661be3edd8898ac6aceb878
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Jul 20 07:29:21 2014 +0100

    sna/video: Bump the maximum size for sprites
    
    A sprite plane is limited by the display engine who's maximum resolution
    has increased since the 2kx2k limitations of 8xx, so let's set it
    correctly to the reported maximum CRTC size (since we have no individual
    query for maximum sprite plane sizes).
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_video_sprite.c b/src/sna/sna_video_sprite.c
index 1106c00..80fa43f 100644
--- a/src/sna/sna_video_sprite.c
+++ b/src/sna/sna_video_sprite.c
@@ -63,9 +63,6 @@ struct local_mode_set_plane {
 	uint32_t src_h, src_w;
 };
 
-#define IMAGE_MAX_WIDTH		2048
-#define IMAGE_MAX_HEIGHT	2048
-
 #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, true)
 


Reply to: