Merge pull request #2638 from pullmoll/xf86-video-mga

New package: xf86-video-mga-1.6.4
This commit is contained in:
Jürgen Buchmüller 2015-10-03 13:30:02 +02:00
commit e2016acf2a
6 changed files with 176 additions and 0 deletions

View file

@ -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 <connor.behan@gmail.com>
--- 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));

View file

@ -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 <ajax@redhat.com>
--- 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!

View file

@ -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 <wiz@NetBSD.org>
Reviewed-by: Connor Behan <connor.behan@gmail.com>
--- 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

View file

@ -0,0 +1,48 @@
Remove DownloadFromScreen
This hook was broken and did the same thing as a software fallback.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
--- 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)

View file

@ -0,0 +1,15 @@
Enable write-combining on the framebuffer BAR
Signed-off-by: Adam Jackson <ajax@redhat.com>
--- 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) {

View file

@ -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 <pullmoll@t-online.de>"
distfiles="${XORG_SITE}/driver/${pkgname}-${version}.tar.bz2"
checksum=48c6690b6751c76f53de64f8dbeaa9d6c62dbcfe890c768fd87167951247d44f
pre_configure() {
autoreconf -if
}
post_install() {
vlicense COPYING
}