Rebased ref, commits from common ancestor:
commit 091035146463bf1aa6674bff6947d04fc620c18f
Author: Carl Worth <cwo...@cworth.org>
Date:   Mon Jan 4 14:20:11 2010 -0800

    configure.ac: Bump version to 2.10.0.
    
    In preparation for the 2.10.0 release.

diff --git a/configure.ac b/configure.ac
index 4877a1f..e02512c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-intel],
-        2.9.99.902,
+        2.10.0,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-intel)
 

commit 01f7d0307b3f5f085e383ff85026757de9cda359
Author: Carl Worth <cwo...@cworth.org>
Date:   Mon Jan 4 14:19:17 2010 -0800

    NEWS: Add final release notes for the 2.10.0 release.
    
    Mentioning that it's functionally identical to our most recent release
    candidate.

diff --git a/NEWS b/NEWS
index 82ee180..29e7913 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,5 @@
-Work-in-progress release notes for the next release (which will be 2.10.0)
-==========================================================================
+Release 1.10.0 (2010-01-04)
+===========================
 New requirements of 2.10 compared to 2.9
 ----------------------------------------
  * Linux kernel with kernel-modesetting (KMS)
@@ -30,10 +30,6 @@ Notable fixes in 2.10 compared to 2.9
  * Fix to support larger extended desktops, (such as a 2560x1600 plus a
    1920x1200 monitor).
 
- * i915: Fix texture sample coordinates, (was causing gray border around
-   images).
-
-   https://bugs.freedesktop.org/show_bug.cgi?id=21523
 
  * Fix glyph corruption due to insufficient cache flushing:
 
@@ -41,9 +37,10 @@ Notable fixes in 2.10 compared to 2.9
 
 Several other correctness and performance fixes are also included.
 
-[Developers, please provide me summaries for any additional features
-of this release that you think should appear in NEWS and in the 2.10.0
-release notes.
+Note: The driver code of the 2.10.0 release is identical to that of
+the 2.9.99.901 release candidate. The only changes in 2.10.0 compared
+to 2.9.99.902 are a minor change to the configure script, and some
+small updates to the documentation.
 
 Snapshot 2.9.99.902 (2009-12-10)
 ================================

commit e966bca3a9143cff37beb54359bea13c9f693b44
Author: Zhenyu Wang <zhen...@linux.intel.com>
Date:   Tue Dec 29 21:49:49 2009 -0800

    Take note for Pineview support in README and manpage
    
    Signed-off-by: Zhenyu Wang <zhen...@linux.intel.com>

diff --git a/README b/README
index 8b0998f..dc64ff7 100644
--- a/README
+++ b/README
@@ -13,6 +13,8 @@ Intel graphics chipsets including:
        915G/GM,945G/GM/GME,946GZ
        G/GM/GME/Q965,
        G/Q33,G/Q35,G41,G/Q43,G/GM/Q45
+       PineView-M (Atom N400 series)
+       PineView-D (Atom D400/D500 series)
 
 Where to get more information about the driver
 ----------------------------------------------
diff --git a/man/intel.man b/man/intel.man
index a4e9ea0..ef8d372 100644
--- a/man/intel.man
+++ b/man/intel.man
@@ -25,7 +25,8 @@ the 830M and later.
 .B intel
 supports the i810, i810-DC100, i810e, i815, i830M, 845G, 852GM, 855GM,
 865G, 915G, 915GM, 945G, 945GM, 965G, 965Q, 946GZ, 965GM, 945GME,
-G33, Q33, Q35, G35, GM45, G45, Q45, G43 and G41 chipsets.
+G33, Q33, Q35, G35, GM45, G45, Q45, G43, G41 chipsets, and Pineview-M in
+Atom N400 series, Pineview-D in Atom D400/D500 series.
 
 .SH CONFIGURATION DETAILS
 Please refer to __xconfigfile__(__filemansuffix__) for general configuration

commit 6137791e9f1a4778afabbbc06de3da68648ae258
Author: Carl Worth <cwo...@cworth.org>
Date:   Mon Jan 4 14:08:24 2010 -0800

    man page: Remove section describing BACKLIGHT_CONTROL property.
    
    This apparently no longer exists in a KMS world, so remove it from the
    documentation.

diff --git a/man/intel.man b/man/intel.man
index 90bdb95..a4e9ea0 100644
--- a/man/intel.man
+++ b/man/intel.man
@@ -199,30 +199,6 @@ Low Voltage Differential Signalling output (typically a 
laptop LCD panel).  Avai
 By adjusting the BACKLIGHT property, the brightness on the LVDS output can be 
adjusted.  In some cases, this property may be unavailable (for example if your 
platform uses an external microcontroller to control the backlight).
 
 .PP
-.B BACKLIGHT_CONTROL
-- method used to control backlight
-.TP 2
-The driver will attempt to automatically detect the backlight control method 
for your platform.  If this fails however, you can select another method which 
may allow you to control your backlight.  Available methods include:
-.RS
-.PP
-.B native
-.TP 4
-Intel chipsets include backlight control registers, which on some platforms 
may be wired to control the backlight directly.  This method uses those 
registers.
-.PP
-.B legacy
-.TP 4
-The legacy backlight control registers exist in PCI configuration space, and 
have fewer available backlight levels than the native registers.  However, some 
platforms are wired this way and so need to use this method.
-.PP
-.B combo
-.TP 4
-This method attempts to use the native registers where possible, resorting to 
the legacy, configuration space registers only to enable the backlight if 
needed.  On platforms that have both wired this can be a good choice as it 
allows the fine grained backlight control of the native interface.
-.PP
-.B kernel
-.TP 4
-On some system, the kernel may provide a backlight control driver.  In that 
case, using the kernel interfaces is preferable, as the same driver may respond 
to hotkey events or external APIs.
-.RE
-
-.PP
 .B scaling mode
 - control LCD panel scaling mode
 .TP 2

commit 7f36a439249cc2101d8985de5e95af652e5b984b
Author: Carl Worth <cwo...@cworth.org>
Date:   Mon Jan 4 14:07:24 2010 -0800

    man page: Rename PANEL_FITTING to "scaling mode".
    
    The old UMS name was PANEL_FITTING while the new KMS name is "scaling mode".
    
    Fixes bug #25606.

diff --git a/man/intel.man b/man/intel.man
index 7d12823..90bdb95 100644
--- a/man/intel.man
+++ b/man/intel.man
@@ -223,8 +223,8 @@ On some system, the kernel may provide a backlight control 
driver.  In that case
 .RE
 
 .PP
-.B PANEL_FITTING
-- control LCD panel fitting
+.B scaling mode
+- control LCD panel scaling mode
 .TP 2
 By default, the driver will attempt to upscale resolutions smaller than the 
LCD's native size while preserving the aspect ratio.  Other modes are available 
however:
 .RS

commit a6fb71e6e26fb31f4cd10fad2d3a87d9114a649a
Author: Carl Worth <cwo...@cworth.org>
Date:   Mon Jan 4 14:05:27 2010 -0800

    man page: Add additional indentation for some output configuration options.
    
    The BACKLIGHT_CONTROL and PANEL_FITTING options appear in a list, and
    then each contain a sub-list of sub-options. Use indentation to make
    this structure more apparent to the reader.

diff --git a/man/intel.man b/man/intel.man
index 9e24ca5..7d12823 100644
--- a/man/intel.man
+++ b/man/intel.man
@@ -203,6 +203,7 @@ By adjusting the BACKLIGHT property, the brightness on the 
LVDS output can be ad
 - method used to control backlight
 .TP 2
 The driver will attempt to automatically detect the backlight control method 
for your platform.  If this fails however, you can select another method which 
may allow you to control your backlight.  Available methods include:
+.RS
 .PP
 .B native
 .TP 4
@@ -219,12 +220,14 @@ This method attempts to use the native registers where 
possible, resorting to th
 .B kernel
 .TP 4
 On some system, the kernel may provide a backlight control driver.  In that 
case, using the kernel interfaces is preferable, as the same driver may respond 
to hotkey events or external APIs.
+.RE
 
 .PP
 .B PANEL_FITTING
 - control LCD panel fitting
 .TP 2
 By default, the driver will attempt to upscale resolutions smaller than the 
LCD's native size while preserving the aspect ratio.  Other modes are available 
however:
+.RS
 .PP
 .B center
 .TP 4
@@ -237,6 +240,7 @@ The default mode.  Try to upscale the image to the screen 
size, while preserving
 .B full
 .TP 4
 Upscale the image to the native screen size without regard to aspect ratio.  
In this mode, the full screen image may appear distorted in some resolutions.
+.RE
 
 .SS "TV"
 Integrated TV output.  Available properties include:

commit 25a6c8dfae240143309b14cc32ebac6008c3a378
Author: Gaetan Nadon <mems...@videotron.ca>
Date:   Tue Dec 15 21:46:48 2009 -0500

    configure.ac: use backticks rather than $() for cmd subs
    
    Use "$PKG_CONFIG" rather than hard coded "pkg-config"
    
    Acked-by: Dan Nicholson <dbn.li...@gmail.com>
    Acked-by: Daniel Stone <dan...@fooishbar.org>
    
    Signed-off-by: Gaetan Nadon <mems...@videotron.ca>

diff --git a/configure.ac b/configure.ac
index 9aee5a3..4877a1f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -97,7 +97,7 @@ PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
                   HAVE_XEXTPROTO_71="no")
 AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ])
 
-sdkdir=$(pkg-config --variable=sdkdir xorg-server)
+sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
 
 save_CFLAGS="$CFLAGS"
 CFLAGS="$XORG_CFLAGS $DRI_CFLAGS $DRM_CFLAGS"

commit 2c142e421e859406b5aff16ba18624150269fc06
Author: Carl Worth <cwo...@cworth.org>
Date:   Thu Dec 10 15:25:44 2009 -0800

    Update version to 2.9.99.902.
    
    For the second release-candidate snapshot in preparation for 2.10.

diff --git a/configure.ac b/configure.ac
index e25223e..9aee5a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-intel],
-        2.9.99.901,
+        2.9.99.902,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-intel)
 

commit 8ecf70ea553083cbc26928dc3973c8f6f8b3d9d0
Author: Carl Worth <cwo...@cworth.org>
Date:   Thu Dec 10 15:17:57 2009 -0800

    NEWS: Add notes for 2.9.99.902 (and preliminary notes for 2.10)
    
    This comes from my cursory glance over the commit log from 2.9.1
    to master.

diff --git a/NEWS b/NEWS
index 891da07..82ee180 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,62 @@
+Work-in-progress release notes for the next release (which will be 2.10.0)
+==========================================================================
+New requirements of 2.10 compared to 2.9
+----------------------------------------
+ * Linux kernel with kernel-modesetting (KMS)
+
+   All user-modesetting code has now been removed from the driver.
+   We highly recommend kernel version 2.6.32 or later.
+
+ * Libdrm >= 2.4.16
+
+New features in 2.10 compared to 2.9
+------------------------------------
+ * New driver debugging options available in xorg.conf
+   (DebugFlushBatches, DebugFlushCaches, DebugWait). See "man intel"
+   for more details.
+
+ * Video overlay support with KMS. This currently requires Linux
+   2.6.33, but a backport to 2.6.32 is available here:
+
+   
http://gitorious.org/daniel-s-linux-stuff/linux-kernel/commits/intel-kms-overlay-for-2.6.32
+
+Notable fixes in 2.10 compared to 2.9
+-----------------------------------
+ * Fix crash when XRenderComposite is called with a -1 value for
+   width/height, (crash at login when using compiz).
+
+   http://bugs.freedesktop.org/show_bug.cgi?id=24724
+
+ * Fix to support larger extended desktops, (such as a 2560x1600 plus a
+   1920x1200 monitor).
+
+ * i915: Fix texture sample coordinates, (was causing gray border around
+   images).
+
+   https://bugs.freedesktop.org/show_bug.cgi?id=21523
+
+ * Fix glyph corruption due to insufficient cache flushing:
+
+   https://bugs.freedesktop.org/show_bug.cgi?id=24315
+
+Several other correctness and performance fixes are also included.
+
+[Developers, please provide me summaries for any additional features
+of this release that you think should appear in NEWS and in the 2.10.0
+release notes.
+
+Snapshot 2.9.99.902 (2009-12-10)
+================================
+This is the second release candidate in preparation for the upcoming
+2.10.0 release. We will appreciate any feedback we can get from
+testing of this snapshot to improve the 2.10.0 release.
+
+Compared to the previous snapshot, this snapshot now correctly
+verifies that libdrm 2.4.16 (or newer) is available. The previous
+snapshot also required libdrm 2.4.16 for correct functionality, but
+neglected to notify the user of this at configure, compile, or install
+time and would instead simply fail to run.
+
 Snapshot 2.9.99.901 (2009-11-30)
 ================================
 This is the first release candidate in preparation for the upcoming
@@ -8,11 +67,6 @@ With this snapshot, the xf86-video-intel driver requires 
kernel
 modesetting (KMS) as all of the user modesetting (UMS) support has
 been removed from the driver.
 
-See the commit log for further changes in this release, and
-developers, please provide me summaries for any major features in this
-release that you think should appear in NEWS and in the 2.10.0 release
-notes.
-
 Release 2.9.0 (2009-09-28)
 ==========================
 We are pleased to announce the 2.9.0 release of the xf86-video-intel

commit 88b2209a7526a7c7f3b3a2d491d48bd0d5d56e04
Author: Carl Worth <cwo...@cworth.org>
Date:   Thu Dec 10 14:52:46 2009 -0800

    Document the DebugFlushBatches, DebugFlushCaches, and DebugWait options.
    
    These were added in 3c0815abf28744e215bea286e71d935cd486955a . The
    documentation added here comes straight from that commit message.

diff --git a/man/intel.man b/man/intel.man
index 9344d28..9e24ca5 100644
--- a/man/intel.man
+++ b/man/intel.man
@@ -137,6 +137,24 @@ server log.
 .IP
 Default: Disabled
 .TP
+.BI "Option \*qDebugFlushBatches\*q \*q" boolean \*q
+Flush the batch buffer after every single operation.
+.IP
+Default: Disabled
+.TP
+.BI "Option \*qDebugFlushCaches\*q \*q" boolean \*q
+Include an MI_FLUSH at the end of every batch buffer to force data to
+be flushed out of cache and into memory before the completion of the
+batch.
+.IP
+Default: Disabled
+.TP
+.BI "Option \*qDebugWait\*q \*q" boolean \*q
+Wait for the completion of every batch buffer before continuing,
+i.e. perform synchronous rendering.
+.IP
+Default: Disabled
+.TP
 .BI "Option \*qSwapbuffersWait\*q \*q" boolean \*q
 This option controls the behavior of glXSwapBuffers and glXCopySubBufferMESA
 calls by GL applications.  If enabled, the calls will avoid tearing by making

commit 8d6faf7dc546bda64e11bf6dea7f3c997f07f887
Author: Tobias Doerffel <tobias.doerf...@gmail.com>
Date:   Wed Dec 9 09:57:20 2009 +0100

    Fix compiler warning in i830_copy_video_data() if XvMC is disabled
    
    The variable "intel" is unused when building i830_video.c without XvMC
    support which results in a compiler warning:
    
      i830_video.c: In function 'i830_copy_video_data':
      i830_video.c:1443: warning: unused variable `intel'
    
    Trivial fix via #ifdef.

diff --git a/src/i830_video.c b/src/i830_video.c
index 7d0d3bf..8f6bfd2 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -1428,7 +1428,9 @@ i830_copy_video_data(ScrnInfoPtr scrn, 
intel_adaptor_private *adaptor_priv,
                     INT32 x1, INT32 y1, INT32 x2, INT32 y2,
                     int id, unsigned char *buf)
 {
+#ifdef INTEL_XVMC
        intel_screen_private *intel = intel_get_screen_private(scrn);
+#endif
        int srcPitch = 0, srcPitch2 = 0;
        int top, left, npixels, nlines, size;
 

commit bd81734465912d79d6320a6fb021ce43d258b906
Author: Daniel Vetter <daniel.vet...@ffwll.ch>
Date:   Tue Dec 8 15:27:41 2009 +0100

    Xv: enable drmmode overlay
    
    Now that libdrm 2.4.16 is released (and already required) we can
    unconditionally enable this.
    
    Please add something like this to the release-notes/NEWS file:
    
    * Overlay support for kernel modesetting. This needs at least kernel
      v2.6.33 to work. A backport to 2.6.32 is available at:
    
      
http://gitorious.org/daniel-s-linux-stuff/linux-kernel/commits/intel-kms-overlay-for-2.6.32
    
    Signed-off-by: Daniel Vetter <daniel.vet...@ffwll.ch>

diff --git a/src/i830_video.c b/src/i830_video.c
index b0403d4..7d0d3bf 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -203,7 +203,6 @@ static XF86ImageRec Images[NUM_IMAGES] = {
 /* kernel modesetting overlay functions */
 static Bool drmmode_has_overlay(ScrnInfoPtr scrn)
 {
-#ifdef DRM_MODE_OVERLAY_LANDED
        intel_screen_private *intel = intel_get_screen_private(scrn);
        struct drm_i915_getparam gp;
        int has_overlay = 0;
@@ -213,14 +212,10 @@ static Bool drmmode_has_overlay(ScrnInfoPtr scrn)
        drmCommandWriteRead(intel->drmSubFD, DRM_I915_GETPARAM, &gp, 
sizeof(gp));
 
        return has_overlay ? TRUE : FALSE;
-#else
-       return FALSE;
-#endif
 }
 
 static void drmmode_overlay_update_attrs(ScrnInfoPtr scrn)
 {
-#ifdef DRM_MODE_OVERLAY_LANDED
        intel_screen_private *intel = intel_get_screen_private(scrn);
        intel_adaptor_private *adaptor_priv = intel_get_adaptor_private(scrn);
        struct drm_intel_overlay_attrs attrs;
@@ -243,12 +238,10 @@ static void drmmode_overlay_update_attrs(ScrnInfoPtr scrn)
 
        if (ret != 0)
                OVERLAY_DEBUG("overlay attrs ioctl failed: %i\n", ret);
-#endif
 }
 
 static void drmmode_overlay_off(ScrnInfoPtr scrn)
 {
-#ifdef DRM_MODE_OVERLAY_LANDED
        intel_screen_private *intel = intel_get_screen_private(scrn);
        struct drm_intel_overlay_put_image request;
        int ret;
@@ -260,7 +253,6 @@ static void drmmode_overlay_off(ScrnInfoPtr scrn)
 
        if (ret != 0)
                OVERLAY_DEBUG("overlay switch-off ioctl failed: %i\n", ret);
-#endif
 }
 
 static Bool
@@ -270,7 +262,6 @@ drmmode_overlay_put_image(ScrnInfoPtr scrn, xf86CrtcPtr 
crtc,
                          BoxPtr dstBox, short src_w, short src_h, short drw_w,
                          short drw_h)
 {
-#ifdef DRM_MODE_OVERLAY_LANDED
        intel_screen_private *intel = intel_get_screen_private(scrn);
        intel_adaptor_private *adaptor_priv = intel_get_adaptor_private(scrn);
        struct drm_intel_overlay_put_image request;
@@ -336,9 +327,6 @@ drmmode_overlay_put_image(ScrnInfoPtr scrn, xf86CrtcPtr 
crtc,
                return FALSE;
        } else
                return TRUE;
-#else
-       return FALSE;
-#endif
 }
 
 void I830InitVideo(ScreenPtr screen)

commit 37f631d669c165c4fb56ccd7a6fc0a432f453b52
Author: Chris Wilson <ch...@chris-wilson.co.uk>
Date:   Thu Dec 10 08:50:16 2009 +0000

    Revert "uxa-glyphs: Enable TILING_X on glyph caches."
    
    This reverts commit 3f11bbec420080151406c203af292e55177e77d1.
    
    For unknown reasons, enabling tiling for the glyph cache is causing
    glyph corruption both across suspend and resume and VT switching, on a
    wide range of chipsets (reports include both i8xx and gm45)
    
    This strongly suggests that we are handling tiling, or updates to tiled
    buffers, incorrectly across i915_gem_idle(). However, until we can find
    the root cause, we want to fix this regression before the next stable
    release, so simply revert this patch. :(
    
    Fixes:
      [Bug 25406] fonts garbled after resuming from suspend since 6729b508
      http://bugs.freedesktop.org/show_bug.cgi?id=25406
    
    Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>

diff --git a/src/common.h b/src/common.h
index 3169cdf..b9269b5 100644
--- a/src/common.h
+++ b/src/common.h
@@ -389,15 +389,4 @@ extern int I810_DEBUG;
 struct pci_device *
 intel_host_bridge (void);
 
-/**
- * Hints to CreatePixmap to tell the driver how the pixmap is going to be
- * used.
- *
- * Compare to CREATE_PIXMAP_USAGE_* in the server.
- */
-enum {
-       INTEL_CREATE_PIXMAP_TILING_X = 0x10000000,
-       INTEL_CREATE_PIXMAP_TILING_Y,
-};
-
 #endif /* _INTEL_COMMON_H_ */
diff --git a/src/i830.h b/src/i830.h
index 21a5025..a66038a 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -600,6 +600,17 @@ extern const int I830CopyROP[16];
 #define ALLOW_SHARING                  0x00000010
 #define DISABLE_REUSE                  0x00000020
 
+/**
+ * Hints to CreatePixmap to tell the driver how the pixmap is going to be
+ * used.
+ *
+ * Compare to CREATE_PIXMAP_USAGE_* in the server.
+ */
+enum {
+       INTEL_CREATE_PIXMAP_TILING_X = 0x10000000,
+       INTEL_CREATE_PIXMAP_TILING_Y,
+};
+
 void i830_debug_flush(ScrnInfoPtr scrn);
 
 static inline PixmapPtr get_drawable_pixmap(DrawablePtr drawable)
diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c
index 5c23321..ff16781 100644
--- a/uxa/uxa-glyphs.c
+++ b/uxa/uxa-glyphs.c
@@ -47,7 +47,6 @@
 #include <stdlib.h>
 
 #include "uxa-priv.h"
-#include "../src/common.h"
 
 #include "mipict.h"
 
@@ -190,8 +189,7 @@ static Bool uxa_realize_glyph_caches(ScreenPtr pScreen, 
unsigned int format)
 
        pPixmap = (*pScreen->CreatePixmap) (pScreen,
                                            CACHE_PICTURE_WIDTH,
-                                           height, depth,
-                                           INTEL_CREATE_PIXMAP_TILING_X);
+                                           height, depth, 0);
        if (!pPixmap)
                return FALSE;
 

commit 093bb9ebe69760975a3fcf2322db950312e6c2d7
Author: Chris Wilson <ch...@chris-wilson.co.uk>
Date:   Tue Dec 8 23:45:28 2009 +0000

    i965: Only use the affine kernels if both src and mask are affine
    
    Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>

diff --git a/src/i965_render.c b/src/i965_render.c
index e79ac04..066901c 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -1589,7 +1589,7 @@ i965_prepare_composite(int op, PicturePtr source_picture,
                intel->transform[1] = mask_picture->transform;
                intel->scale_units[1][0] = mask->drawable.width;
                intel->scale_units[1][1] = mask->drawable.height;
-               composite_op->is_affine |=
+               composite_op->is_affine &=
                    i830_transform_is_affine(intel->transform[1]);
        }
 

commit 0cf04ea4d736f7d7848f33b772d88a0f1b6678b1
Author: Chris Wilson <ch...@chris-wilson.co.uk>
Date:   Tue Dec 8 23:44:45 2009 +0000

    i965: Set src_filter before testing.
    
    Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>

diff --git a/src/i965_render.c b/src/i965_render.c
index 10ed561..e79ac04 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -1469,6 +1469,8 @@ i965_prepare_composite(int op, PicturePtr source_picture,
        uint32_t *binding_table;
        drm_intel_bo *binding_table_bo, *surface_state_bo;
 
+       composite_op->src_filter =
+           sampler_state_filter_from_picture(source_picture->filter);
        if (composite_op->src_filter < 0) {
                intel_debug_fallback(scrn, "Bad src filter 0x%x\n",
                                     source_picture->filter);
@@ -1572,8 +1574,6 @@ i965_prepare_composite(int op, PicturePtr source_picture,
        intel->render_dest = dest;
        drm_intel_bo_unreference(composite_op->binding_table_bo);
        composite_op->binding_table_bo = binding_table_bo;
-       composite_op->src_filter =
-           sampler_state_filter_from_picture(source_picture->filter);
 
        intel->scale_units[0][0] = source->drawable.width;
        intel->scale_units[0][1] = source->drawable.height;

commit 417ad2712edcbca635eb5eeff0d11cdb16c069ed
Author: Chris Wilson <ch...@chris-wilson.co.uk>
Date:   Tue Dec 8 23:43:57 2009 +0000

    Assert that we only call OUT_BATCH() inside a BATCH
    
    Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>

diff --git a/src/i830_batchbuffer.h b/src/i830_batchbuffer.h
index 16c33ef..1beba4f 100644
--- a/src/i830_batchbuffer.h
+++ b/src/i830_batchbuffer.h
@@ -75,7 +75,7 @@ static inline void intel_batch_end_atomic(ScrnInfoPtr scrn)
 static inline void intel_batch_emit_dword(intel_screen_private *intel, 
uint32_t dword)
 {
        assert(intel->batch_ptr != NULL);
-       assert(intel_batch_space(intel) >= 4);
+       assert(intel->batch_emitting);
        *(uint32_t *) (intel->batch_ptr + intel->batch_used) = dword;
        intel->batch_used += 4;
 }

commit 47416b1eea09b238a997636d35998d71e0d18161
Author: Chris Wilson <ch...@chris-wilson.co.uk>
Date:   Tue Dec 8 13:47:07 2009 +0000

    i965: Maximum number of vertices per composite is 24, not 18
    
    Beware the potential buffer overflow.
    
    Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>

diff --git a/src/i965_render.c b/src/i965_render.c
index 62e17e4..10ed561 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -1682,7 +1682,7 @@ i965_composite(PixmapPtr dest, int srcX, int srcY, int 
maskX, int maskY,
        float src_x[3], src_y[3], src_w[3], mask_x[3], mask_y[3], mask_w[3];
        int i;
        drm_intel_bo *vb_bo;
-       float vb[18];
+       float vb[24]; /* 3 * (2 dst + 3 src + 3 mask) */
        Bool is_affine = render_state->composite_op.is_affine;
 
        if (is_affine) {
@@ -1801,7 +1801,6 @@ i965_composite(PixmapPtr dest, int srcX, int srcY, int 
maskX, int maskY,
                if (!is_affine)
                        vb[i++] = mask_w[0];
        }
-       assert(i <= VERTEX_BUFFER_SIZE);
        drm_intel_bo_subdata(vb_bo, render_state->vb_offset * 4, i * 4, vb);
 
        if (!i965_composite_check_aperture(scrn))

commit c1afc831c8fe4cbececee7dfa23506a6746c2425
Author: Chris Wilson <ch...@chris-wilson.co.uk>
Date:   Mon Dec 7 21:27:56 2009 +0000

    uxa: Cache solid fills.
    
    Maintain a small cache of pixmaps to hold SolidFill pictures. Currently
    we create a pixmap the size of the damaged region and fill that using
    pixman before downloading it to the GPU and compositing. Needless to say
    this is extremely expensive compared to simply emitting the solid
    colour. To mitigate this cost, we maintain a small cache of 1x1R
    pictures which is recognised by the driver as being a solid, but at the
    very least is maintained as a GPU ready pixmap.
    
    This gives a good boost to cairo-xcb (which uses solid fills) on a gm45:
    
    Before:
      gnome-terminal-vim: 41.9s
    After:
      gnome-terminal-vim: 31.7s
    
    Compare with using a cache of 1x1R pixmaps in cairo-xcb:
      gnome-terminal-vim: 31.6s
    
    Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>

diff --git a/uxa/uxa-priv.h b/uxa/uxa-priv.h
index 35961aa..c1f3688 100644
--- a/uxa/uxa-priv.h
+++ b/uxa/uxa-priv.h
@@ -135,6 +135,13 @@ typedef struct {
 
 #define UXA_NUM_GLYPH_CACHES 4
 
+typedef struct {
+       uint32_t color;
+       PicturePtr picture;
+} uxa_solid_cache_t;
+
+#define UXA_NUM_SOLID_CACHE 16
+
 typedef void (*EnableDisableFBAccessProcPtr) (int, Bool);
 typedef struct {
        uxa_driver_t *info;
@@ -162,6 +169,10 @@ typedef struct {
        unsigned offScreenCounter;
 
        uxa_glyph_cache_t glyphCaches[UXA_NUM_GLYPH_CACHES];
+
+       PicturePtr solid_clear, solid_black, solid_white;
+       uxa_solid_cache_t solid_cache[UXA_NUM_SOLID_CACHE];
+       int solid_cache_size;
 } uxa_screen_t;
 
 /*
diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c
index abd0bf5..525f75b 100644
--- a/uxa/uxa-render.c
+++ b/uxa/uxa-render.c
@@ -454,6 +454,93 @@ uxa_picture_from_pixman_image(ScreenPtr pScreen,
 }
 
 static PicturePtr
+uxa_create_solid(ScreenPtr screen, uint32_t color)
+{
+       PixmapPtr pixmap;
+       PicturePtr picture;
+       uint32_t repeat = RepeatNormal;
+       int error = 0;
+
+       pixmap = (*screen->CreatePixmap)(screen, 1, 1, 32,
+                                        UXA_CREATE_PIXMAP_FOR_MAP);
+       if (!pixmap)
+               return 0;
+
+       if (!uxa_prepare_access((DrawablePtr)pixmap, UXA_ACCESS_RW)) {
+               (*screen->DestroyPixmap)(pixmap);
+               return 0;
+       }
+       *((uint32_t *)pixmap->devPrivate.ptr) = color;
+       uxa_finish_access((DrawablePtr)pixmap);
+
+       picture = CreatePicture(0, &pixmap->drawable,
+                               PictureMatchFormat(screen, 32, PICT_a8r8g8b8),
+                               CPRepeat, &repeat, serverClient, &error);
+       (*screen->DestroyPixmap)(pixmap);
+
+       return picture;
+}
+
+static PicturePtr
+uxa_acquire_solid(ScreenPtr screen, SourcePict *source)
+{
+       uxa_screen_t *uxa_screen = uxa_get_screen(screen);
+       PictSolidFill *solid = &source->solidFill;
+       PicturePtr picture;
+       int i;
+
+       if ((solid->color >> 24) == 0) {
+               if (!uxa_screen->solid_clear) {
+                       uxa_screen->solid_clear = uxa_create_solid(screen, 0);
+                       if (!uxa_screen->solid_clear)
+                               return 0;
+               }
+               picture = uxa_screen->solid_clear;
+               goto DONE;
+       } else if (solid->color == 0xff000000) {
+               if (!uxa_screen->solid_black) {
+                       uxa_screen->solid_black = uxa_create_solid(screen, 
0xff000000);
+                       if (!uxa_screen->solid_black)
+                               return 0;
+               }
+               picture = uxa_screen->solid_black;
+               goto DONE;
+       } else if (solid->color == 0xffffffff) {
+               if (!uxa_screen->solid_white) {
+                       uxa_screen->solid_white = uxa_create_solid(screen, 
0xffffffff);
+                       if (!uxa_screen->solid_white)
+                               return 0;
+               }
+               picture = uxa_screen->solid_white;
+               goto DONE;
+       }
+
+       for (i = 0; i < uxa_screen->solid_cache_size; i++) {
+               if (uxa_screen->solid_cache[i].color == solid->color) {
+                       picture = uxa_screen->solid_cache[i].picture;
+                       goto DONE;
+               }
+       }
+
+       picture = uxa_create_solid(screen, solid->color);
+       if (!picture)
+               return 0;
+
+       if (uxa_screen->solid_cache_size == UXA_NUM_SOLID_CACHE) {
+               i = rand() % UXA_NUM_SOLID_CACHE;
+               FreePicture(uxa_screen->solid_cache[i].picture, 0);
+       } else
+               uxa_screen->solid_cache_size++;
+
+       uxa_screen->solid_cache[i].picture = picture;
+       uxa_screen->solid_cache[i].color = solid->color;
+
+DONE:
+       picture->refcnt++;
+       return picture;
+}
+
+static PicturePtr
 uxa_acquire_pattern(ScreenPtr pScreen,
                    PicturePtr pSrc,
                    pixman_format_code_t format,
@@ -461,9 +548,16 @@ uxa_acquire_pattern(ScreenPtr pScreen,
 {
        PicturePtr pDst;
 
+       if (pSrc->pSourcePict) {
+               SourcePict *source = pSrc->pSourcePict;
+               if (source->type == SourcePictTypeSolidFill)
+                       return uxa_acquire_solid (pScreen, source);
+       }
+
        pDst = uxa_picture_for_pixman_format(pScreen, format, width, height);
        if (!pDst)
                return 0;
+
        if (uxa_prepare_access(pDst->pDrawable, UXA_ACCESS_RW)) {
                fbComposite(PictOpSrc, pSrc, NULL, pDst,
                            x, y, 0, 0, 0, 0, width, height);
diff --git a/uxa/uxa.c b/uxa/uxa.c
index 4bf8c77..d6ad5a6 100644
--- a/uxa/uxa.c
+++ b/uxa/uxa.c
@@ -361,6 +361,16 @@ static Bool uxa_close_screen(int i, ScreenPtr pScreen)
 #ifdef RENDER
        PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
 #endif
+       int n;
+
+       if (uxa_screen->solid_clear)
+               FreePicture(uxa_screen->solid_clear, 0);
+       if (uxa_screen->solid_black)
+               FreePicture(uxa_screen->solid_black, 0);
+       if (uxa_screen->solid_white)
+               FreePicture(uxa_screen->solid_white, 0);
+       for (n = 0; n < uxa_screen->solid_cache_size; n++)
+               FreePicture(uxa_screen->solid_cache[n].picture, 0);
 
        uxa_glyphs_fini(pScreen);
 
@@ -467,6 +477,11 @@ Bool uxa_driver_init(ScreenPtr screen, uxa_driver_t * 
uxa_driver)
 
        dixSetPrivate(&screen->devPrivates, &uxa_screen_index, uxa_screen);
 
+       uxa_screen->solid_cache_size = 0;
+       uxa_screen->solid_clear = 0;
+       uxa_screen->solid_black = 0;
+       uxa_screen->solid_white = 0;
+
 //    exaDDXDriverInit(screen);
 
        /*

commit cd475bad23c02130d11c49882c11261c9f0d4ef1
Author: Chris Wilson <ch...@chris-wilson.co.uk>
Date:   Mon Dec 7 11:09:14 2009 +0000

    batch: Ensure we send a MI_FLUSH in the block handler for TFP
    
    This should restore the previous level of synchronisation between
    textures and pixmaps, but *does not* guarantee that a texture will be
    flushed before use. tfp should be fixed so that the ddx can submit the
    batch if required to flush the pixmap.
    
    A side-effect of this patch is to rename intel_batch_flush() to
    intel_batch_submit() to reduce the confusion of executing a batch buffer
    with that of emitting a MI_FLUSH.
    
    Should fix the remaining rendering corruption involving tfp [inc compiz]:
    
      Bug 25431 [i915 bisected] piglit/texturing_tfp regressed
      http://bugs.freedesktop.org/show_bug.cgi?id=25431
    
      Bug 25481 Wrong cursor format and cursor blink rate with compiz enabled
      http://bugs.freedesktop.org/show_bug.cgi?id=25481
    
    Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>

diff --git a/src/i830_accel.c b/src/i830_accel.c
index 509d652..74808fd 100644
--- a/src/i830_accel.c
+++ b/src/i830_accel.c
@@ -56,10 +56,10 @@ void i830_debug_flush(ScrnInfoPtr scrn)
        intel_screen_private *intel = intel_get_screen_private(scrn);
 
        if (intel->debug_flush & DEBUG_FLUSH_CACHES)
-               intel_batch_pipelined_flush(scrn);
+               intel_batch_emit_flush(scrn);
 
        if (intel->debug_flush & DEBUG_FLUSH_BATCHES)
-               intel_batch_flush(scrn);
+               intel_batch_submit(scrn);
 }
 
 /* The following function sets up the supported acceleration. Call it
diff --git a/src/i830_batchbuffer.c b/src/i830_batchbuffer.c
index 12e044a..ed80f14 100644
--- a/src/i830_batchbuffer.c
+++ b/src/i830_batchbuffer.c
@@ -93,16 +93,13 @@ void intel_batch_teardown(ScrnInfoPtr scrn)
        }
 }
 
-void intel_batch_pipelined_flush(ScrnInfoPtr scrn)
+void intel_batch_emit_flush(ScrnInfoPtr scrn)
 {
        intel_screen_private *intel = intel_get_screen_private(scrn);
        int flags;
 
        assert (!intel->in_batch_atomic);
 
-       if (intel->batch_used == 0)
-               return;
-
        /* Big hammer, look to the pipelined flushes in future. */
        flags = MI_WRITE_DIRTY_STATE | MI_INVALIDATE_MAP_CACHE;
        if (IS_I965G(intel))
@@ -122,9 +119,11 @@ void intel_batch_pipelined_flush(ScrnInfoPtr scrn)
                entry->flush_read_domains = entry->flush_write_domain = 0;
                list_del(&entry->flush);
        }
+
+       intel->need_mi_flush = FALSE;
 }
 
-void intel_batch_flush(ScrnInfoPtr scrn)
+void intel_batch_submit(ScrnInfoPtr scrn)
 {
        intel_screen_private *intel = intel_get_screen_private(scrn);
        int ret;
@@ -175,6 +174,12 @@ void intel_batch_flush(ScrnInfoPtr scrn)
                entry->batch_read_domains = entry->batch_write_domain = 0;
                list_del(&entry->batch);
        }
+
+       /* Mark that we need to flush whatever potential rendering we've done 
in the
+        * blockhandler.  We could set this less often, but it's probably not 
worth
+        * the work.
+        */
+       intel->need_mi_flush = !list_is_empty(&intel->flush_pixmaps);


-- 
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/e1nkfhq-0003li...@alioth.debian.org

Reply via email to