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

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



 .gitignore                      |    1 
 NEWS                            |   35 
 configure.ac                    |   34 
 man/intel.man                   |    2 
 src/i965_reg.h                  |    4 
 src/i965_render.c               |   71 
 src/intel.h                     |    9 
 src/intel_batchbuffer.c         |   50 
 src/intel_dri.c                 |   13 
 src/intel_driver.c              |    7 
 src/intel_module.c              |    4 
 src/intel_uxa.c                 |   28 
 src/intel_video.c               |   38 
 src/legacy/i810/Makefile.am     |    1 
 src/legacy/i810/i810.h          |   14 
 src/legacy/i810/i810_cursor.c   |   19 
 src/legacy/i810/i810_driver.c   |   21 
 src/legacy/i810/i810_io.c       |  133 -
 src/legacy/i810/xvmc/I810XvMC.c |    2 
 src/sna/Makefile.am             |    8 
 src/sna/compiler.h              |   43 
 src/sna/gen2_render.c           |  982 +++++----
 src/sna/gen3_render.c           |  781 +++++--
 src/sna/gen4_render.c           |  281 ++
 src/sna/gen5_render.c           |  397 ++-
 src/sna/gen5_render.h           |   47 
 src/sna/gen6_render.c           |  371 ++-
 src/sna/gen7_render.c           |  324 ++-
 src/sna/gen7_render.h           |    4 
 src/sna/kgem.c                  |  502 +++-
 src/sna/kgem.h                  |   56 
 src/sna/kgem_debug.c            |   14 
 src/sna/kgem_debug_gen2.c       |  631 +++++
 src/sna/kgem_debug_gen3.c       |    1 
 src/sna/sna.h                   |   64 
 src/sna/sna_accel.c             | 4316 ++++++++++++++++++++++++++++++++--------
 src/sna/sna_blt.c               |  741 +++++-
 src/sna/sna_composite.c         |   87 
 src/sna/sna_damage.c            |  666 +++++-
 src/sna/sna_damage.h            |   57 
 src/sna/sna_display.c           |   27 
 src/sna/sna_dri.c               |  110 -
 src/sna/sna_driver.c            |   22 
 src/sna/sna_glyphs.c            |  101 
 src/sna/sna_gradient.c          |   67 
 src/sna/sna_io.c                |   33 
 src/sna/sna_reg.h               |    6 
 src/sna/sna_render.c            |  139 -
 src/sna/sna_render.h            |   60 
 src/sna/sna_render_inline.h     |    8 
 src/sna/sna_tiling.c            |   27 
 src/sna/sna_trapezoids.c        | 4198 ++++++++++++++++++++++++++++----------
 src/sna/sna_video.c             |   12 
 src/sna/sna_video_textured.c    |   19 
 src/xvmc/i965_xvmc.c            |    2 
 src/xvmc/intel_batchbuffer.h    |    1 
 src/xvmc/intel_xvmc.c           |    2 
 src/xvmc/xvmc_vld.c             |    2 
 58 files changed, 12080 insertions(+), 3615 deletions(-)

New commits:
commit 7237374a03d1e0c2e6c0b2d0eb42afc8df25df0d
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Oct 30 16:46:10 2011 +0000

    configure: Bump version to 2.16.901

diff --git a/configure.ac b/configure.ac
index 0a60bd7..102a25a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.63])
 AC_INIT([xf86-video-intel],
-        [2.16.0],
+        [2.16.901],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-intel])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 0a78a75e75225d89e465804c482a667840a2c8de
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Oct 30 16:45:46 2011 +0000

    NEWS: Add release notes for 2.16.901

diff --git a/NEWS b/NEWS
index 46d0d24..c736d63 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,27 @@
+Snapshot 2.16.901 (2011-10-30)
+==============================
+This is the first release candidate in preparation for the upcoming
+2.17.0 release. We will appreciate any feedback we can get from
+testing of this snapshot.
+
+The basis of this release are to push out a couple of critical stability
+fixes for SandyBridge and IvyBridge. There is very little else to see
+here. Those 200+ other commits do not exist...
+
+Bugs fixed in this snapshot (compared to 2.16.0)
+--------------------------------------------------
+
+ * Workaround blitter hang on SandyBridge and IvyBridge
+   https://bugzilla.kernel.org/show_bug.cgi?id=27892
+   https://bugs.freedesktop.org/show_bug.cgi
+
+ * Workaround pipe control issues on SandyBridge
+
+ * Use correct maximum PS thread count on IvyBridge
+
+ * Protect against failed pixmap allocation for XV
+   https://bugs.freedesktop.org/show_bug.cgi?id=40439
+
 Release 2.16.0 (2011-08-09)
 ==============================
 A new quarter, a new release! The key feature of this release, looking past

commit c7552cb819ae8c90975193c159236e0070628dd9
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Sun Oct 30 16:35:14 2011 +0100

    i810: kill mmio vga access helpers
    
    Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

diff --git a/src/legacy/i810/Makefile.am b/src/legacy/i810/Makefile.am
index 3676da6..a1bdd85 100644
--- a/src/legacy/i810/Makefile.am
+++ b/src/legacy/i810/Makefile.am
@@ -14,7 +14,6 @@ liblegacy_i810_la_SOURCES = \
          i810_dga.c \
          i810_driver.c \
          i810.h \
-         i810_io.c \
          i810_memory.c \
          i810_reg.h \
          i810_ring.h \
diff --git a/src/legacy/i810/i810.h b/src/legacy/i810/i810.h
index c3a6255..3a355a3 100644
--- a/src/legacy/i810/i810.h
+++ b/src/legacy/i810/i810.h
@@ -74,14 +74,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 typedef struct _I810Rec *I810Ptr;
 
-typedef void (*I810WriteIndexedByteFunc)(I810Ptr pI810, IOADDRESS addr,
-					 uint8_t index, uint8_t value);
-typedef uint8_t(*I810ReadIndexedByteFunc)(I810Ptr pI810, IOADDRESS addr,
-					  uint8_t index);
-typedef void (*I810WriteByteFunc)(I810Ptr pI810, IOADDRESS addr,
-				  uint8_t value);
-typedef uint8_t(*I810ReadByteFunc)(I810Ptr pI810, IOADDRESS addr);
-
 extern void I810SetTiledMemory(ScrnInfoPtr pScrn, int nr, unsigned start,
 			       unsigned pitch, unsigned size);
 
@@ -215,11 +207,6 @@ typedef struct _I810Rec {
    CloseScreenProcPtr CloseScreen;
    ScreenBlockHandlerProcPtr BlockHandler;
 
-   I810WriteIndexedByteFunc writeControl;
-   I810ReadIndexedByteFunc readControl;
-   I810WriteByteFunc writeStandard;
-   I810ReadByteFunc readStandard;
-
    Bool directRenderingDisabled;        /* DRI disabled in PreInit */
    Bool directRenderingEnabled;		/* false if XF86DRI not defined. */
 
diff --git a/src/legacy/i810/i810_driver.c b/src/legacy/i810/i810_driver.c
index 9509ae2..d8f7c45 100644
--- a/src/legacy/i810/i810_driver.c
+++ b/src/legacy/i810/i810_driver.c
@@ -652,8 +652,6 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
    }
 #endif
 
-   /*  We won't be using the VGA access after the probe */
-   I810SetMMIOAccess(pI810);
    return TRUE;
 }
 
diff --git a/src/legacy/i810/i810_io.c b/src/legacy/i810/i810_io.c
deleted file mode 100644
index 954ed6e..0000000
--- a/src/legacy/i810/i810_io.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-/*
- * Authors:
- *   Daryll Strauss <daryll@precisioninsight.com>
- *
- */
-
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "compiler.h"
-
-#include "i810.h"
-
-#define minb(p) *(volatile uint8_t *)(pI810->MMIOBase + (p))
-#define moutb(p,v) *(volatile uint8_t *)(pI810->MMIOBase + (p)) = (v)
-
-static void
-I810WriteControlMMIO(I810Ptr pI810, IOADDRESS addr, uint8_t index, uint8_t val)
-{
-   moutb(addr, index);
-   moutb(addr + 1, val);
-}
-
-static uint8_t
-I810ReadControlMMIO(I810Ptr pI810, IOADDRESS addr, uint8_t index)
-{
-   moutb(addr, index);
-   return minb(addr + 1);
-}
-
-static void
-I810WriteStandardMMIO(I810Ptr pI810, IOADDRESS addr, uint8_t val)
-{
-   moutb(addr, val);
-}
-
-static uint8_t
-I810ReadStandardMMIO(I810Ptr pI810, IOADDRESS addr)
-{
-   return minb(addr);
-}
-
-void
-I810SetMMIOAccess(I810Ptr pI810)
-{
-   pI810->writeControl = I810WriteControlMMIO;
-   pI810->readControl = I810ReadControlMMIO;
-   pI810->writeStandard = I810WriteStandardMMIO;
-   pI810->readStandard = I810ReadStandardMMIO;
-}

commit e8b8adeab3b2e69a8684217271604a5f658f617d
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Sun Oct 30 16:34:05 2011 +0100

    i810: use vgahw functions instead of roll-your-own
    
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

diff --git a/src/legacy/i810/i810_cursor.c b/src/legacy/i810/i810_cursor.c
index 898a136..88829cb 100644
--- a/src/legacy/i810/i810_cursor.c
+++ b/src/legacy/i810/i810_cursor.c
@@ -239,26 +239,29 @@ I810SetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
 {
    int tmp;
    I810Ptr pI810 = I810PTR(pScrn);
+   vgaHWPtr hwp;
 
 #ifdef ARGB_CURSOR
    if (pI810->CursorIsARGB)
       return;
 #endif
 
+   hwp = VGAHWPTR(pScrn);
+
    tmp = INREG8(PIXPIPE_CONFIG_0);
    tmp |= EXTENDED_PALETTE;
    OUTREG8(PIXPIPE_CONFIG_0, tmp);
 
-   pI810->writeStandard(pI810, DACMASK, 0xFF);
-   pI810->writeStandard(pI810, DACWX, 0x04);
+   hwp->writeDacMask(hwp, 0xFF);
+   hwp->writeDacWriteAddr(hwp, 0x04);
 
-   pI810->writeStandard(pI810, DACDATA, (bg & 0x00FF0000) >> 16);
-   pI810->writeStandard(pI810, DACDATA, (bg & 0x0000FF00) >> 8);
-   pI810->writeStandard(pI810, DACDATA, (bg & 0x000000FF));
+   hwp->writeDacData(hwp, (bg & 0x00FF0000) >> 16);
+   hwp->writeDacData(hwp, (bg & 0x0000FF00) >> 8);
+   hwp->writeDacData(hwp, (bg & 0x000000FF));
 
-   pI810->writeStandard(pI810, DACDATA, (fg & 0x00FF0000) >> 16);
-   pI810->writeStandard(pI810, DACDATA, (fg & 0x0000FF00) >> 8);
-   pI810->writeStandard(pI810, DACDATA, (fg & 0x000000FF));
+   hwp->writeDacData(hwp, (fg & 0x00FF0000) >> 16);
+   hwp->writeDacData(hwp, (fg & 0x0000FF00) >> 8);
+   hwp->writeDacData(hwp, (fg & 0x000000FF));
 
    tmp = INREG8(PIXPIPE_CONFIG_0);
    tmp &= ~EXTENDED_PALETTE;
diff --git a/src/legacy/i810/i810_driver.c b/src/legacy/i810/i810_driver.c
index 83c999f..9509ae2 100644
--- a/src/legacy/i810/i810_driver.c
+++ b/src/legacy/i810/i810_driver.c
@@ -790,7 +790,7 @@ DoSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, I810RegPtr i810Reg,
     * into the fields of the vgaI810Rec structure goes here.
     */
    i810Reg->IOControl = hwp->readCrtc(hwp, IO_CTNL);
-   i810Reg->AddressMapping = pI810->readControl(pI810, GRX, ADDRESS_MAPPING);
+   i810Reg->AddressMapping = hwp->readGr(hwp, ADDRESS_MAPPING);
    i810Reg->BitBLTControl = INREG8(BITBLT_CNTL);
    i810Reg->VideoClk2_M = INREG16(VCLK2_VCO_M);
    i810Reg->VideoClk2_N = INREG16(VCLK2_VCO_N);
@@ -985,10 +985,10 @@ DoRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, I810RegPtr i810Reg,
    temp |= i810Reg->InterlaceControl;
    hwp->writeCrtc(hwp, INTERLACE_CNTL, temp);
 
-   temp = pI810->readControl(pI810, GRX, ADDRESS_MAPPING);
+   temp = hwp->readGr(hwp, ADDRESS_MAPPING);
    temp &= 0xE0;			/* Save reserved bits 7:5 */
    temp |= i810Reg->AddressMapping;
-   pI810->writeControl(pI810, GRX, ADDRESS_MAPPING, temp);
+   hwp->writeGr(hwp, ADDRESS_MAPPING, temp);
 
    /* Setting the OVRACT Register for video overlay */
    {
@@ -2061,6 +2061,7 @@ I810DisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
    I810Ptr pI810;
    unsigned char SEQ01 = 0;
    int DPMSSyncSelect = 0;
+   vgaHWPtr hwp;
 
    pI810 = I810PTR(pScrn);
    switch (PowerManagementMode) {
@@ -2086,9 +2087,11 @@ I810DisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
       break;
    }
 
+   hwp = VGAHWPTR(pScrn);
+
    /* Turn the screen on/off */
-   SEQ01 |= pI810->readControl(pI810, SRX, 0x01) & ~0x20;
-   pI810->writeControl(pI810, SRX, 0x01, SEQ01);
+   SEQ01 |= hwp->readSeq(hwp, 0x01) & ~0x20;
+   hwp->writeSeq(hwp, 0x01, SEQ01);
 
    /* Set the DPMS mode */
    OUTREG8(DPMS_SYNC_SELECT, DPMSSyncSelect);

commit 4aeea489ed3189d7ebcae4199153c1ae736ebf68
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Sun Oct 30 16:07:45 2011 +0100

    i810: rip out PIO access functions
    
    All the io done at init time is already converted to libpciaccess
    
    Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

diff --git a/src/legacy/i810/i810.h b/src/legacy/i810/i810.h
index 6620695..c3a6255 100644
--- a/src/legacy/i810/i810.h
+++ b/src/legacy/i810/i810.h
@@ -178,7 +178,6 @@ typedef struct _I810Rec {
    int Chipset;
    unsigned long LinearAddr;
    unsigned long MMIOAddr;
-   IOADDRESS ioBase;
    EntityInfoPtr pEnt;
    struct pci_device *PciInfo;
 
diff --git a/src/legacy/i810/i810_driver.c b/src/legacy/i810/i810_driver.c
index 3637e25..83c999f 100644
--- a/src/legacy/i810/i810_driver.c
+++ b/src/legacy/i810/i810_driver.c
@@ -234,7 +234,6 @@ I810DoDDC(ScrnInfoPtr pScrn, int index)
 static Bool
 I810PreInit(ScrnInfoPtr pScrn, int flags)
 {
-   vgaHWPtr hwp;
    I810Ptr pI810;
    ClockRangePtr clockRanges;
    int i;
@@ -270,8 +269,6 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
    /* Allocate a vgaHWRec */
    if (!vgaHWGetHWRec(pScrn))
       return FALSE;
-   hwp = VGAHWPTR(pScrn);
-   pI810->ioBase = hwp->PIOOffset;
 
    pI810->PciInfo = xf86GetPciInfoForEntity(pI810->pEnt->index);
 
@@ -378,9 +375,6 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
     */
    I810DoDDC(pScrn, pI810->pEnt->index);
 
-   /* We have to use PIO to probe, because we haven't mapped yet */
-   I810SetPIOAccess(pI810);
-
    intel_detect_chipset(pScrn, pI810->PciInfo, &chipset);
 
    /*
diff --git a/src/legacy/i810/i810_io.c b/src/legacy/i810/i810_io.c
index b485cef..954ed6e 100644
--- a/src/legacy/i810/i810_io.c
+++ b/src/legacy/i810/i810_io.c
@@ -45,43 +45,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define moutb(p,v) *(volatile uint8_t *)(pI810->MMIOBase + (p)) = (v)
 
 static void
-I810WriteControlPIO(I810Ptr pI810, IOADDRESS addr, uint8_t index, uint8_t val)
-{
-   addr += pI810->ioBase;
-   outb(addr, index);
-   outb(addr + 1, val);
-}
-
-static uint8_t
-I810ReadControlPIO(I810Ptr pI810, IOADDRESS addr, uint8_t index)
-{
-   addr += pI810->ioBase;
-   outb(addr, index);
-   return inb(addr + 1);
-}
-
-static void
-I810WriteStandardPIO(I810Ptr pI810, IOADDRESS addr, uint8_t val)
-{
-   outb(pI810->ioBase + addr, val);
-}
-
-static uint8_t
-I810ReadStandardPIO(I810Ptr pI810, IOADDRESS addr)
-{
-   return inb(pI810->ioBase + addr);
-}
-
-void
-I810SetPIOAccess(I810Ptr pI810)
-{
-   pI810->writeControl = I810WriteControlPIO;
-   pI810->readControl = I810ReadControlPIO;
-   pI810->writeStandard = I810WriteStandardPIO;
-   pI810->readStandard = I810ReadStandardPIO;
-}
-
-static void
 I810WriteControlMMIO(I810Ptr pI810, IOADDRESS addr, uint8_t index, uint8_t val)
 {
    moutb(addr, index);

commit e735636194671e221eca3e86b9bd06fd0d4b6c5a
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Sun Oct 30 15:51:49 2011 +0100

    i810: kill dead i830 defines
    
    Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

diff --git a/src/legacy/i810/i810_io.c b/src/legacy/i810/i810_io.c
index a6cf305..b485cef 100644
--- a/src/legacy/i810/i810_io.c
+++ b/src/legacy/i810/i810_io.c
@@ -39,23 +39,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "xf86_OSproc.h"
 #include "compiler.h"
 
-#ifdef BUILD_FOR_I830
-#include "i830.h"
-#define pI810 pI830
-#define I810Ptr I830Ptr
-#define I810WriteControlPIO I830WriteControlPIO
-#define I810ReadControlPIO I830ReadControlPIO
-#define I810WriteStandardPIO I830WriteStandardPIO
-#define I810ReadStandardPIO I830ReadStandardPIO
-#define I810SetPIOAccess I830SetPIOAccess
-#define I810WriteControlMMIO I830WriteControlMMIO
-#define I810ReadControlMMIO I830ReadControlMMIO
-#define I810WriteStandardMMIO I830WriteStandardMMIO
-#define I810ReadStandardMMIO I830ReadStandardMMIO
-#define I810SetMMIOAccess I830SetMMIOAccess
-#else
 #include "i810.h"
-#endif
 
 #define minb(p) *(volatile uint8_t *)(pI810->MMIOBase + (p))
 #define moutb(p,v) *(volatile uint8_t *)(pI810->MMIOBase + (p)) = (v)

commit bb840ee09fa620648065884306fbe3e0da37ad77
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Oct 30 16:13:04 2011 +0000

    sna: Convert PolyRectangles to use Box32
    
    For the same overflow protection.
    
    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 47b8698..c285c97 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4186,7 +4186,7 @@ sna_poly_rectangle_extents(DrawablePtr drawable, GCPtr gc,
 			   int n, xRectangle *r,
 			   BoxPtr out)
 {
-	BoxRec box;
+	Box32Rec box;
 	int extra = gc->lineWidth >> 1;
 	bool clipped;
 
@@ -4195,20 +4195,11 @@ sna_poly_rectangle_extents(DrawablePtr drawable, GCPtr gc,
 
 	box.x1 = r->x;
 	box.y1 = r->y;
-	box.x2 = r->x + r->width;
-	box.y2 = r->y + r->height;
+	box.x2 = box.x1 + r->width;
+	box.y2 = box.y1 + r->height;
 
-	while (--n) {
-		r++;
-		if (r->x < box.x1)
-			box.x1 = r->x;
-		if (r->x + r->width > box.x2)
-			box.x2 = r->x + r->width;
-		if (r->y < box.y1)
-			box.y1 = r->y;
-		if (r->y + r->width > box.y2)
-			box.y2 = r->y + r->height;
-	}
+	while (--n)
+		box32_add_rect(&box, r++);
 
 	box.x2++;
 	box.y2++;
@@ -4220,11 +4211,10 @@ sna_poly_rectangle_extents(DrawablePtr drawable, GCPtr gc,
 		box.y2 += extra;
 	}
 
-	if (box_empty(&box))
+	clipped = box32_trim_and_translate(&box, drawable, gc);
+	if (!box32_to_box16(&box, out))
 		return 0;
 
-	clipped = trim_and_translate_box(&box, drawable, gc);
-	*out = box;
 	return 1 | clipped << 1;
 }
 

commit af52e234a78bbde964a93ef8cce21f41a5c959f3
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Oct 30 15:34:34 2011 +0000

    sna: Fix compilation
    
    Remember to drink coffee and compile "obvious" fixes before pushing.
    
    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 3666544..47b8698 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1086,7 +1086,7 @@ static inline void box32_add_rect(Box32Rec *box, const xRectangle *r)
 
 	v = r->y;
 	if (box->y1 > v)
-		box->y1 = ;
+		box->y1 = v;
 	v += r->height;
 	if (box->y2 < v)
 		box->y2 = v;

commit 23b314729c43101e515e2625db2a2401c72c2596
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Oct 30 15:24:21 2011 +0000

    sna: Rewrite box32_add_rect() to enable int32_t promotion
    
    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 d227184..3666544 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1077,15 +1077,17 @@ static inline void box32_add_rect(Box32Rec *box, const xRectangle *r)
 {
 	int32_t v;
 
-	if (box->x1 > r->x)
-		box->x1 = r->x;
-	v = r->x + r->width;
+	v = r->x;
+	if (box->x1 > v)
+		box->x1 = v;
+	v += r->width;
 	if (box->x2 < v)
 		box->x2 = v;
 
-	if (box->y1 > r->y)
-		box->y1 = r->y;
-	v = r->y + r->height;
+	v = r->y;
+	if (box->y1 > v)
+		box->y1 = ;
+	v += r->height;
 	if (box->y2 < v)
 		box->y2 = v;
 }

commit 427622aca31b7463eb2dcd52e352dc8997e84baa
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Oct 30 12:02:42 2011 +0000

    sna: Push overflow detection to the end of extents
    
    Removes a couple of conditionals from the middle of the hotpath and on
    Intel we are not realising the benefit of only utilising 16-bit values.
    
    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 3eb0d85..d227184 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -78,6 +78,10 @@ static inline void region_maybe_clip(RegionRec *r, RegionRec *clip)
 		RegionIntersect(r, r, clip);
 }
 
+typedef struct box32 {
+	int32_t x1, y1, x2, y2;
+} Box32Rec;
+
 #define PM_IS_SOLID(_draw, _pm) \
 	(((_pm) & FbFullMask((_draw)->depth)) == FbFullMask((_draw)->depth))
 
@@ -979,6 +983,65 @@ static inline bool trim_and_translate_box(BoxPtr box, DrawablePtr d, GCPtr gc)
 	return clipped;
 }
 
+static inline bool box32_trim(Box32Rec *box, DrawablePtr d)
+{
+	bool clipped = false;
+
+	if (box->x1 < 0)
+		box->x1 = 0, clipped = true;
+	if (box->x2 > d->width)
+		box->x2 = d->width, clipped = true;
+
+	if (box->y1 < 0)
+		box->y1 = 0, clipped = true;
+	if (box->y2 > d->height)
+		box->y2 = d->height, clipped = true;
+
+	return clipped;
+}
+
+static inline bool box32_clip(Box32Rec *box, GCPtr gc)
+{
+	bool clipped = gc->pCompositeClip->data != NULL;
+	const BoxRec *clip = &gc->pCompositeClip->extents;
+
+	if (box->x1 < clip->x1)
+		box->x1 = clip->x1, clipped = true;
+	if (box->x2 > clip->x2)
+		box->x2 = clip->x2, clipped = true;
+
+	if (box->y1 < clip->y1)
+		box->y1 = clip->y1, clipped = true;
+	if (box->y2 > clip->y2)
+		box->y2 = clip->y2, clipped = true;
+
+	return clipped;
+}
+
+static inline void box32_translate(Box32Rec *box, DrawablePtr d)
+{
+	box->x1 += d->x;
+	box->x2 += d->x;
+
+	box->y1 += d->y;
+	box->y2 += d->y;
+}
+
+static inline bool box32_trim_and_translate(Box32Rec *box, DrawablePtr d, GCPtr gc)
+{
+	bool clipped;
+
+	if (likely (gc->pCompositeClip)) {
+		box32_translate(box, d);
+		clipped = box32_clip(box, gc);
+	} else {
+		clipped = box32_trim(box, d);
+		box32_translate(box, d);
+	}
+
+	return clipped;
+}
+
 static inline void box_add_pt(BoxPtr box, int16_t x, int16_t y)
 {
 	if (box->x1 > x)
@@ -1000,19 +1063,29 @@ static int16_t bound(int16_t a, uint16_t b)
 	return v;
 }
 
-static inline void box_add_rect(BoxPtr box, const xRectangle *r)
+static inline bool box32_to_box16(const Box32Rec *b32, BoxRec *b16)
 {
-	int v;
+	b16->x1 = b32->x1;
+	b16->y1 = b32->y1;
+	b16->x2 = b32->x2;
+	b16->y2 = b32->y2;
+
+	return b16->x2 > b16->x1 && b16->y2 > b16->y1;
+}
+
+static inline void box32_add_rect(Box32Rec *box, const xRectangle *r)
+{
+	int32_t v;
 
 	if (box->x1 > r->x)
 		box->x1 = r->x;
-	v = bound(r->x, r->width);
+	v = r->x + r->width;
 	if (box->x2 < v)
 		box->x2 = v;
 
 	if (box->y1 > r->y)
 		box->y1 = r->y;
-	v =bound(r->y, r->height);
+	v = r->y + r->height;
 	if (box->y2 < v)
 		box->y2 = v;
 }
@@ -5172,7 +5245,7 @@ sna_poly_fill_rect_extents(DrawablePtr drawable, GCPtr gc,
 			   int n, xRectangle *rect,
 			   BoxPtr out)
 {
-	BoxRec box;
+	Box32Rec box;
 	bool clipped;
 
 	if (n == 0)
@@ -5181,17 +5254,16 @@ sna_poly_fill_rect_extents(DrawablePtr drawable, GCPtr gc,
 	DBG(("%s: [0] = (%d, %d)x(%d, %d)\n",
 	     __FUNCTION__, rect->x, rect->y, rect->width, rect->height));
 	box.x1 = rect->x;
-	box.x2 = bound(box.x1, rect->width);
+	box.x2 = box.x1 + rect->width;
 	box.y1 = rect->y;
-	box.y2 = bound(box.y1, rect->height);
+	box.y2 = box.y1 + rect->height;
 	while (--n)
-		box_add_rect(&box, ++rect);
+		box32_add_rect(&box, ++rect);
 
-	clipped = trim_and_translate_box(&box, drawable, gc);
-	if (box_empty(&box))
+	clipped = box32_trim_and_translate(&box, drawable, gc);
+	if (!box32_to_box16(&box, out))
 		return 0;
 
-	*out = box;
 	return 1 | clipped << 1;
 }
 

commit 2d3aba8518ae790325c6123dacc3ce73b6e91cbd
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Oct 30 11:22:26 2011 +0000

    Revert "sna: Don't flush the render caches if in the process of writing again"
    
    This reverts commit 15266e1b9500f6b348661c60d1982bde911f2d0e.
    
    KDE relies upon the ability to render into a sampler and then render
    upon itself. Not the first sign of madness...
    
    Will have to find another way of winning back the compwinwin
    performance.

diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index f8e71e7..d2a296c 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -1375,8 +1375,7 @@ gen2_render_composite(struct sna *sna,
 			   NULL))
 		kgem_submit(&sna->kgem);
 
-	if ((tmp->src.bo != tmp->dst.bo && kgem_bo_is_dirty(tmp->src.bo)) ||
-	    (tmp->mask.bo && tmp->mask.bo != tmp->dst.bo && kgem_bo_is_dirty(tmp->mask.bo))) {
+	if (kgem_bo_is_dirty(tmp->src.bo) || kgem_bo_is_dirty(tmp->mask.bo)) {
 		if (tmp->src.bo == tmp->dst.bo || tmp->mask.bo == tmp->dst.bo) {
 			kgem_emit_flush(&sna->kgem);
 		} else {
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index e21ea6c..eca841e 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -2479,8 +2479,7 @@ gen3_render_composite(struct sna *sna,
 			   NULL))
 		kgem_submit(&sna->kgem);
 
-	if ((tmp->src.bo != tmp->dst.bo && kgem_bo_is_dirty(tmp->src.bo)) ||
-	    (tmp->mask.bo && tmp->mask.bo != tmp->dst.bo && kgem_bo_is_dirty(tmp->mask.bo))) {
+	if (kgem_bo_is_dirty(tmp->src.bo) || kgem_bo_is_dirty(tmp->mask.bo)) {
 		if (tmp->src.bo == tmp->dst.bo || tmp->mask.bo == tmp->dst.bo) {
 			kgem_emit_flush(&sna->kgem);
 		} else {
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index 9fa2278..c603e67 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -2058,8 +2058,7 @@ gen4_render_composite(struct sna *sna,
 			   NULL))
 		kgem_submit(&sna->kgem);
 
-	if ((tmp->src.bo != tmp->dst.bo && kgem_bo_is_dirty(tmp->src.bo)) ||
-	    (tmp->mask.bo && tmp->mask.bo != tmp->dst.bo && kgem_bo_is_dirty(tmp->mask.bo)))
+	if (kgem_bo_is_dirty(tmp->src.bo) || kgem_bo_is_dirty(tmp->mask.bo))
 		kgem_emit_flush(&sna->kgem);
 
 	gen4_bind_surfaces(sna, tmp);
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index b33125c..3006bd1 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -2078,8 +2078,7 @@ gen5_render_composite(struct sna *sna,
 			   tmp->dst.bo, tmp->src.bo, tmp->mask.bo, NULL))
 		kgem_submit(&sna->kgem);
 
-	if ((tmp->src.bo != tmp->dst.bo && kgem_bo_is_dirty(tmp->src.bo)) ||
-	    (tmp->mask.bo && tmp->mask.bo != tmp->dst.bo && kgem_bo_is_dirty(tmp->mask.bo)))
+	if (kgem_bo_is_dirty(tmp->src.bo) || kgem_bo_is_dirty(tmp->mask.bo))
 		kgem_emit_flush(&sna->kgem);
 
 	gen5_bind_surfaces(sna, tmp);
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index 6a132ad..b7f0ed0 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -2248,8 +2248,7 @@ gen6_render_composite(struct sna *sna,
 			   NULL))
 		kgem_submit(&sna->kgem);
 
-	if ((tmp->src.bo != tmp->dst.bo && kgem_bo_is_dirty(tmp->src.bo)) ||
-	    (tmp->mask.bo && tmp->mask.bo != tmp->dst.bo && kgem_bo_is_dirty(tmp->mask.bo)))
+	if (kgem_bo_is_dirty(tmp->src.bo) || kgem_bo_is_dirty(tmp->mask.bo))
 		kgem_emit_flush(&sna->kgem);
 
 	gen6_emit_composite_state(sna, tmp);
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 3f9e59a..4667bad 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -2388,8 +2388,7 @@ gen7_render_composite(struct sna *sna,
 			   NULL))
 		kgem_submit(&sna->kgem);
 
-	if ((tmp->src.bo != tmp->dst.bo && kgem_bo_is_dirty(tmp->src.bo)) ||
-	    (tmp->mask.bo && tmp->mask.bo != tmp->dst.bo && kgem_bo_is_dirty(tmp->mask.bo)))
+	if (kgem_bo_is_dirty(tmp->src.bo) || kgem_bo_is_dirty(tmp->mask.bo))
 		kgem_emit_flush(&sna->kgem);
 
 	gen7_emit_composite_state(sna, tmp);

commit d4062705178856cffc83030fa40f758e9d884566
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Oct 30 10:40:32 2011 +0000

    sna/composite: Fix incorrect operator reduction for RenderFillRectangles
    
    As exemplified by KDE (using Kate) on gen3, it would attempt to render a
    large set of boxes using OVER and a transparent colour. As gen3 copied
    across some of the BLT assumptions, it was incorrectly reducing that to
    a CLEAR and thus rendering incorrectly.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index e76876c..f8e71e7 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -1938,20 +1938,19 @@ gen2_render_fill_boxes(struct sna *sna,
 					   box, n))
 		return TRUE;
 
-	if (!sna_get_pixel_from_rgba(&pixel,
-				     color->red,
-				     color->green,
-				     color->blue,
-				     color->alpha,
-				     PICT_a8r8g8b8))
+	if (op == PictOpClear)
+		pixel = 0;
+	else if (!sna_get_pixel_from_rgba(&pixel,
+					  color->red,
+					  color->green,
+					  color->blue,
+					  color->alpha,
+					  PICT_a8r8g8b8))
 		return FALSE;
 
 	DBG(("%s: using shader for op=%d, format=%x, pixel=%x\n",
 	     __FUNCTION__, op, (int)format, pixel));
 
-	if (pixel == 0)
-		op = PictOpClear;
-
 	memset(&tmp, 0, sizeof(tmp));
 	tmp.op = op;
 	tmp.dst.pixmap = dst;
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index efd5d7a..e21ea6c 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -3675,6 +3675,23 @@ static inline Bool prefer_fill_blt(struct sna *sna)
 #endif
 }
 
+static inline void set_fill_shader(struct sna_composite_channel *c,
+				   uint32_t pixel)
+{
+	if (pixel == 0)
+		c->u.gen3.type = SHADER_ZERO;
+	else if (pixel == 0xff000000)
+		c->u.gen3.type = SHADER_BLACK;
+	else if (pixel == 0xffffffff)
+		c->u.gen3.type = SHADER_WHITE;
+	else
+		c->u.gen3.type = SHADER_CONSTANT;
+	c->u.gen3.mode = pixel;
+	c->is_affine = 1;
+	c->alpha_fixup = 0;
+	c->rb_reversed = 0;
+}
+
 static Bool
 gen3_render_fill_boxes(struct sna *sna,
 		       CARD8 op,
@@ -3716,20 +3733,20 @@ gen3_render_fill_boxes(struct sna *sna,
 					   box, n))
 		return TRUE;
 
-	if (!sna_get_pixel_from_rgba(&pixel,
-				     color->red,
-				     color->green,
-				     color->blue,
-				     color->alpha,
-				     PICT_a8r8g8b8))
-		return FALSE;
-
+	if (op == PictOpClear) {
+		pixel = 0;
+	} else {
+		if (!sna_get_pixel_from_rgba(&pixel,
+					     color->red,
+					     color->green,
+					     color->blue,
+					     color->alpha,
+					     PICT_a8r8g8b8))
+			return FALSE;
+	}
 	DBG(("%s: using shader for op=%d, format=%x, pixel=%x\n",
 	     __FUNCTION__, op, (int)format, pixel));
 
-	if (pixel == 0)
-		op = PictOpClear;
-
 	tmp.op = op;
 	tmp.dst.pixmap = dst;
 	tmp.dst.width = dst->drawable.width;
@@ -3740,11 +3757,7 @@ gen3_render_fill_boxes(struct sna *sna,
 	tmp.floats_per_rect = 6;
 	tmp.rb_reversed = 0;


Reply to: