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

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



 NEWS                         |   41 +++++
 configure.ac                 |    2 
 src/compat-api.h             |    1 
 src/intel_module.c           |   46 ++---
 src/sna/gen2_render.c        |    4 
 src/sna/gen3_render.c        |    4 
 src/sna/gen4_render.c        |    6 
 src/sna/gen5_render.c        |    6 
 src/sna/gen6_render.c        |    9 -
 src/sna/gen7_render.c        |   23 ++
 src/sna/kgem.c               |   28 ++-
 src/sna/sna.h                |    6 
 src/sna/sna_accel.c          |  192 ++++++++++++++----------
 src/sna/sna_cpu.c            |    6 
 src/sna/sna_display.c        |  244 ++++++++++++++++++++++--------
 src/sna/sna_display_fake.c   |   15 -
 src/sna/sna_dri.c            |   10 +
 src/sna/sna_driver.c         |   23 +-
 src/sna/sna_glyphs.c         |   10 -
 src/sna/sna_render.c         |    3 
 src/sna/sna_render.h         |   15 -
 src/sna/sna_video.c          |  162 +++++++++++++-------
 src/sna/sna_video.h          |   44 ++++-
 src/sna/sna_video_hwmc.c     |   64 +++-----
 src/sna/sna_video_hwmc.h     |    2 
 src/sna/sna_video_overlay.c  |  344 ++++++++++++++++++++++---------------------
 src/sna/sna_video_sprite.c   |  282 ++++++++++++++++++++---------------
 src/sna/sna_video_textured.c |  257 +++++++++++++++-----------------
 test/Makefile.am             |    2 
 test/tearing.mp4             |binary
 30 files changed, 1098 insertions(+), 753 deletions(-)

New commits:
commit 2770655371954413c750b030c9a7135baee302d4
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Jun 6 12:04:23 2013 +0100

    2.21.9 release

diff --git a/NEWS b/NEWS
index eb0d9b2..2d358c0 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,25 @@
+Release 2.21.9 (2013-06-06)
+===========================
+Consolidating the copy-on-write support, hopefully cleaning up the last of
+the regressions.
+
+ * Restore vsync on textured videos.
+   [regression from 2.21.8]
+   https://bugs.freedesktop.org/show_bug.cgi?id=65048
+
+ * Fix incorrect ordering of possible_clones with certain outputs, which
+   can lead to attempting to incorrectly clone 2 outputs and failing to
+   light them up.
+   [regression from 2.20.10]
+
+ * Fix performance regression from not promoting large fills to the GPU
+   [regression from 2.21.7]
+
+ * Undo the pixmap clone before performing a DRI2CopyRegion
+   [regression from 2.21.7]
+   https://bugs.freedesktop.org/show_bug.cgi?id=65250
+
+
 Release 2.21.8 (2013-05-27)
 ===========================
 A quick release to cleanup a few regressions from the introduction of
diff --git a/configure.ac b/configure.ac
index 0bac6f6..3f6f9bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-intel],
-        [2.21.8],
+        [2.21.9],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-intel])
 AC_CONFIG_SRCDIR([Makefile.am])

commit d3345cd269dc75999b35f3286d21059974dcb24b
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Jun 6 12:18:32 2013 +0100

    sna: Only emit an error for terminal mmap failures
    
    If we repeat the mmap, keep quiet. Only emit the ErrorF in case even the
    repeated attempts to mmap the bo fail.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 62713de..fefaa8b 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -292,8 +292,8 @@ retry_gtt:
 	VG_CLEAR(mmap_arg);
 	mmap_arg.handle = bo->handle;
 	if (drmIoctl(kgem->fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &mmap_arg)) {
-		ErrorF("%s: failed to retrieve GTT offset for handle=%d: %d\n",
-		       __FUNCTION__, bo->handle, errno);
+		int err = errno;
+
 		(void)__kgem_throttle_retire(kgem, 0);
 		if (kgem_expire_cache(kgem))
 			goto retry_gtt;
@@ -303,6 +303,8 @@ retry_gtt:
 			goto retry_gtt;
 		}
 
+		ErrorF("%s: failed to retrieve GTT offset for handle=%d: %d\n",
+		       __FUNCTION__, bo->handle, err);
 		return NULL;
 	}
 
@@ -310,8 +312,8 @@ retry_mmap:
 	ptr = mmap(0, bytes(bo), PROT_READ | PROT_WRITE, MAP_SHARED,
 		   kgem->fd, mmap_arg.offset);
 	if (ptr == MAP_FAILED) {
-		ErrorF("%s: failed to mmap %d, %d bytes, into GTT domain: %d\n",
-		       __FUNCTION__, bo->handle, bytes(bo), errno);
+		int err = errno;
+
 		if (__kgem_throttle_retire(kgem, 0))
 			goto retry_mmap;
 
@@ -320,6 +322,8 @@ retry_mmap:
 			goto retry_mmap;
 		}
 
+		ErrorF("%s: failed to mmap handle=%d, %d bytes, into GTT domain: %d\n",
+		       __FUNCTION__, bo->handle, bytes(bo), err);
 		ptr = NULL;
 	}
 
@@ -4694,8 +4698,8 @@ retry:
 	mmap_arg.offset = 0;
 	mmap_arg.size = bytes(bo);
 	if (drmIoctl(kgem->fd, DRM_IOCTL_I915_GEM_MMAP, &mmap_arg)) {
-		ErrorF("%s: failed to mmap %d, %d bytes, into CPU domain: %d\n",
-		       __FUNCTION__, bo->handle, bytes(bo), errno);
+		int err = errno;
+
 		if (__kgem_throttle_retire(kgem, 0))
 			goto retry;
 
@@ -4704,6 +4708,8 @@ retry:
 			goto retry;
 		}
 
+		ErrorF("%s: failed to mmap handle=%d, %d bytes, into CPU domain: %d\n",
+		       __FUNCTION__, bo->handle, bytes(bo), err);
 		return NULL;
 	}
 
@@ -4734,8 +4740,8 @@ retry:
 	mmap_arg.offset = 0;
 	mmap_arg.size = bytes(bo);
 	if (drmIoctl(kgem->fd, DRM_IOCTL_I915_GEM_MMAP, &mmap_arg)) {
-		ErrorF("%s: failed to mmap %d, %d bytes, into CPU domain: %d\n",
-		       __FUNCTION__, bo->handle, bytes(bo), errno);
+		int err = errno;
+
 		if (__kgem_throttle_retire(kgem, 0))
 			goto retry;
 
@@ -4744,6 +4750,8 @@ retry:
 			goto retry;
 		}
 
+		ErrorF("%s: failed to mmap handle=%d, %d bytes, into CPU domain: %d\n",
+		       __FUNCTION__, bo->handle, bytes(bo), err);
 		return NULL;
 	}
 

commit 70fa080d02bff9742523cea52c875d9447a78bfd
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jun 5 23:32:01 2013 +0100

    sna: Include the GT details in the backend name for a chipset
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index c25ef94..187cc15 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -68,6 +68,7 @@
 #define GEN6_MAX_SIZE 8192
 
 struct gt_info {
+	const char *name;
 	int max_vs_threads;
 	int max_gs_threads;
 	int max_wm_threads;
@@ -79,6 +80,7 @@ struct gt_info {
 };
 
 static const struct gt_info gt1_info = {
+	.name = "Sandybridge (gen6, gt1)",
 	.max_vs_threads = 24,
 	.max_gs_threads = 21,
 	.max_wm_threads = 40,
@@ -86,6 +88,7 @@ static const struct gt_info gt1_info = {
 };
 
 static const struct gt_info gt2_info = {
+	.name = "Sandybridge (gen6, gt2)",
 	.max_vs_threads = 60,
 	.max_gs_threads = 60,
 	.max_wm_threads = 80,
@@ -3704,5 +3707,5 @@ const char *gen6_render_init(struct sna *sna, const char *backend)
 
 	sna->render.max_3d_size = GEN6_MAX_SIZE;
 	sna->render.max_3d_pitch = 1 << 18;
-	return "Sandybridge (gen6)";
+	return sna->render_state.gen6.info->name;
 }
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 6dbf1d2..3e3da48 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -75,6 +75,7 @@
 #define is_aligned(x, y) (((x) & ((y) - 1)) == 0)
 
 struct gt_info {
+	const char *name;
 	uint32_t max_vs_threads;
 	uint32_t max_gs_threads;
 	uint32_t max_wm_threads;
@@ -86,6 +87,7 @@ struct gt_info {
 };
 
 static const struct gt_info ivb_gt_info = {
+	.name = "Ivybridge (gen7)",
 	.max_vs_threads = 16,
 	.max_gs_threads = 16,
 	.max_wm_threads = (16-1) << IVB_PS_MAX_THREADS_SHIFT,
@@ -93,6 +95,7 @@ static const struct gt_info ivb_gt_info = {
 };
 
 static const struct gt_info ivb_gt1_info = {
+	.name = "Ivybridge (gen7, gt1)",
 	.max_vs_threads = 36,
 	.max_gs_threads = 36,
 	.max_wm_threads = (48-1) << IVB_PS_MAX_THREADS_SHIFT,
@@ -100,13 +103,23 @@ static const struct gt_info ivb_gt1_info = {
 };
 
 static const struct gt_info ivb_gt2_info = {
+	.name = "Ivybridge (gen7, gt2)",
 	.max_vs_threads = 128,
 	.max_gs_threads = 128,
 	.max_wm_threads = (172-1) << IVB_PS_MAX_THREADS_SHIFT,
 	.urb = { 256, 704, 320 },
 };
 
+static const struct gt_info vlv_gt_info = {
+	.name = "Valleyview (gen7)",
+	.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 hsw_gt_info = {
+	.name = "Haswell (gen7.5)",
 	.max_vs_threads = 8,
 	.max_gs_threads = 8,
 	.max_wm_threads =
@@ -116,6 +129,7 @@ static const struct gt_info hsw_gt_info = {
 };
 
 static const struct gt_info hsw_gt1_info = {
+	.name = "Haswell (gen7.5, gt1)",
 	.max_vs_threads = 70,
 	.max_gs_threads = 70,
 	.max_wm_threads =
@@ -125,6 +139,7 @@ static const struct gt_info hsw_gt1_info = {
 };
 
 static const struct gt_info hsw_gt2_info = {
+	.name = "Haswell (gen7.5, gt2)",
 	.max_vs_threads = 140,
 	.max_gs_threads = 140,
 	.max_wm_threads =
@@ -3718,13 +3733,12 @@ static bool is_mobile(struct sna *sna)
 	return (DEVICE_ID(sna->PciInfo) & 0xf) == 0x6;
 }
 
-static const char *gen7_render_setup(struct sna *sna)
+static bool gen7_render_setup(struct sna *sna)
 {
 	struct gen7_render_state *state = &sna->render_state.gen7;
 	struct sna_static_stream general;
 	struct gen7_sampler_state *ss;
 	int i, j, k, l, m;
-	const char *backend;
 
 	if (sna->kgem.gen == 070) {
 		state->info = &ivb_gt_info;
@@ -3733,10 +3747,8 @@ static const char *gen7_render_setup(struct sna *sna)
 			if (is_gt2(sna))
 				state->info = &ivb_gt2_info; /* XXX requires GT_MODE WiZ disabled */
 		}
-		backend = "Ivybridge (gen7)";
 	} else if (sna->kgem.gen == 071) {
-		state->info = &ivb_gt_info;
-		backend = "Valleyview (gen7)";
+		state->info = &vlv_gt_info;
 	} else if (sna->kgem.gen == 075) {
 		state->info = &hsw_gt_info;
 		if (DEVICE_ID(sna->PciInfo) & 0xf) {
@@ -3744,9 +3756,8 @@ static const char *gen7_render_setup(struct sna *sna)
 			if (is_gt2(sna))
 				state->info = &hsw_gt2_info;
 		}
-		backend = "Haswell (gen7.5)";
 	} else
-		return NULL;
+		return false;
 
 	sna_static_stream_init(&general);
 
@@ -3807,16 +3818,13 @@ static const char *gen7_render_setup(struct sna *sna)
 	state->cc_blend = gen7_composite_create_blend_state(&general);
 
 	state->general_bo = sna_static_stream_fini(sna, &general);
-	return state->general_bo ? backend : NULL;
+	return state->general_bo != NULL;
 }
 
-const char *gen7_render_init(struct sna *sna, const char *parent)
+const char *gen7_render_init(struct sna *sna, const char *backend)
 {
-	const char *backend;
-
-	backend = gen7_render_setup(sna);
-	if (backend == NULL)
-		return parent;
+	if (!gen7_render_setup(sna))
+		return backend;
 
 	sna->kgem.context_switch = gen7_render_context_switch;
 	sna->kgem.retire = gen7_render_retire;
@@ -3860,5 +3868,5 @@ const char *gen7_render_init(struct sna *sna, const char *parent)
 
 	sna->render.max_3d_size = GEN7_MAX_SIZE;
 	sna->render.max_3d_pitch = 1 << 18;
-	return backend;
+	return sna->render_state.gen7.info->name;
 }

commit 45c09bfe58c37bbf7965af25bdd4fa5c37c0908f
Author: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Date:   Wed Jun 5 13:07:13 2013 -0300

    Add more correct names for Haswell.
    
    As we find out more of the final product names for Haswell chipsets, we
    need to update the user visible identification strings.
    
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>

diff --git a/src/intel_module.c b/src/intel_module.c
index 8b3b196..c1d0e09 100644
--- a/src/intel_module.c
+++ b/src/intel_module.c
@@ -160,19 +160,19 @@ static const SymTabRec intel_chipsets[] = {
 	{PCI_CHIP_IVYBRIDGE_D_GT2,		"Ivybridge Desktop (GT2)" },
 	{PCI_CHIP_IVYBRIDGE_S_GT1,		"Ivybridge Server" },
 	{PCI_CHIP_IVYBRIDGE_S_GT2,		"Ivybridge Server (GT2)" },
-	{PCI_CHIP_HASWELL_D_GT1,		"Haswell Desktop (GT1)" },
-	{PCI_CHIP_HASWELL_D_GT2,		"Haswell Desktop (GT2)" },
+	{PCI_CHIP_HASWELL_D_GT1,		"HD Graphics" },
+	{PCI_CHIP_HASWELL_D_GT2,		"HD Graphics 4600" },
 	{PCI_CHIP_HASWELL_D_GT3,		"Haswell Desktop (GT3)" },
-	{PCI_CHIP_HASWELL_M_GT1,		"Haswell Mobile (GT1)" },
-	{PCI_CHIP_HASWELL_M_GT2,		"Haswell Mobile (GT2)" },
+	{PCI_CHIP_HASWELL_M_GT1,		"HD Graphics" },
+	{PCI_CHIP_HASWELL_M_GT2,		"HD Graphics 4600" },
 	{PCI_CHIP_HASWELL_M_GT3,		"Haswell Mobile (GT3)" },
-	{PCI_CHIP_HASWELL_S_GT1,		"Haswell Server (GT1)" },
-	{PCI_CHIP_HASWELL_S_GT2,		"Haswell Server (GT2)" },
+	{PCI_CHIP_HASWELL_S_GT1,		"HD Graphics" },
+	{PCI_CHIP_HASWELL_S_GT2,		"HD Graphics P4600/P4700" },
 	{PCI_CHIP_HASWELL_S_GT3,		"Haswell Server (GT3)" },
 	{PCI_CHIP_HASWELL_B_GT1,		"Haswell (GT1)" },
 	{PCI_CHIP_HASWELL_B_GT2,		"Haswell (GT2)" },
 	{PCI_CHIP_HASWELL_B_GT3,		"Haswell (GT3)" },
-	{PCI_CHIP_HASWELL_E_GT1,		"Haswell (GT1)" },
+	{PCI_CHIP_HASWELL_E_GT1,		"HD Graphics" },
 	{PCI_CHIP_HASWELL_E_GT2,		"Haswell (GT2)" },
 	{PCI_CHIP_HASWELL_E_GT3,		"Haswell (GT3)" },
 	{PCI_CHIP_HASWELL_SDV_D_GT1,		"Haswell SDV Desktop (GT1)" },
@@ -193,23 +193,23 @@ static const SymTabRec intel_chipsets[] = {
 	{PCI_CHIP_HASWELL_ULT_D_GT1,		"Haswell ULT Desktop (GT1)" },
 	{PCI_CHIP_HASWELL_ULT_D_GT2,		"Haswell ULT Desktop (GT2)" },
 	{PCI_CHIP_HASWELL_ULT_D_GT3,		"Iris(TM) Graphics 5100" },
-	{PCI_CHIP_HASWELL_ULT_M_GT1,		"Haswell ULT Mobile (GT1)" },
-	{PCI_CHIP_HASWELL_ULT_M_GT2,		"Haswell ULT Mobile (GT2)" },
-	{PCI_CHIP_HASWELL_ULT_M_GT3,		"Iris(TM) Graphics 5100" },
+	{PCI_CHIP_HASWELL_ULT_M_GT1,		"HD Graphics" },
+	{PCI_CHIP_HASWELL_ULT_M_GT2,		"HD Graphics 4400" },
+	{PCI_CHIP_HASWELL_ULT_M_GT3,		"HD Graphics 5000" },
 	{PCI_CHIP_HASWELL_ULT_S_GT1,		"Haswell ULT Server (GT1)" },
 	{PCI_CHIP_HASWELL_ULT_S_GT2,		"Haswell ULT Server (GT2)" },
 	{PCI_CHIP_HASWELL_ULT_S_GT3,		"Iris(TM) Graphics 5100" },
 	{PCI_CHIP_HASWELL_ULT_B_GT1,		"Haswell ULT (GT1)" },
 	{PCI_CHIP_HASWELL_ULT_B_GT2,		"Haswell ULT (GT2)" },
 	{PCI_CHIP_HASWELL_ULT_B_GT3,		"Iris(TM) Graphics 5100" },
-	{PCI_CHIP_HASWELL_ULT_E_GT1,		"Haswell ULT (GT1)" },
-	{PCI_CHIP_HASWELL_ULT_E_GT2,		"Haswell ULT (GT2)" },
+	{PCI_CHIP_HASWELL_ULT_E_GT1,		"HD Graphics" },
+	{PCI_CHIP_HASWELL_ULT_E_GT2,		"HD Graphics 4200" },
 	{PCI_CHIP_HASWELL_ULT_E_GT3,		"Iris(TM) Graphics 5100" },
 	{PCI_CHIP_HASWELL_CRW_D_GT1,		"Haswell CRW Desktop (GT1)" },
-	{PCI_CHIP_HASWELL_CRW_D_GT2,		"Haswell CRW Desktop (GT2)" },
+	{PCI_CHIP_HASWELL_CRW_D_GT2,		"HD Graphics 4600" },
 	{PCI_CHIP_HASWELL_CRW_D_GT3,		"Iris(TM) Pro Graphics 5200" },
 	{PCI_CHIP_HASWELL_CRW_M_GT1,		"Haswell CRW Mobile (GT1)" },
-	{PCI_CHIP_HASWELL_CRW_M_GT2,		"Haswell CRW Mobile (GT2)" },
+	{PCI_CHIP_HASWELL_CRW_M_GT2,		"HD Graphics 4600" },
 	{PCI_CHIP_HASWELL_CRW_M_GT3,		"Iris(TM) Pro Graphics 5200" },
 	{PCI_CHIP_HASWELL_CRW_S_GT1,		"Haswell CRW Server (GT1)" },
 	{PCI_CHIP_HASWELL_CRW_S_GT2,		"Haswell CRW Server (GT2)" },

commit a9f9fb8e44bb0bdbd004da1fce986585ebcafd28
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jun 5 09:48:19 2013 +0100

    sna/video: Fix redundant initialisation of video->clip
    
    It will be created before use anyway, but this silences a compiler
    warning.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_video_overlay.c b/src/sna/sna_video_overlay.c
index 6d85275..e3140b3 100644
--- a/src/sna/sna_video_overlay.c
+++ b/src/sna/sna_video_overlay.c
@@ -775,7 +775,7 @@ void sna_video_overlay_setup(struct sna *sna, ScreenPtr screen)
 	video->gamma1 = 0x101010;
 	video->gamma0 = 0x080808;
 	video->rotation = RR_Rotate_0;
-	RegionNil(&video->clip);
+	RegionNull(&video->clip);
 
 	xvColorKey = MAKE_ATOM("XV_COLORKEY");
 	xvBrightness = MAKE_ATOM("XV_BRIGHTNESS");

commit 5d0ae71f1d667759ed4cfd2b7e793a08b8e3702c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jun 5 09:12:48 2013 +0100

    sna: Do not conflate ignoring an output with an allocation failure
    
    If the user explicitly ignores an output through xorg.conf, then
    xf86OutputCreate returns NULL. This is not to be confused with an
    allocation error that also returns NULL. The latter is terminal, the
    former is desired.
    
    Fixes regression from commit a9acc8dbb436e1e523e7d7c0f3c41946a2d0f245
    Author: Chris Wilson <chris@chris-wilson.co.uk>
    Date:   Thu May 30 12:09:52 2013 +0100
    
        sna: Cleanup up error reporting after failure to init KMS interface
    
    Reported-by: David Rosca <nowrep@gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65381
    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 2d59831..99e7311 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -44,6 +44,7 @@
 #include <X11/extensions/dpmsconst.h>
 #include <xf86drm.h>
 #include <xf86DDC.h> /* for xf86InterpretEDID */
+#include <xf86Opt.h> /* for xf86OptionPtr */
 
 #include "sna.h"
 #include "sna_reg.h"
@@ -59,6 +60,8 @@
 #define __DBG(x)
 #endif
 
+extern XF86ConfigPtr xf86configptr;
+
 struct sna_crtc {
 	struct drm_mode_modeinfo kmode;
 	int dpms_mode;
@@ -2380,6 +2383,29 @@ sna_zaphod_match(const char *s, const char *output)
 }
 
 static bool
+output_ignored(ScrnInfoPtr scrn, const char *name)
+{
+	char monitor_name[64];
+	const char *monitor;
+	XF86ConfMonitorPtr conf;
+
+	snprintf(monitor_name, sizeof(monitor_name), "monitor-%s", name);
+	monitor = xf86findOptionValue(scrn->options, monitor_name);
+	if (!monitor)
+		monitor = name;
+
+	conf = xf86findMonitor(monitor,
+			       xf86configptr->conf_monitor_lst);
+	if (conf == NULL && XF86_CRTC_CONFIG_PTR(scrn)->num_output == 0)
+		conf = xf86findMonitor(scrn->monitor->id,
+				       xf86configptr->conf_monitor_lst);
+	if (conf == NULL)
+		return false;
+
+	return xf86CheckBoolOption(conf->mon_option_lst, "Ignore", 0);
+}
+
+static bool
 sna_output_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num)
 {
 	struct sna *sna = to_sna(scrn);
@@ -2389,6 +2415,7 @@ sna_output_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num)
 	struct sna_output *sna_output;
 	const char *output_name;
 	char name[32];
+	bool ret = false;
 	int i;
 
 	koutput = drmModeGetConnector(sna->kgem.fd,
@@ -2412,8 +2439,8 @@ sna_output_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num)
 
 		str = xf86GetOptValString(sna->Options, OPTION_ZAPHOD);
 		if (str && !sna_zaphod_match(str, name)) {
-			drmModeFreeConnector(koutput);
-			return true;
+			ret = true;
+			goto cleanup_connector;
 		}
 
 		if ((enc.possible_crtcs & (1 << scrn->confScreen->device->screen)) == 0) {
@@ -2430,8 +2457,15 @@ sna_output_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num)
 	}
 
 	output = xf86OutputCreate(scrn, &sna_output_funcs, name);
-	if (!output)
+	if (!output) {
+		/* xf86OutputCreate does not differentiate between
+		 * a failure to allocate the output, and a user request
+		 * to ignore the output. So reconstruct whether the user
+		 * explicitly ignored the output.
+		 */
+		ret = output_ignored(scrn, name);
 		goto cleanup_connector;
+	}
 
 	sna_output = calloc(sizeof(struct sna_output), 1);
 	if (!sna_output)
@@ -2470,7 +2504,7 @@ cleanup_output:
 	xf86OutputDestroy(output);
 cleanup_connector:
 	drmModeFreeConnector(koutput);
-	return false;
+	return ret;
 }
 
 /* We need to map from kms encoder based possible_clones mask to X output based
@@ -2830,7 +2864,7 @@ bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna)
 			sna_mode_compute_possible_clones(scrn);
 
 #if HAS_PIXMAP_SHARING
-	xf86ProviderSetup(scrn, NULL, "Intel");
+		xf86ProviderSetup(scrn, NULL, "Intel");
 #endif
 	} else {
 		if (!sna_mode_fake_init(sna))

commit 6dacaddb6a28670a52cead4b62c056a8acde8f3a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Jun 3 15:34:37 2013 +0100

    sna: Always populate the CPU features string
    
    So that we don't print random contents of the stack on ancient 32-bit
    CPUs with no extended instruction sets.
    
    References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1186800
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_cpu.c b/src/sna/sna_cpu.c
index 489bf6c..c96b21f 100644
--- a/src/sna/sna_cpu.c
+++ b/src/sna/sna_cpu.c
@@ -108,7 +108,9 @@ char *sna_cpu_features_to_string(unsigned features, char *line)
 	char *ret = line;
 
 #ifdef __x86_64__
-	line += sprintf (line, ", x86-64");
+	line += sprintf (line, "x86-64");
+#else
+	line += sprintf (line, "x86");
 #endif
 
 	if (features & SSE2)
@@ -126,5 +128,5 @@ char *sna_cpu_features_to_string(unsigned features, char *line)
 	if (features & AVX2)
 		line += sprintf (line, ", avx2");
 
-	return ret + 2;
+	return ret;
 }

commit 8a88c01c3737a3570628600b1ab51938f82e226d
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Jun 3 14:14:09 2013 +0100

    sna: Make copying the glyph size more compact
    
    The assembly was ugly with an unwarranted AGU stall.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index 3e2d79b..62415c8 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -85,6 +85,7 @@
 #define N_STACK_GLYPHS 512
 
 #define glyph_valid(g) *((uint32_t *)&(g)->info.width)
+#define glyph_copy_size(r, g) *(uint32_t *)&(r)->width = *(uint32_t *)&g->info.width
 
 #if HAS_DEBUG_FULL
 static void _assert_pixmap_contains_box(PixmapPtr pixmap, BoxPtr box, const char *function)
@@ -632,10 +633,8 @@ glyphs_to_dst(struct sna *sna,
 				r.dst.y = y - glyph->info.y;
 				r.src.x = r.dst.x + src_x;
 				r.src.y = r.dst.y + src_y;
-				r.mask.x = priv.coordinate.x;
-				r.mask.y = priv.coordinate.y;
-				r.width  = glyph->info.width;
-				r.height = glyph->info.height;
+				r.mask = priv.coordinate;
+				glyph_copy_size(&r, glyph);
 
 				DBG(("%s: glyph=(%d, %d)x(%d, %d), unclipped\n",
 				     __FUNCTION__,
@@ -1164,8 +1163,7 @@ next_image:
 				r.mask = r.src;
 				r.dst.x = x - glyph->info.x;
 				r.dst.y = y - glyph->info.y;
-				r.width  = glyph->info.width;
-				r.height = glyph->info.height;
+				glyph_copy_size(&r, glyph);
 				tmp.blt(sna, &tmp, &r);
 
 next_glyph:

commit 66ad4d6f3c990bd40d816b4a22122bbf64786e4c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Jun 2 12:13:46 2013 +0100

    sna/dri: Undo any COW before performing a copy with DRI2CopyRegion
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65250
    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 9f8d9a7..9c1bda0 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -477,6 +477,12 @@ static void damage(PixmapPtr pixmap, RegionPtr region)
 	priv = sna_pixmap(pixmap);
 	assert(priv != NULL);
 	assert(priv->gpu_bo);
+
+	if (priv->cow) {
+		sna_pixmap_undo_cow(to_sna_from_pixmap(pixmap), priv,
+				    region ? MOVE_READ : 0);
+	}
+
 	if (DAMAGE_IS_ALL(priv->gpu_damage))
 		return;
 
@@ -509,7 +515,7 @@ static void set_bo(PixmapPtr pixmap, struct kgem_bo *bo)
 	assert((priv->pinned & PIN_PRIME) == 0);
 	assert(priv->flush);
 
-	if (priv->cow)
+	if (priv->cow && priv->gpu_bo != bo)
 		sna_pixmap_undo_cow(sna, priv, 0);
 
 	/* Post damage on the new front buffer so that listeners, such

commit 9a8ff7861c50b2f8698a968a011d5d833c7d5975
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Jun 2 12:13:28 2013 +0100

    sna: Add some more DBG hints to copy-on-write cloning
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index ef8f036..62713de 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1771,8 +1771,8 @@ void kgem_bo_undo(struct kgem *kgem, struct kgem_bo *bo)
 	if (kgem->nexec != 1 || bo->exec == NULL)
 		return;
 
-	DBG(("%s: only handle in batch, discarding last operations\n",
-	     __FUNCTION__));
+	DBG(("%s: only handle in batch, discarding last operations for handle=%ld\n",
+	     __FUNCTION__, bo->handle));
 
 	assert(bo->exec == &kgem->exec[0]);
 	assert(kgem->exec[0].handle == bo->handle);
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index fccc69e..7e0ca6d 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1668,11 +1668,13 @@ sna_pixmap_make_cow(struct sna *sna,
 	if (src_priv->gpu_bo->proxy)
 		return false;
 
-	DBG(("%s: make cow src=%ld, dst=%ld, handle=%ld\n",
+	DBG(("%s: make cow src=%ld, dst=%ld, handle=%ld (already cow? src=%d, dst=%d)\n",
 	     __FUNCTION__,
 	     src_priv->pixmap->drawable.serialNumber,
 	     dst_priv->pixmap->drawable.serialNumber,
-	     src_priv->gpu_bo->handle));
+	     src_priv->gpu_bo->handle,
+	     src_priv->cow ? IS_COW_OWNER(src_priv->cow) ? 1 : -1 : 0,
+	     dst_priv->cow ? IS_COW_OWNER(dst_priv->cow) ? 1 : -1 : 0));
 
 	if (dst_priv->pinned) {
 		DBG(("%s: can't cow, dst_pinned=%x\n",
@@ -1693,8 +1695,10 @@ sna_pixmap_make_cow(struct sna *sna,
 		cow->bo = src_priv->gpu_bo;
 		cow->refcnt = 1;
 
-		DBG(("%s: attaching source cow to pixmap=%ld\n",
-		     __FUNCTION__, src_priv->pixmap->drawable.serialNumber));
+		DBG(("%s: moo! attaching source cow to pixmap=%ld, handle=%d\n",
+		     __FUNCTION__,
+		     src_priv->pixmap->drawable.serialNumber,
+		     cow->bo->handle));
 
 		src_priv->cow = MAKE_COW_OWNER(cow);
 		list_init(&src_priv->cow_list);
@@ -1721,8 +1725,11 @@ sna_pixmap_make_cow(struct sna *sna,
 	list_add(&dst_priv->cow_list, &cow->list);
 	cow->refcnt++;
 
-	DBG(("%s: attaching clone to pixmap=%ld\n",
-	     __FUNCTION__, dst_priv->pixmap->drawable.serialNumber));
+	DBG(("%s: moo! attaching clone to pixmap=%ld (source=%ld, handle=%d)\n",
+	     __FUNCTION__,
+	     dst_priv->pixmap->drawable.serialNumber,
+	     src_priv->pixmap->drawable.serialNumber,
+	     cow->bo->handle));
 
 	if (dst_priv->mapped) {
 		dst_priv->pixmap->devPrivate.ptr = NULL;
@@ -4645,6 +4652,8 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 
 	/* XXX hack for firefox -- subsequent uses of src will be corrupt! */
 	if (src_priv && src_priv->cow && src_priv->gpu_bo == dst_priv->gpu_bo) {
+		DBG(("%s: discarding cow reference for cousin copy\n",
+		     __FUNCTION__));
 		assert(src_priv->cpu_damage == NULL);
 		bo = dst_priv->gpu_bo;
 		damage = NULL;

commit c4ad7b14ca71b95af83864b05793ea357f48bb88
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Jun 1 16:58:15 2013 +0100

    sna: Prevent adding damage to an already all-damaged GPU bo
    
    Keep the bookkeeping straight after propagating the source clear colour:
    commit 810a0ce2f89ba6b343b5043963626c0f2d50fb22 [2.21.7]
    Author: Chris Wilson <chris@chris-wilson.co.uk>
    Date:   Fri May 10 12:02:10 2013 +0100
    
        sna: Propagate clear color when replacing by a CopyArea
    
    Reported-by: Roman Jarosz <kedgedev@gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65247
    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 7cdc8fc..fccc69e 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4678,6 +4678,7 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 						       dst_pixmap->drawable.height);
 					sna_damage_destroy(&dst_priv->cpu_damage);
 					list_del(&dst_priv->flush_list);
+					return;
 				}
 			} else {
 				struct sna_fill_op fill;

commit be84b6929705584f30b63d6e613ff3d8e6e3dc1d
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Jun 1 16:51:38 2013 +0100

    sna/dri: Reorder assert not to fail on a pageflip deferred to after a modeset
    
    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 06d1f21..9f8d9a7 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -1584,10 +1584,10 @@ sna_dri_flip_continue(struct sna *sna, struct sna_dri_frame_event *info)
 		if (!info->draw)
 			return false;
 
-		assert(sna_pixmap_get_buffer(get_drawable_pixmap(info->draw)) == info->front);
 		if (!can_flip(sna, info->draw, info->front, info->back))
 			return false;
 
+		assert(sna_pixmap_get_buffer(get_drawable_pixmap(info->draw)) == info->front);
 		if (!sna_dri_page_flip(sna, info))
 			return false;
 

commit 2e11b520bbdb1af7e977db7fdef2d4c41242d56f
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu May 30 15:34:08 2013 +0100

    sna: Compile fix for non-debug builds
    
    sna_display.c: In function 'get_fb':
    sna_display.c:181:3: warning: implicit declaration of function 'assert_scanout' [-Wimplicit-function-declaration]
    sna_display.c:181:3: warning: nested extern declaration of 'assert_scanout' [-Wnested-externs]
    
    * sigh
    
    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 3231ca0..2d59831 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -162,6 +162,8 @@ static void assert_scanout(struct kgem *kgem, struct kgem_bo *bo,
 
 	assert(width == info.width && height == info.height);
 }
+#else
+#define assert_scanout(k, b, w, h)
 #endif
 
 static unsigned get_fb(struct sna *sna, struct kgem_bo *bo,

commit 3a9975729c665cd09a33e33eab608350aaee8160
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu May 30 14:15:23 2013 +0100

    sna: Restore GPU promotion for large fills
    
    Fix another regression from
    commit ef9dc6fae585d5616446eedc1e6e91173f4064c1 [2.21.7]
    Author: Chris Wilson <chris@chris-wilson.co.uk>
    Date:   Mon May 20 11:08:51 2013 +0100
    
        sna: Undo a few more overwritten operations upon a bo
    
    The REPLACES predicate was meant to complement the existing tests, not
    be compulsory.
    
    Found whilst investigating why performance seemed to have dropped off in
    Phoronix's benchmarks.
    
    Reported-by: Michael Larabel <michael@phoronix.com>
    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 3e3e75c..7cdc8fc 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -12223,8 +12223,7 @@ sna_poly_fill_rect(DrawablePtr draw, GCPtr gc, int n, xRectangle *rect)
 			hint |= REPLACES;
 		if (priv->cpu_damage == NULL) {
 			if (priv->gpu_bo &&
-			    hint & REPLACES &&
-			    box_inplace(pixmap, &region.extents)) {
+			    (hint & REPLACES || box_inplace(pixmap, &region.extents))) {
 				DBG(("%s: promoting to full GPU\n",
 				     __FUNCTION__));
 				assert(priv->gpu_bo->proxy == NULL);

commit 08b33ba8f12bb4bc425ca1bc40e2660e446e2c65
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu May 30 14:57:56 2013 +0100

    sna: Assert that an existing scanout is the desired size
    
    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 6cade44..3231ca0 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -145,6 +145,25 @@ uint32_t sna_crtc_to_plane(xf86CrtcPtr crtc)
 	return to_sna_crtc(crtc)->plane;
 }
 
+#ifndef NDEBUG
+static void gem_close(int fd, uint32_t handle);
+static void assert_scanout(struct kgem *kgem, struct kgem_bo *bo,
+			   int width, int height)
+{
+	struct drm_mode_fb_cmd info;
+
+	assert(bo->scanout);
+
+	VG_CLEAR(info);
+	info.fb_id = bo->delta;
+
+	assert(drmIoctl(kgem->fd, DRM_IOCTL_MODE_GETFB, &info) == 0);
+	gem_close(kgem->fd, info.handle);
+
+	assert(width == info.width && height == info.height);
+}
+#endif
+
 static unsigned get_fb(struct sna *sna, struct kgem_bo *bo,
 		       int width, int height)
 {
@@ -157,6 +176,7 @@ static unsigned get_fb(struct sna *sna, struct kgem_bo *bo,
 	if (bo->delta) {
 		DBG(("%s: reusing fb=%d for handle=%d\n",
 		     __FUNCTION__, bo->delta, bo->handle));
+		assert_scanout(&sna->kgem, bo, width, height);
 		return bo->delta;
 	}
 

commit a9acc8dbb436e1e523e7d7c0f3c41946a2d0f245
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu May 30 12:09:52 2013 +0100

    sna: Cleanup up error reporting after failure to init KMS interface
    
    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 cee0aea..6cade44 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -2793,30 +2793,32 @@ bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna)
 	int i;
 
 	mode->kmode = drmModeGetResources(sna->kgem.fd);
-	if (!mode->kmode)
-		return sna_mode_fake_init(sna);
+	if (mode->kmode) {
+		xf86CrtcConfigInit(scrn, &sna_mode_funcs);
 
-	xf86CrtcConfigInit(scrn, &sna_mode_funcs);
+		for (i = 0; i < mode->kmode->count_crtcs; i++)
+			if (!sna_crtc_init(scrn, mode, i))
+				return false;
 
-	for (i = 0; i < mode->kmode->count_crtcs; i++)
-		if (!sna_crtc_init(scrn, mode, i))
-			return false;
-
-	for (i = 0; i < mode->kmode->count_connectors; i++)
-		if (!sna_output_init(scrn, mode, i))
-			return false;
+		for (i = 0; i < mode->kmode->count_connectors; i++)
+			if (!sna_output_init(scrn, mode, i))
+				return false;
 
-	if (!xf86IsEntityShared(scrn->entityList[0]))
-		sna_mode_compute_possible_clones(scrn);
-
-	set_size_range(sna);
+		if (!xf86IsEntityShared(scrn->entityList[0]))
+			sna_mode_compute_possible_clones(scrn);
 
 #if HAS_PIXMAP_SHARING
 	xf86ProviderSetup(scrn, NULL, "Intel");
 #endif
-	xf86InitialConfiguration(scrn, TRUE);
+	} else {
+		if (!sna_mode_fake_init(sna))
+			return false;
+	}
 


Reply to: