xf86-video-mga: update to 1.6.5
This commit is contained in:
parent
d325160e4e
commit
f0bd643ff5
7 changed files with 166 additions and 156 deletions
|
@ -1,36 +0,0 @@
|
|||
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));
|
|
@ -1,31 +0,0 @@
|
|||
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!
|
|
@ -1,23 +0,0 @@
|
|||
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
|
163
srcpkgs/xf86-video-mga/patches/fix-warnings.patch
Normal file
163
srcpkgs/xf86-video-mga/patches/fix-warnings.patch
Normal file
|
@ -0,0 +1,163 @@
|
|||
Fix various warnings regarding mixture of const vs. non-const
|
||||
pointers, cast of pointers to integers of different size
|
||||
and referencing const pointers in non-const struct members.
|
||||
|
||||
--- src/mga_merge.c 2017-01-18 13:40:25.071924814 +0100
|
||||
+++ src/mga_merge.c 2017-01-18 13:44:25.432988563 +0100
|
||||
@@ -18,12 +18,12 @@
|
||||
#include "fbdevhw.h"
|
||||
|
||||
static int
|
||||
-StrToRanges(range* r, char* s) {
|
||||
+StrToRanges(range* r, const char* s) {
|
||||
float num=0.0;
|
||||
int rangenum=0;
|
||||
Bool gotdash = FALSE;
|
||||
Bool nextdash = FALSE;
|
||||
- char* strnum=NULL;
|
||||
+ const char* strnum=NULL;
|
||||
do {
|
||||
switch(*s) {
|
||||
case '0': case '1': case '2': case '3': case '4': case '5':
|
||||
@@ -130,9 +130,9 @@
|
||||
|
||||
/* takes a config file string of MetaModes and generates a MetaModeList */
|
||||
static DisplayModePtr
|
||||
-GenerateModeList(ScrnInfoPtr pScrn, char* str,
|
||||
+GenerateModeList(ScrnInfoPtr pScrn, const char* str,
|
||||
DisplayModePtr i, DisplayModePtr j, MgaScrn2Rel srel) {
|
||||
- char* strmode = str;
|
||||
+ const char* strmode = str;
|
||||
char modename[256];
|
||||
Bool gotdash = FALSE;
|
||||
MgaScrn2Rel sr;
|
||||
Use const char* instead of char* where appropriate.
|
||||
|
||||
--- src/mga_merge.c 2017-01-17 23:40:29.000000000 +0100
|
||||
+++ src/mga_merge.c 2017-01-18 13:22:37.819740652 +0100
|
||||
@@ -117,7 +117,7 @@
|
||||
}
|
||||
|
||||
static DisplayModePtr
|
||||
-GetModeFromName(char* str, DisplayModePtr i)
|
||||
+GetModeFromName(const char* str, DisplayModePtr i)
|
||||
{
|
||||
DisplayModePtr c = i;
|
||||
if(!i) return NULL;
|
||||
@@ -165,7 +165,7 @@
|
||||
} else {
|
||||
mode1 = GetModeFromName(modename,i);
|
||||
if(!mode1) {
|
||||
- char* tmps = str;
|
||||
+ const char* tmps = str;
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"Mode: \"%s\" is not a supported mode for monitor 1\n",modename);
|
||||
/* find if a monitor2 mode follows */
|
||||
@@ -232,7 +232,7 @@
|
||||
MGAPtr pMga1;
|
||||
MessageType from;
|
||||
int i;
|
||||
- char* s;
|
||||
+ const char* s;
|
||||
ClockRangePtr clockRanges;
|
||||
MgaScrn2Rel Monitor2Pos;
|
||||
|
||||
--- src/mga_dacG.c 2017-01-17 23:40:29.000000000 +0100
|
||||
+++ src/mga_dacG.c 2017-01-18 13:39:10.951904459 +0100
|
||||
@@ -1853,9 +1853,9 @@
|
||||
mgaReg->PIXPLLCSaved = TRUE;
|
||||
|
||||
#ifdef XSERVER_LIBPCIACCESS
|
||||
- pci_device_cfg_read_u32(pMga->PciInfo, & mgaReg->Option,
|
||||
+ pci_device_cfg_read_u32(pMga->PciInfo, (uint32_t *)& mgaReg->Option,
|
||||
PCI_OPTION_REG);
|
||||
- pci_device_cfg_read_u32(pMga->PciInfo, & mgaReg->Option2,
|
||||
+ pci_device_cfg_read_u32(pMga->PciInfo, (uint32_t *)& mgaReg->Option2,
|
||||
PCI_MGA_OPTION2);
|
||||
#else
|
||||
mgaReg->Option = pciReadLong(pMga->PciTag, PCI_OPTION_REG);
|
||||
@@ -1864,7 +1864,7 @@
|
||||
#endif
|
||||
if (pMga->Chipset == PCI_CHIP_MGAG400 || pMga->Chipset == PCI_CHIP_MGAG550)
|
||||
#ifdef XSERVER_LIBPCIACCESS
|
||||
- pci_device_cfg_read_u32(pMga->PciInfo, & mgaReg->Option3,
|
||||
+ pci_device_cfg_read_u32(pMga->PciInfo, (uint32_t *)& mgaReg->Option3,
|
||||
PCI_MGA_OPTION3);
|
||||
#else
|
||||
mgaReg->Option3 = pciReadLong(pMga->PciTag, PCI_MGA_OPTION3);
|
||||
@@ -2029,7 +2029,7 @@
|
||||
#define DDC_P1_SDA_MASK (1 << 1)
|
||||
#define DDC_P1_SCL_MASK (1 << 3)
|
||||
|
||||
-static const struct mgag_i2c_private {
|
||||
+static struct mgag_i2c_private {
|
||||
unsigned sda_mask;
|
||||
unsigned scl_mask;
|
||||
} i2c_priv[] = {
|
||||
@@ -2121,10 +2121,14 @@
|
||||
static I2CBusPtr
|
||||
mgag_create_i2c_bus(const char *name, unsigned bus_index, unsigned scrn_index)
|
||||
{
|
||||
+ static char name_buff[4][256];
|
||||
+ static int which = 0;
|
||||
I2CBusPtr I2CPtr = xf86CreateI2CBusRec();
|
||||
|
||||
if (I2CPtr != NULL) {
|
||||
- I2CPtr->BusName = name;
|
||||
+ which = (which + 1) % 4;
|
||||
+ snprintf(name_buff[which], sizeof(name_buff[which]), "%s", name);
|
||||
+ I2CPtr->BusName = name_buff[which];
|
||||
I2CPtr->scrnIndex = scrn_index;
|
||||
I2CPtr->I2CPutBits = MGAG_I2CPutBits;
|
||||
I2CPtr->I2CGetBits = MGAG_I2CGetBits;
|
||||
--- src/mga_driver.c 2017-01-17 23:40:29.000000000 +0100
|
||||
+++ src/mga_driver.c 2017-01-18 13:30:12.991807437 +0100
|
||||
@@ -1138,7 +1138,7 @@
|
||||
CARD32 Option, MaxMapSize;
|
||||
|
||||
#ifdef XSERVER_LIBPCIACCESS
|
||||
- pci_device_cfg_read_u32(pMga->PciInfo, &Option,
|
||||
+ pci_device_cfg_read_u32(pMga->PciInfo, (uint32_t *)&Option,
|
||||
PCI_OPTION_REG);
|
||||
MaxMapSize = pMga->PciInfo->regions[0].size;
|
||||
#else
|
||||
@@ -1933,7 +1933,7 @@
|
||||
} else {
|
||||
int from = X_DEFAULT;
|
||||
#ifdef USE_EXA
|
||||
- char *s = xf86GetOptValString(pMga->Options, OPTION_ACCELMETHOD);
|
||||
+ const char *s = xf86GetOptValString(pMga->Options, OPTION_ACCELMETHOD);
|
||||
#endif
|
||||
pMga->NoAccel = FALSE;
|
||||
pMga->Exa = FALSE;
|
||||
@@ -2635,9 +2635,8 @@
|
||||
}
|
||||
else
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
- "MAPPED Framebuffer %08llX %llx to %08llX.\n",
|
||||
- (long long)fbaddr, (long long)fbsize,
|
||||
- (long long)pMga->FbBase);
|
||||
+ "MAPPED Framebuffer %p %llx to %p.\n",
|
||||
+ fbaddr, (long long)fbsize, pMga->FbBase);
|
||||
|
||||
if(pMga->entityPrivate == NULL || pMga->entityPrivate->mappedIOUsage == 0) {
|
||||
region = &dev->regions[pMga->io_bar];
|
||||
@@ -2644,7 +2644,7 @@
|
||||
err = pci_device_map_range(dev,
|
||||
region->base_addr, region->size,
|
||||
PCI_DEV_MAP_FLAG_WRITABLE,
|
||||
- &pMga->IOBase);
|
||||
+ (void **)&pMga->IOBase);
|
||||
|
||||
if (err) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
@@ -2773,7 +2773,8 @@
|
||||
pMga->entityPrivate->mappedIOBase = NULL;
|
||||
}
|
||||
|
||||
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "UNMAPPING framebuffer 0x%08llX, 0x%llX.\n", (long long)pMga->FbBase, (long long)pMga->FbMapSize);
|
||||
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "UNMAPPING framebuffer %p, 0x%llX.\n",
|
||||
+ pMga->FbBase, (long long)pMga->FbMapSize);
|
||||
pci_device_unmap_range(dev, pMga->FbBase,
|
||||
pMga->FbMapSize);
|
||||
#else
|
|
@ -1,48 +0,0 @@
|
|||
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)
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
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) {
|
|
@ -1,7 +1,7 @@
|
|||
# Template build file for 'xf86-video-mga'.
|
||||
pkgname=xf86-video-mga
|
||||
version=1.6.4
|
||||
revision=3
|
||||
version=1.6.5
|
||||
revision=1
|
||||
lib32disabled=yes
|
||||
build_style=gnu-configure
|
||||
hostmakedepends="automake libtool pkg-config xorg-util-macros"
|
||||
|
@ -13,7 +13,7 @@ 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
|
||||
checksum=b663cd8e6364f7c4e2637b9fcab9861d0e3971518c73b00d213f6545a1289422
|
||||
|
||||
LDFLAGS="-Wl,-z,lazy"
|
||||
|
||||
|
|
Loading…
Reference in a new issue