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

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



 Makefile.am                     |    1 
 NEWS                            |   34 ++++++++-
 configure.ac                    |   32 +++++---
 man/intel.man                   |    2 
 src/compat-api.h                |   54 ++++++++++++++
 src/intel_driver.h              |    3 
 src/intel_module.c              |    7 +
 src/render_program/Makefile.am  |   16 ++--
 src/sna/fb/fb.h                 |   15 +++-
 src/sna/fb/fbbitmap.c           |   41 +++++++++-
 src/sna/fb/fbblt.c              |    4 -
 src/sna/fb/fbpict.c             |   12 ---
 src/sna/fb/fbpict.h             |   20 +++--
 src/sna/fb/fbpoint.c            |    4 -
 src/sna/fb/fbseg.c              |    3 
 src/sna/gen2_render.c           |    4 -
 src/sna/gen3_render.c           |   15 ++--
 src/sna/gen4_render.c           |   69 +++++++-----------
 src/sna/gen5_render.c           |   43 +++++------
 src/sna/gen6_render.c           |   28 +++++--
 src/sna/gen7_render.c           |   28 +++++--
 src/sna/kgem.c                  |  143 ++++++++++++++++++++++----------------
 src/sna/kgem.h                  |    1 
 src/sna/sna.h                   |   18 +++-
 src/sna/sna_accel.c             |  150 +++++++++++++++++++++-------------------
 src/sna/sna_composite.c         |   38 ++++++----
 src/sna/sna_damage.h            |    1 
 src/sna/sna_display.c           |   13 ++-
 src/sna/sna_dri.c               |    8 +-
 src/sna/sna_driver.c            |   18 ++++
 src/sna/sna_glyphs.c            |   22 ++++-
 src/sna/sna_io.c                |    7 +
 src/sna/sna_render.c            |   35 ++++++---
 src/sna/sna_render.h            |    8 +-
 src/sna/sna_render_inline.h     |   18 +++-
 src/sna/sna_trapezoids.c        |  141 +++++++++++++++++++++----------------
 src/xvmc/Makefile.am            |    5 -
 src/xvmc/shader/mc/Makefile.am  |    4 -
 src/xvmc/shader/vld/Makefile.am |    4 -
 test/.gitignore                 |    1 
 test/Makefile.am                |    2 
 test/lowlevel-blt-bench.c       |  135 ++++++++++++++++++++++++++++++++++++
 test/test.h                     |    5 +
 test/test_display.c             |   17 ++++
 44 files changed, 843 insertions(+), 386 deletions(-)

New commits:
commit 65c320e677b8ab4d745568b33f381d5865bf8b73
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Feb 10 14:20:59 2013 +0000

    2.21.2 release

diff --git a/NEWS b/NEWS
index 518e30f..e19d657 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,10 @@
+Release 2.21.2 (2013-02-10)
+===========================
+Pass the brown paper bags, I need half a dozen or so. That seemingly
+innocuous build fix with xorg-1.13 happned to have the little side-effect
+of breaking glyph rendering with xorg-1.12 and older on 64-bit machines.
+
+
 Release 2.21.1 (2013-02-10)
 ===========================
 A fix for a potential GPU hang on 945gm (GMA3100) and earlier chipsets,
diff --git a/configure.ac b/configure.ac
index 971bd6f..3a4b6db 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-intel],
-        [2.21.1],
+        [2.21.2],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-intel])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 0d75b19979b1ac14353765e2bb84c6a466129109
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Feb 10 15:47:53 2013 +0000

    sna: Restore glyphs with xorg-1.12
    
    That simple and innocuous build fix for xorg-1.13 bizarrely causes
    missing glyphs with earlier Xorgs.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/compat-api.h b/src/compat-api.h
index 2a912e5..6d147c7 100644
--- a/src/compat-api.h
+++ b/src/compat-api.h
@@ -28,8 +28,10 @@
 #ifndef COMPAT_API_H
 #define COMPAT_API_H
 
+#include <xorg-server.h>
 #include <xorgVersion.h>
 
+#include <picturestr.h>
 #ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
 #define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]
 #define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p
diff --git a/src/sna/fb/fbpict.c b/src/sna/fb/fbpict.c
index 27bed14..906a5f3 100644
--- a/src/sna/fb/fbpict.c
+++ b/src/sna/fb/fbpict.c
@@ -25,11 +25,8 @@
 
 #include <string.h>
 
-#include <picturestr.h>
-#include <mipict.h>
-#include <fbpict.h>
-
 #include "fb.h"
+#include "fbpict.h"
 
 static void
 SourceValidateOnePicture(PicturePtr picture)
diff --git a/src/sna/fb/fbpict.h b/src/sna/fb/fbpict.h
index 1ce09df..5601385 100644
--- a/src/sna/fb/fbpict.h
+++ b/src/sna/fb/fbpict.h
@@ -24,17 +24,23 @@
 #ifndef FBPICT_H
 #define FBPICT_H
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <picturestr.h>
+
 #include "sfb.h"
 
 extern void
 fbComposite(CARD8 op,
-            PicturePtr pSrc,
-            PicturePtr pMask,
-            PicturePtr pDst,
-            INT16 xSrc,
-            INT16 ySrc,
-            INT16 xMask,
-            INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
+	    PicturePtr pSrc,
+	    PicturePtr pMask,
+	    PicturePtr pDst,
+	    INT16 xSrc, INT16 ySrc,
+	    INT16 xMask, INT16 yMask,
+	    INT16 xDst, INT16 yDst,
+	    CARD16 width, CARD16 height);
 
 extern pixman_image_t *image_from_pict(PicturePtr pict,
 				       Bool has_clip,

commit 9fd0d8873a5a5c4f77904cab0b9909ca941b5dae
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Feb 10 14:29:29 2013 +0000

    NEWS: fix bug url
    
    The dangers of cutting and pasting from git log.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/NEWS b/NEWS
index f4b3a82..518e30f 100644
--- a/NEWS
+++ b/NEWS
@@ -16,7 +16,7 @@ like Debian 6.0 (Squeeze).
    only observed on just one particular laptop.
 
  * Fix alignment of subsurface proxies for old chipsets.
-   https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel
+   https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1120108
 
  * Repair build against Xorg-1.6 and contemporary packages.
 

commit 617fadf3acf7bf75fb203c1e85fd0ddb98b3dbb9
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Feb 10 14:20:59 2013 +0000

    2.21.1 release

diff --git a/NEWS b/NEWS
index bc384e7..f4b3a82 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,26 @@
+Release 2.21.1 (2013-02-10)
+===========================
+A fix for a potential GPU hang on 945gm (GMA3100) and earlier chipsets,
+along with backporting SNA to the packages found in stable distributions
+like Debian 6.0 (Squeeze).
+
+ * Cleanup compilation warnings from deblint, thanks to Paul Menzel
+
+ * Minor build improvements by Damien Lespiau.
+
+ * Disable generating span geometry for non-rectilinear spans on gen4
+   in order to work around and prevent one class of render corruption.
+
+ * Prevent cache thrashing and severe performance degradation on LLC
+   machines for streaming texture updates. However, note the effect was
+   only observed on just one particular laptop.
+
+ * Fix alignment of subsurface proxies for old chipsets.
+   https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel
+
+ * Repair build against Xorg-1.6 and contemporary packages.
+
+
 Release 2.21.0 (2013-02-01)
 ===========================
 A few new features:
diff --git a/configure.ac b/configure.ac
index 25b479a..971bd6f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-intel],
-        [2.21.0],
+        [2.21.1],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-intel])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 3169a4e53cf39cc3d5c18ac6add909aa3a58de7e
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Feb 10 11:57:14 2013 +0000

    sna: Reorder some includes so that compat-api.h comes after the headers it wraps
    
    Fixes the build in cases where the compat-api.h was defining macros to
    subvert the real functions found in the xorg includes
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/fb/fbpict.c b/src/sna/fb/fbpict.c
index 349ec53..27bed14 100644
--- a/src/sna/fb/fbpict.c
+++ b/src/sna/fb/fbpict.c
@@ -25,13 +25,12 @@
 
 #include <string.h>
 
-#include "fb.h"
-
-#include <xorgVersion.h>
 #include <picturestr.h>
 #include <mipict.h>
 #include <fbpict.h>
 
+#include "fb.h"
+
 static void
 SourceValidateOnePicture(PicturePtr picture)
 {

commit 71fbad64c5cfe6832a03815bece4c89d15253e1a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Feb 10 10:54:17 2013 +0000

    configure: Fix typo in checking for libdrm_intel
    
    The package name is libdrm_intel not libdrm_intel-1, an obvious
    cut'n'paste error from testing for pixman-1.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/configure.ac b/configure.ac
index cdc1ac9..25b479a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -215,20 +215,23 @@ AC_ARG_ENABLE(uxa,
 	      AS_HELP_STRING([--enable-uxa],
 			     [Enable Unified Acceleration Architecture (UXA) [default=yes]]),
 	      [UXA="$enableval"],
-	      [UXA=yes])
+	      [UXA=auto])
 AC_MSG_CHECKING([whether to include UXA support])
-AC_MSG_RESULT([$UXA])
-if ! pkg-config --exists 'libdrm_intel-1 >= 2.4.29'; then
-	UXA=no
-fi
-if ! pkg-config --exists 'pixman-1 >= 0.24.0'; then
-	UXA=no
+if test "x$UXA" = "xauto"; then
+	if ! pkg-config --exists 'libdrm_intel >= 2.4.29'; then
+		UXA=no
+	fi
+	if ! pkg-config --exists 'pixman-1 >= 0.24.0'; then
+		UXA=no
+	fi
 fi
 if test "x$UXA" != "xno"; then
 	AC_DEFINE(USE_UXA, 1, [Enable UXA support])
 	PKG_CHECK_MODULES(DRMINTEL, [libdrm_intel >= 2.4.29])
 	required_pixman_version=0.24
+	UXA=yes
 fi
+AC_MSG_RESULT([$UXA])
 AM_CONDITIONAL(UXA, test x$UXA != xno)
 
 AC_MSG_CHECKING([whether to include GLAMOR support])

commit 3cbdfb54d1fcfed7745111e861e19b7bbac243cc
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Feb 9 19:15:20 2013 +0000

    sna: Backport to squeeze - Xorg-1.6, pixman-0.16, libdrm-2.4.21
    
    The principle change is to switch to the old Privates API and undo the
    Region renames.
    
    The downside is that this ignores the critical bugfixes made to the
    xserver since xorg-1.6 - but I assume that whoever wants to run the
    latest hardware on the old xservers is also backporting those stability
    fixes...
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/configure.ac b/configure.ac
index 13a4b46..cdc1ac9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -184,12 +184,16 @@ AC_ARG_ENABLE(ums-only, AS_HELP_STRING([--enable-ums-only],
               [UMS_ONLY=no])
 
 required_xorg_xserver_version=1.6
-required_pixman_version=0.24
+required_pixman_version=0.16
 
 if pkg-config --exists 'pixman-1 >= 0.27.1'; then
 	AC_DEFINE([HAS_PIXMAN_GLYPHS], 1, [Enable pixman glyph cache])
 fi
 
+if pkg-config --exists 'pixman-1 >= 0.24.0'; then
+	AC_DEFINE([HAS_PIXMAN_TRIANGLES], 1, [Enable pixman triangle rasterisation])
+fi
+
 AC_ARG_ENABLE(sna,
 	      AS_HELP_STRING([--enable-sna],
 			     [Enable SandyBridge's New Acceleration (SNA) [default=auto]]),
@@ -201,7 +205,6 @@ if test "x$SNA" = "xauto" && pkg-config --exists "xorg-server >= 1.10"; then
 	SNA=yes
 fi
 if test "x$SNA" != "xno"; then
-	required_xorg_xserver_version=1.10
 	AC_DEFINE(USE_SNA, 1, [Enable SNA support])
 fi
 AC_MSG_CHECKING([whether to include SNA support])
@@ -214,12 +217,19 @@ AC_ARG_ENABLE(uxa,
 	      [UXA="$enableval"],
 	      [UXA=yes])
 AC_MSG_CHECKING([whether to include UXA support])
-AM_CONDITIONAL(UXA, test x$UXA != xno)
 AC_MSG_RESULT([$UXA])
+if ! pkg-config --exists 'libdrm_intel-1 >= 2.4.29'; then
+	UXA=no
+fi
+if ! pkg-config --exists 'pixman-1 >= 0.24.0'; then
+	UXA=no
+fi
 if test "x$UXA" != "xno"; then
 	AC_DEFINE(USE_UXA, 1, [Enable UXA support])
 	PKG_CHECK_MODULES(DRMINTEL, [libdrm_intel >= 2.4.29])
+	required_pixman_version=0.24
 fi
+AM_CONDITIONAL(UXA, test x$UXA != xno)
 
 AC_MSG_CHECKING([whether to include GLAMOR support])
 AC_ARG_ENABLE(glamor,
@@ -347,7 +357,7 @@ XORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11)
 XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
 
 # Obtain compiler/linker options for the driver dependencies
-PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.24]) # libdrm_intel is checked separately
+PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.20]) # libdrm_intel is checked separately
 PKG_CHECK_MODULES(DRI, [xf86driproto], , DRI=no)
 PKG_CHECK_MODULES(DRI2, [dri2proto >= 2.6],, DRI2=no)
 PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
diff --git a/src/compat-api.h b/src/compat-api.h
index 6b76572..2a912e5 100644
--- a/src/compat-api.h
+++ b/src/compat-api.h
@@ -28,6 +28,8 @@
 #ifndef COMPAT_API_H
 #define COMPAT_API_H
 
+#include <xorgVersion.h>
+
 #ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
 #define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]
 #define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p
@@ -103,4 +105,54 @@
 
 #endif
 
+#ifndef INCLUDE_LEGACY_REGION_DEFINES
+#define RegionCreate(r, s) REGION_CREATE(NULL, r, s)
+#define RegionBreak(r) REGION_BREAK(NULL, r)
+#define RegionSizeof REGION_SZOF
+#define RegionBoxptr REGION_BOXPTR
+#define RegionEnd REGION_END
+#define RegionExtents(r) REGION_EXTENTS(NULL, r)
+#define RegionRects REGION_RECTS
+#define RegionNumRects REGION_NUM_RECTS
+#define RegionContainsRect(r, b) RECT_IN_REGION(NULL, r, b)
+#define RegionContainsPoint(r, x, y, b) POINT_IN_REGION(NULL, r, x, y, b)
+#define RegionCopy(res, r) REGION_COPY(NULL, res, r)
+#define RegionIntersect(res, r1, r2) REGION_INTERSECT(NULL, res, r1, r2)
+#define RegionUnion(res, r1, r2) REGION_UNION(NULL, res, r1, r2)
+#define RegionTranslate(r, x, y) REGION_TRANSLATE(NULL, r, x, y)
+#define RegionUninit(r) REGION_UNINIT(NULL, r)
+#define region_from_bitmap BITMAP_TO_REGION
+#define RegionNil REGION_NIL
+#define RegionNull(r) REGION_NULL(NULL, r)
+#define RegionNotEmpty(r) REGION_NOTEMPTY(NULL, r)
+#define RegionEmpty(r) REGION_EMPTY(NULL, r)
+#define RegionDestroy(r) REGION_DESTROY(NULL, r)
+#else
+#define region_from_bitmap BitmapToRegion
+#endif
+
+#ifndef _X_UNUSED
+#define _X_UNUSED
+#endif
+
+#if HAS_DEVPRIVATEKEYREC
+#define __get_private(p, key) dixGetPrivateAddr(&(p)->devPrivates, &(key))
+#else
+#define __get_private(p, key) dixLookupPrivate(&(p)->devPrivates, &(key))
+typedef int DevPrivateKeyRec;
+static inline void FreePixmap(PixmapPtr pixmap)
+{
+	dixFreePrivates(pixmap->devPrivates);
+	free(pixmap);
+}
+#endif
+
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,9,99,902,0)
+#define SourceValidate(d, x, y, w, h, mode) \
+	if ((d)->pScreen->SourceValidate) (d)->pScreen->SourceValidate(d, x, y, w, h, mode)
+#else
+#define SourceValidate(d, x, y, w, h, mode) \
+	if ((d)->pScreen->SourceValidate) (d)->pScreen->SourceValidate(d, x, y, w, h)
+#endif
+
 #endif
diff --git a/src/sna/fb/fb.h b/src/sna/fb/fb.h
index e58e039..d99453d 100644
--- a/src/sna/fb/fb.h
+++ b/src/sna/fb/fb.h
@@ -33,6 +33,7 @@
 #include <gcstruct.h>
 #include <colormap.h>
 #include <windowstr.h>
+#include <regionstr.h>
 
 #include <stdbool.h>
 #include <pixman.h>
@@ -45,6 +46,8 @@
 
 #include "sfb.h"
 
+#include "../../compat-api.h"
+
 #define WRITE(ptr, val) (*(ptr) = (val))
 #define READ(ptr) (*(ptr))
 
@@ -294,12 +297,12 @@ extern DevPrivateKeyRec sna_window_key;
 
 static inline FbGCPrivate *fb_gc(GCPtr gc)
 {
-	return dixGetPrivateAddr(&gc->devPrivates, &sna_gc_key);
+	return (FbGCPrivate *)__get_private(gc, sna_gc_key);
 }
 
 static inline PixmapPtr fbGetWindowPixmap(WindowPtr window)
 {
-	return *(PixmapPtr *)dixGetPrivateAddr(&window->devPrivates, &sna_window_key);
+	return *(PixmapPtr *)__get_private(window, sna_window_key);
 }
 
 #ifdef ROOTLESS
@@ -360,8 +363,14 @@ static inline PixmapPtr fbGetWindowPixmap(WindowPtr window)
  * XFree86 empties the root BorderClip when the VT is inactive,
  * here's a macro which uses that to disable GetImage and GetSpans
  */
+
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,10,0,0,0)
 #define fbWindowEnabled(pWin) \
-    RegionNotEmpty(&(pWin)->drawable.pScreen->root->borderClip)
+	RegionNotEmpty(&(pWin)->drawable.pScreen->root->borderClip)
+#else
+#define fbWindowEnabled(pWin) \
+	RegionNotEmpty(&WindowTable[(pWin)->drawable.pScreen->myNum]->borderClip)
+#endif
 #define fbDrawableEnabled(drawable) \
     ((drawable)->type == DRAWABLE_PIXMAP ? \
      TRUE : fbWindowEnabled((WindowPtr) drawable))
diff --git a/src/sna/fb/fbbitmap.c b/src/sna/fb/fbbitmap.c
index 7c037fe..2ea92a9 100644
--- a/src/sna/fb/fbbitmap.c
+++ b/src/sna/fb/fbbitmap.c
@@ -25,21 +25,50 @@
 
 #include "fb.h"
 
+static Bool region_grow(RegionPtr region)
+{
+	RegDataPtr data;
+	int n;
+
+	n = 16;
+	if (!region->data) {
+		region->data = malloc(RegionSizeof(n));
+		if (!region->data)
+			return RegionBreak(region);
+		region->data->numRects = 1;
+		*RegionBoxptr(region) = region->extents;
+	} else if (!region->data->size) {
+		region->data = malloc(RegionSizeof(n));
+		if (!region->data)
+			return RegionBreak(region);
+		region->data->numRects = 0;
+	} else {
+		n = 2 * region->data->numRects;
+		data = (RegDataPtr) realloc(region->data, RegionSizeof(n));
+		if (!data)
+			return RegionBreak(region);
+		region->data = data;
+	}
+	region->data->size = n;
+	return TRUE;
+}
+
 static inline void add(RegionPtr region,
 		       int16_t x1, int16_t y1, int16_t x2, int16_t y2)
 {
 	BoxPtr r;
 
-	if (region->data->numRects == region->data->size)
-		RegionRectAlloc(region, 1);
+	if (region->data->numRects == region->data->size &&
+	    !region_grow(region))
+		return;
 
 	r = RegionBoxptr(region) + region->data->numRects++;
 	r->x1 = x1; r->y1 = y1;
 	r->x2 = x2; r->y2 = y2;
 
-	DBG(("%s[%d/%d]: (%d, %d), (%d, %d)\n",
+	DBG(("%s[%ld/%ld]: (%d, %d), (%d, %d)\n",
 	     __FUNCTION__,
-	     region->data->numRects, region->data->size,
+	     (long)region->data->numRects, (long)region->data->size,
 	     x1, y1, x2, y2));
 
 	if (x1 < region->extents.x1)
@@ -149,11 +178,11 @@ fbBitmapToRegion(PixmapPtr pixmap)
 	} else
 		region->extents.x1 = region->extents.x2 = 0;
 
-	DBG(("%s: region extents=(%d, %d), (%d, %d) x %d\n",
+	DBG(("%s: region extents=(%d, %d), (%d, %d) x %ld\n",
 	     __FUNCTION__,
 	     region->extents.x1, region->extents.y1,
 	     region->extents.x2, region->extents.y2,
-	     RegionNumRects(region)));
+	     (long)RegionNumRects(region)));
 
 	return region;
 }
diff --git a/src/sna/fb/fbblt.c b/src/sna/fb/fbblt.c
index 287ea40..5ad2e2e 100644
--- a/src/sna/fb/fbblt.c
+++ b/src/sna/fb/fbblt.c
@@ -285,9 +285,9 @@ fbBlt(FbBits *srcLine, FbStride srcStride, int srcX,
 		s += srcX >> 3;
 		d += dstX >> 3;
 
-		DBG(("%s fast blt, src_stride=%d, dst_stride=%d, width=%d (offset=%d)\n",
+		DBG(("%s fast blt, src_stride=%d, dst_stride=%d, width=%d (offset=%ld)\n",
 		     __FUNCTION__,
-		     srcStride, dstStride, width, s - d));
+		     srcStride, dstStride, width, (long)(s - d)));
 
 		if (width == srcStride && width == dstStride) {
 			width *= height;
diff --git a/src/sna/fb/fbpict.c b/src/sna/fb/fbpict.c
index a203851..349ec53 100644
--- a/src/sna/fb/fbpict.c
+++ b/src/sna/fb/fbpict.c
@@ -27,24 +27,22 @@
 
 #include "fb.h"
 
+#include <xorgVersion.h>
 #include <picturestr.h>
 #include <mipict.h>
-#include "fbpict.h"
+#include <fbpict.h>
 
 static void
 SourceValidateOnePicture(PicturePtr picture)
 {
 	DrawablePtr drawable = picture->pDrawable;
-	ScreenPtr screen;
 
 	if (!drawable)
 		return;
 
-	screen = drawable->pScreen;
-	if (screen->SourceValidate)
-		screen->SourceValidate(drawable,
-				       0, 0, drawable->width, drawable->height,
-				       picture->subWindowMode);
+	SourceValidate(drawable,
+		       0, 0, drawable->width, drawable->height,
+		       picture->subWindowMode);
 }
 
 static void
diff --git a/src/sna/fb/fbpoint.c b/src/sna/fb/fbpoint.c
index 3df79a2..c5f0f87 100644
--- a/src/sna/fb/fbpoint.c
+++ b/src/sna/fb/fbpoint.c
@@ -93,10 +93,10 @@ fbPolyPoint(DrawablePtr drawable, GCPtr gc,
 		     int xoff, int yoff,
 		     FbBits and, FbBits xor);
 
-	DBG(("%s x %d, clip=[(%d, %d), (%d, %d)]x%d\n", __FUNCTION__, n,
+	DBG(("%s x %d, clip=[(%d, %d), (%d, %d)]x%ld\n", __FUNCTION__, n,
 	     gc->pCompositeClip->extents.x1, gc->pCompositeClip->extents.y1,
 	     gc->pCompositeClip->extents.x2, gc->pCompositeClip->extents.y2,
-	     RegionNumRects(gc->pCompositeClip)));
+	     (long)RegionNumRects(gc->pCompositeClip)));
 
 	if (mode == CoordModePrevious)
 		fbFixCoordModePrevious(n, pt);
diff --git a/src/sna/fb/fbseg.c b/src/sna/fb/fbseg.c
index 5b8173f..67ad389 100644
--- a/src/sna/fb/fbseg.c
+++ b/src/sna/fb/fbseg.c
@@ -353,7 +353,8 @@ fbSelectBres(DrawablePtr drawable, GCPtr gc)
 	FbBres *bres;
 
 	DBG(("%s: line=%d, fill=%d, and=%lx, bgand=%lx\n",
-	     __FUNCTION__, gc->lineStyle, gc->fillStyle, pgc->and, pgc->bgand));
+	     __FUNCTION__, gc->lineStyle, gc->fillStyle,
+	     (long)pgc->and, (long)pgc->bgand));
 	assert(gc->lineWidth == 0);
 
 	if (gc->lineStyle == LineSolid) {
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 2801efc..86a2dfc 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -111,6 +111,9 @@ search_snoop_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags);
 
 #define MAKE_REQUEST(rq, ring) ((struct kgem_request *)((uintptr_t)(rq) | (ring)))
 
+#define LOCAL_I915_PARAM_HAS_BLT		11
+#define LOCAL_I915_PARAM_HAS_RELAXED_FENCING	12
+#define LOCAL_I915_PARAM_HAS_RELAXED_DELTA	15
 #define LOCAL_I915_PARAM_HAS_SEMAPHORES		20
 #define LOCAL_I915_PARAM_HAS_SECURE_BATCHES	23
 #define LOCAL_I915_PARAM_HAS_PINNED_BATCHES	24
@@ -782,7 +785,7 @@ static bool test_has_relaxed_fencing(struct kgem *kgem)
 		if (DBG_NO_RELAXED_FENCING)
 			return false;
 
-		return gem_param(kgem, I915_PARAM_HAS_RELAXED_FENCING) > 0;
+		return gem_param(kgem, LOCAL_I915_PARAM_HAS_RELAXED_FENCING) > 0;
 	} else
 		return true;
 }
@@ -982,12 +985,12 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, unsigned gen)
 	kgem->vma[MAP_GTT].count = -MAX_GTT_VMA_CACHE;
 	kgem->vma[MAP_CPU].count = -MAX_CPU_VMA_CACHE;
 
-	kgem->has_blt = gem_param(kgem, I915_PARAM_HAS_BLT) > 0;
+	kgem->has_blt = gem_param(kgem, LOCAL_I915_PARAM_HAS_BLT) > 0;
 	DBG(("%s: has BLT ring? %d\n", __FUNCTION__,
 	     kgem->has_blt));
 
 	kgem->has_relaxed_delta =
-		gem_param(kgem, I915_PARAM_HAS_RELAXED_DELTA) > 0;
+		gem_param(kgem, LOCAL_I915_PARAM_HAS_RELAXED_DELTA) > 0;
 	DBG(("%s: has relaxed delta? %d\n", __FUNCTION__,
 	     kgem->has_relaxed_delta));
 
diff --git a/src/sna/sna.h b/src/sna/sna.h
index 5a57a6e..b470c48 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -141,6 +141,15 @@ struct sna_glyph {
 	uint16_t size, pos;
 };
 
+static inline WindowPtr root(ScreenPtr screen)
+{
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,10,0,0,0)
+	return screen->root;
+#else
+	return WindowTable[screen->myNum];
+#endif
+}
+
 static inline PixmapPtr get_window_pixmap(WindowPtr window)
 {
 	return fbGetWindowPixmap(window);
@@ -158,7 +167,7 @@ extern DevPrivateKeyRec sna_pixmap_key;
 
 constant static inline struct sna_pixmap *sna_pixmap(PixmapPtr pixmap)
 {
-	return ((void **)dixGetPrivateAddr(&pixmap->devPrivates, &sna_pixmap_key))[1];
+	return ((void **)__get_private(pixmap, sna_pixmap_key))[1];
 }
 
 static inline struct sna_pixmap *sna_pixmap_from_drawable(DrawablePtr drawable)
@@ -176,7 +185,7 @@ struct sna_gc {
 
 static inline struct sna_gc *sna_gc(GCPtr gc)
 {
-	return dixGetPrivateAddr(&gc->devPrivates, &sna_gc_key);
+	return (struct sna_gc *)__get_private(gc, sna_gc_key);
 }
 
 enum {
@@ -314,7 +323,7 @@ to_sna_from_screen(ScreenPtr screen)
 constant static inline struct sna *
 to_sna_from_pixmap(PixmapPtr pixmap)
 {
-	return ((void **)dixGetPrivateAddr(&pixmap->devPrivates, &sna_pixmap_key))[0];
+	return ((void **)__get_private(pixmap, sna_pixmap_key))[0];
 }
 
 constant static inline struct sna *
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 8ddee46..827dcf4 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -627,7 +627,7 @@ struct kgem_bo *sna_pixmap_change_tiling(PixmapPtr pixmap, uint32_t tiling)
 
 static inline void sna_set_pixmap(PixmapPtr pixmap, struct sna_pixmap *sna)
 {
-	((void **)dixGetPrivateAddr(&pixmap->devPrivates, &sna_pixmap_key))[1] = sna;
+	((void **)__get_private(pixmap, sna_pixmap_key))[1] = sna;
 	assert(sna_pixmap(pixmap) == sna);
 }
 
@@ -727,11 +727,13 @@ create_pixmap(struct sna *sna, ScreenPtr screen,
 		datasize += adjust;
 	}
 
+	DBG(("%s: allocating pixmap %dx%d, depth=%d, size=%ld\n",
+	     __FUNCTION__, width, height, depth, (long)datasize));
 	pixmap = AllocatePixmap(screen, datasize);
 	if (!pixmap)
 		return NullPixmap;
 
-	((void **)dixGetPrivateAddr(&pixmap->devPrivates, &sna_pixmap_key))[0] = sna;
+	((void **)__get_private(pixmap, sna_pixmap_key))[0] = sna;
 	assert(to_sna_from_pixmap(pixmap) == sna);
 
 	pixmap->drawable.type = DRAWABLE_PIXMAP;
@@ -2015,8 +2017,8 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
 
 	assert(priv->gpu_bo->proxy == NULL);
 	if (priv->clear) {
-		int n = REGION_NUM_RECTS(region);
-		BoxPtr box = REGION_RECTS(region);
+		int n = RegionNumRects(region);
+		BoxPtr box = RegionRects(region);
 
 		DBG(("%s: pending clear, doing partial fill\n", __FUNCTION__));
 		if (priv->cpu_bo) {
@@ -2132,9 +2134,9 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
 			 * reads.
 			 */
 			if (flags & MOVE_WRITE) {
-				int n = REGION_NUM_RECTS(region), i;
-				BoxPtr boxes = REGION_RECTS(region);
-				BoxPtr blocks = malloc(sizeof(BoxRec) * REGION_NUM_RECTS(region));
+				int n = RegionNumRects(region), i;
+				BoxPtr boxes = RegionRects(region);
+				BoxPtr blocks = malloc(sizeof(BoxRec) * RegionNumRects(region));
 				if (blocks) {
 					for (i = 0; i < n; i++) {
 						blocks[i].x1 = boxes[i].x1 & ~31;
@@ -2190,8 +2192,8 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
 			} else if (DAMAGE_IS_ALL(priv->gpu_damage) ||
 				   sna_damage_contains_box__no_reduce(priv->gpu_damage,
 								      &r->extents)) {
-				BoxPtr box = REGION_RECTS(r);
-				int n = REGION_NUM_RECTS(r);
+				BoxPtr box = RegionRects(r);
+				int n = RegionNumRects(r);
 				bool ok = false;
 
 				DBG(("%s: region wholly inside damage\n",
@@ -2216,8 +2218,8 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
 
 				pixman_region_init(&need);
 				if (sna_damage_intersect(priv->gpu_damage, r, &need)) {
-					BoxPtr box = REGION_RECTS(&need);
-					int n = REGION_NUM_RECTS(&need);
+					BoxPtr box = RegionRects(&need);
+					int n = RegionNumRects(&need);
 					bool ok = false;
 
 					DBG(("%s: region intersects damage\n",
@@ -2535,10 +2537,10 @@ sna_pixmap_move_area_to_gpu(PixmapPtr pixmap, const BoxRec *box, unsigned int fl
 
 		sna_damage_subtract(&priv->cpu_damage, &r);
 	} else if (sna_damage_intersect(priv->cpu_damage, &r, &i)) {
-		int n = REGION_NUM_RECTS(&i);
+		int n = RegionNumRects(&i);
 		bool ok;
 
-		box = REGION_RECTS(&i);
+		box = RegionRects(&i);
 		ok = false;
 		if (use_cpu_bo_for_upload(sna, priv, 0)) {
 			DBG(("%s: using CPU bo for upload to GPU, %d boxes\n", __FUNCTION__, n));
@@ -3249,7 +3251,7 @@ static bool must_check sna_gc_move_to_cpu(GCPtr gc,
 
 	if (gc->clientClipType == CT_PIXMAP) {
 		PixmapPtr clip = gc->clientClip;
-		gc->clientClip = BitmapToRegion(gc->pScreen, clip);
+		gc->clientClip = region_from_bitmap(gc->pScreen, clip);
 		gc->pScreen->DestroyPixmap(clip);
 		gc->clientClipType = gc->clientClip ? CT_REGION : CT_NONE;
 		changes |= GCClipMask;
@@ -3443,8 +3445,8 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
 	DBG(("%s: upload(%d, %d, %d, %d)\n", __FUNCTION__, x, y, w, h));
 
 	/* Region is pre-clipped and translated into pixmap space */
-	box = REGION_RECTS(region);
-	n = REGION_NUM_RECTS(region);
+	box = RegionRects(region);
+	n = RegionNumRects(region);
 	do {
 		DBG(("%s: copy box (%d, %d)->(%d, %d)x(%d, %d)\n",
 		     __FUNCTION__,
@@ -3536,8 +3538,8 @@ sna_put_xybitmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
 	kgem_set_mode(&sna->kgem, KGEM_BLT, bo);
 
 	/* Region is pre-clipped and translated into pixmap space */
-	box = REGION_RECTS(region);
-	n = REGION_NUM_RECTS(region);
+	box = RegionRects(region);
+	n = RegionNumRects(region);
 	do {
 		int bx1 = (box->x1 - x) & ~7;
 		int bx2 = (box->x2 - x + 7) & ~7;
@@ -3661,8 +3663,8 @@ sna_put_xypixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
 
 	skip = h * BitmapBytePad(w + left);
 	for (i = 1 << (gc->depth-1); i; i >>= 1, bits += skip) {
-		const BoxRec *box = REGION_RECTS(region);
-		int n = REGION_NUM_RECTS(region);
+		const BoxRec *box = RegionRects(region);
+		int n = RegionNumRects(region);
 
 		if ((gc->planemask & i) == 0)
 			continue;
@@ -4690,10 +4692,7 @@ sna_do_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 		return NULL;
 	}
 
-	if (src->pScreen->SourceValidate)
-		src->pScreen->SourceValidate(src, sx, sy,
-					     width, height,
-					     gc->subWindowMode);
+	SourceValidate(src, sx, sy, width, height, gc->subWindowMode);
 
 	sx += src->x;
 	sy += src->y;
@@ -4772,17 +4771,17 @@ sna_do_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 		if (free_clip)
 			RegionDestroy(free_clip);
 	}
-	DBG(("%s: src extents (%d, %d), (%d, %d) x %d\n", __FUNCTION__,
+	DBG(("%s: src extents (%d, %d), (%d, %d) x %ld\n", __FUNCTION__,
 	     region.extents.x1, region.extents.y1,
 	     region.extents.x2, region.extents.y2,
-	     RegionNumRects(&region)));
+	     (long)RegionNumRects(&region)));
 	RegionTranslate(&region, dx-sx, dy-sy);
 	if (gc->pCompositeClip->data)
 		RegionIntersect(&region, &region, gc->pCompositeClip);
-	DBG(("%s: copy region (%d, %d), (%d, %d) x %d\n", __FUNCTION__,
+	DBG(("%s: copy region (%d, %d), (%d, %d) x %ld\n", __FUNCTION__,
 	     region.extents.x1, region.extents.y1,
 	     region.extents.x2, region.extents.y2,
-	     RegionNumRects(&region)));
+	     (long)RegionNumRects(&region)));
 
 	if (RegionNotEmpty(&region))
 		copy(src, dst, gc, &region, sx-dx, sy-dy, bitPlane, closure);
@@ -4804,8 +4803,8 @@ sna_fallback_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 			RegionPtr region, int dx, int dy,
 			Pixel bitplane, void *closure)
 {
-	DBG(("%s (boxes=%dx[(%d, %d), (%d, %d)...], src=+(%d, %d), alu=%d\n",
-	     __FUNCTION__, RegionNumRects(region),
+	DBG(("%s (boxes=%ldx[(%d, %d), (%d, %d)...], src=+(%d, %d), alu=%d\n",
+	     __FUNCTION__, (long)RegionNumRects(region),
 	     region->extents.x1, region->extents.y1,
 	     region->extents.x2, region->extents.y2,
 	     dx, dy, gc->alu));
@@ -5408,9 +5407,9 @@ no_damage_clipped:
 		assert(dx + clip.extents.x2 <= pixmap->drawable.width);
 		assert(dy + clip.extents.y2 <= pixmap->drawable.height);
 
-		DBG(("%s: clip %d x [(%d, %d), (%d, %d)] x %d [(%d, %d)...]\n",
+		DBG(("%s: clip %ld x [(%d, %d), (%d, %d)] x %d [(%d, %d)...]\n",
 		     __FUNCTION__,
-		     REGION_NUM_RECTS(&clip),
+		     (long)RegionNumRects(&clip),
 		     clip.extents.x1, clip.extents.y1, clip.extents.x2, clip.extents.y2,
 		     n, pt->x, pt->y));
 
@@ -5509,9 +5508,9 @@ damage_clipped:
 		assert(dx + clip.extents.x2 <= pixmap->drawable.width);
 		assert(dy + clip.extents.y2 <= pixmap->drawable.height);
 
-		DBG(("%s: clip %d x [(%d, %d), (%d, %d)] x %d [(%d, %d)...]\n",
+		DBG(("%s: clip %ld x [(%d, %d), (%d, %d)] x %d [(%d, %d)...]\n",
 		     __FUNCTION__,
-		     REGION_NUM_RECTS(&clip),
+		     RegionNumRects(&clip),
 		     clip.extents.x1, clip.extents.y1, clip.extents.x2, clip.extents.y2,
 		     n, pt->x, pt->y));
 
@@ -5899,10 +5898,11 @@ sna_copy_bitmap_blt(DrawablePtr _bitmap, DrawablePtr drawable, GCPtr gc,
 	BoxPtr box;
 	int n;
 
-	DBG(("%s: plane=%x (%d,%d),(%d,%d)x%d\n",
-	     __FUNCTION__, (unsigned)bitplane, RegionNumRects(region),
+	DBG(("%s: plane=%x (%d,%d),(%d,%d)x%ld\n",
+	     __FUNCTION__, (unsigned)bitplane,
 	     region->extents.x1, region->extents.y1,
-	     region->extents.x2, region->extents.y2));
+	     region->extents.x2, region->extents.y2,
+	     (long)RegionNumRects(region)));
 
 	box = RegionRects(region);
 	n = RegionNumRects(region);
@@ -6634,8 +6634,8 @@ sna_poly_zero_line_blt(DrawablePtr drawable,
 	     clip.extents.x2, clip.extents.y2,
 	     dx, dy, damage));
 
-	extents = REGION_RECTS(&clip);
-	last_extents = extents + REGION_NUM_RECTS(&clip);
+	extents = RegionRects(&clip);
+	last_extents = extents + RegionNumRects(&clip);
 
 	b = box;
 	do {
@@ -7847,8 +7847,8 @@ sna_poly_zero_segment_blt(DrawablePtr drawable,
 	jump = _jump[(damage != NULL) | !!(dx|dy) << 1];
 
 	b = box;
-	extents = REGION_RECTS(&clip);
-	last_extents = extents + REGION_NUM_RECTS(&clip);
+	extents = RegionRects(&clip);
+	last_extents = extents + RegionNumRects(&clip);
 	do {
 		int n = _n;
 		const xSegment *s = _s;
@@ -10217,8 +10217,8 @@ sna_poly_fill_rect_tiled_blt(DrawablePtr drawable,
 				region.data = NULL;
 				RegionIntersect(&region, &region, &clip);
 
-				nbox = REGION_NUM_RECTS(&region);
-				box = REGION_RECTS(&region);
+				nbox = RegionNumRects(&region);
+				box = RegionRects(&region);
 				while (nbox--) {
 					int height = box->y2 - box->y1;
 					int dst_y = box->y1;
@@ -12098,13 +12098,13 @@ sna_glyph_blt(DrawablePtr drawable, GCPtr gc,
 	_y += drawable->y + dy;
 
 	RegionTranslate(clip, dx, dy);


Reply to: