xserver-xorg-video-cirrus: Changes to 'upstream-unstable'
configure.ac | 20 +++
src/CirrusClk.c | 1
src/Makefile.am | 3
src/alp.h | 2
src/alp_driver.c | 88 ++++++--------
src/alp_hwcurs.c | 5
src/alp_i2c.c | 1
src/alp_xaa.c | 6
src/alp_xaam.c | 9 -
src/cir.h | 9 +
src/cir_dga.c | 20 ++-
src/cir_driver.c | 30 +++-
src/cir_pcirename.h | 24 +++
src/cir_shadow.c | 324 +++++++++++++++++++++++++++++-----------------------
src/compat-api.h | 99 +++++++++++++++
src/lg.h | 2
src/lg_driver.c | 84 ++++++-------
src/lg_hwcurs.c | 5
src/lg_i2c.c | 1
src/lg_xaa.c | 7 -
20 files changed, 468 insertions(+), 272 deletions(-)
New commits:
commit e2bf5b255611de267bc1c56b2fccf51268d28f3d
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date: Tue Jan 8 11:04:38 2013 +0100
cirrus: release 1.5.2
diff --git a/configure.ac b/configure.ac
index dddf9ef..0e00305 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-video-cirrus],
- [1.5.1],
+ [1.5.2],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-video-cirrus])
AC_CONFIG_SRCDIR([Makefile.am])
commit bade70ce71ea26fae4f250f0bd1729dfb0d392df
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date: Tue Jan 8 11:00:33 2013 +0100
cirrus: fix out of bounds access to shadowfb
Perform the same bounds checking other drivers do. Thanks to Dave Gilbert for feedback on this patch.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
diff --git a/src/cir_shadow.c b/src/cir_shadow.c
index a9b425b..6bde0fd 100644
--- a/src/cir_shadow.c
+++ b/src/cir_shadow.c
@@ -15,30 +15,41 @@
#include "cir.h"
#include "alp.h"
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
+#define MAX(a, b) (((a) > (b)) ? (a) : (b))
+
_X_EXPORT void
cirRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
{
CirPtr pCir = CIRPTR(pScrn);
- int width, height, Bpp, FBPitch;
+ int width, height, Bpp, FBPitch, x1, x2, y1, y2;
unsigned char *src, *dst;
Bpp = pScrn->bitsPerPixel >> 3;
FBPitch = BitmapBytePad(pScrn->displayWidth * pScrn->bitsPerPixel);
while(num--) {
- width = (pbox->x2 - pbox->x1) * Bpp;
- height = pbox->y2 - pbox->y1;
- src = pCir->ShadowPtr + (pbox->y1 * pCir->ShadowPitch) +
- (pbox->x1 * Bpp);
- dst = pCir->FbBase + (pbox->y1 * FBPitch) + (pbox->x1 * Bpp);
-
- while(height--) {
- memcpy(dst, src, width);
- dst += FBPitch;
- src += pCir->ShadowPitch;
- }
-
- pbox++;
+ x1 = MAX(pbox->x1, 0);
+ y1 = MAX(pbox->y1, 0);
+ x2 = MIN(pbox->x2, pScrn->virtualX);
+ y2 = MIN(pbox->y2, pScrn->virtualY);
+
+ width = (x2 - x1) * Bpp;
+ height = y2 - y1;
+
+ if (width <= 0 || height <= 0)
+ continue;
+
+ src = pCir->ShadowPtr + (y1 * pCir->ShadowPitch) + (x1 * Bpp);
+ dst = pCir->FbBase + (y1 * FBPitch) + (x1 * Bpp);
+
+ while(height--) {
+ memcpy(dst, src, width);
+ dst += FBPitch;
+ src += pCir->ShadowPitch;
+ }
+
+ pbox++;
}
}
@@ -64,7 +75,7 @@ _X_EXPORT void
cirRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
{
CirPtr pCir = CIRPTR(pScrn);
- int count, width, height, y1, y2, dstPitch, srcPitch;
+ int count, width, height, x1, x2, y1, y2, dstPitch, srcPitch;
CARD8 *dstPtr, *srcPtr, *src;
CARD32 *dst;
@@ -72,36 +83,44 @@ cirRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
srcPitch = -pCir->rotate * pCir->ShadowPitch;
while(num--) {
- width = pbox->x2 - pbox->x1;
- y1 = pbox->y1 & ~3;
- y2 = (pbox->y2 + 3) & ~3;
- height = (y2 - y1) >> 2; /* in dwords */
-
- if(pCir->rotate == 1) {
- dstPtr = pCir->FbBase +
- (pbox->x1 * dstPitch) + pScrn->virtualX - y2;
- srcPtr = pCir->ShadowPtr + ((1 - y2) * srcPitch) + pbox->x1;
- } else {
- dstPtr = pCir->FbBase +
- ((pScrn->virtualY - pbox->x2) * dstPitch) + y1;
- srcPtr = pCir->ShadowPtr + (y1 * srcPitch) + pbox->x2 - 1;
- }
-
- while(width--) {
- src = srcPtr;
- dst = (CARD32*)dstPtr;
- count = height;
- while(count--) {
- *(dst++) = src[0] | (src[srcPitch] << 8) |
- (src[srcPitch * 2] << 16) |
- (src[srcPitch * 3] << 24);
- src += srcPitch * 4;
- }
- srcPtr += pCir->rotate;
- dstPtr += dstPitch;
- }
-
- pbox++;
+ x1 = MAX(pbox->x1, 0);
+ y1 = MAX(pbox->y1, 0);
+ x2 = MIN(pbox->x2, pScrn->virtualX);
+ y2 = MIN(pbox->y2, pScrn->virtualY);
+
+ width = x2 - x1;
+ y1 = y1 & ~3;
+ y2 = (y2 + 3) & ~3;
+ height = (y2 - y1) / 4; /* in dwords */
+
+ if (width <= 0 || height <= 0)
+ continue;
+
+ if(pCir->rotate == 1) {
+ dstPtr = pCir->FbBase +
+ (x1 * dstPitch) + pScrn->virtualX - y2;
+ srcPtr = pCir->ShadowPtr + ((1 - y2) * srcPitch) + x1;
+ } else {
+ dstPtr = pCir->FbBase +
+ ((pScrn->virtualY - x2) * dstPitch) + y1;
+ srcPtr = pCir->ShadowPtr + (y1 * srcPitch) + x2 - 1;
+ }
+
+ while(width--) {
+ src = srcPtr;
+ dst = (CARD32*)dstPtr;
+ count = height;
+ while(count--) {
+ *(dst++) = src[0] | (src[srcPitch] << 8) |
+ (src[srcPitch * 2] << 16) |
+ (src[srcPitch * 3] << 24);
+ src += srcPitch * 4;
+ }
+ srcPtr += pCir->rotate;
+ dstPtr += dstPitch;
+ }
+
+ pbox++;
}
}
@@ -110,7 +129,7 @@ _X_EXPORT void
cirRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
{
CirPtr pCir = CIRPTR(pScrn);
- int count, width, height, y1, y2, dstPitch, srcPitch;
+ int count, width, height, x1, x2, y1, y2, dstPitch, srcPitch;
CARD16 *dstPtr, *srcPtr, *src;
CARD32 *dst;
@@ -118,36 +137,44 @@ cirRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
srcPitch = -pCir->rotate * pCir->ShadowPitch >> 1;
while(num--) {
- width = pbox->x2 - pbox->x1;
- y1 = pbox->y1 & ~1;
- y2 = (pbox->y2 + 1) & ~1;
- height = (y2 - y1) >> 1; /* in dwords */
-
- if(pCir->rotate == 1) {
- dstPtr = (CARD16*)pCir->FbBase +
- (pbox->x1 * dstPitch) + pScrn->virtualX - y2;
- srcPtr = (CARD16*)pCir->ShadowPtr +
- ((1 - y2) * srcPitch) + pbox->x1;
- } else {
- dstPtr = (CARD16*)pCir->FbBase +
- ((pScrn->virtualY - pbox->x2) * dstPitch) + y1;
- srcPtr = (CARD16*)pCir->ShadowPtr +
- (y1 * srcPitch) + pbox->x2 - 1;
- }
-
- while(width--) {
- src = srcPtr;
- dst = (CARD32*)dstPtr;
- count = height;
- while(count--) {
- *(dst++) = src[0] | (src[srcPitch] << 16);
- src += srcPitch * 2;
- }
- srcPtr += pCir->rotate;
- dstPtr += dstPitch;
- }
-
- pbox++;
+ x1 = MAX(pbox->x1, 0);
+ y1 = MAX(pbox->y1, 0);
+ x2 = MIN(pbox->x2, pScrn->virtualX);
+ y2 = MIN(pbox->y2, pScrn->virtualY);
+
+ width = x2 - x1;
+ y1 = y1 & ~1;
+ y2 = (y2 + 1) & ~1;
+ height = (y2 - y1) / 2; /* in dwords */
+
+ if (width <= 0 || height <= 0)
+ continue;
+
+ if(pCir->rotate == 1) {
+ dstPtr = (CARD16*)pCir->FbBase +
+ (x1 * dstPitch) + pScrn->virtualX - y2;
+ srcPtr = (CARD16*)pCir->ShadowPtr +
+ ((1 - y2) * srcPitch) + x1;
+ } else {
+ dstPtr = (CARD16*)pCir->FbBase +
+ ((pScrn->virtualY - x2) * dstPitch) + y1;
+ srcPtr = (CARD16*)pCir->ShadowPtr +
+ (y1 * srcPitch) + x2 - 1;
+ }
+
+ while(width--) {
+ src = srcPtr;
+ dst = (CARD32*)dstPtr;
+ count = height;
+ while(count--) {
+ *(dst++) = src[0] | (src[srcPitch] << 16);
+ src += srcPitch * 2;
+ }
+ srcPtr += pCir->rotate;
+ dstPtr += dstPitch;
+ }
+
+ pbox++;
}
}
@@ -157,7 +184,7 @@ _X_EXPORT void
cirRefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
{
CirPtr pCir = CIRPTR(pScrn);
- int count, width, height, y1, y2, dstPitch, srcPitch;
+ int count, width, height, x1, x2, y1, y2, dstPitch, srcPitch;
CARD8 *dstPtr, *srcPtr, *src;
CARD32 *dst;
@@ -165,42 +192,50 @@ cirRefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
srcPitch = -pCir->rotate * pCir->ShadowPitch;
while(num--) {
- width = pbox->x2 - pbox->x1;
- y1 = pbox->y1 & ~3;
- y2 = (pbox->y2 + 3) & ~3;
- height = (y2 - y1) >> 2; /* blocks of 3 dwords */
-
- if(pCir->rotate == 1) {
- dstPtr = pCir->FbBase +
- (pbox->x1 * dstPitch) + ((pScrn->virtualX - y2) * 3);
- srcPtr = pCir->ShadowPtr + ((1 - y2) * srcPitch) + (pbox->x1 * 3);
- } else {
- dstPtr = pCir->FbBase +
- ((pScrn->virtualY - pbox->x2) * dstPitch) + (y1 * 3);
- srcPtr = pCir->ShadowPtr + (y1 * srcPitch) + (pbox->x2 * 3) - 3;
- }
-
- while(width--) {
- src = srcPtr;
- dst = (CARD32*)dstPtr;
- count = height;
- while(count--) {
- dst[0] = src[0] | (src[1] << 8) | (src[2] << 16) |
+ x1 = MAX(pbox->x1, 0);
+ y1 = MAX(pbox->y1, 0);
+ x2 = MIN(pbox->x2, pScrn->virtualX);
+ y2 = MIN(pbox->y2, pScrn->virtualY);
+
+ width = x2 - x1;
+ y1 = y1 & ~3;
+ y2 = (y2 + 3) & ~3;
+ height = (y2 - y1) / 4; /* blocks of 3 dwords */
+
+ if (width <= 0 || height <= 0)
+ continue;
+
+ if(pCir->rotate == 1) {
+ dstPtr = pCir->FbBase +
+ (x1 * dstPitch) + ((pScrn->virtualX - y2) * 3);
+ srcPtr = pCir->ShadowPtr + ((1 - y2) * srcPitch) + (x1 * 3);
+ } else {
+ dstPtr = pCir->FbBase +
+ ((pScrn->virtualY - x2) * dstPitch) + (y1 * 3);
+ srcPtr = pCir->ShadowPtr + (y1 * srcPitch) + (x2 * 3) - 3;
+ }
+
+ while(width--) {
+ src = srcPtr;
+ dst = (CARD32*)dstPtr;
+ count = height;
+ while(count--) {
+ dst[0] = src[0] | (src[1] << 8) | (src[2] << 16) |
(src[srcPitch] << 24);
- dst[1] = src[srcPitch + 1] | (src[srcPitch + 2] << 8) |
+ dst[1] = src[srcPitch + 1] | (src[srcPitch + 2] << 8) |
(src[srcPitch * 2] << 16) |
(src[(srcPitch * 2) + 1] << 24);
- dst[2] = src[(srcPitch * 2) + 2] | (src[srcPitch * 3] << 8) |
+ dst[2] = src[(srcPitch * 2) + 2] | (src[srcPitch * 3] << 8) |
(src[(srcPitch * 3) + 1] << 16) |
(src[(srcPitch * 3) + 2] << 24);
- dst += 3;
- src += srcPitch * 4;
- }
- srcPtr += pCir->rotate * 3;
- dstPtr += dstPitch;
- }
-
- pbox++;
+ dst += 3;
+ src += srcPitch * 4;
+ }
+ srcPtr += pCir->rotate * 3;
+ dstPtr += dstPitch;
+ }
+
+ pbox++;
}
}
@@ -208,41 +243,49 @@ _X_EXPORT void
cirRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
{
CirPtr pCir = CIRPTR(pScrn);
- int count, width, height, dstPitch, srcPitch;
+ int count, width, height, x1, x2, y1, y2, dstPitch, srcPitch;
CARD32 *dstPtr, *srcPtr, *src, *dst;
dstPitch = pScrn->displayWidth;
srcPitch = -pCir->rotate * pCir->ShadowPitch >> 2;
while(num--) {
- width = pbox->x2 - pbox->x1;
- height = pbox->y2 - pbox->y1;
-
- if(pCir->rotate == 1) {
- dstPtr = (CARD32*)pCir->FbBase +
- (pbox->x1 * dstPitch) + pScrn->virtualX - pbox->y2;
- srcPtr = (CARD32*)pCir->ShadowPtr +
- ((1 - pbox->y2) * srcPitch) + pbox->x1;
- } else {
- dstPtr = (CARD32*)pCir->FbBase +
- ((pScrn->virtualY - pbox->x2) * dstPitch) + pbox->y1;
- srcPtr = (CARD32*)pCir->ShadowPtr +
- (pbox->y1 * srcPitch) + pbox->x2 - 1;
- }
-
- while(width--) {
- src = srcPtr;
- dst = dstPtr;
- count = height;
- while(count--) {
- *(dst++) = *src;
- src += srcPitch;
- }
- srcPtr += pCir->rotate;
- dstPtr += dstPitch;
- }
-
- pbox++;
+ x1 = MAX(pbox->x1, 0);
+ y1 = MAX(pbox->y1, 0);
+ x2 = MIN(pbox->x2, pScrn->virtualX);
+ y2 = MIN(pbox->y2, pScrn->virtualY);
+
+ width = x2 - x1;
+ height = y2 - y1;
+
+ if (width <= 0 || height <= 0)
+ continue;
+
+ if(pCir->rotate == 1) {
+ dstPtr = (CARD32*)pCir->FbBase +
+ (x1 * dstPitch) + pScrn->virtualX - y2;
+ srcPtr = (CARD32*)pCir->ShadowPtr +
+ ((1 - y2) * srcPitch) + x1;
+ } else {
+ dstPtr = (CARD32*)pCir->FbBase +
+ ((pScrn->virtualY - x2) * dstPitch) + y1;
+ srcPtr = (CARD32*)pCir->ShadowPtr +
+ (y1 * srcPitch) + x2 - 1;
+ }
+
+ while(width--) {
+ src = srcPtr;
+ dst = dstPtr;
+ count = height;
+ while(count--) {
+ *(dst++) = *src;
+ src += srcPitch;
+ }
+ srcPtr += pCir->rotate;
+ dstPtr += dstPitch;
+ }
+
+ pbox++;
}
}
commit 5fcb3b018797457c3099a86c6c1257b6e4e89ceb
Author: Adam Jackson <ajax@redhat.com>
Date: Tue Sep 25 08:54:36 2012 -0400
Remove mibstore.h
Signed-off-by: Adam Jackson <ajax@redhat.com>
diff --git a/src/alp_driver.c b/src/alp_driver.c
index e38c613..36f2039 100644
--- a/src/alp_driver.c
+++ b/src/alp_driver.c
@@ -39,9 +39,6 @@
/* All drivers initialising the SW cursor need this */
#include "mipointer.h"
-/* All drivers implementing backing store need this */
-#include "mibstore.h"
-
#include "micmap.h"
/* Needed by the Shadow Framebuffer */
@@ -1617,8 +1614,6 @@ AlpScreenInit(SCREEN_INIT_ARGS_DECL)
if (init_picture)
fbPictureInit (pScreen, 0, 0);
- miInitializeBackingStore(pScreen);
-
/*
* Set initial black & white colourmap indices.
*/
diff --git a/src/lg_driver.c b/src/lg_driver.c
index 13f222d..c20bbd0 100644
--- a/src/lg_driver.c
+++ b/src/lg_driver.c
@@ -46,9 +46,6 @@
/* need this for inputInfo */
#include "inputstr.h"
-/* All drivers implementing backing store need this */
-#include "mibstore.h"
-
#include "micmap.h"
/* Needed by the Shadow Framebuffer */
@@ -1373,8 +1370,6 @@ LgScreenInit(SCREEN_INIT_ARGS_DECL)
fbPictureInit(pScreen, 0, 0);
- miInitializeBackingStore(pScreen);
-
/*
* Set initial black & white colourmap indices.
*/
commit aa9016576163b3065910437b6ea51a69f24a41ca
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Aug 21 21:01:43 2012 +1000
cirrus: fix build against old server
Reported-by: jobermayer on irc
Signed-off-by: Dave Airlie <airlied@redhat.com>
diff --git a/src/cir_driver.c b/src/cir_driver.c
index c8d5aae..2df4a2e 100644
--- a/src/cir_driver.c
+++ b/src/cir_driver.c
@@ -258,7 +258,11 @@ CIRProbe(DriverPtr drv, int flags)
pPci->device_id, pPci->bus, pPci->domain, pPci->dev, pPci->func);
xf86DrvMsg(0, X_ERROR,
"cirrus: This driver cannot operate until it has been unloaded.\n");
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 13
+ xf86UnclaimPciSlot(pPci);
+#else
xf86UnclaimPciSlot(pPci, devSections[0]);
+#endif
free(devSections);
return FALSE;
}
commit bc04e9ed659be51a3c712f34a038bd60f639f9c5
Author: Dave Airlie <airlied@redhat.com>
Date: Mon Aug 20 13:49:19 2012 +1000
cirrus: fix falling back after kernel check
if we find a kernel driver the code leave the pci slot claimed which
stops us falling back. unclaim the pci slot.
Signed-off-by: Dave Airlie <airlied@redhat.com>
diff --git a/src/cir_driver.c b/src/cir_driver.c
index 5468b6b..c8d5aae 100644
--- a/src/cir_driver.c
+++ b/src/cir_driver.c
@@ -237,9 +237,10 @@ CIRProbe(DriverPtr drv, int flags)
CIRChipsets, CIRPciChipsets, devSections,
numDevSections, drv, &usedChips);
/* Free it since we don't need that list after this */
- free(devSections);
- if (numUsed <= 0)
+ if (numUsed <= 0) {
+ free(devSections);
return FALSE;
+ }
if (flags & PROBE_DETECT)
foundScreen = TRUE;
else for (i = 0; i < numUsed; i++) {
@@ -257,6 +258,8 @@ CIRProbe(DriverPtr drv, int flags)
pPci->device_id, pPci->bus, pPci->domain, pPci->dev, pPci->func);
xf86DrvMsg(0, X_ERROR,
"cirrus: This driver cannot operate until it has been unloaded.\n");
+ xf86UnclaimPciSlot(pPci, devSections[0]);
+ free(devSections);
return FALSE;
}
#endif
@@ -290,6 +293,7 @@ CIRProbe(DriverPtr drv, int flags)
pScrn->Probe = NULL;
}
}
+ free(devSections);
free(usedChips);
return foundScreen;
commit 129076c2a9c20ab515736bb7141b4f334699e21b
Author: Dave Airlie <airlied@redhat.com>
Date: Tue Jul 17 16:05:09 2012 +1000
xf86-video-cirrus: bump to version 1.5.1
Signed-off-by: Dave Airlie <airlied@redhat.com>
diff --git a/configure.ac b/configure.ac
index 1157ab1..dddf9ef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-video-cirrus],
- [1.5.0],
+ [1.5.1],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-video-cirrus])
AC_CONFIG_SRCDIR([Makefile.am])
commit e443ede15981549ff5f6b01f42c3cb8dc909d778
Author: Dave Airlie <airlied@gmail.com>
Date: Fri Jul 13 14:47:40 2012 +1000
cirrus: handle server with no XAA
this fixes cirrus to work with a server with no XAA module.
Signed-off-by: Dave Airlie <airlied@redhat.com>
diff --git a/configure.ac b/configure.ac
index 1cc4d93..1157ab1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,6 +72,24 @@ AC_CHECK_HEADER(xf1bpp.h,[AC_DEFINE(HAVE_XF1BPP, 1, [Have 1bpp support])],[])
AC_CHECK_HEADER(xf4bpp.h,[AC_DEFINE(HAVE_XF4BPP, 1, [Have 4bpp support])],[])
CPPFLAGS="$SAVE_CPPFLAGS"
+AC_ARG_ENABLE(xaa,
+ AS_HELP_STRING([--enable-xaa],
+ [Enable legacy X Acceleration Architecture (XAA) [default=auto]]),
+ [XAA="$enableval"],
+ [XAA=auto])
+if test "x$XAA" != xno; then
+ save_CFLAGS=$CFLAGS
+ save_CPPFLAGS=$CPPFLAGS
+ CFLAGS=$XORG_CFLAGS
+ CPPFLAGS="$XORG_CFLAGS"
+ AC_CHECK_HEADERS([xaa.h], XAA=yes, XAA=no)
+ CFLAGS=$save_CFLAGS
+ CPPFLAGS=$save_CPPFLAGS
+fi
+AC_MSG_CHECKING([whether to include XAA support])
+AM_CONDITIONAL(XAA, test "x$XAA" = xyes)
+AC_MSG_RESULT([$XAA])
+
if test "x$XSERVER_LIBPCIACCESS" = xyes; then
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
diff --git a/src/alp.h b/src/alp.h
index a182d0c..c09e24b 100644
--- a/src/alp.h
+++ b/src/alp.h
@@ -40,8 +40,10 @@ typedef struct {
} AlpRegRec, *AlpRegPtr;
extern Bool AlpHWCursorInit(ScreenPtr pScreen, int size);
+#ifdef HAVE_XAA_H
extern Bool AlpXAAInit(ScreenPtr pScreen);
extern Bool AlpXAAInitMMIO(ScreenPtr pScreen);
+#endif
extern Bool AlpDGAInit(ScreenPtr pScreen);
extern Bool AlpI2CInit(ScrnInfoPtr pScrn);
diff --git a/src/alp_driver.c b/src/alp_driver.c
index d1300df..e38c613 100644
--- a/src/alp_driver.c
+++ b/src/alp_driver.c
@@ -1088,7 +1088,12 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
/* Load XAA if needed */
if (!pCir->NoAccel) {
- if (!xf86LoadSubModule(pScrn, "xaa")) {
+#ifdef HAVE_XAA_H
+ if (!xf86LoadSubModule(pScrn, "xaa"))
+#else
+ if (1)
+#endif
+ {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Falling back to shadowfb\n");
pCir->NoAccel = TRUE;
@@ -1096,6 +1101,7 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
}
}
+
/* Load ramdac if needed */
if (pCir->HWCursor) {
if (!xf86LoadSubModule(pScrn, "ramdac")) {
@@ -1650,10 +1656,12 @@ AlpScreenInit(SCREEN_INIT_ARGS_DECL)
if (!pCir->NoAccel) { /* Initialize XAA functions */
AlpOffscreenAccelInit(pScrn);
+#ifdef HAVE_XAA_H
if (!(pCir->UseMMIO ? AlpXAAInitMMIO(pScreen) :
AlpXAAInit(pScreen)))
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Could not initialize XAA\n");
+#endif
}
#if 1
@@ -1860,9 +1868,11 @@ AlpCloseScreen(CLOSE_SCREEN_ARGS_DECL)
CirUnmapMem(pCir, pScrn->scrnIndex);
}
+#ifdef HAVE_XAA_H
if (pCir->AccelInfoRec)
XAADestroyInfoRec(pCir->AccelInfoRec);
pCir->AccelInfoRec = NULL;
+#endif
if (pCir->CursorInfoRec)
xf86DestroyCursorInfoRec(pCir->CursorInfoRec);
pCir->CursorInfoRec = NULL;
diff --git a/src/alp_xaa.c b/src/alp_xaa.c
index 5a43357..b3ddd64 100644
--- a/src/alp_xaa.c
+++ b/src/alp_xaa.c
@@ -16,6 +16,7 @@
#define _ALP_PRIVATE_
#include "alp.h"
+#ifdef HAVE_XAA_H
#define WAIT outb(pCir->PIOReg, 0x31); \
while(inb(pCir->PIOReg + 1) & pCir->chip.alp->waitMsk){};
#define WAIT_1 outb(pCir->PIOReg, 0x31); \
@@ -683,4 +684,4 @@ AlpXAAInit(ScreenPtr pScreen)
return TRUE;
}
-
+#endif
diff --git a/src/alp_xaam.c b/src/alp_xaam.c
index 79f621d..8e9fd52 100644
--- a/src/alp_xaam.c
+++ b/src/alp_xaam.c
@@ -17,6 +17,7 @@
#define _ALP_PRIVATE_
#include "alp.h"
+#ifdef HAVE_XAA_H
#ifdef DEBUG
#define minb(p) \
(ErrorF("minb(%X)\n", p),\
@@ -266,7 +267,4 @@ AlpXAAInitMMIO(ScreenPtr pScreen)
return TRUE;
}
-
-
-
-
+#endif
diff --git a/src/cir.h b/src/cir.h
index 3915a31..0a5d403 100644
--- a/src/cir.h
+++ b/src/cir.h
@@ -4,7 +4,9 @@
#define CIR_H
#include "xf86Cursor.h"
+#ifdef HAVE_XAA_H
#include "xaa.h"
+#endif
#include "xf86i2c.h"
#include <string.h>
#include <stdlib.h>
@@ -44,7 +46,9 @@ typedef struct {
Bool NoAccel;
Bool HWCursor;
Bool UseMMIO;
+#ifdef HAVE_XAA_H
XAAInfoRecPtr AccelInfoRec;
+#endif
xf86CursorInfoPtr CursorInfoRec;
int DGAnumModes;
DGAModePtr DGAModes;
diff --git a/src/cir_dga.c b/src/cir_dga.c
index b841be3..bf3a9dd 100644
--- a/src/cir_dga.c
+++ b/src/cir_dga.c
@@ -30,8 +30,10 @@
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86Pci.h"
+#ifdef HAVE_XAA_H
#include "xaa.h"
#include "xaalocal.h"
+#endif
#include "vgaHW.h"
#include "cir.h"
#include "dgaproc.h"
@@ -39,15 +41,17 @@
static Bool Cir_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
int *, int *, int *);
static Bool Cir_SetMode(ScrnInfoPtr, DGAModePtr);
-static void Cir_Sync(ScrnInfoPtr);
static int Cir_GetViewport(ScrnInfoPtr);
static void Cir_SetViewport(ScrnInfoPtr, int, int, int);
+#ifdef HAVE_XAA_H
+static void Cir_Sync(ScrnInfoPtr);
static void Cir_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long);
static void Cir_BlitRect(ScrnInfoPtr, int, int, int, int, int, int);
/*
static void Cir_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int,
unsigned long);
*/
+#endif
static
DGAFunctionRec CirDGAFuncs = {
@@ -56,9 +60,13 @@ DGAFunctionRec CirDGAFuncs = {
Cir_SetMode,
Cir_SetViewport,
Cir_GetViewport,
+#ifdef HAVE_XAA_H
Cir_Sync,
Cir_FillRect,
Cir_BlitRect,
+#else
+ NULL, NULL, NULL,
+#endif
NULL /* Cir_BlitTransRect */
};
@@ -207,14 +215,12 @@ Cir_GetViewport(
return pCir->DGAViewportStatus;
}
-
-
+#ifdef HAVE_XAA_H
static void
Cir_Sync(
ScrnInfoPtr pScrn
){
CirPtr pCir = CIRPTR(pScrn);
-
if(pCir->AccelInfoRec) {
(*pCir->AccelInfoRec->Sync)(pScrn);
}
@@ -255,3 +261,4 @@ Cir_BlitRect(
SET_SYNC_FLAG(pCir->AccelInfoRec);
}
}
+#endif
diff --git a/src/lg.h b/src/lg.h
index 985f634..fa716d6 100644
--- a/src/lg.h
+++ b/src/lg.h
@@ -59,8 +59,10 @@ typedef struct {
/* lg_driver.c */
extern LgLineDataRec LgLineData[];
+#ifdef HAVE_XAA_H
/* lg_xaa.c */
extern Bool LgXAAInit(ScreenPtr pScreen);
+#endif
/* lg_hwcurs.c */
extern Bool LgHWCursorInit(ScreenPtr pScreen);
diff --git a/src/lg_driver.c b/src/lg_driver.c
index ab613d8..13f222d 100644
--- a/src/lg_driver.c
+++ b/src/lg_driver.c
@@ -797,7 +797,12 @@ LgPreInit(ScrnInfoPtr pScrn, int flags)
/* Load XAA if needed */
if (!pCir->NoAccel) {
- if (!xf86LoadSubModule(pScrn, "xaa")) {
+#ifdef HAVE_XAA_H
+ if (!xf86LoadSubModule(pScrn, "xaa"))
+#else
+ if (1)
+#endif
+ {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Falling back to shadowfb\n");
pCir->NoAccel = TRUE;
@@ -1375,10 +1380,12 @@ LgScreenInit(SCREEN_INIT_ARGS_DECL)
*/
xf86SetBlackWhitePixels(pScreen);
+#ifdef HAVE_XAA_H
if (!pCir->NoAccel) { /* Initialize XAA functions */
if (!LgXAAInit(pScreen))
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Could not initialize XAA\n");
}
+#endif
#if 1
pCir->DGAModeInit = LgModeInit;
if (!CirDGAInit(pScreen))
@@ -1609,9 +1616,11 @@ LgCloseScreen(CLOSE_SCREEN_ARGS_DECL)
CirUnmapMem(pCir, pScrn->scrnIndex);
}
+#ifdef HAVE_XAA_H
if (pCir->AccelInfoRec)
XAADestroyInfoRec(pCir->AccelInfoRec);
pCir->AccelInfoRec = NULL;
+#endif
if (pCir->CursorInfoRec)
xf86DestroyCursorInfoRec(pCir->CursorInfoRec);
diff --git a/src/lg_xaa.c b/src/lg_xaa.c
index 45ecea7..5e6e72e 100644
--- a/src/lg_xaa.c
+++ b/src/lg_xaa.c
@@ -26,6 +26,8 @@
#include "cir.h"
#define _LG_PRIVATE_
#include "lg.h"
+
+#ifdef HAVE_XAA_H
#include "lg_xaa.h"
/* Laguna raster operations, source is OP1 and destination is OP0. */
@@ -296,4 +298,4 @@ LgSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1,
LgSETDSTXY(x2, y2);
LgSETEXTENTS(w, h);
}
-
+#endif
commit 46a9e962c6f33509e89d664115a9a2db51c9b67d
Author: Dave Airlie <airlied@redhat.com>
Date: Mon Jul 2 11:57:59 2012 +0100
cirrus: bump to 1.5.0 for release.
Signed-off-by: Dave Airlie <airlied@redhat.com>
diff --git a/configure.ac b/configure.ac
index e6e22f5..1cc4d93 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-video-cirrus],
- [1.4.0],
+ [1.5.0],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-video-cirrus])
AC_CONFIG_SRCDIR([Makefile.am])
commit 7ae890b29b12609d410f5558640bb0407b0fdd2d
Author: Johannes Obermayr <johannesobermayr@gmx.de>
Date: Sat Jun 9 11:29:02 2012 +0100
use int scrnIndex instead of int i in macro SCREEN_INIT_ARGS_DECL.
Signed-off-by: Dave Airlie <airlied@redhat.com>
diff --git a/src/compat-api.h b/src/compat-api.h
index 6bc946f..205ac59 100644
--- a/src/compat-api.h
+++ b/src/compat-api.h
@@ -46,7 +46,7 @@
#define SCREEN_ARG_TYPE int
#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)]
-#define SCREEN_INIT_ARGS_DECL int i, ScreenPtr pScreen, int argc, char **argv
+#define SCREEN_INIT_ARGS_DECL int scrnIndex, ScreenPtr pScreen, int argc, char **argv
#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask
#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask
commit bab8041291ff81c81a98aca385cce561ecddc9d1
Author: Dave Airlie <airlied@redhat.com>
Date: Tue Jun 5 19:35:39 2012 +0100
cirrus: drop xf86PciInfo.
This drops usage of deprecated header file.
Signed-off-by: Dave Airlie <airlied@redhat.com>
diff --git a/src/CirrusClk.c b/src/CirrusClk.c
index 6fd6270..a8b24ac 100644
--- a/src/CirrusClk.c
+++ b/src/CirrusClk.c
@@ -17,7 +17,6 @@
#include "xf86.h"
#include "xf86_OSproc.h"
-#include "xf86PciInfo.h"
#include "xf86Pci.h"
#include "cir.h"
diff --git a/src/alp_driver.c b/src/alp_driver.c
index 77a5ba9..d1300df 100644
--- a/src/alp_driver.c
+++ b/src/alp_driver.c
@@ -24,13 +24,6 @@
/* Everything using inb/outb, etc needs "compiler.h" */
#include "compiler.h"
-/* Drivers for PCI hardware need this */
-#include "xf86PciInfo.h"
-
-#ifndef PCI_CHIP_GD7556 /* for old xf86PciInfo.h */
-#define PCI_CHIP_GD7556 0x004C
-#endif
-
/* Drivers that need to access the PCI config space directly need this */
#include "xf86Pci.h"
Reply to: