From a29a913757b58be398f1685fb5786e794dde89a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Tue, 29 Sep 2015 22:27:17 +0200 Subject: [PATCH] New package: xf86-video-mga-1.6.4 --- .../patches/composite-fixup.patch | 36 ++++++++++++++ .../patches/fix-exa-support.patch | 31 ++++++++++++ .../patches/fix-function-call-type.patch | 23 +++++++++ .../patches/remove-download-from-screen.patch | 48 +++++++++++++++++++ .../patches/write-combining.patch | 15 ++++++ srcpkgs/xf86-video-mga/template | 23 +++++++++ 6 files changed, 176 insertions(+) create mode 100644 srcpkgs/xf86-video-mga/patches/composite-fixup.patch create mode 100644 srcpkgs/xf86-video-mga/patches/fix-exa-support.patch create mode 100644 srcpkgs/xf86-video-mga/patches/fix-function-call-type.patch create mode 100644 srcpkgs/xf86-video-mga/patches/remove-download-from-screen.patch create mode 100644 srcpkgs/xf86-video-mga/patches/write-combining.patch create mode 100644 srcpkgs/xf86-video-mga/template diff --git a/srcpkgs/xf86-video-mga/patches/composite-fixup.patch b/srcpkgs/xf86-video-mga/patches/composite-fixup.patch new file mode 100644 index 00000000000..e901b82c234 --- /dev/null +++ b/srcpkgs/xf86-video-mga/patches/composite-fixup.patch @@ -0,0 +1,36 @@ +A driver like this that tries to composite a lot will definitely need to +avoid crashing for solid pictures. + +Signed-off-by: Connor Behan + +--- src/mga_exa.c ++++ src/mga_exa.c +@@ -318,6 +318,11 @@ mgaGetTexFormat(PicturePtr pPict) + static Bool + mgaCheckSourceTexture(int tmu, PicturePtr pPict) + { ++ if (!pPict->pDrawable) { ++ DEBUG_MSG(("Solid / gradient pictures not supported\n")); ++ return FALSE; ++ } ++ + int w = pPict->pDrawable->width; + int h = pPict->pDrawable->height; + +@@ -354,7 +359,7 @@ static Bool + mgaCheckComposite(int op, PicturePtr pSrcPict, PicturePtr pMaskPict, + PicturePtr pDstPict) + { +- MGAPtr pMga = xf86ScreenToScrn(pSrcPict->pDrawable->pScreen)->driverPrivate; ++ MGAPtr pMga = xf86ScreenToScrn(pDstPict->pDrawable->pScreen)->driverPrivate; + + if (op >= sizeof(mgaBlendOp) / sizeof(mgaBlendOp[0])) { + DEBUG_MSG(("unsupported op %x\n", op)); +@@ -521,6 +526,7 @@ mgaPrepareComposite(int op, PicturePtr pSrcPict, PicturePtr pMaskPict, + { + PMGA(pDst); + CARD32 fcol = 0xff000000, ds0 = 0, ds1 = 0, cmd, blendcntl; ++ if (!pSrc || !pSrcPict->pDrawable) return FALSE; + + mgaSetup(pMga, pDst, pDstPict, 2); + OUTREG(MGAREG_DSTORG, exaGetPixmapOffset(pDst)); diff --git a/srcpkgs/xf86-video-mga/patches/fix-exa-support.patch b/srcpkgs/xf86-video-mga/patches/fix-exa-support.patch new file mode 100644 index 00000000000..2cf05045226 --- /dev/null +++ b/srcpkgs/xf86-video-mga/patches/fix-exa-support.patch @@ -0,0 +1,31 @@ +MGA DDX: make it possible to find EXA support +Newer versions of the xserver stricter requirements on header order +which caused the configure tests for EXA support to erroneously fail. +Since XAA was already removed from an earlier version of xserver, the +configure failure meant no acceleration was possible. Patch configure +tests similar to r128. + +Reviewed-by: Adam Jackson + +--- configure.ac ++++ configure.ac +@@ -155,8 +155,9 @@ if test "x$EXA" = xyes; then + + SAVE_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $XORG_CFLAGS" +- AC_CHECK_HEADER(exa.h, +- [have_exa_h="yes"], [have_exa_h="no"]) ++ AC_CHECK_HEADERS(exa.h, ++ [have_exa_h="yes"], [have_exa_h="no"], ++ [#include "xorg-server.h"]) + CPPFLAGS="$SAVE_CPPFLAGS" + else + AC_MSG_RESULT(no) +@@ -167,6 +168,7 @@ CPPFLAGS="$CPPFLAGS $XORG_CFLAGS" + if test "x$have_exa_h" = xyes; then + AC_MSG_CHECKING([whether EXA version is at least 2.0.0]) + AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ ++#include "xorg-server.h" + #include "exa.h" + #if EXA_VERSION_MAJOR < 2 + #error OLD EXA! diff --git a/srcpkgs/xf86-video-mga/patches/fix-function-call-type.patch b/srcpkgs/xf86-video-mga/patches/fix-function-call-type.patch new file mode 100644 index 00000000000..7415186f092 --- /dev/null +++ b/srcpkgs/xf86-video-mga/patches/fix-function-call-type.patch @@ -0,0 +1,23 @@ +Use correct type in function call. +Fixes passing argument 2 of 'pci_device_cfg_read_u32' from incompatible pointer type +pciaccess.h:153:5: note: expected '__uint32_t *' but argument is of type 'CARD32 *' + +Signed-off-by: Thomas Klausner +Reviewed-by: Connor Behan + +--- src/mga_dac3026.c ++++ src/mga_dac3026.c +@@ -852,8 +852,12 @@ MGA3026Save(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg, + mgaReg->DacRegs[i] = inTi3026(MGADACregs[i]); + + #ifdef XSERVER_LIBPCIACCESS +- pci_device_cfg_read_u32(pMga->PciInfo, & mgaReg->Option, ++ { ++ uint32_t Option; ++ pci_device_cfg_read_u32(pMga->PciInfo, & Option, + PCI_OPTION_REG); ++ mgaReg->Option = Option; ++ } + #else + mgaReg->Option = pciReadLong(pMga->PciTag, PCI_OPTION_REG); + #endif diff --git a/srcpkgs/xf86-video-mga/patches/remove-download-from-screen.patch b/srcpkgs/xf86-video-mga/patches/remove-download-from-screen.patch new file mode 100644 index 00000000000..12068749522 --- /dev/null +++ b/srcpkgs/xf86-video-mga/patches/remove-download-from-screen.patch @@ -0,0 +1,48 @@ +Remove DownloadFromScreen +This hook was broken and did the same thing as a software fallback. + +Signed-off-by: Connor Behan + +--- src/mga_exa.c ++++ src/mga_exa.c +@@ -723,31 +723,6 @@ mgaUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, + return TRUE; + } + +-static Bool +-mgaDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, +- char *dst, int dst_pitch) +-{ +- PMGA(pSrc); +- +- char *src = (char *) exaGetPixmapFirstPixel(pSrc); +- int src_pitch = exaGetPixmapPitch(pSrc); +- +- int cpp = (pSrc->drawable.bitsPerPixel + 7) / 8; +- int bytes = w * cpp; +- +- src += y * src_pitch + x * cpp; +- +- QUIESCE_DMA(pSrc); +- +- while (h--) { +- memcpy (dst, src, bytes); +- src += src_pitch; +- dst += dst_pitch; +- } +- +- return TRUE; +-} +- + static void + mgaWaitMarker(ScreenPtr pScreen, int marker) + { +@@ -895,7 +870,6 @@ mgaExaInit(ScreenPtr pScreen) + } + + pExa->UploadToScreen = mgaUploadToScreen; +- pExa->DownloadFromScreen = mgaDownloadFromScreen; + + #ifdef MGADRI + if (pMga->directRenderingEnabled) + diff --git a/srcpkgs/xf86-video-mga/patches/write-combining.patch b/srcpkgs/xf86-video-mga/patches/write-combining.patch new file mode 100644 index 00000000000..7df6be882c2 --- /dev/null +++ b/srcpkgs/xf86-video-mga/patches/write-combining.patch @@ -0,0 +1,15 @@ +Enable write-combining on the framebuffer BAR +Signed-off-by: Adam Jackson + +--- src/mga_driver.c ++++ src/mga_driver.c +@@ -2594,7 +2594,8 @@ MGAMapMem(ScrnInfoPtr pScrn) + pciaddr_t fbsize = pMga->FbMapSize; + err = pci_device_map_range(dev, + fbaddr, fbsize, +- PCI_DEV_MAP_FLAG_WRITABLE, ++ PCI_DEV_MAP_FLAG_WRITABLE | ++ PCI_DEV_MAP_FLAG_WRITE_COMBINE, + (void **)&pMga->FbBase); + + if (err) { diff --git a/srcpkgs/xf86-video-mga/template b/srcpkgs/xf86-video-mga/template new file mode 100644 index 00000000000..cb29b137738 --- /dev/null +++ b/srcpkgs/xf86-video-mga/template @@ -0,0 +1,23 @@ +# Template build file for 'xf86-video-mga'. +pkgname=xf86-video-mga +version=1.6.4 +revision=1 +lib32disabled=yes +build_style=gnu-configure +hostmakedepends="automake libtool pkg-config xorg-util-macros" +makedepends="xorg-server-devel" +depends="virtual?xserver-abi-video-19_1" +nocross=yes +short_desc="Xorg Matrox Graphics Adapter video driver" +homepage="http://xorg.freedesktop.org" +license="MIT" +maintainer="Jürgen Buchmüller " +distfiles="${XORG_SITE}/driver/${pkgname}-${version}.tar.bz2" +checksum=48c6690b6751c76f53de64f8dbeaa9d6c62dbcfe890c768fd87167951247d44f + +pre_configure() { + autoreconf -if +} +post_install() { + vlicense COPYING +}