--- a/open-src/driver/xf86-video-mach64/113.patch Wed Dec 05 17:25:49 2012 -0800
+++ b/open-src/driver/xf86-video-mach64/113.patch Thu Dec 06 08:08:39 2012 -0800
@@ -1,14 +1,119 @@
---- src/atiscreen.c Thu Sep 20 08:11:15 2012
-+++ src/atiscreen.c Thu Sep 20 08:12:36 2012
-@@ -580,7 +580,11 @@
+From 5eb7fec958bc6ba8a1a2b0be4916cac818866e1c Mon Sep 17 00:00:00 2001
+From: Dave Airlie <[email protected]>
+Date: Wed, 18 Jul 2012 18:46:49 +1000
+Subject: [PATCH:xf86-video-mach64] mach64: fix build on 32-bit.
+
+tvout code only builds on 32-bit, fix build.
+
+Signed-off-by: Dave Airlie <[email protected]>
+---
+ src/atiscreen.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/atiscreen.c b/src/atiscreen.c
+index 2957877..b1fbd3c 100644
+--- a/src/atiscreen.c
++++ b/src/atiscreen.c
+@@ -580,7 +580,7 @@ ATIScreenInit(SCREEN_INIT_ARGS_DECL)
#ifdef TV_OUT
/* Fix-up TV out after ImpacTV probe */
if (pATI->OptionTvOut && pATI->Chip < ATI_CHIP_264GTPRO)
-+#ifndef XF86_SCRN_INTERFACE
- ATISwitchMode(0, pScreenInfo->currentMode, 0);
-+#else
-+ ATISwitchMode(pScreenInfo->currentMode, 0);
-+#endif
+- ATISwitchMode(0, pScreenInfo->currentMode, 0);
++ ATISwitchMode(SWITCH_MODE_ARGS(pScreenInfo, pScreenInfo->currentMode));
#endif /* TV_OUT */
#ifdef XF86DRI_DEVEL
+
+
+From 104e3e067a7dcac143cb672fe42d56396ba6087b Mon Sep 17 00:00:00 2001
+From: Adam Jackson <[email protected]>
+Date: Wed, 26 Sep 2012 16:21:25 -0400
+Subject: [PATCH:xf86-video-mach64] Don't gratuitously disable Render when
+ ShadowFBing
+
+There's no reason to do this, and I am at a loss to explain why that was
+ever done. The first instance of this logic comes from xfree86 (over 11
+years ago!):
+
+http://cvsweb.xfree86.org/cvsweb/xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c.diff?r1=1.15&r2=1.16
+
+Now, cfb never had Render support, so that might make some sense if
+there was an intermediate uncommitted state where the driver used fb for
+direct but cfb for shadowed. But that's really the only plausible
+explanation I can think of.
+
+Signed-off-by: Adam Jackson <[email protected]>
+---
+ src/atiscreen.c | 18 ++++--------------
+ 1 file changed, 4 insertions(+), 14 deletions(-)
+
+diff --git a/src/atiscreen.c b/src/atiscreen.c
+index b1fbd3c..62a4dd9 100644
+--- a/src/atiscreen.c
++++ b/src/atiscreen.c
+@@ -476,21 +476,11 @@ ATIScreenInit(SCREEN_INIT_ARGS_DECL)
+ }
+ }
+
+- /* If applicable, initialise RENDER extension */
++ /* initialise RENDER extension */
++ if (!fbPictureInit(pScreen, NULL, 0) && (serverGeneration == 1))
+ {
+- if (pATI->OptionShadowFB)
+- {
+- if (serverGeneration == 1)
+- xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
+- "RENDER extension not supported with a shadowed"
+- " framebuffer.\n");
+- }
+- else if (!fbPictureInit(pScreen, NULL, 0) &&
+- (serverGeneration == 1))
+- {
+- xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
+- "RENDER extension initialisation failed.\n");
+- }
++ xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
++ "RENDER extension initialisation failed.\n");
+ }
+
+ xf86SetBlackWhitePixels(pScreen);
+
+
+From 42c4e423eec789606eec9703be23a9fd4483a14a Mon Sep 17 00:00:00 2001
+From: Adam Jackson <[email protected]>
+Date: Tue, 2 Oct 2012 10:19:47 -0400
+Subject: [PATCH:xf86-video-mach64] Fix build with neither XAA nor EXA against
+ xserver 1.13.0
+
+Pull in picturestr.h to get GLYPH_HAS_GLYPH_PICTURE_ACCESSOR defined
+before compat-api.h is parsed, otherwise you fail with:
+
+In file included from /usr/include/xorg/picturestr.h:28:0,
+ from /usr/include/xorg/exa.h:38,
+ from atimach64accel.h:31,
+ from atiscreen.c:46:
+/usr/include/xorg/glyphstr.h:138:2: error: expected ')' before '*' token
+/usr/include/xorg/glyphstr.h:138:2: error: expected ')' before '(' token
+/usr/include/xorg/glyphstr.h:140:2: error: expected ')' before '*' token
+/usr/include/xorg/glyphstr.h:140:2: error: expected ')' before '(' token
+
+Signed-off-by: Adam Jackson <[email protected]>
+---
+ src/atistruct.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/atistruct.h b/src/atistruct.h
+index 702360b..98dc15e 100644
+--- a/src/atistruct.h
++++ b/src/atistruct.h
+@@ -51,6 +51,7 @@
+
+ #endif /* TV_OUT */
+
++#include "picturestr.h"
+ #ifdef USE_EXA
+ #include "exa.h"
+ #endif
+--
+1.7.9.2
+
--- a/open-src/driver/xf86-video-mach64/Makefile Wed Dec 05 17:25:49 2012 -0800
+++ b/open-src/driver/xf86-video-mach64/Makefile Thu Dec 06 08:08:39 2012 -0800
@@ -38,7 +38,8 @@
# Patches to apply to source after unpacking, in order
SOURCE_PATCHES = 6205248.patch,-p1 \
- 113.patch
+ 113.patch,-p1 \
+ exa-crash.patch,-p1
# Man pages to apply Sun footer to & attributes to list
#SUNTOUCHED_MANPAGES=man/*.man
@@ -47,6 +48,8 @@
# Extra flags to pass to configure script
# - Disable DRI since the kernel module isn't ported
MODULE_CONFIG_OPTS=--disable-dri
+# - Disable EXA for now since it isn't completely working & crashes a lot
+MODULE_CONFIG_OPTS += --disable-exa
# Paths to find libraries/modules to link with
MODULE_LD_OPTIONS= \
@@ -54,7 +57,7 @@
-L$(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) \
-R$(X11_SERVERMODS_DIR) \
-R$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) \
- -lexa -lint10 -lpciaccess -lfb -lpixman-1 -lshadowfb -lXfont -lvbe
+ -lint10 -lpciaccess -lfb -lpixman-1 -lshadowfb -lXfont -lvbe
# Additional install rules beyond what upstream installs
MODULE_ADD_INSTALL_TARGETS=install_docs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/driver/xf86-video-mach64/exa-crash.patch Thu Dec 06 08:08:39 2012 -0800
@@ -0,0 +1,63 @@
+From f5fa7780dd152637b422617527abca5b26d51851 Mon Sep 17 00:00:00 2001
+From: Connor Behan <[email protected]>
+Date: Fri, 15 Jun 2012 17:27:40 -0700
+Subject: [PATCH] Fix memory locations in UTS / DFS
+
+Instead of using devPrivate.ptr, we should use EXA functions to
+calculate the offset of a pixmap from the EXA memory base.
+Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=51137
+
+Signed-off-by: Connor Behan <[email protected]>
+---
+ src/atimach64exa.c | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/src/atimach64exa.c b/src/atimach64exa.c
+index e4d5307..ffab9bf 100644
+--- a/src/atimach64exa.c
++++ b/src/atimach64exa.c
+@@ -394,14 +394,18 @@ static Bool
+ Mach64UploadToScreen(PixmapPtr pDst, int x, int y, int w, int h,
+ char *src, int src_pitch)
+ {
+- char *dst = pDst->devPrivate.ptr;
++ ScreenPtr pScreen = pDst->drawable.pScreen;
++ ScrnInfoPtr pScreenInfo = xf86ScreenToScrn(pScreen);
++ ATIPtr pATI = ATIPTR(pScreenInfo);
++
++ char *dst = pATI->pExa->memoryBase + exaGetPixmapOffset(pDst);
+ int dst_pitch = exaGetPixmapPitch(pDst);
+
+ int bpp = pDst->drawable.bitsPerPixel;
+ int cpp = (bpp + 7) / 8;
+ int wBytes = w * cpp;
+
+- exaWaitSync(pDst->drawable.pScreen);
++ exaWaitSync(pScreen);
+
+ dst += (x * cpp) + (y * dst_pitch);
+
+@@ -421,14 +425,18 @@ static Bool
+ Mach64DownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h,
+ char *dst, int dst_pitch)
+ {
+- char *src = pSrc->devPrivate.ptr;
++ ScreenPtr pScreen = pSrc->drawable.pScreen;
++ ScrnInfoPtr pScreenInfo = xf86ScreenToScrn(pScreen);
++ ATIPtr pATI = ATIPTR(pScreenInfo);
++
++ char *src = pATI->pExa->memoryBase + exaGetPixmapOffset(pSrc);
+ int src_pitch = exaGetPixmapPitch(pSrc);
+
+ int bpp = pSrc->drawable.bitsPerPixel;
+ int cpp = (bpp + 7) / 8;
+ int wBytes = w * cpp;
+
+- exaWaitSync(pSrc->drawable.pScreen);
++ exaWaitSync(pScreen);
+
+ src += (x * cpp) + (y * src_pitch);
+
+--
+1.7.10.3
+
--- a/open-src/xserver/xorg/6912996.patch Wed Dec 05 17:25:49 2012 -0800
+++ b/open-src/xserver/xorg/6912996.patch Thu Dec 06 08:08:39 2012 -0800
@@ -8,7 +8,7 @@
- return (CARD8 *) pExaPixmap->fb_ptr - pExaScr->info->memoryBase;
+ /* added in as a fix for 6912996 */
-+ if (exaPixmapHasGpuCopy(pExaPixmap) && pExaPixmap->fb_ptr)
++ if (exaPixmapHasGpuCopy(pPix) && pExaPixmap->fb_ptr)
+ return (CARD8 *) pExaPixmap->fb_ptr - pExaScr->info->memoryBase;
+ else
+ return (CARD8 *) pExaPixmap->sys_ptr - pExaScr->info->memoryBase;