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

xserver-xorg-video-ati: Changes to 'ubuntu'



 ChangeLog                           |  515 ++++++++++++++++++++++++++++++++++++
 configure.ac                        |   14 
 debian/changelog                    |   57 +++
 debian/control                      |   10 
 man/radeon.man                      |   20 +
 src/ati_pciids_gen.h                |    7 
 src/bicubic_table.py                |   72 +++++
 src/drmmode_display.c               |  156 +++++++++-
 src/drmmode_display.h               |    1 
 src/evergreen_accel.c               |  179 ++++++++++--
 src/evergreen_exa.c                 |  206 +++++++++-----
 src/evergreen_state.h               |    6 
 src/evergreen_textured_videofuncs.c |    5 
 src/pcidb/ati_pciids.csv            |    7 
 src/r600_exa.c                      |  246 ++++++++++-------
 src/r600_state.h                    |    6 
 src/r600_textured_videofuncs.c      |   20 +
 src/r6xx_accel.c                    |   75 +++--
 src/radeon.h                        |   16 +
 src/radeon_accel.c                  |    5 
 src/radeon_chipinfo_gen.h           |    7 
 src/radeon_chipset_gen.h            |    7 
 src/radeon_commonfuncs.c            |   17 -
 src/radeon_crtc.c                   |   27 +
 src/radeon_dri2.c                   |  154 +++++-----
 src/radeon_driver.c                 |   69 ++--
 src/radeon_drm.h                    |   23 +
 src/radeon_exa.c                    |   91 ++++++
 src/radeon_exa_render.c             |  317 ++++++++++++----------
 src/radeon_exa_shared.c             |   38 ++
 src/radeon_exa_shared.h             |    1 
 src/radeon_kms.c                    |   94 ++++++
 src/radeon_output.c                 |    4 
 src/radeon_pci_chipset_gen.h        |    7 
 src/radeon_pci_device_match_gen.h   |    7 
 src/radeon_probe.h                  |    7 
 src/radeon_textured_videofuncs.c    |   68 ++--
 37 files changed, 1984 insertions(+), 577 deletions(-)

New commits:
commit c38980f2e49c453d98af0be27237f5f03d3e0e05
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Fri Jun 8 14:28:21 2012 +0200

    Merge from debian-unstable
    
    * Merge from Debian. Remaining Ubuntu changes:
      - debian/control:
        + firmware-linux -> linux-firmware
      - debian/rules:
        + Remove reference to radeon-kms.conf
      - debian/radeon-kms.conf:
        + Don't install modprobe rule for KMS; the Ubuntu kernel defaults to KMS.
      - Re-added missing src/bicubic_table.py

diff --git a/debian/changelog b/debian/changelog
index 7711d95..94cc739 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,17 @@
+xserver-xorg-video-ati (1:6.14.99~git20111219.aacbd629-0ubuntu3) UNRELEASED; urgency=low
+
+  [ Maarten Lankhorst ]
+  * Merge from Debian. Remaining Ubuntu changes:
+    - debian/control:
+      + firmware-linux -> linux-firmware
+    - debian/rules:
+      + Remove reference to radeon-kms.conf
+    - debian/radeon-kms.conf:
+      + Don't install modprobe rule for KMS; the Ubuntu kernel defaults to KMS.
+    - Re-added missing src/bicubic_table.py
+
+ -- Maarten Lankhorst <maarten.lankhorst@canonical.com>  Fri, 08 Jun 2012 14:23:31 +0200
+
 xserver-xorg-video-ati (1:6.14.99~git20111219.aacbd629-0ubuntu2) precise; urgency=low
 
   * debian/control: Suggest linux-firmware rather than firmware-linux.
diff --git a/src/bicubic_table.py b/src/bicubic_table.py
new file mode 100755
index 0000000..232ccb7
--- /dev/null
+++ b/src/bicubic_table.py
@@ -0,0 +1,72 @@
+#!/usr/bin/python
+
+import struct
+
+def half(i):
+ fs, fe, fm = ((i >> 31) & 0x1, (i >> 23) & 0xff, i & 0x7fffff)
+ s, e, m = (fs, 0, 0)
+
+ if (fe == 0x0):
+  pass
+ if ((fe == 0xff) and (fm == 0x0)):
+  e = 31
+ elif (fe == 0xff):
+  m = 1
+  e = 31
+ else:
+  exp = fe - 127;
+  if (exp < -24):
+   pass
+  elif (exp < -14):
+   temp = 10 - (-14 - exp)
+   m = 2**temp + (m >> (23 - temp))
+  elif (exp > 15):
+   e = 31
+  else:
+   e = exp + 15
+   m = fm >> 13
+
+ return ((s << 15) | (e << 10) | m)
+
+def texgen(pix):
+
+ tex = []
+
+ for i in range(0,pix,4):
+
+  a = i / float(pix)
+  a2 = a ** 2
+  a3 = a ** 3
+
+  w0 = 1 / 6.0 * (-a3 + 3 * a2 + -3 * a + 1)
+  w1 = 1 / 6.0 * (3 * a3 + -6 * a2 + 4)
+  w2 = 1 / 6.0 * (-3 * a3 + 3 * a2 + 3 * a + 1)
+  w3 = 1 / 6.0 * a3
+
+  tex.append(-(1 - (w1 / (w0 + w1)) + a))
+  tex.append(1 + (w3 / (w2 + w3)) - a)
+  tex.append(w0 + w1)
+  tex.append(w2 + w3)
+
+ return tex
+
+def printrow(l, offset):
+
+ seq = [ struct.unpack('<I',struct.pack('f',i))[0] for i in l[offset:offset+4] ]
+ seq = [ hex(half(i)) for i in seq ]
+ return "\t" + ", ".join(seq) + ","
+
+def maketable(pix):
+
+ l = texgen(pix)
+
+ print "static const uint16_t bicubic_tex_" + str(pix) + "[] = {"
+
+ for i in range(0, pix, 4):
+
+  print printrow(l, i)
+
+ print "\t0 };\n"
+
+maketable(512)
+maketable(2048)

commit 1eb002090759afe3f44dc58ae7739fcb87ac41bc
Author: Cyril Brulebois <kibi@debian.org>
Date:   Sat May 19 21:00:49 2012 +0000

    Upload to unstable.

diff --git a/debian/changelog b/debian/changelog
index aafb2e3..5f16c8b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,11 +1,11 @@
-xserver-xorg-video-ati (1:6.14.4-4) UNRELEASED; urgency=low
+xserver-xorg-video-ati (1:6.14.4-4) unstable; urgency=low
 
   * Cherry-pick from upstream to fix regression on UMS (Closes: #670570):
     - EXA: Attempt to fix solid picture acceleration with UMS.
     - EXA/UMS: Synchronize to the GPU before writing solid colour to scratch pixmap.
     - UMS/EXA: Add reminder for potential solid picture performance issue.
 
- -- Cyril Brulebois <kibi@debian.org>  Sat, 19 May 2012 20:32:19 +0000
+ -- Cyril Brulebois <kibi@debian.org>  Sat, 19 May 2012 21:00:45 +0000
 
 xserver-xorg-video-ati (1:6.14.4-3) unstable; urgency=low
 

commit ab3d973dcf3260154dbc223dac650878b1fd1197
Author: Cyril Brulebois <kibi@debian.org>
Date:   Sat May 19 20:59:04 2012 +0000

    Document the cherry-picks.
    
    The last one is *really* just here for completeness.

diff --git a/debian/changelog b/debian/changelog
index 5e3f1b0..aafb2e3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+xserver-xorg-video-ati (1:6.14.4-4) UNRELEASED; urgency=low
+
+  * Cherry-pick from upstream to fix regression on UMS (Closes: #670570):
+    - EXA: Attempt to fix solid picture acceleration with UMS.
+    - EXA/UMS: Synchronize to the GPU before writing solid colour to scratch pixmap.
+    - UMS/EXA: Add reminder for potential solid picture performance issue.
+
+ -- Cyril Brulebois <kibi@debian.org>  Sat, 19 May 2012 20:32:19 +0000
+
 xserver-xorg-video-ati (1:6.14.4-3) unstable; urgency=low
 
   * Fix uninstallability issues on ia64 by dropping mach64 and r128 from

commit 596b31b63cc9a77409ecf8e3f1f484eb08861331
Author: Thierry Vignaud <thierry.vignaud@gmail.com>
Date:   Wed May 16 14:43:53 2012 +0200

    UMS/EXA: Add reminder for potential solid picture performance issue.
    (cherry picked from commit 3fb694b308ebadd1b849836059b6b56bb19385f7)

diff --git a/src/radeon_exa_shared.c b/src/radeon_exa_shared.c
index 45222b5..7af8a52 100644
--- a/src/radeon_exa_shared.c
+++ b/src/radeon_exa_shared.c
@@ -157,6 +157,7 @@ PixmapPtr RADEONSolidPixmap(ScreenPtr pScreen, uint32_t solid)
 	return NULL;
     }
 
+    /* XXX: Big hammer... */
     info->accel_state->exa->WaitMarker(pScreen, info->accel_state->exaSyncMarker);
     memcpy(info->FB + exaGetPixmapOffset(pPix), &solid, 4);
 

commit 6a5f35d07dfe85a400b7f3504e1b725dc04d233b
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Wed May 9 11:08:49 2012 +0200

    EXA/UMS: Synchronize to the GPU before writing solid colour to scratch pixmap.
    
    UMS doesn't do this automagically. It's a big hammer that will probably suck
    for performance, but I don't have any better ideas right now.
    
    Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
    (cherry picked from commit b0b7d8d26fd107df342b5c87b0a38e5bb08101a9)

diff --git a/src/radeon_exa_shared.c b/src/radeon_exa_shared.c
index 31e2870..45222b5 100644
--- a/src/radeon_exa_shared.c
+++ b/src/radeon_exa_shared.c
@@ -157,6 +157,7 @@ PixmapPtr RADEONSolidPixmap(ScreenPtr pScreen, uint32_t solid)
 	return NULL;
     }
 
+    info->accel_state->exa->WaitMarker(pScreen, info->accel_state->exaSyncMarker);
     memcpy(info->FB + exaGetPixmapOffset(pPix), &solid, 4);
 
     return pPix;

commit be52743a3418fa8ba7583268552edc3ff1b184d6
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Thu May 3 15:07:30 2012 +0200

    EXA: Attempt to fix solid picture acceleration with UMS.
    
    Only compile tested, but should fix
    https://bugs.freedesktop.org/show_bug.cgi?id=49182 .
    
    Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
    (cherry picked from commit 6bda7ceda645e838723883d133d614def1511d16)

diff --git a/src/radeon_exa_shared.c b/src/radeon_exa_shared.c
index 28dc335..31e2870 100644
--- a/src/radeon_exa_shared.c
+++ b/src/radeon_exa_shared.c
@@ -128,19 +128,36 @@ Bool RADEONCheckBPP(int bpp)
 
 PixmapPtr RADEONSolidPixmap(ScreenPtr pScreen, uint32_t solid)
 {
+    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    RADEONInfoPtr info = RADEONPTR(pScrn);
     PixmapPtr pPix = pScreen->CreatePixmap(pScreen, 1, 1, 32, 0);
-    struct radeon_bo *bo;
 
     exaMoveInPixmap(pPix);
-    bo = radeon_get_pixmap_bo(pPix);
 
-    if (radeon_bo_map(bo, 1)) {
+#if defined(XF86DRM_MODE)
+    if (info->cs) {
+	struct radeon_bo *bo;
+
+	bo = radeon_get_pixmap_bo(pPix);
+
+	if (radeon_bo_map(bo, 1)) {
+	    pScreen->DestroyPixmap(pPix);
+	    return NULL;
+	}
+
+	memcpy(bo->ptr, &solid, 4);
+	radeon_bo_unmap(bo);
+
+	return pPix;
+    }
+#endif
+
+    if (!exaDrawableIsOffscreen(&pPix->drawable)) {
 	pScreen->DestroyPixmap(pPix);
 	return NULL;
     }
 
-    memcpy(bo->ptr, &solid, 4);
-    radeon_bo_unmap(bo);
+    memcpy(info->FB + exaGetPixmapOffset(pPix), &solid, 4);
 
     return pPix;
 }

commit c3c6ee277ec87ef20257190fde6f6d8ceb36efda
Author: Cyril Brulebois <kibi@debian.org>
Date:   Fri May 18 11:39:07 2012 +0200

    Upload to unstable.

diff --git a/debian/changelog b/debian/changelog
index de28365..5e3f1b0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,10 @@
-xserver-xorg-video-ati (1:6.14.4-3) UNRELEASED; urgency=low
+xserver-xorg-video-ati (1:6.14.4-3) unstable; urgency=low
 
   * Fix uninstallability issues on ia64 by dropping mach64 and r128 from
     dependencies on this architecture, since those were removed (the ia64
     domain I/O support code is gone in xserver 1.12).
 
- -- Cyril Brulebois <kibi@debian.org>  Fri, 18 May 2012 11:31:46 +0200
+ -- Cyril Brulebois <kibi@debian.org>  Fri, 18 May 2012 11:39:03 +0200
 
 xserver-xorg-video-ati (1:6.14.4-2) unstable; urgency=medium
 

commit 42fd3337aac4dd1e2efa71cbcbd87ae11d4e527d
Author: Cyril Brulebois <kibi@debian.org>
Date:   Fri May 18 11:38:58 2012 +0200

    Fix uninstallability issues on ia64.
    
    Drop mach64 and r128 from dependencies on this architecture, since those
    were removed (the ia64 domain I/O support code is gone in xserver 1.12).

diff --git a/debian/changelog b/debian/changelog
index d42f0c0..de28365 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+xserver-xorg-video-ati (1:6.14.4-3) UNRELEASED; urgency=low
+
+  * Fix uninstallability issues on ia64 by dropping mach64 and r128 from
+    dependencies on this architecture, since those were removed (the ia64
+    domain I/O support code is gone in xserver 1.12).
+
+ -- Cyril Brulebois <kibi@debian.org>  Fri, 18 May 2012 11:31:46 +0200
+
 xserver-xorg-video-ati (1:6.14.4-2) unstable; urgency=medium
 
   * Cherry-picks from upstream git:
diff --git a/debian/control b/debian/control
index 455402a..f06e736 100644
--- a/debian/control
+++ b/debian/control
@@ -32,8 +32,8 @@ Depends:
  ${shlibs:Depends},
  ${misc:Depends},
  ${xviddriver:Depends},
- xserver-xorg-video-r128,
- xserver-xorg-video-mach64,
+ xserver-xorg-video-r128 [!ia64],
+ xserver-xorg-video-mach64 [!ia64],
  xserver-xorg-video-radeon
 Provides: ${xviddriver:Provides}
 Description: X.Org X server -- AMD/ATI display driver wrapper
@@ -57,8 +57,8 @@ Architecture: any
 Depends:
  ${misc:Depends},
  xserver-xorg-video-ati (= ${binary:Version}),
- xserver-xorg-video-mach64-dbg,
- xserver-xorg-video-r128-dbg,
+ xserver-xorg-video-mach64-dbg [!ia64],
+ xserver-xorg-video-r128-dbg [!ia64],
  xserver-xorg-video-radeon-dbg
 Section: debug
 Priority: extra

commit 9178ac42b012258da6583c34bf4ef06471162ddc
Author: Julien Cristau <jcristau@debian.org>
Date:   Mon Apr 16 20:02:46 2012 +0200

    Changelog entry for upload to unstable.

diff --git a/debian/changelog b/debian/changelog
index 99b4bb5..d42f0c0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,18 @@
+xserver-xorg-video-ati (1:6.14.4-2) unstable; urgency=medium
+
+  * Cherry-picks from upstream git:
+    - r6xx-r9xx: force 1D tiling for buffer with height < 64
+    - Make radeon_setup_kernel_mem failures more graceful and verbose
+    - RADEONCopySwap: Fix RADEON_HOST_DATA_SWAP_16BIT case
+    - EXA: Support acceleration of solid pictures on R3xx-R7xx
+    - EXA: Support acceleration of solid pictures on Evergreen/NI
+    - EXA: Support acceleration of solid pictures on R1xx
+    - EXA: Support acceleration of solid pictures on R2xx
+  * The solid picture acceleration should fix the rendering mess people have
+    been seeing with cairo 1.12, and thus closes: #666982.
+
+ -- Julien Cristau <jcristau@debian.org>  Mon, 16 Apr 2012 20:03:31 +0200
+
 xserver-xorg-video-ati (1:6.14.4-1) unstable; urgency=low
 
   * New upstream release:

commit 1cf032f4675e5d1db3ea1cfb5802072e8104de2a
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Fri Apr 13 13:28:10 2012 -0400

    EXA: Support acceleration of solid pictures on R2xx.
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
    (cherry picked from commit 0bda305f7ab2a4720b3fea3f318ab2a73be151e5)

diff --git a/src/radeon_exa_render.c b/src/radeon_exa_render.c
index 451a625..7f1a3ff 100644
--- a/src/radeon_exa_render.c
+++ b/src/radeon_exa_render.c
@@ -756,17 +756,8 @@ static Bool R200CheckCompositeTexture(PicturePtr pPict,
 				      int unit)
 {
     unsigned int repeatType = pPict->repeat ? pPict->repeatType : RepeatNone;
-    int w = pPict->pDrawable->width;
-    int h = pPict->pDrawable->height;
     int i;
 
-    /* r200 limit should be 2048, there are issues with 2048
-     * see bug 19269
-     */
-
-    if ((w > 2047) || (h > 2047))
-	RADEON_FALLBACK(("Picture w/h too large (%dx%d)\n", w, h));
-
     for (i = 0; i < sizeof(R200TexFormats) / sizeof(R200TexFormats[0]); i++)
     {
 	if (R200TexFormats[i].fmt == pPict->format)
@@ -776,7 +767,7 @@ static Bool R200CheckCompositeTexture(PicturePtr pPict,
 	RADEON_FALLBACK(("Unsupported picture format 0x%x\n",
 			 (int)pPict->format));
 
-    if (!RADEONCheckTexturePOT(pPict, unit == 0))
+    if (pPict->pDrawable && !RADEONCheckTexturePOT(pPict, unit == 0))
 	return FALSE;
 
     if (pPict->filter != PictFilterNearest &&
@@ -809,15 +800,24 @@ static Bool FUNC_NAME(R200TextureSetup)(PicturePtr pPict, PixmapPtr pPix,
 {
     RINFO_FROM_SCREEN(pPix->drawable.pScreen);
     uint32_t txfilter, txformat, txoffset, txpitch;
-    int w = pPict->pDrawable->width;
-    int h = pPict->pDrawable->height;
-    unsigned int repeatType = pPict->repeat ? pPict->repeatType : RepeatNone;
-    Bool repeat = (repeatType == RepeatNormal || repeatType == RepeatReflect) &&
-	!(unit == 0 && (info->accel_state->need_src_tile_x || info->accel_state->need_src_tile_y));
-    int i;
+    unsigned int repeatType;
+    Bool repeat;
+    int i, w, h;
     struct radeon_exa_pixmap_priv *driver_priv;
     ACCEL_PREAMBLE();
 
+    if (pPict->pDrawable) {
+	w = pPict->pDrawable->width;
+	h = pPict->pDrawable->height;
+	repeatType = pPict->repeat ? pPict->repeatType : RepeatNone;
+    } else {
+	w = h = 1;
+	repeatType = RepeatNormal;
+    }
+
+    repeat = (repeatType == RepeatNormal || repeatType == RepeatReflect) &&
+	!(unit == 0 && (info->accel_state->need_src_tile_x || info->accel_state->need_src_tile_y));
+
     txpitch = exaGetPixmapPitch(pPix);
 
     txoffset = 0;
@@ -926,22 +926,6 @@ static Bool R200CheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskP
     if (op >= sizeof(RadeonBlendOp) / sizeof(RadeonBlendOp[0]))
 	RADEON_FALLBACK(("Unsupported Composite op 0x%x\n", op));
 
-    if (!pSrcPicture->pDrawable)
-	RADEON_FALLBACK(("Solid or gradient pictures not supported yet\n"));
-
-    /* r200 limit should be 2048, there are issues with 2048
-     * see bug 19269
-     */
-
-    pSrcPixmap = RADEONGetDrawablePixmap(pSrcPicture->pDrawable);
-
-    if (pSrcPixmap->drawable.width > 2047 ||
-	pSrcPixmap->drawable.height > 2047) {
-	RADEON_FALLBACK(("Source w/h too large (%d,%d).\n",
-			 pSrcPixmap->drawable.width,
-			 pSrcPixmap->drawable.height));
-    }
-
     pDstPixmap = RADEONGetDrawablePixmap(pDstPicture->pDrawable);
 
     if (pDstPixmap->drawable.width > 2047 ||
@@ -951,20 +935,35 @@ static Bool R200CheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskP
 			 pDstPixmap->drawable.height));
     }
 
+    if (pSrcPicture->pDrawable) {
+	/* r200 limit should be 2048, there are issues with 2048
+	 * see 197a62704742a4a19736c2637ac92d1dc5ab34ed
+	 */
+	pSrcPixmap = RADEONGetDrawablePixmap(pSrcPicture->pDrawable);
+
+	if (pSrcPixmap->drawable.width > 2047 ||
+	    pSrcPixmap->drawable.height > 2047) {
+	    RADEON_FALLBACK(("Source w/h too large (%d,%d).\n",
+			     pSrcPixmap->drawable.width,
+			     pSrcPixmap->drawable.height));
+	}
+    } else if (pSrcPicture->pSourcePict->type != SourcePictTypeSolidFill)
+	RADEON_FALLBACK(("Gradient pictures not supported yet\n"));
+
     if (pMaskPicture) {
 	PixmapPtr pMaskPixmap;
 
-	if (!pMaskPicture->pDrawable)
-	    RADEON_FALLBACK(("Solid or gradient pictures not supported yet\n"));
-
-	pMaskPixmap = RADEONGetDrawablePixmap(pMaskPicture->pDrawable);
+	if (pMaskPicture->pDrawable) {
+	    pMaskPixmap = RADEONGetDrawablePixmap(pMaskPicture->pDrawable);
 
-	if (pMaskPixmap->drawable.width > 2047 ||
-	    pMaskPixmap->drawable.height > 2047) {
-	    RADEON_FALLBACK(("Mask w/h too large (%d,%d).\n",
-			     pMaskPixmap->drawable.width,
-			     pMaskPixmap->drawable.height));
-	}
+	    if (pMaskPixmap->drawable.width > 2047 ||
+		pMaskPixmap->drawable.height > 2047) {
+		RADEON_FALLBACK(("Mask w/h too large (%d,%d).\n",
+				 pMaskPixmap->drawable.width,
+				 pMaskPixmap->drawable.height));
+	    }
+	} else if (pMaskPicture->pSourcePict->type != SourcePictTypeSolidFill)
+	    RADEON_FALLBACK(("Gradient pictures not supported yet\n"));
 
 	if (pMaskPicture->componentAlpha) {
 	    /* Check if it's component alpha that relies on a source alpha and
@@ -997,7 +996,8 @@ static Bool FUNC_NAME(R200PrepareComposite)(int op, PicturePtr pSrcPicture,
 				PicturePtr pMaskPicture, PicturePtr pDstPicture,
 				PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst)
 {
-    RINFO_FROM_SCREEN(pDst->drawable.pScreen);
+    ScreenPtr pScreen = pDst->drawable.pScreen;
+    RINFO_FROM_SCREEN(pScreen);
     uint32_t dst_format, dst_pitch;
     uint32_t pp_cntl, blendcntl, cblend, ablend, colorpitch;
     int pixel_shift;
@@ -1024,9 +1024,24 @@ static Bool FUNC_NAME(R200PrepareComposite)(int op, PicturePtr pSrcPicture,
     if (((dst_pitch >> pixel_shift) & 0x7) != 0)
 	RADEON_FALLBACK(("Bad destination pitch 0x%x\n", (int)dst_pitch));
 
+    if (!pSrc) {
+	pSrc = RADEONSolidPixmap(pScreen, cpu_to_le32(pSrcPicture->pSourcePict->solidFill.color));
+	if (!pSrc)
+	    RADEON_FALLBACK("Failed to create solid scratch pixmap\n");
+    }
+
     if (!RADEONSetupSourceTile(pSrcPicture, pSrc, FALSE, TRUE))
 	return FALSE;
 
+    if (pMaskPicture && !pMask) {
+	pMask = RADEONSolidPixmap(pScreen, cpu_to_le32(pMaskPicture->pSourcePict->solidFill.color));
+	if (!pMask) {
+	    if (!pSrcPicture->pDrawable)
+		pScreen->DestroyPixmap(pSrc);
+	    RADEON_FALLBACK("Failed to create solid scratch pixmap\n");
+	}
+    }
+
     RADEONPrepareCompositeCS(op, pSrcPicture, pMaskPicture, pDstPicture,
 			     pSrc, pMask, pDst);
 

commit 3949d4d76e68ea23b8772ac4f106dcebaa33c5a5
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Fri Apr 13 13:24:46 2012 -0400

    EXA: Support acceleration of solid pictures on R1xx.
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
    (cherry picked from commit a7754b076e355fef3aea082b6e2d3aefbb8e7a9b)

diff --git a/src/radeon_exa_render.c b/src/radeon_exa_render.c
index b6cc9e4..451a625 100644
--- a/src/radeon_exa_render.c
+++ b/src/radeon_exa_render.c
@@ -338,17 +338,8 @@ static Bool R100CheckCompositeTexture(PicturePtr pPict,
 				      int unit)
 {
     unsigned int repeatType = pPict->repeat ? pPict->repeatType : RepeatNone;
-    int w = pPict->pDrawable->width;
-    int h = pPict->pDrawable->height;
     int i;
 
-    /* r100 limit should be 2048, there are issues with 2048
-     * see 197a62704742a4a19736c2637ac92d1dc5ab34ed
-     */
-
-    if ((w > 2047) || (h > 2047))
-	RADEON_FALLBACK(("Picture w/h too large (%dx%d)\n", w, h));
-
     for (i = 0; i < sizeof(R100TexFormats) / sizeof(R100TexFormats[0]); i++) {
 	if (R100TexFormats[i].fmt == pPict->format)
 	    break;
@@ -357,7 +348,7 @@ static Bool R100CheckCompositeTexture(PicturePtr pPict,
 	RADEON_FALLBACK(("Unsupported picture format 0x%x\n",
 			(int)pPict->format));
 
-    if (!RADEONCheckTexturePOT(pPict, unit == 0))
+    if (pPict->pDrawable && !RADEONCheckTexturePOT(pPict, unit == 0))
 	return FALSE;
 
     if (pPict->filter != PictFilterNearest &&
@@ -392,15 +383,24 @@ static Bool FUNC_NAME(R100TextureSetup)(PicturePtr pPict, PixmapPtr pPix,
 {
     RINFO_FROM_SCREEN(pPix->drawable.pScreen);
     uint32_t txfilter, txformat, txoffset, txpitch;
-    int w = pPict->pDrawable->width;
-    int h = pPict->pDrawable->height;
-    unsigned int repeatType = pPict->repeat ? pPict->repeatType : RepeatNone;
-    Bool repeat = (repeatType == RepeatNormal || repeatType == RepeatReflect) &&
-	!(unit == 0 && (info->accel_state->need_src_tile_x || info->accel_state->need_src_tile_y));
-    int i;
+    unsigned int repeatType;
+    Bool repeat;
+    int i, w, h;
     struct radeon_exa_pixmap_priv *driver_priv;
     ACCEL_PREAMBLE();
 
+    if (pPict->pDrawable) {
+	w = pPict->pDrawable->width;
+	h = pPict->pDrawable->height;
+	repeatType = pPict->repeat ? pPict->repeatType : RepeatNone;
+    } else {
+	w = h = 1;
+	repeatType = RepeatNormal;
+    }
+
+    repeat = (repeatType == RepeatNormal || repeatType == RepeatReflect) &&
+	!(unit == 0 && (info->accel_state->need_src_tile_x || info->accel_state->need_src_tile_y));
+
     txpitch = exaGetPixmapPitch(pPix);
     txoffset = 0;
 
@@ -510,22 +510,6 @@ static Bool R100CheckComposite(int op, PicturePtr pSrcPicture,
     if (op >= sizeof(RadeonBlendOp) / sizeof(RadeonBlendOp[0]))
 	RADEON_FALLBACK(("Unsupported Composite op 0x%x\n", op));
 
-    if (!pSrcPicture->pDrawable)
-	RADEON_FALLBACK(("Solid or gradient pictures not supported yet\n"));
-
-    /* r100 limit should be 2048, there are issues with 2048
-     * see 197a62704742a4a19736c2637ac92d1dc5ab34ed
-     */
-
-    pSrcPixmap = RADEONGetDrawablePixmap(pSrcPicture->pDrawable);
-
-    if (pSrcPixmap->drawable.width > 2047 ||
-	pSrcPixmap->drawable.height > 2047) {
-	RADEON_FALLBACK(("Source w/h too large (%d,%d).\n",
-			 pSrcPixmap->drawable.width,
-			 pSrcPixmap->drawable.height));
-    }
-
     pDstPixmap = RADEONGetDrawablePixmap(pDstPicture->pDrawable);
 
     if (pDstPixmap->drawable.width > 2047 ||
@@ -535,20 +519,35 @@ static Bool R100CheckComposite(int op, PicturePtr pSrcPicture,
 			 pDstPixmap->drawable.height));
     }
 
+    if (pSrcPicture->pDrawable) {
+	/* r100 limit should be 2048, there are issues with 2048
+	 * see 197a62704742a4a19736c2637ac92d1dc5ab34ed
+	 */
+	pSrcPixmap = RADEONGetDrawablePixmap(pSrcPicture->pDrawable);
+
+	if (pSrcPixmap->drawable.width > 2047 ||
+	    pSrcPixmap->drawable.height > 2047) {
+	    RADEON_FALLBACK(("Source w/h too large (%d,%d).\n",
+			     pSrcPixmap->drawable.width,
+			     pSrcPixmap->drawable.height));
+	}
+    } else if (pSrcPicture->pSourcePict->type != SourcePictTypeSolidFill)
+	RADEON_FALLBACK(("Gradient pictures not supported yet\n"));
+
     if (pMaskPicture) {
 	PixmapPtr pMaskPixmap;
 
-	if (!pMaskPicture->pDrawable)
-	    RADEON_FALLBACK(("Solid or gradient pictures not supported yet\n"));
-
-	pMaskPixmap = RADEONGetDrawablePixmap(pMaskPicture->pDrawable);
+	if (pMaskPicture->pDrawable) {
+	    pMaskPixmap = RADEONGetDrawablePixmap(pMaskPicture->pDrawable);
 
-	if (pMaskPixmap->drawable.width > 2047 ||
-	    pMaskPixmap->drawable.height > 2047) {
-	    RADEON_FALLBACK(("Mask w/h too large (%d,%d).\n",
-			     pMaskPixmap->drawable.width,
-			     pMaskPixmap->drawable.height));
-	}
+	    if (pMaskPixmap->drawable.width > 2047 ||
+		pMaskPixmap->drawable.height > 2047) {
+		RADEON_FALLBACK(("Mask w/h too large (%d,%d).\n",
+				 pMaskPixmap->drawable.width,
+				 pMaskPixmap->drawable.height));
+	    }
+	} else if (pMaskPicture->pSourcePict->type != SourcePictTypeSolidFill)
+	    RADEON_FALLBACK(("Gradient pictures not supported yet\n"));
 
 	if (pMaskPicture->componentAlpha) {
 	    /* Check if it's component alpha that relies on a source alpha and
@@ -624,7 +623,8 @@ static Bool FUNC_NAME(R100PrepareComposite)(int op,
 					    PixmapPtr pMask,
 					    PixmapPtr pDst)
 {
-    RINFO_FROM_SCREEN(pDst->drawable.pScreen);
+    ScreenPtr pScreen = pDst->drawable.pScreen;
+    RINFO_FROM_SCREEN(pScreen);
     uint32_t dst_format, dst_pitch, colorpitch;
     uint32_t pp_cntl, blendcntl, cblend, ablend;
     int pixel_shift;
@@ -648,12 +648,27 @@ static Bool FUNC_NAME(R100PrepareComposite)(int op,
 
     CHECK_OFFSET(pDst, 0x0f, "destination");
 
+    if (!pSrc) {
+	pSrc = RADEONSolidPixmap(pScreen, cpu_to_le32(pSrcPicture->pSourcePict->solidFill.color));
+	if (!pSrc)
+	    RADEON_FALLBACK("Failed to create solid scratch pixmap\n");
+    }
+
     if (((dst_pitch >> pixel_shift) & 0x7) != 0)
 	RADEON_FALLBACK(("Bad destination pitch 0x%x\n", (int)dst_pitch));
 
     if (!RADEONSetupSourceTile(pSrcPicture, pSrc, FALSE, TRUE))
 	return FALSE;
 
+    if (pMaskPicture && !pMask) {
+	pMask = RADEONSolidPixmap(pScreen, cpu_to_le32(pMaskPicture->pSourcePict->solidFill.color));
+	if (!pMask) {
+	    if (!pSrcPicture->pDrawable)
+		pScreen->DestroyPixmap(pSrc);
+	    RADEON_FALLBACK("Failed to create solid scratch pixmap\n");
+	}
+    }
+
     RADEONPrepareCompositeCS(op, pSrcPicture, pMaskPicture, pDstPicture,
 			     pSrc, pMask, pDst);
 

commit 739c794e0ecbea0d09ba10c06eeacf5c02029698
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Sat Apr 14 08:53:39 2012 -0400

    EXA: Support acceleration of solid pictures on Evergreen/NI.
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
    (cherry picked from commit cac2d7ed54918579418fc762558497d3ec547fad)

diff --git a/src/evergreen_exa.c b/src/evergreen_exa.c
index cee3ec2..61b47a4 100644
--- a/src/evergreen_exa.c
+++ b/src/evergreen_exa.c
@@ -748,17 +748,8 @@ static Bool EVERGREENCheckCompositeTexture(PicturePtr pPict,
 					   int op,
 					   int unit)
 {
-    int w = pPict->pDrawable->width;
-    int h = pPict->pDrawable->height;
     unsigned int repeatType = pPict->repeat ? pPict->repeatType : RepeatNone;
     unsigned int i;
-    int max_tex_w, max_tex_h;
-
-    max_tex_w = 16384;
-    max_tex_h = 16384;
-
-    if ((w > max_tex_w) || (h > max_tex_h))
-	RADEON_FALLBACK(("Picture w/h too large (%dx%d)\n", w, h));
 
     for (i = 0; i < sizeof(EVERGREENTexFormats) / sizeof(EVERGREENTexFormats[0]); i++) {
 	if (EVERGREENTexFormats[i].fmt == pPict->format)
@@ -798,9 +789,16 @@ static void EVERGREENXFormSetup(PicturePtr pPict, PixmapPtr pPix,
     ScrnInfoPtr pScrn = xf86Screens[pPix->drawable.pScreen->myNum];
     RADEONInfoPtr info = RADEONPTR(pScrn);
     struct radeon_accel_state *accel_state = info->accel_state;
-    int w = pPict->pDrawable->width;
-    int h = pPict->pDrawable->height;
     int const_offset = unit * 8;
+    int w, h;
+
+    if (pPict->pDrawable) {
+	w = pPict->pDrawable->width;
+	h = pPict->pDrawable->height;
+    } else {
+	w = 1;
+	h = 1;
+    }
 
     if (pPict->transform != 0) {
 	accel_state->is_transform[unit] = TRUE;
@@ -837,9 +835,7 @@ static Bool EVERGREENTextureSetup(PicturePtr pPict, PixmapPtr pPix,
     ScrnInfoPtr pScrn = xf86Screens[pPix->drawable.pScreen->myNum];
     RADEONInfoPtr info = RADEONPTR(pScrn);
     struct radeon_accel_state *accel_state = info->accel_state;
-    int w = pPict->pDrawable->width;
-    int h = pPict->pDrawable->height;
-    unsigned int repeatType = pPict->repeat ? pPict->repeatType : RepeatNone;
+    unsigned int repeatType;
     unsigned int i;
     tex_resource_t  tex_res;
     tex_sampler_t   tex_samp;
@@ -854,9 +850,17 @@ static Bool EVERGREENTextureSetup(PicturePtr pPict, PixmapPtr pPix,
     }
 
     /* Texture */
+    if (pPict->pDrawable) {
+	tex_res.w               = pPict->pDrawable->width;
+	tex_res.h               = pPict->pDrawable->height;
+	repeatType              = pPict->repeat ? pPict->repeatType : RepeatNone;
+    } else {
+	tex_res.w               = 1;
+	tex_res.h               = 1;
+	repeatType              = RepeatNormal;
+    }
+
     tex_res.id                  = unit;
-    tex_res.w                   = w;
-    tex_res.h                   = h;
     tex_res.pitch               = accel_state->src_obj[unit].pitch;
     tex_res.depth               = 0;
     tex_res.dim                 = SQ_TEX_DIM_2D;
@@ -1054,33 +1058,30 @@ static Bool EVERGREENCheckComposite(int op, PicturePtr pSrcPicture,
 {
     uint32_t tmp1;
     PixmapPtr pSrcPixmap, pDstPixmap;
-    int max_tex_w, max_tex_h, max_dst_w, max_dst_h;
 
     /* Check for unsupported compositing operations. */
     if (op >= (int) (sizeof(EVERGREENBlendOp) / sizeof(EVERGREENBlendOp[0])))
 	RADEON_FALLBACK(("Unsupported Composite op 0x%x\n", op));
 
-    if (!pSrcPicture->pDrawable)
-	RADEON_FALLBACK(("Solid or gradient pictures not supported yet\n"));
+    if (pSrcPicture->pDrawable) {
+	pSrcPixmap = RADEONGetDrawablePixmap(pSrcPicture->pDrawable);
 
-    pSrcPixmap = RADEONGetDrawablePixmap(pSrcPicture->pDrawable);
-
-    max_tex_w = 8192;
-    max_tex_h = 8192;
-    max_dst_w = 8192;
-    max_dst_h = 8192;
+	if (pSrcPixmap->drawable.width >= 16384 ||
+	    pSrcPixmap->drawable.height >= 16384) {
+	    RADEON_FALLBACK(("Source w/h too large (%d,%d).\n",
+			     pSrcPixmap->drawable.width,
+			     pSrcPixmap->drawable.height));
+	}
 
-    if (pSrcPixmap->drawable.width >= max_tex_w ||
-	pSrcPixmap->drawable.height >= max_tex_h) {
-	RADEON_FALLBACK(("Source w/h too large (%d,%d).\n",
-			 pSrcPixmap->drawable.width,
-			 pSrcPixmap->drawable.height));
-    }
+	if (!EVERGREENCheckCompositeTexture(pSrcPicture, pDstPicture, op, 0))
+	    return FALSE;
+    } else if (pSrcPicture->pSourcePict->type != SourcePictTypeSolidFill)
+	RADEON_FALLBACK(("Gradient pictures not supported yet\n"));
 
     pDstPixmap = RADEONGetDrawablePixmap(pDstPicture->pDrawable);
 
-    if (pDstPixmap->drawable.width >= max_dst_w ||
-	pDstPixmap->drawable.height >= max_dst_h) {
+    if (pDstPixmap->drawable.width >= 16384 ||
+	pDstPixmap->drawable.height >= 16384) {
 	RADEON_FALLBACK(("Dest w/h too large (%d,%d).\n",
 			 pDstPixmap->drawable.width,
 			 pDstPixmap->drawable.height));
@@ -1089,38 +1090,35 @@ static Bool EVERGREENCheckComposite(int op, PicturePtr pSrcPicture,
     if (pMaskPicture) {
 	PixmapPtr pMaskPixmap;
 
-	if (!pMaskPicture->pDrawable)
-	    RADEON_FALLBACK(("Solid or gradient pictures not supported yet\n"));
-
-	pMaskPixmap = RADEONGetDrawablePixmap(pMaskPicture->pDrawable);
+	if (pMaskPicture->pDrawable) {
+	    pMaskPixmap = RADEONGetDrawablePixmap(pMaskPicture->pDrawable);
 
-	if (pMaskPixmap->drawable.width >= max_tex_w ||
-	    pMaskPixmap->drawable.height >= max_tex_h) {
-	    RADEON_FALLBACK(("Mask w/h too large (%d,%d).\n",
-			     pMaskPixmap->drawable.width,
-			     pMaskPixmap->drawable.height));
-	}
+	    if (pMaskPixmap->drawable.width >= 16384 ||
+		pMaskPixmap->drawable.height >= 16384) {
+	      RADEON_FALLBACK(("Mask w/h too large (%d,%d).\n",
+			       pMaskPixmap->drawable.width,
+			       pMaskPixmap->drawable.height));
+	    }
 
-	if (pMaskPicture->componentAlpha) {
-	    /* Check if it's component alpha that relies on a source alpha and
-	     * on the source value.  We can only get one of those into the
-	     * single source value that we get to blend with.
-	     */
-	    if (EVERGREENBlendOp[op].src_alpha &&
-		(EVERGREENBlendOp[op].blend_cntl & COLOR_SRCBLEND_mask) !=
-		(BLEND_ZERO << COLOR_SRCBLEND_shift)) {
-		RADEON_FALLBACK(("Component alpha not supported with source "
-				 "alpha and source value blending.\n"));
+	    if (pMaskPicture->componentAlpha) {
+		/* Check if it's component alpha that relies on a source alpha and
+		 * on the source value.  We can only get one of those into the
+		 * single source value that we get to blend with.
+		 */
+		if (EVERGREENBlendOp[op].src_alpha &&
+		    (EVERGREENBlendOp[op].blend_cntl & COLOR_SRCBLEND_mask) !=
+		    (BLEND_ZERO << COLOR_SRCBLEND_shift)) {
+		    RADEON_FALLBACK(("Component alpha not supported with source "
+				     "alpha and source value blending.\n"));
+		}
 	    }
-	}
 
-	if (!EVERGREENCheckCompositeTexture(pMaskPicture, pDstPicture, op, 1))
-	    return FALSE;
+	    if (!EVERGREENCheckCompositeTexture(pMaskPicture, pDstPicture, op, 1))
+		return FALSE;
+	} else if (pMaskPicture->pSourcePict->type != SourcePictTypeSolidFill)
+	    RADEON_FALLBACK(("Gradient pictures not supported yet\n"));
     }
 
-    if (!EVERGREENCheckCompositeTexture(pSrcPicture, pDstPicture, op, 0))
-	return FALSE;
-
     if (!EVERGREENGetDestFormat(pDstPicture, &tmp1))
 	return FALSE;
 
@@ -1132,7 +1130,8 @@ static Bool EVERGREENPrepareComposite(int op, PicturePtr pSrcPicture,
 				      PicturePtr pMaskPicture, PicturePtr pDstPicture,
 				      PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst)
 {
-    ScrnInfoPtr pScrn = xf86Screens[pSrc->drawable.pScreen->myNum];
+    ScreenPtr pScreen = pDst->drawable.pScreen;
+    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
     RADEONInfoPtr info = RADEONPTR(pScrn);
     struct radeon_accel_state *accel_state = info->accel_state;
     uint32_t dst_format;
@@ -1142,13 +1141,19 @@ static Bool EVERGREENPrepareComposite(int op, PicturePtr pSrcPicture,
     struct r600_accel_object src_obj, mask_obj, dst_obj;
     float *cbuf;
 
-    if (pDst->drawable.bitsPerPixel < 8 || pSrc->drawable.bitsPerPixel < 8)
+    if (pDst->drawable.bitsPerPixel < 8 || (pSrc && pSrc->drawable.bitsPerPixel < 8))
 	return FALSE;
 
+    if (!pSrc) {
+	pSrc = RADEONSolidPixmap(pScreen, pSrcPicture->pSourcePict->solidFill.color);
+	if (!pSrc)
+	    RADEON_FALLBACK("Failed to create solid scratch pixmap\n");
+    }
+
     src_obj.offset = 0;
     dst_obj.offset = 0;
-    src_obj.bo = radeon_get_pixmap_bo(pSrc);
     dst_obj.bo = radeon_get_pixmap_bo(pDst);
+    src_obj.bo = radeon_get_pixmap_bo(pSrc);
     dst_obj.surface = radeon_get_pixmap_surface(pDst);
     src_obj.surface = radeon_get_pixmap_surface(pSrc);
     dst_obj.tiling_flags = radeon_get_pixmap_tiling(pDst);
@@ -1166,7 +1171,15 @@ static Bool EVERGREENPrepareComposite(int op, PicturePtr pSrcPicture,
     dst_obj.bpp = pDst->drawable.bitsPerPixel;


Reply to: