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

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



 NEWS                  |   48 +++++++
 configure.ac          |   19 ++-
 src/intel_display.c   |    9 +
 src/intel_driver.c    |    4 
 src/intel_driver.h    |    2 
 src/intel_module.c    |   21 ++-
 src/sna/gen2_render.c |    4 
 src/sna/gen3_render.c |   17 --
 src/sna/gen4_render.c |    4 
 src/sna/gen5_render.c |    4 
 src/sna/gen6_render.c |    4 
 src/sna/gen7_render.c |   20 ++-
 src/sna/kgem.c        |  112 +++++++++++++++---
 src/sna/kgem.h        |    3 
 src/sna/sna.h         |    6 
 src/sna/sna_accel.c   |   31 +++--
 src/sna/sna_blt.c     |   18 ++
 src/sna/sna_display.c |   33 ++++-
 src/sna/sna_dri.c     |   36 +++--
 src/sna/sna_driver.c  |    6 
 src/sna/sna_glyphs.c  |  305 ++++++++++++++++++++++++++++++++++++++++++++++++++
 src/sna/sna_io.c      |  228 ++++++++++++++++++++++++++++---------
 src/sna/sna_render.c  |    2 
 src/sna/sna_render.h  |    1 
 24 files changed, 778 insertions(+), 159 deletions(-)

New commits:
commit 88502b32d5d2b826fc08344392c98300341410e1
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Sep 16 09:02:46 2012 +0100

    2.20.8 release
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/NEWS b/NEWS
index 8836a11..62ec266 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,49 @@
+Release 2.20.8 (2012-09-16)
+===========================
+Another new small feature, another new release. And a few more bugs
+fixed as well! But what is this new feature, do I hear you ask? Why, it
+is nothing less than enabling the ValleyView SDV! The lucky person to
+have their hands on one will now be able to enjoy X in full TechniColor.
+
+For the rest of us, a few more bugs were fixed with interesting
+combinations of software and rendering patterns.
+
+ * Add an extra layer of defence against trying to use a non-GEM device
+   with UXA. This should already be taken care of with the new probe,
+   but the extra sanity check already existed in the code but was doing
+   nothing.
+   https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/962892
+
+ * Fix computation of valid CRTCs bitmask for ZaphodHead
+   Some systems can only handle certain outputs on certain pipes
+   (Screens), and this information was not being propagated through to X
+   and randr correctly, breaking valid configurations and not detecting
+   invalid configurations correctly.
+
+ * Disable global glyph caching with ZaphodHeads.
+   The glyph privates need to be Screen private, but at the moment are
+   global leading to conflicts and invalid rendering with multiple heads.
+   https://bugs.freedesktop.org/show_bug.cgi?id=54707
+
+ * Prevent direct read back of unmappable buffers
+   https://bugs.freedesktop.org/show_bug.cgi?id=54808
+
+ * Tile large uploads whilst replacing the alpha channel
+   https://bugs.freedesktop.org/show_bug.cgi?id=54808
+
+ * Correct the source offset when converting a RENDER composite
+   operation into a BLT composite operation.
+   https://bugs.freedesktop.org/show_bug.cgi?id=54868
+
+ * Correct a minor typo in flattening alphamaps which caused the
+   replacement pixmap to often end up with a height of zero.
+   https://bugs.gentoo.org/show_bug.cgi?id=434860
+
+ * Don't discard the CPU damage if only part of is being replaced.
+   This is most evident when combining software renders like Opera with
+   accelerated rendering.
+   https://bugs.freedesktop.org/show_bug.cgi?id=54937
+
 Release 2.20.7 (2012-09-08)
 ===========================
 Continuing the flurry of releases, this week saw the release of
diff --git a/configure.ac b/configure.ac
index 2d651e1..6b0b0a8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-intel],
-        [2.20.7],
+        [2.20.8],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-intel])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 395d738b5086f24659b56b4b3536bffaebad8a3e
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Sep 15 21:18:35 2012 +0100

    sna: Improve handling of probe failure during initialisation
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index f68b054..fc7c881 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -880,8 +880,10 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, int gen)
 	     kgem->has_llc, kgem->has_cacheing, kgem->has_userptr));
 
 	VG_CLEAR(aperture);
-	aperture.aper_size = 64*1024*1024;
+	aperture.aper_size = 0;
 	(void)drmIoctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
+	if (aperture.aper_size == 0)
+		aperture.aper_size = 64*1024*1024;
 
 	kgem->aperture_total = aperture.aper_size;
 	kgem->aperture_high = aperture.aper_size * 3/4;
@@ -949,11 +951,6 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, int gen)
 	if (kgem->large_object_size > kgem->max_gpu_size)
 		kgem->large_object_size = kgem->max_gpu_size;
 
-	if (kgem->max_upload_tile_size > kgem->large_object_size)
-		kgem->max_upload_tile_size = kgem->large_object_size;
-	if (kgem->max_copy_tile_size > kgem->large_object_size)
-		kgem->max_copy_tile_size = kgem->large_object_size;
-
 	if (kgem->has_llc | kgem->has_cacheing | kgem->has_userptr) {
 		if (kgem->large_object_size > kgem->max_cpu_size)
 			kgem->large_object_size = kgem->max_cpu_size;

commit fe78904a45979d47bb092ce37d321854e2418344
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Sep 13 22:15:14 2012 +0100

    Add basic support for ValleyView
    
    Bind to the ValleyView SDV for verifying the render routines.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/intel_driver.h b/src/intel_driver.h
index ac02cc7..b719062 100644
--- a/src/intel_driver.h
+++ b/src/intel_driver.h
@@ -229,6 +229,8 @@
 #define PCI_CHIP_HASWELL_CRW_S_GT2	0x0D2A
 #define PCI_CHIP_HASWELL_CRW_S_GT2_PLUS	0x0D3A
 
+#define PCI_CHIP_VALLEYVIEW_PO		0x0f30
+
 #endif
 
 #define I85X_CAPID			0x44
diff --git a/src/intel_module.c b/src/intel_module.c
index 65a91b1..bc0b6d2 100644
--- a/src/intel_module.c
+++ b/src/intel_module.c
@@ -103,6 +103,10 @@ static const struct intel_device_info intel_ivybridge_info = {
 	.gen = 70,
 };
 
+static const struct intel_device_info intel_valleyview_info = {
+	.gen = 70,
+};
+
 static const struct intel_device_info intel_haswell_info = {
 	.gen = 75,
 };
@@ -192,6 +196,7 @@ static const SymTabRec _intel_chipsets[] = {
 	{PCI_CHIP_HASWELL_CRW_S_GT1,		"Haswell CRW Server (GT1)" },
 	{PCI_CHIP_HASWELL_CRW_S_GT2,		"Haswell CRW Server (GT2)" },
 	{PCI_CHIP_HASWELL_CRW_S_GT2_PLUS,	"Haswell CRW Server (GT2+)" },
+	{PCI_CHIP_VALLEYVIEW_PO,		"ValleyView PO board" },
 	{-1,					NULL}
 };
 #define NUM_CHIPSETS (sizeof(_intel_chipsets) / sizeof(_intel_chipsets[0]))
@@ -301,6 +306,8 @@ static const struct pci_id_match intel_device_match[] = {
 	INTEL_DEVICE_MATCH (PCI_CHIP_HASWELL_CRW_S_GT2, &intel_haswell_info ),
 	INTEL_DEVICE_MATCH (PCI_CHIP_HASWELL_CRW_S_GT2_PLUS, &intel_haswell_info ),
 
+	INTEL_DEVICE_MATCH (PCI_CHIP_VALLEYVIEW_PO, &intel_valleyview_info ),
+
 	INTEL_DEVICE_MATCH (PCI_MATCH_ANY, &intel_generic_info ),
 	{ 0, 0, 0 },
 };

commit 3b9259f7cedc179617bc24b3912d2d8d75c5a824
Author: Ian Stakenvicius <axs@gentoo.org>
Date:   Fri Sep 14 21:04:42 2012 +0100

    configure: Make udev dependency optional
    
    In order to support buildbots where the udev headers may exist on the
    build system but not the target, we need explicit control over optional
    dependencies.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54942

diff --git a/configure.ac b/configure.ac
index f94f140..2d651e1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,9 +85,20 @@ fi
 PKG_CHECK_MODULES(GEN4ASM, [intel-gen4asm >= 1.2], [gen4asm=yes], [gen4asm=no])
 AM_CONDITIONAL(HAVE_GEN4ASM, test x$gen4asm = xyes)
 
-PKG_CHECK_MODULES(UDEV, [libudev], [udev=yes], [udev=no])
-if test x"$udev" = xyes; then
-	AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection])
+AC_ARG_ENABLE(udev,
+              AS_HELP_STRING([--disable-udev],
+                             [Disable udev-based monitor hotplug detection [default=auto]]),
+              [UDEV="$enableval"],
+              [UDEV=auto])
+
+if test x$UDEV != "xno"; then
+	PKG_CHECK_MODULES(UDEV, [libudev], [udev=yes], [udev=no])
+	if test x$UDEV == xyes -a x$udev != xyes; then
+		AC_MSG_ERROR([udev support requested but not found (libudev)])
+	fi
+	if test x$udev = xyes; then
+		AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection])
+	fi
 fi
 
 PKG_CHECK_MODULES(X11, [x11 xrender xext pixman-1], [x11=yes], [x11=no])

commit d995705fb01842652a79076cbecee4392f653bfe
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Sep 14 19:32:06 2012 +0100

    sna: Only discard CPU damage if we completely overwrite its extents
    
    If we are performing a clipped copy, then we must be careful not to
    completely discard the CPU damage as it may not be entirely replaced.
    
    Reported-by: Roman Jarosz <kedgedev@gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54937
    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 7db7368..6832a7c 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4410,7 +4410,8 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 			sna_damage_destroy(&dst_priv->cpu_damage);
 			list_del(&dst_priv->list);
 		}
-		hint |= IGNORE_CPU;
+		if (region->data == NULL)
+			hint |= IGNORE_CPU;
 	}
 
 	bo = sna_drawable_use_bo(&dst_pixmap->drawable, hint,

commit deacab87e4ba7fe09f0f16568dc2848949f2707a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Sep 14 17:01:13 2012 +0100

    sna/dri: flip->next_front.bo is owned by the DRI drawable not by the flip
    
    Be careful not to delete the reference we presume we hold as it is
    borrowed from the DRI drawable.
    
    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 d6cc2aa..b1fba20 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -941,9 +941,6 @@ sna_dri_frame_event_info_free(struct sna *sna,
 	if (info->old_front.bo)
 		kgem_bo_destroy(&sna->kgem, info->old_front.bo);
 
-	if (info->next_front.bo)
-		kgem_bo_destroy(&sna->kgem, info->next_front.bo);
-
 	if (info->cache.bo)
 		kgem_bo_destroy(&sna->kgem, info->cache.bo);
 
@@ -1431,7 +1428,6 @@ static void sna_dri_flip_event(struct sna *sna,
 
 			flip->cache = flip->old_front;
 			flip->old_front = flip->next_front;
-			flip->next_front.bo = NULL;
 
 			flip->count = sna_page_flip(sna,
 						    get_private(flip->front)->bo,
@@ -1457,8 +1453,6 @@ static void sna_dri_flip_event(struct sna *sna,
 			sna->dri.flip_pending = flip;
 		} else {
 finish_async_flip:
-			flip->next_front.bo = NULL;
-
 			DBG(("%s: async flip completed\n", __FUNCTION__));
 			sna_dri_frame_event_info_free(sna, draw, flip);
 		}

commit 5369408d596a0611d4f76333dac2e1c93e63e8b6
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Sep 14 16:12:00 2012 +0100

    sna/dri: And the hunt for the use-after-free continues...
    
    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 2296ab6..d6cc2aa 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -196,11 +196,13 @@ static struct kgem_bo *sna_pixmap_set_dri(struct sna *sna,
 
 constant static inline void *sna_pixmap_get_buffer(PixmapPtr pixmap)
 {
+	assert(pixmap->refcnt);
 	return ((void **)dixGetPrivateAddr(&pixmap->devPrivates, &sna_pixmap_key))[2];
 }
 
 static inline void sna_pixmap_set_buffer(PixmapPtr pixmap, void *ptr)
 {
+	assert(pixmap->refcnt);
 	((void **)dixGetPrivateAddr(&pixmap->devPrivates, &sna_pixmap_key))[2] = ptr;
 }
 
@@ -429,8 +431,11 @@ static void set_bo(PixmapPtr pixmap, struct kgem_bo *bo)
 	sna_damage_destroy(&priv->cpu_damage);
 	priv->undamaged = false;
 
-	kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
-	priv->gpu_bo = ref(bo);
+	assert(bo->refcnt);
+	if (priv->gpu_bo != bo) {
+		kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
+		priv->gpu_bo = ref(bo);
+	}
 	if (bo->domain != DOMAIN_GPU)
 		bo->domain = DOMAIN_NONE;
 

commit 8e9d64203428b344433ac8f86dc1f06d2c32529a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Sep 14 14:06:38 2012 +0100

    sna: Fix typo for sna_render_picture_flatten()
    
    Pass it the correct value for the pixmap height, and not its 'y'
    coordinate!
    
    Reported-by: Eugene Rosenzweig <ugn@outlook.com>
    Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=434860
    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 4493bf6..5844922 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -1500,7 +1500,7 @@ sna_render_picture_fixup(struct sna *sna,
 		DBG(("%s: alphamap\n", __FUNCTION__));
 		if (is_gpu(picture->pDrawable) || is_gpu(picture->alphaMap->pDrawable)) {
 			return sna_render_picture_flatten(sna, picture, channel,
-							  x, y, w, y, dst_x, dst_y);
+							  x, y, w, h, dst_x, dst_y);
 		}
 
 		goto do_fixup;

commit 6ee9969f0e99975a24e113af9591909d9023d8af
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Sep 14 13:04:50 2012 +0100

    sna/dri: Update AsyncSwap for recent changes in tracking DRI drawables
    
    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 de0f84d..2296ab6 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -1417,7 +1417,9 @@ static void sna_dri_flip_event(struct sna *sna,
 		     __FUNCTION__, flip->pipe,
 		     sna->dri.flip_pending != NULL,
 		     flip->front->name != flip->old_front.name));
-		assert(sna->dri.flip_pending == flip);
+
+		if (sna->dri.flip_pending)
+			goto finish_async_flip;
 
 		if (flip->front->name != flip->next_front.name) {
 			DBG(("%s: async flip continuing\n", __FUNCTION__));
@@ -1435,6 +1437,8 @@ static void sna_dri_flip_event(struct sna *sna,
 			flip->next_front.bo = get_private(flip->front)->bo;
 			flip->next_front.name = flip->front->name;
 			flip->off_delay = 5;
+
+			sna->dri.flip_pending = flip;
 		} else if (--flip->off_delay) {
 			DBG(("%s: queuing no-flip [delay=%d]\n",
 			     __FUNCTION__, flip->off_delay));
@@ -1444,12 +1448,13 @@ static void sna_dri_flip_event(struct sna *sna,
 						    flip, flip->pipe);
 			if (flip->count == 0)
 				goto finish_async_flip;
+
+			sna->dri.flip_pending = flip;
 		} else {
 finish_async_flip:
 			flip->next_front.bo = NULL;
 
 			DBG(("%s: async flip completed\n", __FUNCTION__));
-			sna->dri.flip_pending = NULL;
 			sna_dri_frame_event_info_free(sna, draw, flip);
 		}
 		break;
@@ -1992,6 +1997,7 @@ blit:
 			goto blit;
 
 		info->client = client;
+		info->draw = draw;
 		info->type = DRI2_ASYNC_FLIP;
 		info->pipe = pipe;
 		info->front = front;

commit d2dbb991384f2b820a714eba262691ed97a6a22a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Sep 14 13:04:14 2012 +0100

    sna/dri: Add a bunch of assertions for hunting a use-after-free
    
    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 36122e2..a0129e4 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -2495,6 +2495,7 @@ sna_page_flip(struct sna *sna,
 	int count;
 
 	DBG(("%s: handle %d attached\n", __FUNCTION__, bo->handle));
+	assert(bo->refcnt);
 
 	kgem_submit(&sna->kgem);
 
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index ff6b587..de0f84d 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -115,6 +115,7 @@ get_private(DRI2Buffer2Ptr buffer)
 
 static inline struct kgem_bo *ref(struct kgem_bo *bo)
 {
+	assert(bo->refcnt);
 	bo->refcnt++;
 	return bo;
 }
@@ -877,6 +878,8 @@ sna_dri_remove_frame_event(WindowPtr win,
 
 	while (chain->chain != info)
 		chain = chain->chain;
+	assert(chain != info);
+	assert(info->chain != chain);
 	chain->chain = info->chain;
 }
 
@@ -912,8 +915,11 @@ sna_dri_add_frame_event(DrawablePtr draw, struct sna_dri_frame_event *info)
 		return;
 	}
 
+	assert(chain != info);
 	while (chain->chain != NULL)
 		chain = chain->chain;
+
+	assert(chain != info);
 	chain->chain = info;
 }
 
@@ -2031,6 +2037,7 @@ blit:
 				    CREATE_SCANOUT | CREATE_EXACT);
 		name = kgem_bo_flink(&sna->kgem, bo);
 	}
+	assert(bo->refcnt);
 	get_private(info->back)->bo = bo;
 	info->back->name = name;
 

commit d8756091474aeb44e5d8eed6b20b65c23b6574e7
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Sep 14 12:17:28 2012 +0100

    sna/dri: Version bump for prototypical AsyncSwap
    
    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 8dc2f01..ff6b587 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -50,7 +50,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #error DRI2 version supported by the Xserver is too old
 #endif
 
-#if DRI2INFOREC_VERSION < 9
+#if DRI2INFOREC_VERSION < 10
 #define USE_ASYNC_SWAP 0
 #endif
 
@@ -2250,7 +2250,7 @@ bool sna_dri_open(struct sna *sna, ScreenPtr screen)
 #endif
 
 #if USE_ASYNC_SWAP
-	info.version = 9;
+	info.version = 10;
 	info.AsyncSwap = sna_dri_async_swap;
 #endif
 

commit 0fc3d020f3086b5c6ecef1fed1aaedef7aa52b01
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Sep 14 09:49:00 2012 +0100

    Skip adding unknown special modes
    
    In light of the discussion on how to add stereo modes it was revealed
    that we would happily add modes with unknown and unhandled strange
    flags. Adam Jackson mentioned that he has plans to fix that with some
    upcoming work, but as a first step we can simply eradicate them whilst
    pondering how to support the stereoscopic vision of the future.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/intel_display.c b/src/intel_display.c
index 0372f9f..bf16049 100644
--- a/src/intel_display.c
+++ b/src/intel_display.c
@@ -52,6 +52,8 @@
 
 #include "intel_glamor.h"
 
+#define KNOWN_MODE_FLAGS ((1<<14)-1)
+
 struct intel_mode {
 	int fd;
 	uint32_t fb_id;
@@ -316,7 +318,7 @@ mode_from_kmode(ScrnInfoPtr scrn,
 	mode->VTotal = kmode->vtotal;
 	mode->VScan = kmode->vscan;
 
-	mode->Flags = kmode->flags; //& FLAG_BITS;
+	mode->Flags = kmode->flags;
 	mode->name = strdup(kmode->name);
 
 	if (kmode->type & DRM_MODE_TYPE_DRIVER)
@@ -324,6 +326,9 @@ mode_from_kmode(ScrnInfoPtr scrn,
 	if (kmode->type & DRM_MODE_TYPE_PREFERRED)
 		mode->type |= M_T_PREFERRED;
 
+	if (mode->status == MODE_OK && kmode->flags & ~KNOWN_MODE_FLAGS)
+		mode->status = MODE_BAD; /* unknown flags => unhandled */
+
 	xf86SetModeCrtc (mode, scrn->adjustFlags);
 }
 
@@ -347,7 +352,7 @@ mode_to_kmode(ScrnInfoPtr scrn,
 	kmode->vtotal = mode->VTotal;
 	kmode->vscan = mode->VScan;
 
-	kmode->flags = mode->Flags; //& FLAG_BITS;
+	kmode->flags = mode->Flags;
 	if (mode->name)
 		strncpy(kmode->name, mode->name, DRM_DISPLAY_MODE_LEN);
 	kmode->name[DRM_DISPLAY_MODE_LEN-1] = 0;
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index a9c5440..36122e2 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -51,6 +51,8 @@
 
 #include "intel_options.h"
 
+#define KNOWN_MODE_FLAGS ((1<<14)-1)
+
 #if 0
 #define __DBG DBG
 #else
@@ -549,7 +551,7 @@ mode_from_kmode(ScrnInfoPtr scrn,
 	mode->VTotal = kmode->vtotal;
 	mode->VScan = kmode->vscan;
 
-	mode->Flags = kmode->flags; //& FLAG_BITS;
+	mode->Flags = kmode->flags;
 	mode->name = strdup(kmode->name);
 
 	if (kmode->type & DRM_MODE_TYPE_DRIVER)
@@ -557,6 +559,9 @@ mode_from_kmode(ScrnInfoPtr scrn,
 	if (kmode->type & DRM_MODE_TYPE_PREFERRED)
 		mode->type |= M_T_PREFERRED;
 
+	if (mode->status == MODE_OK && kmode->flags & ~KNOWN_MODE_FLAGS)
+		mode->status = MODE_BAD; /* unknown flags => unhandled */
+
 	xf86SetModeCrtc (mode, scrn->adjustFlags);
 }
 
@@ -578,7 +583,7 @@ mode_to_kmode(struct drm_mode_modeinfo *kmode, DisplayModePtr mode)
 	kmode->vtotal = mode->VTotal;
 	kmode->vscan = mode->VScan;
 
-	kmode->flags = mode->Flags; //& FLAG_BITS;
+	kmode->flags = mode->Flags;
 	if (mode->name)
 		strncpy(kmode->name, mode->name, DRM_DISPLAY_MODE_LEN);
 	kmode->name[DRM_DISPLAY_MODE_LEN-1] = 0;

commit 35d81d97b38d05f132a4823e57fff4012e966504
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Sep 13 22:32:47 2012 +0100

    sna/gen7: Defensively program default GT values
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 53fcb2a..383caa4 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -83,6 +83,13 @@ struct gt_info {
 	} urb;
 };
 
+static const struct gt_info ivb_gt_info = {
+	.max_vs_threads = 16,
+	.max_gs_threads = 16,
+	.max_wm_threads = (16-1) << IVB_PS_MAX_THREADS_SHIFT,
+	.urb = { 128, 64, 64 },
+};
+
 static const struct gt_info ivb_gt1_info = {
 	.max_vs_threads = 36,
 	.max_gs_threads = 36,
@@ -4255,9 +4262,12 @@ static bool gen7_render_setup(struct sna *sna)
 	int i, j, k, l, m;
 
 	if (sna->kgem.gen == 70) {
-		state->info = &ivb_gt1_info;
-		if (DEVICE_ID(sna->PciInfo) & 0x20)
-			state->info = &ivb_gt2_info; /* XXX requires GT_MODE WiZ disabled */
+		state->info = &ivb_gt_info;
+		if (DEVICE_ID(sna->PciInfo) & 0xf) {
+			state->info = &ivb_gt1_info;
+			if (DEVICE_ID(sna->PciInfo) & 0x20)
+				state->info = &ivb_gt2_info; /* XXX requires GT_MODE WiZ disabled */
+		}
 	} else if (sna->kgem.gen == 75) {
 		state->info = &hsw_gt_info;
 	} else

commit 3fbdedbf9d509c5ca58ae0a01fe8e54dcc990cf8
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Sep 13 22:10:08 2012 +0100

    sna: Fix analysis of source extents for BLT composite
    
    After we have computed the source offset vector for the transformed
    source bo, we need to use that with respect to the destination rectangle
    to verify that the source sample is wholly within bounds.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index 7d51823..ca61bd3 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -1780,9 +1780,7 @@ gen2_render_composite(struct sna *sna,
 	case 1:
 		if (mask == NULL && tmp->src.bo &&
 		    sna_blt_composite__convert(sna,
-					       src_x, src_y,
-					       width, height,
-					       dst_x, dst_y,
+					       dst_x, dst_y, width, height,
 					       tmp))
 			return true;
 		break;
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index 60e197e..723dd5e 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -2868,9 +2868,7 @@ gen3_render_composite(struct sna *sna,
 	case 1:
 		if (mask == NULL && tmp->src.bo &&
 		    sna_blt_composite__convert(sna,
-					       src_x, src_y,
-					       width, height,
-					       dst_x, dst_y,
+					       dst_x, dst_y, width, height,
 					       tmp))
 			return true;
 
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index d8b76a1..ceef528 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -2315,9 +2315,7 @@ gen4_render_composite(struct sna *sna,
 	case 1:
 		if (mask == NULL &&
 		    sna_blt_composite__convert(sna,
-					       src_x, src_y,
-					       width, height,
-					       dst_x, dst_y,
+					       dst_x, dst_y, width, height,
 					       tmp))
 			return true;
 
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 5eff871..c9a2cc0 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -2330,9 +2330,7 @@ gen5_render_composite(struct sna *sna,
 	case 1:
 		if (mask == NULL &&
 		    sna_blt_composite__convert(sna,
-					       src_x, src_y,
-					       width, height,
-					       dst_x, dst_y,
+					       dst_x, dst_y, width, height,
 					       tmp))
 			return true;
 
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index 363e8db..8e10af3 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -2708,9 +2708,7 @@ gen6_render_composite(struct sna *sna,
 		if (mask == NULL &&
 		    prefer_blt_composite(sna, tmp) &&
 		    sna_blt_composite__convert(sna,
-					       src_x, src_y,
-					       width, height,
-					       dst_x, dst_y,
+					       dst_x, dst_y, width, height,
 					       tmp))
 			return true;
 
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 705a17d..53fcb2a 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -2811,9 +2811,7 @@ gen7_render_composite(struct sna *sna,
 		if (mask == NULL &&
 		    prefer_blt_composite(sna, tmp) &&
 		    sna_blt_composite__convert(sna,
-					       src_x, src_y,
-					       width, height,
-					       dst_x, dst_y,
+					       dst_x, dst_y, width, height,
 					       tmp))
 			return true;
 
diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c
index 757447b..b97df22 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -1914,7 +1914,6 @@ bool
 sna_blt_composite__convert(struct sna *sna,
 			   int x, int y,
 			   int width, int height,
-			   int dst_x, int dst_y,
 			   struct sna_composite_op *tmp)
 {
 	uint32_t alpha_fixup;
diff --git a/src/sna/sna_render.h b/src/sna/sna_render.h
index 442c78d..03a7005 100644
--- a/src/sna/sna_render.h
+++ b/src/sna/sna_render.h
@@ -574,7 +574,6 @@ bool sna_blt_composite(struct sna *sna,
 bool sna_blt_composite__convert(struct sna *sna,
 				int x, int y,
 				int width, int height,
-				int dst_x, int dst_y,
 				struct sna_composite_op *tmp);
 
 bool sna_blt_fill(struct sna *sna, uint8_t alu,

commit 6c7f998f7bda4f4f1286e079412d5d3a5b2eb073
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Sep 13 20:41:23 2012 +0100

    sna: Fix BLT composite offset
    
    Reported-by: Jiri Slaby <jirislaby@gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54868
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c
index 120d9a5..757447b 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -1990,8 +1990,8 @@ sna_blt_composite__convert(struct sna *sna,
 	}
 
 	tmp->u.blt.src_pixmap = NULL;
-	tmp->u.blt.sx = x - dst_x;
-	tmp->u.blt.sy = y - dst_y;
+	tmp->u.blt.sx = tmp->src.offset[0];
+	tmp->u.blt.sy = tmp->src.offset[1];
 	DBG(("%s: blt dst offset (%d, %d), source offset (%d, %d), with alpha fixup? %x\n",
 	     __FUNCTION__,
 	     tmp->dst.x, tmp->dst.y, tmp->u.blt.sx, tmp->u.blt.sy, alpha_fixup));

commit 2575cd0d236b4e1694e3185a487ebfd8bfe6499f
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Sep 13 20:08:37 2012 +0100

    sna: Avoid corrupting the CPU bo when compositing fallback data through BLT
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c
index c286918..120d9a5 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -1866,10 +1866,11 @@ clear:
 			     __FUNCTION__));
 		} else {
 			ret = prepare_blt_copy(sna, tmp, bo, alpha_fixup);
-			if (fallback)
-				ret = prepare_blt_put(sna, tmp, alpha_fixup);
+			if (fallback && !ret)
+				goto put;
 		}
 	} else {
+put:
 		if (!tmp->dst.bo) {
 			RegionRec region;
 
@@ -1879,6 +1880,14 @@ clear:
 			if (!sna_drawable_move_region_to_cpu(dst->pDrawable, &region,
 							MOVE_INPLACE_HINT | MOVE_WRITE))
 				return false;
+		} else {
+			if (tmp->dst.bo == sna_pixmap(tmp->dst.pixmap)->cpu_bo) {
+				assert(kgem_bo_is_busy(tmp->dst.bo));
+				tmp->dst.bo = sna_drawable_use_bo(dst->pDrawable,
+								  FORCE_GPU | PREFER_GPU,
+								  &dst_box,
+								  &tmp->damage);
+			}
 		}
 		ret = prepare_blt_put(sna, tmp, alpha_fixup);
 	}

commit 5781de2e5ab0d7e8e62965bda714789879555ed4
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Sep 13 19:53:29 2012 +0100

    sna/gen3: Tidy NO_COMPOSITE debugging
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index c5ec9bc..60e197e 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -2811,17 +2811,6 @@ gen3_render_composite(struct sna *sna,
 		return false;
 	}
 
-#if NO_COMPOSITE
-	if (mask)
-		return false;
-
-	return sna_blt_composite(sna, op,
-				 src, dst,
-				 src_x, src_y,
-				 dst_x, dst_y,
-				 width, height, tmp);
-#endif
-
 	/* Try to use the BLT engine unless it implies a
 	 * 3D -> 2D context switch.
 	 */
@@ -4688,7 +4677,9 @@ bool gen3_render_init(struct sna *sna)
 {
 	struct sna_render *render = &sna->render;
 
+#if !NO_COMPOSITE
 	render->composite = gen3_render_composite;
+#endif
 #if !NO_COMPOSITE_SPANS
 	render->check_composite_spans = gen3_check_composite_spans;
 	render->composite_spans = gen3_render_composite_spans;

commit dd1432b2c00c94ac75af4740b66b5cd1a573e261
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Sep 13 19:47:29 2012 +0100

    sna: Do not attempt to change tiling if wedged
    
    The caller will just have to live with the current tiling, which should
    be fine in most cases, in other cases the gpu is wedged...
    
    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 5bff247..7db7368 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -564,6 +564,11 @@ struct kgem_bo *sna_pixmap_change_tiling(PixmapPtr pixmap, uint32_t tiling)
 		return NULL;
 	}
 
+	if (wedged(sna)) {
+		DBG(("%s: can't convert bo, wedged\n", __FUNCTION__));
+		return NULL;
+	}
+
 	assert_pixmap_damage(pixmap);
 
 	bo = kgem_create_2d(&sna->kgem,

commit 8c7dd2219fa777bf6354c4e0ef38a2f09fe09675
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Sep 13 17:14:23 2012 +0100

    sna: Prefer to use indirect uploads for very small updates
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c
index fa87133..a466f55 100644
--- a/src/sna/sna_io.c
+++ b/src/sna/sna_io.c
@@ -537,6 +537,8 @@ static bool upload_inplace(struct kgem *kgem,
 			   const BoxRec *box,
 			   int n, int bpp)
 {
+	unsigned int bytes;
+
 	if (!kgem_bo_can_map(kgem, bo))
 		return false;
 
@@ -547,16 +549,15 @@ static bool upload_inplace(struct kgem *kgem,
 	 * able to almagamate a series of small writes into a single
 	 * operation.
 	 */
-	if (__kgem_bo_is_busy(kgem, bo)) {
-		unsigned int bytes = 0;
-		while (n--) {
-			bytes += (box->x2 - box->x1) * (box->y2 - box->y1);
-			box++;
-		}
-		return bytes * bpp >> 12 >= kgem->half_cpu_cache_pages;
+	bytes = 0;
+	while (n--) {
+		bytes += (box->x2 - box->x1) * (box->y2 - box->y1);
+		box++;
 	}
-
-	return true;
+	if (__kgem_bo_is_busy(kgem, bo))
+		return bytes * bpp >> 12 >= kgem->half_cpu_cache_pages;
+	else
+		return bytes * bpp >> 12;
 }
 
 bool sna_write_boxes(struct sna *sna, PixmapPtr dst,

commit d87a56ed1789e0c5058b302bb930d7e952ff3e5e
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Sep 13 09:57:30 2012 +0100

    sna: Teach sna_replace__xor() how to tile large uploads
    
    This path is hit using eog+cairo-1.10 and a large image, e.g.
    http://marsrovers.jpl.nasa.gov/gallery/press/opportunity/20120705a/PIA15689_Greeley_Pan_wDeck_L257F.jpg
    
    Reported-by: Michael Laß <bevan@bi-co.net>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54808
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c
index 738ec8e..fa87133 100644
--- a/src/sna/sna_io.c
+++ b/src/sna/sna_io.c
@@ -81,7 +81,7 @@ static void read_boxes_inplace(struct kgem *kgem,
 	DBG(("%s x %d, tiling=%d\n", __FUNCTION__, n, bo->tiling));
 
 	if (!kgem_bo_can_map(kgem, bo))
-		return false;
+		return;
 


Reply to: