xf86-video-intel: 3 commits - configure.ac src/sna/Makefile.am src/sna/sna_driver.c src/sna/sna.h

Chris Wilson ickle at kemper.freedesktop.org
Thu Jul 12 14:20:38 PDT 2012


 configure.ac         |   39 +++++++++++++++++++++++++--------------
 src/sna/Makefile.am  |   10 +++-------
 src/sna/sna.h        |   14 ++++++++++++--
 src/sna/sna_driver.c |    2 --
 4 files changed, 40 insertions(+), 25 deletions(-)

New commits:
commit b5d6a57f12025aef9850c7d9baa6905f776be971
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jul 12 22:16:27 2012 +0100

    Enable compilation of SNA by default
    
    But only if we meet the required versions of Xorg and leave UXA as the
    default AccelMethod for the time being.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/configure.ac b/configure.ac
index 128a30c..d323da7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -120,13 +120,17 @@ required_pixman_version=0.24
 
 AC_ARG_ENABLE(sna,
 	      AS_HELP_STRING([--enable-sna],
-			     [Enable SandyBridge's New Acceleration (SNA) [default=no]]),
+			     [Enable SandyBridge's New Acceleration (SNA) [default=auto]]),
 	      [SNA="$enableval"],
-	      [SNA=no])
+	      [SNA=auto])
+
+AC_CHECK_HEADERS([sys/sysinfo.h], , SNA=no)
+if test "x$SNA" = "xauto" && pkg-config --exists "xorg-server >= 1.10"; then
+	SNA=yes
+fi
 if test "x$SNA" != "xno"; then
 	required_xorg_xserver_version=1.10
 	AC_DEFINE(USE_SNA, 1, [Enable SNA support])
-	AC_CHECK_HEADERS([sys/sysinfo.h])
 fi
 AC_MSG_CHECKING([whether to include SNA support])
 AM_CONDITIONAL(SNA, test x$SNA != xno)
commit 6c2975ab2943478b3a246b5fb231f9f3df2d8475
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jul 12 22:14:39 2012 +0100

    Fix the reporting of whether SNA is configured
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/configure.ac b/configure.ac
index 55c1251..128a30c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -115,30 +115,31 @@ AC_ARG_ENABLE(kms-only, AS_HELP_STRING([--enable-kms-only],
               [KMS_ONLY="$enableval"],
               [KMS_ONLY=no])
 
-AC_MSG_CHECKING([whether to include SNA support])
+required_xorg_xserver_version=1.6
+required_pixman_version=0.24
+
 AC_ARG_ENABLE(sna,
 	      AS_HELP_STRING([--enable-sna],
 			     [Enable SandyBridge's New Acceleration (SNA) [default=no]]),
 	      [SNA="$enableval"],
 	      [SNA=no])
-AM_CONDITIONAL(SNA, test x$SNA != xno)
-required_xorg_xserver_version=1.6
-required_pixman_version=0.24
 if test "x$SNA" != "xno"; then
 	required_xorg_xserver_version=1.10
 	AC_DEFINE(USE_SNA, 1, [Enable SNA support])
 	AC_CHECK_HEADERS([sys/sysinfo.h])
 fi
+AC_MSG_CHECKING([whether to include SNA support])
+AM_CONDITIONAL(SNA, test x$SNA != xno)
 AC_MSG_RESULT([$SNA])
 
-AC_MSG_CHECKING([whether to include UXA support])
 AC_ARG_ENABLE(uxa,
 	      AS_HELP_STRING([--enable-uxa],
 			     [Enable Unified Acceleration Architecture (UXA) [default=yes]]),
 	      [UXA="$enableval"],
 	      [UXA=yes])
-AC_MSG_RESULT([$UXA])
+AC_MSG_CHECKING([whether to include UXA support])
 AM_CONDITIONAL(UXA, test x$UXA != xno)
+AC_MSG_RESULT([$UXA])
 if test "x$UXA" != "xno"; then
 	AC_DEFINE(USE_UXA, 1, [Enable UXA support])
 	PKG_CHECK_MODULES(DRMINTEL, [libdrm_intel >= 2.4.29])
commit fd15ce65ab8ce5cf571e37daa7db1ee245616cd4
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jul 12 20:32:14 2012 +0100

    sna: Fix build without DRI2
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/configure.ac b/configure.ac
index 323f283..55c1251 100644
--- a/configure.ac
+++ b/configure.ac
@@ -168,7 +168,7 @@ AC_ARG_ENABLE(xaa,
 	      [XAA=auto])
 if test "x$XAA" != xno; then
         save_CFLAGS=$CFLAGS
-        CFLAGS=$XSERVER_CFLAGS
+        CFLAGS=$XORG_CFLAGS
 	AC_CHECK_HEADERS([xaa.h], XAA=yes, XAA=no)
         CFLAGS=$save_CFLAGS
 fi
@@ -183,8 +183,8 @@ AC_ARG_ENABLE(dga,
 	      [DGA=auto])
 if test "x$DGA" != xno; then
         save_CFLAGS=$CFLAGS
-        CFLAGS=$XSERVER_CFLAGS
-	AC_CHECK_HEADERS([dgaproc.h], DGA=yes, DGA=no)
+        CFLAGS=$XORG_CFLAGS
+	AC_CHECK_HEADERS([dgaproc.h], DGA=yes, DGA=no, [#include <dixstruct.h>])
         CFLAGS=$save_CFLAGS
 fi
 AC_MSG_CHECKING([whether to include DGA support])
@@ -324,10 +324,16 @@ else
                 AC_MSG_ERROR([DRI requested but prerequisites not found])
         fi
 fi
-AM_CONDITIONAL(DRI2, test x$DRI2 != xno)
+
 if test "x$DRI2" != "xno"; then
-        AC_DEFINE(USE_DRI2,1,[Enable DRI2 driver support])
+	save_CFLAGS=$CFLAGS
+	CFLAGS="$XORG_CFLAGS $DRM_CFLAGS $DRI_CFLAGS $DRI2_CFLAGS"
+	AC_CHECK_HEADERS([dri2.h], DRI2=yes, DRI2=no, [#include <dixstruct.h>])
+	CFLAGS=$save_CFLAGS
 fi
+AC_MSG_CHECKING([whether to include DRI2 support])
+AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)
+AC_MSG_RESULT([$DRI2])
 
 if test "$XVMC" = yes; then
 	PKG_CHECK_MODULES(XVMCLIB,
diff --git a/src/sna/Makefile.am b/src/sna/Makefile.am
index 604a5db..8463a80 100644
--- a/src/sna/Makefile.am
+++ b/src/sna/Makefile.am
@@ -27,7 +27,6 @@ AM_CFLAGS = \
 	@XORG_CFLAGS@ \
 	@UDEV_CFLAGS@ \
 	@DRM_CFLAGS@ \
-	@DRI_CFLAGS@ \
 	$(NULL)
 
 if DEBUG
@@ -83,12 +82,9 @@ libsna_la_SOURCES = \
 	$(NULL)
 
 if DRI2
-libsna_la_SOURCES += \
-	sna_dri.c \
-	$(NULL)
-libsna_la_LIBADD += \
-	$(DRI_LIBS) \
-	$(NULL)
+AM_CFLAGS += @DRI_CFLAGS@
+libsna_la_SOURCES += sna_dri.c
+libsna_la_LIBADD += $(DRI_LIBS)
 endif
 
 if XVMC
diff --git a/src/sna/sna.h b/src/sna/sna.h
index d4f6dec..abb010c 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -58,11 +58,13 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include <xf86drmMode.h>
 
 #include "../compat-api.h"
-#define _XF86DRI_SERVER_
 #include <drm.h>
-#include <dri2.h>
 #include <i915_drm.h>
 
+#ifdef HAVE_DRI2_H
+#include <dri2.h>
+#endif
+
 #if HAVE_UDEV
 #include <libudev.h>
 #endif
@@ -338,11 +340,19 @@ extern xf86CrtcPtr sna_covering_crtc(ScrnInfoPtr scrn,
 extern bool sna_wait_for_scanline(struct sna *sna, PixmapPtr pixmap,
 				  xf86CrtcPtr crtc, const BoxRec *clip);
 
+#if HAVE_DRI2_H
 Bool sna_dri_open(struct sna *sna, ScreenPtr pScreen);
 void sna_dri_page_flip_handler(struct sna *sna, struct drm_event_vblank *event);
 void sna_dri_vblank_handler(struct sna *sna, struct drm_event_vblank *event);
 void sna_dri_destroy_window(WindowPtr win);
 void sna_dri_close(struct sna *sna, ScreenPtr pScreen);
+#else
+static inline bool sna_dri_open(struct sna *sna, ScreenPtr pScreen) { return false; }
+static inline void sna_dri_page_flip_handler(struct sna *sna, struct drm_event_vblank *event) { }
+static inline void sna_dri_vblank_handler(struct sna *sna, struct drm_event_vblank *event) { }
+static inline void sna_dri_destroy_window(WindowPtr win) { }
+static inline void sna_dri_close(struct sna *sna, ScreenPtr pScreen) { }
+#endif
 
 extern bool sna_crtc_on(xf86CrtcPtr crtc);
 int sna_crtc_to_pipe(xf86CrtcPtr crtc);
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index eee9527..1433971 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -941,12 +941,10 @@ sna_screen_init(SCREEN_INIT_ARGS_DECL)
 	xf86DPMSInit(screen, xf86DPMSSet, 0);
 
 	sna_video_init(sna, screen);
-#if USE_DRI2
 	sna->directRenderingOpen = sna_dri_open(sna, screen);
 	if (sna->directRenderingOpen)
 		xf86DrvMsg(scrn->scrnIndex, X_INFO,
 			   "direct rendering: DRI2 Enabled\n");
-#endif
 
 	if (serverGeneration == 1)
 		xf86ShowUnusedOptions(scrn->scrnIndex, scrn->options);


More information about the xorg-commit mailing list