xf86-video-intel: 3 commits - configure.ac Makefile.am src/bios_reader/bios_reader.c src/bios_reader/Makefile.am src/i830_accel.c src/i830_bios.h src/i830_driver.c src/i830_exa.c src/i830_render.c src/i915_render.c src/Makefile.am

Eric Anholt anholt at kemper.freedesktop.org
Mon Oct 6 17:28:14 PDT 2008


 Makefile.am                   |    7 ++++++-
 configure.ac                  |    9 +++++++++
 src/Makefile.am               |    9 ++++++---
 src/bios_reader/Makefile.am   |    3 ++-
 src/bios_reader/bios_reader.c |    3 +++
 src/i830_accel.c              |    6 +++++-
 src/i830_bios.h               |    4 ++++
 src/i830_driver.c             |    2 ++
 src/i830_exa.c                |   25 ++++++++++++++++---------
 src/i830_render.c             |   22 ++++++++++++++++++----
 src/i915_render.c             |   23 ++++++++++++++++++-----
 11 files changed, 89 insertions(+), 24 deletions(-)

New commits:
commit 3a4151b69daa478ac6edf042d604ee41e8429c0d
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Oct 6 17:00:08 2008 -0700

    Fix driver build against server 1.4.2.
    
    This disables UXA and DRM modesetting pre-1.5, due to privates handling
    issues.

diff --git a/Makefile.am b/Makefile.am
index 5db07de..896427f 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 86bb80f..d5db3a9 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 8966bd6..9b32215 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 386e653..a9b3005 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 3a2a9a4..933c8b8 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 fd29df1..e03f2de 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
 
commit 3621183cf4acef23414e8d69c34b1e587f52ec67
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Oct 6 16:59:16 2008 -0700

    Fix bios_reader build against old servers.
    
    The server's pci_device structure ends up conflicting with libpciaccess's.
    Just don't include the server structure for this non-server tool.

diff --git a/src/bios_reader/Makefile.am b/src/bios_reader/Makefile.am
index c85081e..9f1c45a 100644
--- a/src/bios_reader/Makefile.am
+++ b/src/bios_reader/Makefile.am
@@ -1,4 +1,5 @@
-AM_CFLAGS = @WARN_CFLAGS@ @XORG_CFLAGS@ @XMODES_CFLAGS@ @PCIACCESS_CFLAGS@
+AM_CFLAGS = @WARN_CFLAGS@ @XORG_CFLAGS@ @XMODES_CFLAGS@ @PCIACCESS_CFLAGS@ \
+	-DREG_DUMPER
 
 noinst_PROGRAMS = bios_reader  $(BIOS_DUMPER) $(SWF_DUMPER)
 
diff --git a/src/bios_reader/bios_reader.c b/src/bios_reader/bios_reader.c
index 61b492d..2a6906d 100644
--- a/src/bios_reader/bios_reader.c
+++ b/src/bios_reader/bios_reader.c
@@ -38,6 +38,9 @@
 
 #include "../i830_bios.h"
 
+typedef uint8_t CARD8;
+typedef uint16_t CARD16;
+typedef uint32_t CARD32;
 #define _PARSE_EDID_
 #include "edid.h"
 
diff --git a/src/i830_bios.h b/src/i830_bios.h
index 0a1f4ba..39706ac 100644
--- a/src/i830_bios.h
+++ b/src/i830_bios.h
@@ -29,7 +29,9 @@
 #define _I830_BIOS_H_
 
 #include <stdint.h>
+#ifndef REG_DUMPER
 #include <xf86str.h>
+#endif
 
 struct vbt_header {
     char signature[20];			/**< Always starts with 'VBT$' */
@@ -393,7 +395,9 @@ struct vch_bdb_22 {
     struct vch_panel_data   panels[16];
 } __attribute__((packed));
 
+#ifndef REG_DUMPER
 int i830_bios_init(ScrnInfoPtr pScrn);
+#endif
 
 /*
  * Driver<->VBIOS interaction occurs through scratch bits in
commit 080d36648f92d3b9a559e5458687fa82afab411f
Author: Eric Anholt <eric at anholt.net>
Date:   Wed Oct 1 16:13:09 2008 -0700

    Add support for RepeatPad and RepeatReflect to 915 and 830-class Render accel.

diff --git a/src/i830_render.c b/src/i830_render.c
index c1ce856..7b05daa 100644
--- a/src/i830_render.c
+++ b/src/i830_render.c
@@ -244,8 +244,8 @@ static Bool i830_check_composite_texture(PicturePtr pPict, int unit)
         I830FALLBACK("Unsupported picture format 0x%x\n",
 		     (int)pPict->format);
 
-    if (pPict->repeat && pPict->repeatType != RepeatNormal)
-	I830FALLBACK("unsupport repeat type\n");
+    if (pPict->repeatType > RepeatReflect)
+        I830FALLBACK("Unsupported picture repeat %d\n", pPict->repeatType);
 
     if (pPict->filter != PictFilterNearest &&
         pPict->filter != PictFilterBilinear)
@@ -276,7 +276,7 @@ i830_texture_setup(PicturePtr pPict, PixmapPtr pPix, int unit)
     ScrnInfoPtr pScrn = xf86Screens[pPict->pDrawable->pScreen->myNum];
     I830Ptr pI830 = I830PTR(pScrn);
     uint32_t format, pitch, filter;
-    uint32_t wrap_mode = TEXCOORDMODE_CLAMP_BORDER;
+    uint32_t wrap_mode;
 
     pitch = intel_get_pixmap_pitch(pPix);
     pI830->scale_units[unit][0] = pPix->drawable.width;
@@ -285,8 +285,22 @@ i830_texture_setup(PicturePtr pPict, PixmapPtr pPix, int unit)
 
     format = i8xx_get_card_format(pPict);
 
-    if (pPict->repeat)
+    switch (pPict->repeatType) {
+    case RepeatNone:
+	wrap_mode = TEXCOORDMODE_CLAMP_BORDER;
+	break;
+    case RepeatNormal:
 	wrap_mode = TEXCOORDMODE_WRAP;
+	break;
+    case RepeatPad:
+	wrap_mode = TEXCOORDMODE_CLAMP;
+	break;
+    case RepeatReflect:
+	wrap_mode = TEXCOORDMODE_MIRROR;
+	break;
+    default:
+	FatalError("Unkown repeat type %d\n", pPict->repeatType);
+    }
 
     switch (pPict->filter) {
     case PictFilterNearest:
diff --git a/src/i915_render.c b/src/i915_render.c
index 970c42a..039db3b 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -201,9 +201,8 @@ static Bool i915_check_composite_texture(PicturePtr pPict, int unit)
         I830FALLBACK("Unsupported picture format 0x%x\n",
 		     (int)pPict->format);
 
-    if (pPict->repeat && pPict->repeatType != RepeatNormal)
-	I830FALLBACK("extended repeat (%d) not supported\n",
-		     pPict->repeatType);
+    if (pPict->repeatType > RepeatReflect)
+        I830FALLBACK("Unsupported picture repeat %d\n", pPict->repeatType);
 
     if (pPict->filter != PictFilterNearest &&
         pPict->filter != PictFilterBilinear)
@@ -252,7 +251,7 @@ i915_texture_setup(PicturePtr pPict, PixmapPtr pPix, int unit)
     I830Ptr pI830 = I830PTR(pScrn);
     uint32_t format, pitch, filter;
     int w, h, i;
-    uint32_t wrap_mode = TEXCOORDMODE_CLAMP_BORDER;
+    uint32_t wrap_mode;
 
     pitch = intel_get_pixmap_pitch(pPix);
     w = pPict->pDrawable->width;
@@ -270,8 +269,22 @@ i915_texture_setup(PicturePtr pPict, PixmapPtr pPix, int unit)
 	I830FALLBACK("unknown texture format\n");
     format = i915_tex_formats[i].card_fmt;
 
-    if (pPict->repeat)
+    switch (pPict->repeatType) {
+    case RepeatNone:
+	wrap_mode = TEXCOORDMODE_CLAMP_BORDER;
+	break;
+    case RepeatNormal:
 	wrap_mode = TEXCOORDMODE_WRAP;
+	break;
+    case RepeatPad:
+	wrap_mode = TEXCOORDMODE_CLAMP_EDGE;
+	break;
+    case RepeatReflect:
+	wrap_mode = TEXCOORDMODE_MIRROR;
+	break;
+    default:
+	FatalError("Unkown repeat type %d\n", pPict->repeatType);
+    }
 
     switch (pPict->filter) {
     case PictFilterNearest:


More information about the xorg-commit mailing list