From: Daniel Stone <daniel@fooishbar.org>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH] Make XAA support optional
Date: Wed, 18 Jan 2012 14:45:51 +1100 [thread overview]
Message-ID: <1326858351-24897-1-git-send-email-daniel@fooishbar.org> (raw)
Does what it says on the box.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
---
configure.ac | 14 ++++++++++++++
src/legacy/i810/Makefile.am | 6 +++++-
src/legacy/i810/i810.h | 4 ++++
src/legacy/i810/i810_dga.c | 2 ++
src/legacy/i810/i810_driver.c | 10 +++++++++-
src/legacy/i810/i810_hwmc.c | 2 ++
src/legacy/i810/i810_video.c | 2 ++
7 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 63beb64..c3cbfd4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -268,6 +268,20 @@ if test "x$DEBUG" = xfull; then
CFLAGS="$CFLAGS -O0 -ggdb3"
fi
+save_CFLAGS=$CFLAGS
+CFLAGS="$XORG_CFLAGS"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <xorg-server.h>
+#include "xaa.h"
+#include "xaalocal.h"
+]])],
+ [have_xaa=yes],
+ [have_xaa=no])
+CFLAGS=$save_CFLAGS
+if test "x$have_xaa" = xyes; then
+ AC_DEFINE(XAA,1,[Enable XAA acceleration for i810])
+fi
+AM_CONDITIONAL(XAA, test x$have_xaa = xyes)
+
AC_CHECK_HEADERS([sys/timerfd.h])
DRIVER_NAME=intel
diff --git a/src/legacy/i810/Makefile.am b/src/legacy/i810/Makefile.am
index a1bdd85..a88508c 100644
--- a/src/legacy/i810/Makefile.am
+++ b/src/legacy/i810/Makefile.am
@@ -8,7 +8,6 @@ AM_CFLAGS = @CWARNFLAGS@ @XORG_CFLAGS@ @DRM_CFLAGS@ @DRI_CFLAGS@ @PCIACCESS_CFLA
$(NULL)
liblegacy_i810_la_SOURCES = \
- i810_accel.c \
i810_common.h \
i810_cursor.c \
i810_dga.c \
@@ -20,6 +19,11 @@ liblegacy_i810_la_SOURCES = \
i810_video.c \
i810_wmark.c
+if XAA
+liblegacy_i810_la_SOURCES += \
+ i810_accel.c
+endif
+
if DRI
liblegacy_i810_la_SOURCES +=\
i810_dri.c \
diff --git a/src/legacy/i810/i810.h b/src/legacy/i810/i810.h
index 183c701..d10f304 100644
--- a/src/legacy/i810/i810.h
+++ b/src/legacy/i810/i810.h
@@ -42,7 +42,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "compiler.h"
#include "xf86Pci.h"
#include "i810_reg.h"
+#ifdef XAA
#include "xaa.h"
+#endif
#include "xf86Cursor.h"
#include "xf86xv.h"
#include "vbe.h"
@@ -201,7 +203,9 @@ typedef struct _I810Rec {
I810RegRec SavedReg;
I810RegRec ModeReg;
+#ifdef XAA
XAAInfoRecPtr AccelInfoRec;
+#endif
xf86CursorInfoPtr CursorInfoRec;
CloseScreenProcPtr CloseScreen;
ScreenBlockHandlerProcPtr BlockHandler;
diff --git a/src/legacy/i810/i810_dga.c b/src/legacy/i810/i810_dga.c
index 44181c6..4174309 100644
--- a/src/legacy/i810/i810_dga.c
+++ b/src/legacy/i810/i810_dga.c
@@ -29,8 +29,10 @@
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86Pci.h"
+#ifdef XAA
#include "xaa.h"
#include "xaalocal.h"
+#endif
#include "i810.h"
#include "i810_reg.h"
#include "dgaproc.h"
diff --git a/src/legacy/i810/i810_driver.c b/src/legacy/i810/i810_driver.c
index d8f7c45..5026a26 100644
--- a/src/legacy/i810/i810_driver.c
+++ b/src/legacy/i810/i810_driver.c
@@ -345,13 +345,15 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
if (xf86ReturnOptValBool(pI810->Options, OPTION_NOACCEL, FALSE))
pI810->noAccel = TRUE;
+#ifdef XAA
if (!pI810->noAccel) {
if (!xf86LoadSubModule(pScrn, "xaa")) {
I810FreeRec(pScrn);
return FALSE;
}
}
-
+#endif
+
#ifdef XF86DRI
pI810->directRenderingDisabled =
!xf86ReturnOptValBool(pI810->Options, OPTION_DRI, TRUE);
@@ -1701,6 +1703,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
return FALSE;
}
+#ifdef XAA
if (!xf86ReturnOptValBool(pI810->Options, OPTION_NOACCEL, FALSE)) {
if (pI810->LpRing->mem.Size != 0) {
I810SetRingRegs(pScrn);
@@ -1712,6 +1715,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
I810EmitFlush(pScrn);
}
}
+#endif
miInitializeBackingStore(pScreen);
xf86SetBackingStore(pScreen);
@@ -1962,7 +1966,9 @@ I810CloseScreen(int scrnIndex, ScreenPtr pScreen)
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
vgaHWPtr hwp = VGAHWPTR(pScrn);
I810Ptr pI810 = I810PTR(pScrn);
+#ifdef XAA
XAAInfoRecPtr infoPtr = pI810->AccelInfoRec;
+#endif
if (pScrn->vtSema == TRUE) {
if (pI810->AccelInfoRec != NULL) {
@@ -1994,12 +2000,14 @@ I810CloseScreen(int scrnIndex, ScreenPtr pScreen)
pI810->ScanlineColorExpandBuffers = NULL;
}
+#ifdef XAA
if (infoPtr) {
if (infoPtr->ScanlineColorExpandBuffers)
free(infoPtr->ScanlineColorExpandBuffers);
XAADestroyInfoRec(infoPtr);
pI810->AccelInfoRec = NULL;
}
+#endif
if (pI810->CursorInfoRec) {
xf86DestroyCursorInfoRec(pI810->CursorInfoRec);
diff --git a/src/legacy/i810/i810_hwmc.c b/src/legacy/i810/i810_hwmc.c
index ba50e1e..43feb55 100644
--- a/src/legacy/i810/i810_hwmc.c
+++ b/src/legacy/i810/i810_hwmc.c
@@ -53,8 +53,10 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "xf86xvmc.h"
#include <X11/extensions/Xv.h>
#include <X11/extensions/XvMC.h>
+#ifdef XAA
#include "xaa.h"
#include "xaalocal.h"
+#endif
#include "dixstruct.h"
#include "fourcc.h"
diff --git a/src/legacy/i810/i810_video.c b/src/legacy/i810/i810_video.c
index a0e6acd..82b6956 100644
--- a/src/legacy/i810/i810_video.c
+++ b/src/legacy/i810/i810_video.c
@@ -49,8 +49,10 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "i810.h"
#include "xf86xv.h"
#include <X11/extensions/Xv.h>
+#ifdef XAA
#include "xaa.h"
#include "xaalocal.h"
+#endif
#include "dixstruct.h"
#include "fourcc.h"
--
1.7.8.3
next reply other threads:[~2012-01-18 3:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-18 3:45 Daniel Stone [this message]
2012-01-18 10:37 ` [PATCH] Make XAA support optional Chris Wilson
2012-01-18 12:04 ` Daniel Vetter
2012-01-18 12:27 ` Chris Wilson
2012-01-18 12:41 ` Daniel Vetter
2012-01-18 14:36 ` Eugeni Dodonov
2012-01-19 0:16 ` Kenneth Graunke
2012-01-19 17:22 ` Glen Gray
2012-01-19 17:25 ` Daniel Vetter
2012-01-19 17:49 ` Eugeni Dodonov
2012-01-20 9:40 ` Glen Gray
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1326858351-24897-1-git-send-email-daniel@fooishbar.org \
--to=daniel@fooishbar.org \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox