diff options
author | Eric Anholt <eric@anholt.net> | 2008-10-06 17:00:08 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2008-10-06 17:26:43 -0700 |
commit | 3a4151b69daa478ac6edf042d604ee41e8429c0d (patch) | |
tree | fff1ba0ece972c7b593a01ae7f3bc9681d63aae5 | |
parent | 3621183cf4acef23414e8d69c34b1e587f52ec67 (diff) |
Fix driver build against server 1.4.2.
This disables UXA and DRM modesetting pre-1.5, due to privates handling
issues.
-rw-r--r-- | Makefile.am | 7 | ||||
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | src/Makefile.am | 9 | ||||
-rw-r--r-- | src/i830_accel.c | 6 | ||||
-rw-r--r-- | src/i830_driver.c | 2 | ||||
-rw-r--r-- | src/i830_exa.c | 25 |
6 files changed, 44 insertions, 14 deletions
diff --git a/Makefile.am b/Makefile.am index 5db07de9..896427f3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,7 +19,12 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. AUTOMAKE_OPTIONS = foreign -SUBDIRS = uxa src man + +if BUILD_UXA +UXA_DIR = uxa +endif + +SUBDIRS = $(UXA_DIR) src man EXTRA_DIST = README DISTCLEANFILES = doltcompile diff --git a/configure.ac b/configure.ac index 86bb80fd..d5db3a94 100644 --- a/configure.ac +++ b/configure.ac @@ -84,6 +84,8 @@ XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto) # Checks for pkg-config packages PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto $REQUIRED_MODULES]) +PKG_CHECK_MODULES(UXA, [xorg-server >= 1.5], [BUILD_UXA=yes], [BUILD_UXA=no]) + sdkdir=$(pkg-config --variable=sdkdir xorg-server) drm_cflags=$(pkg-config --cflags libdrm) @@ -108,6 +110,8 @@ if test x$DRI != xno; then AC_CHECK_HEADER(xf86drmMode.h, [DRM_MODE=yes],[DRM_MODE=no] [#include "stdint.h"]) + dnl exaGetPixmapDriverPrivate required for DRM_MODE. + PKG_CHECK_MODULES(DRM_MODE, [xorg-server >= 1.5], [], [DRM_MODE=no]) if test "x$DRM_MODE" = xyes; then AC_DEFINE(XF86DRM_MODE,1,[DRM kernel modesetting]) fi @@ -124,6 +128,11 @@ if test x$DRI = xauto; then fi AC_MSG_RESULT([$DRI]) +AM_CONDITIONAL(BUILD_UXA, test $BUILD_UXA = yes) +if test "$BUILD_UXA" = yes; then + AC_DEFINE(I830_USE_UXA, 1, [UMA Acceleration Architecture support]) +fi + AC_CHECK_HEADER(xf86Modes.h,[XMODES=yes],[XMODES=no],[#include "xorg-server.h"]) AC_CHECK_DECL(XSERVER_LIBPCIACCESS, [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no], diff --git a/src/Makefile.am b/src/Makefile.am index 8966bd68..9b322151 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -32,14 +32,17 @@ SUBDIRS = xvmc bios_reader ch7017 ch7xxx ivch sil164 tfp410 $(REGDUMPER) AM_CFLAGS = @WARN_CFLAGS@ @XORG_CFLAGS@ @DRM_CFLAGS@ @DRI_CFLAGS@ \ @PCIACCESS_CFLAGS@ @UXA_CFLAGS@ \ - @XMODES_CFLAGS@ -DI830_XV -DI830_USE_XAA -DI830_USE_EXA -DI830_USE_UXA + @XMODES_CFLAGS@ -DI830_XV -DI830_USE_XAA -DI830_USE_EXA intel_drv_la_LTLIBRARIES = intel_drv.la intel_drv_la_LDFLAGS = -module -avoid-version intel_drv_ladir = @moduledir@/drivers -intel_drv_la_LIBADD = -lm ../uxa/libuxa.la +intel_drv_la_LIBADD = -lm -ldrm_intel +if BUILD_UXA +intel_drv_la_LIBADD += ../uxa/libuxa.la +endif if XSERVER_LIBPCIACCESS -intel_drv_la_LIBADD += @PCIACCESS_LIBS@ @DRM_LIBS@ -ldrm_intel +intel_drv_la_LIBADD += @PCIACCESS_LIBS@ @DRM_LIBS@ endif XMODE_SRCS=\ diff --git a/src/i830_accel.c b/src/i830_accel.c index 386e653f..a9b30059 100644 --- a/src/i830_accel.c +++ b/src/i830_accel.c @@ -331,9 +331,13 @@ I830AccelInit(ScreenPtr pScreen) pI830->accel_max_y = 2048; } switch (pI830->accel) { -#ifdef I830_USE_UXA case ACCEL_UXA: +#ifdef I830_USE_UXA return i830_uxa_init(pScreen); +#else + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "UXA not built in, falling back to EXA.\n"); + return I830EXAInit(pScreen); #endif #ifdef I830_USE_EXA case ACCEL_EXA: diff --git a/src/i830_driver.c b/src/i830_driver.c index 3a2a9a40..933c8b87 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -2693,8 +2693,10 @@ I830BlockHandler(int i, pI830->need_mi_flush = FALSE; } +#ifdef I830_USE_UXA if (pI830->accel == ACCEL_UXA) i830_uxa_block_handler (pScreen); +#endif /* * Check for FIFO underruns at block time (which amounts to just * periodically). If this happens, it means our DSPARB or some other diff --git a/src/i830_exa.c b/src/i830_exa.c index fd29df11..e03f2de1 100644 --- a/src/i830_exa.c +++ b/src/i830_exa.c @@ -726,14 +726,6 @@ I830EXAInit(ScreenPtr pScreen) return TRUE; } -static int uxa_pixmap_index; - -static void -i830_uxa_set_pixmap_bo (PixmapPtr pixmap, dri_bo *bo) -{ - dixSetPrivate(&pixmap->devPrivates, &uxa_pixmap_index, bo); -} - dri_bo * i830_get_pixmap_bo(PixmapPtr pixmap) { @@ -741,17 +733,31 @@ i830_get_pixmap_bo(PixmapPtr pixmap) ScrnInfoPtr scrn = xf86Screens[screen->myNum]; I830Ptr i830 = I830PTR(scrn); +#ifdef I830_USE_UXA if (i830->accel == ACCEL_UXA) { return dixLookupPrivate(&pixmap->devPrivates, &uxa_pixmap_index); - } else if (i830->accel == ACCEL_EXA) { + } +#endif +#ifdef XF86DRM_MODE + if (i830->accel == ACCEL_EXA) { struct i830_exa_pixmap_priv *driver_priv = exaGetPixmapDriverPrivate(pixmap); return driver_priv ? driver_priv->bo : NULL; } +#endif return NULL; } +#if defined(I830_USE_UXA) +static int uxa_pixmap_index; + +static void +i830_uxa_set_pixmap_bo (PixmapPtr pixmap, dri_bo *bo) +{ + dixSetPrivate(&pixmap->devPrivates, &uxa_pixmap_index, bo); +} + static Bool i830_uxa_prepare_access (PixmapPtr pixmap, uxa_access_t access) { @@ -937,6 +943,7 @@ i830_uxa_init (ScreenPtr pScreen) return TRUE; } +#endif /* I830_USE_UXA */ #ifdef XF86DRI |