xf86-video-intel: 2 commits - configure.ac src/i810_accel.c src/i810_driver.c src/i810.h src/i830.h src/i830_render.c src/Makefile.am

Eric Anholt anholt at kemper.freedesktop.org
Thu Nov 5 16:02:43 PST 2009


 configure.ac      |   36 ++++++++++++++++++++++++++++++------
 src/Makefile.am   |    4 +++-
 src/i810.h        |    8 ++++----
 src/i810_accel.c  |    4 ++--
 src/i810_driver.c |   36 ++++++++++++++++++------------------
 src/i830.h        |    4 ++++
 src/i830_render.c |   15 +++++++++------
 7 files changed, 70 insertions(+), 37 deletions(-)

New commits:
commit dbb68168dc909ab2ec1d935322c3fd8581e666f1
Author: Eric Anholt <eric at anholt.net>
Date:   Thu Nov 5 15:40:20 2009 -0800

    Revert "configure: make --disable-dri work even if the server supports DRI"
    
    This reverts commit a851139c2141f6da370186148f2836e18b2acf83.
    It broke the build, and I don't see why we should be supporting this
    anyway.
    
    Conflicts:
    
    	configure.ac
    	src/Makefile.am

diff --git a/configure.ac b/configure.ac
index 0a69b67..2348a7a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -79,7 +79,7 @@ AC_ARG_ENABLE(kms-only, AC_HELP_STRING([--enable-kms-only],
 XORG_DRIVER_CHECK_EXT(XINERAMA, xineramaproto)
 XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
 XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
-XORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11 xf86driproto glproto)
+XORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11)
 XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
 
 # Checks for pkg-config packages
@@ -93,15 +93,37 @@ AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ])
 
 sdkdir=$(pkg-config --variable=sdkdir xorg-server)
 
+save_CFLAGS="$CFLAGS"
+CFLAGS="$XORG_CFLAGS $DRI_CFLAGS $DRM_CFLAGS"
+CPPFLAGS="$XORG_CFLAGS $DRI_CFLAGS $DRM_CFLAGS"
+AC_MSG_CHECKING([whether to include DRI support])
 if test x$DRI != xno; then
-	AC_CHECK_FILES([${sdkdir}/dri.h ${sdkdir}/sarea.h ${sdkdir}/dristruct.h],
-	               [DRI="yes"
-	                AC_DEFINE(HAVE_DRI,1,[Enable DRI driver support])],
-	               [DRI="no"])
+        AC_CHECK_FILE([${sdkdir}/dri.h],
+                      [have_dri_h="yes"], [have_dri_h="no"])
+        AC_CHECK_FILE([${sdkdir}/sarea.h],
+                      [have_sarea_h="yes"], [have_sarea_h="no"])
+        AC_CHECK_FILE([${sdkdir}/dristruct.h],
+                      [have_dristruct_h="yes"], [have_dristruct_h="no"])
 fi
-AM_CONDITIONAL(DRI, test x$DRI = xyes)
 AC_MSG_CHECKING([whether to include DRI support])
+if test x$DRI = xauto; then
+        if test "$have_dri_h" = yes -a \
+                "$have_sarea_h" = yes -a \
+                "$have_dristruct_h" = yes; then
+                DRI="yes"
+        else
+                DRI="no"
+        fi
+fi
 AC_MSG_RESULT([$DRI])
+CFLAGS="$save_CFLAGS $DEBUGFLAGS"
+
+AM_CONDITIONAL(DRI, test x$DRI = xyes)
+if test "$DRI" = yes; then
+        PKG_CHECK_MODULES(DRI, [xf86driproto glproto])
+        AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
+        AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
+fi
 
 AM_CONDITIONAL(VIDEO_DEBUG, test x$VIDEO_DEBUG = xyes)
 if test "$VIDEO_DEBUG" = yes; then
@@ -125,6 +147,8 @@ if test "$KMS_ONLY" = yes; then
 	AC_DEFINE(KMS_ONLY,1,[Assume KMS support])
 fi
 
+AC_SUBST([DRI_CFLAGS])
+
 DRIVER_NAME=intel
 AC_SUBST([DRIVER_NAME])
 AC_SUBST([moduledir])
diff --git a/src/Makefile.am b/src/Makefile.am
index d8e02ff..99a613d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -26,7 +26,7 @@ SUBDIRS = xvmc bios_reader reg_dumper render_program
 # _ladir passes a dummy rpath to libtool so the thing will actually link
 # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
 
-AM_CFLAGS = @CWARNFLAGS@ @XORG_CFLAGS@ @DRM_CFLAGS@ \
+AM_CFLAGS = @CWARNFLAGS@ @XORG_CFLAGS@ @DRM_CFLAGS@ @DRI_CFLAGS@ \
 	@PCIACCESS_CFLAGS@ -I$(top_srcdir)/uxa -I$(top_srcdir)/src/render_program
 
 intel_drv_la_LTLIBRARIES = intel_drv.la
@@ -99,6 +99,8 @@ EXTRA_DIST = 		\
 if DRI
 intel_drv_la_SOURCES += \
 	$(INTEL_DRI_SRCS)
+intel_drv_la_LIBADD += \
+	$(DRI_LIBS)
 endif
 
 if XVMC
diff --git a/src/i810.h b/src/i810.h
index db36882..93b8b76 100644
--- a/src/i810.h
+++ b/src/i810.h
@@ -52,7 +52,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "xorg-server.h"
 #include <pciaccess.h>
 
-#ifdef HAVE_DRI
+#ifdef XF86DRI
 #include "xf86drm.h"
 #include "sarea.h"
 #define _XF86DRI_SERVER_
@@ -229,9 +229,9 @@ typedef struct _I810Rec {
    I810ReadByteFunc readStandard;
 
    Bool directRenderingDisabled;        /* DRI disabled in PreInit */
-   Bool directRenderingEnabled;		/* false if HAVE_DRI not defined. */
+   Bool directRenderingEnabled;		/* false if XF86DRI not defined. */
 
-#ifdef HAVE_DRI
+#ifdef XF86DRI
    int LockHeld;
    DRIInfoPtr pDRIInfo;
    int drmSubFD;
@@ -272,7 +272,7 @@ typedef struct _I810Rec {
 #define I810_SELECT_BACK	1
 #define I810_SELECT_DEPTH	2
 
-#ifdef HAVE_DRI
+#ifdef XF86DRI
 extern Bool I810DRIScreenInit(ScreenPtr pScreen);
 extern void I810DRICloseScreen(ScreenPtr pScreen);
 extern Bool I810DRIFinishScreenInit(ScreenPtr pScreen);
diff --git a/src/i810_accel.c b/src/i810_accel.c
index 9484265..ae4a654 100644
--- a/src/i810_accel.c
+++ b/src/i810_accel.c
@@ -213,7 +213,7 @@ I810WaitLpRing(ScrnInfoPtr pScrn, int n, int timeout_millis)
 		start);
 	 I810PrintErrorState(pScrn);
 	 ErrorF("space: %d wanted %d\n", ring->space, n);
-#ifdef HAVE_DRI
+#ifdef XF86DRI
 	 if (pI810->directRenderingEnabled) {
 	    DRIUnlock(screenInfo.screens[pScrn->scrnIndex]);
 	    DRICloseScreen(screenInfo.screens[pScrn->scrnIndex]);
@@ -245,7 +245,7 @@ I810Sync(ScrnInfoPtr pScrn)
    if (I810_DEBUG & (DEBUG_VERBOSE_ACCEL | DEBUG_VERBOSE_SYNC))
       ErrorF("I810Sync\n");
 
-#ifdef HAVE_DRI
+#ifdef XF86DRI
    /* VT switching tries to do this.  
     */
    if (!pI810->LockHeld && pI810->directRenderingEnabled) {
diff --git a/src/i810_driver.c b/src/i810_driver.c
index 398244e..68e45bb 100644
--- a/src/i810_driver.c
+++ b/src/i810_driver.c
@@ -72,7 +72,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "i810.h"
 #include "i830.h"
 
-#ifdef HAVE_DRI
+#ifdef XF86DRI
 #include "dri.h"
 #endif
 
@@ -280,7 +280,7 @@ int I810_DEBUG = (0
 #endif
 
 #ifndef I830_ONLY
-#ifdef HAVE_DRI
+#ifdef XF86DRI
 static int i810_pitches[] = {
    512,
    1024,
@@ -651,7 +651,7 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
       }
    }
    
-#ifdef HAVE_DRI
+#ifdef XF86DRI
    pI810->directRenderingDisabled =
      !xf86ReturnOptValBool(pI810->Options, OPTION_DRI, TRUE);
 
@@ -852,7 +852,7 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
 
    i = xf86ValidateModes(pScrn, pScrn->monitor->Modes,
 			 pScrn->display->modes, clockRanges,
-#ifndef HAVE_DRI
+#ifndef XF86DRI
 			 0, 320, 1600, 64 * pScrn->bitsPerPixel,
 #else
 			 i810_pitches, 0, 0, 64 * pScrn->bitsPerPixel,
@@ -908,7 +908,7 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
    pI810->allowPageFlip=FALSE;
    enable = xf86ReturnOptValBool(pI810->Options, OPTION_PAGEFLIP, FALSE);   
 
-#ifdef HAVE_DRI
+#ifdef XF86DRI
    if (!pI810->directRenderingDisabled) {
      pI810->allowPageFlip = enable;
      if (pI810->allowPageFlip == TRUE)
@@ -946,7 +946,7 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
       pI810->numSurfaces = 0;
    }
 
-#ifdef HAVE_DRI
+#ifdef XF86DRI
    /* Load the dri module if requested. */
    if (xf86ReturnOptValBool(pI810->Options, OPTION_DRI, FALSE)) {
       xf86LoadSubModule(pScrn, "dri");
@@ -1662,7 +1662,7 @@ I810ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
    if (!I810SetMode(pScrn, mode))
       return FALSE;
 
-#ifdef HAVE_DRI
+#ifdef XF86DRI
    if (pI810->directRenderingEnabled) {
       DRILock(screenInfo.screens[pScrn->scrnIndex], 0);
       pI810->LockHeld = 1;
@@ -1671,7 +1671,7 @@ I810ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
 
    DoRestore(pScrn, &hwp->ModeReg, &pI810->ModeReg, FALSE);
 
-#ifdef HAVE_DRI
+#ifdef XF86DRI
    if (pI810->directRenderingEnabled) {
       DRIUnlock(screenInfo.screens[pScrn->scrnIndex]);
       pI810->LockHeld = 0;
@@ -1943,7 +1943,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
     * memory.  Wonder if this is going to be a problem...
     */
 
-#ifdef HAVE_DRI
+#ifdef XF86DRI
    /*
     * Setup DRI after visuals have been established, but before fbScreenInit
     * is called.   fbScreenInit will eventually call into the drivers
@@ -2011,7 +2011,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
 
    xf86SetBlackWhitePixels(pScreen);
 
-#ifdef HAVE_DRI
+#ifdef XF86DRI
    if (pI810->LpRing->mem.Start == 0 && pI810->directRenderingEnabled) {
       pI810->directRenderingEnabled = FALSE;
       driFrom = X_PROBED;
@@ -2089,7 +2089,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
 
    I810InitVideo(pScreen);
 
-#ifdef HAVE_DRI
+#ifdef XF86DRI
    if (pI810->directRenderingEnabled) {
       /* Now that mi, fb, drm and others have done their thing,
        * complete the DRI setup.
@@ -2139,7 +2139,7 @@ I810SwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
  * If lockups on mode switch are still seen revisit this code. (EE)
  */
 
-# ifdef HAVE_DRI
+# ifdef XF86DRI
    if (pI810->directRenderingEnabled) {
       if (I810_DEBUG & DEBUG_VERBOSE_DRI)
 	 ErrorF("calling dri lock\n");
@@ -2154,7 +2154,7 @@ I810SwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
    }
    I810Restore(pScrn);
 
-# ifdef HAVE_DRI
+# ifdef XF86DRI
    if (pI810->directRenderingEnabled) {
        if (!I810DRILeave(pScrn))
 	   return FALSE;
@@ -2228,7 +2228,7 @@ I810EnterVT(int scrnIndex, int flags)
 {
    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
 
-#ifdef HAVE_DRI
+#ifdef XF86DRI
    I810Ptr pI810 = I810PTR(pScrn);
 #endif
 
@@ -2238,7 +2238,7 @@ I810EnterVT(int scrnIndex, int flags)
    if (!I810BindGARTMemory(pScrn)) {
       return FALSE;
    }
-#ifdef HAVE_DRI
+#ifdef XF86DRI
    if (!I810DRIEnter(pScrn)) {
       return FALSE;
    }
@@ -2266,7 +2266,7 @@ I810LeaveVT(int scrnIndex, int flags)
    if (I810_DEBUG & DEBUG_VERBOSE_DRI)
       ErrorF("\n\n\nLeave VT\n");
 
-#ifdef HAVE_DRI
+#ifdef XF86DRI
    if (pI810->directRenderingEnabled) {
       if (I810_DEBUG & DEBUG_VERBOSE_DRI)
 	 ErrorF("calling dri lock\n");
@@ -2284,7 +2284,7 @@ I810LeaveVT(int scrnIndex, int flags)
 
    if (!I810UnbindGARTMemory(pScrn))
       return;
-#ifdef HAVE_DRI
+#ifdef XF86DRI
    if (!I810DRILeave(pScrn))
       return;
 #endif
@@ -2309,7 +2309,7 @@ I810CloseScreen(int scrnIndex, ScreenPtr pScreen)
       I810Restore(pScrn);
       vgaHWLock(hwp);
    }
-#ifdef HAVE_DRI
+#ifdef XF86DRI
    if (pI810->directRenderingEnabled) {
       I810DRICloseScreen(pScreen);
       pI810->directRenderingEnabled = FALSE;
diff --git a/src/i830.h b/src/i830.h
index 81504fa..7d6a9ff 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -61,6 +61,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "xorg-server.h"
 #include <pciaccess.h>
 
+#include "xf86drm.h"
+#include "sarea.h"
+#define _XF86DRI_SERVER_
+#include "dri.h"
 #include "GL/glxint.h"
 #include "i830_dri.h"
 #include "intel_bufmgr.h"
commit 4c8e783d84d2c14c8a1638b6a12307c0164d3e31
Author: Eric Anholt <eric at anholt.net>
Date:   Wed Oct 21 13:30:38 2009 -0700

    Fix "Remove flow-control macros for fallbacks in the 2D driver."
    
    I guess this is the sort of failure due to rebase-happiness that makes
    Linus yell at us for rebasing.

diff --git a/src/i830_render.c b/src/i830_render.c
index 7fe528e..24d644b 100644
--- a/src/i830_render.c
+++ b/src/i830_render.c
@@ -197,8 +197,9 @@ static Bool i830_get_blend_cntl(ScrnInfoPtr scrn, int op, PicturePtr mask,
 	 */
 	if (dst_format == PICT_a8 && ((sblend == BLENDFACTOR_DST_ALPHA ||
 				       sblend == BLENDFACTOR_INV_DST_ALPHA))) {
-		I830FALLBACK
-		    ("Can't do dst alpha blending with PICT_a8 dest.\n");
+		intel_debug_fallback(scrn, "Can't do dst alpha blending with "
+				     "PICT_a8 dest.\n");
+		return FALSE;
 	}
 
 	/* If the source alpha is being used, then we should only be in a case
@@ -398,10 +399,12 @@ i830_check_composite(int op, PicturePtr source_picture, PicturePtr mask_picture,
 		 * source value that we get to blend with.
 		 */
 		if (i830_blend_op[op].src_alpha &&
-		    (i830_blend_op[op].src_blend != BLENDFACTOR_ZERO))
-			I830FALLBACK
-			    ("Component alpha not supported with source "
-			     "alpha and source value blending.\n");
+		    (i830_blend_op[op].src_blend != BLENDFACTOR_ZERO)) {
+			intel_debug_fallback(scrn, "Component alpha not "
+					     "supported with source alpha and "
+					     "source value blending.\n");
+			return FALSE;
+		}
 	}
 
 	if (!i830_check_composite_texture(scrn, source_picture, 0)) {


More information about the xorg-commit mailing list