[PATCH] xv: disable reputimage hook on newer api

Luc Verhaegen libv at skynet.be
Wed Nov 24 09:21:23 PST 2010


From: Luc Verhaegen <luc.verhaegen at basyskom.de>

This change makes Xv support slightly less nice, but should, in itself,
not deteriorate things too much, as most drivers function acceptably
without reputimage.

Signed-off-by: Luc Verhaegen <luc.verhaegen at basyskom.de>
---
 configure.ac    |   18 ++++++++++++++++++
 src/apm_video.c |    4 ++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 780b0a5..1d8ea0c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,6 +72,24 @@ PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
 DRIVER_NAME=apm
 AC_SUBST([DRIVER_NAME])
 
+# since we cannot use the result from XORG_DRIVER_CHECK_EXT directly.
+AC_CHECK_DECL([XV], [have_xv=yes], [have_xv=false], [#include "xorg/xorg-server.h"])
+if test "x$have_xv" = xyes; then
+	SAVED_CFLAGS="$CFLAGS"
+	CFLAGS="$CFLAGS $XORG_CFLAGS"
+
+	AC_CHECK_MEMBER([ScrnInfoRec.ModeSet],
+		[SCRNINFO_HAS_MODESET=yes], [SCRNINFO_HAS_MODESET=no],
+		[#include "xf86str.h"])
+	if test "x$SCRNINFO_HAS_MODESET" = xyes; then
+		AC_DEFINE(XV_NEW_REPUT, 1,
+			[XvReputImage takes more all coordinates])
+	fi
+
+	CFLAGS="$SAVED_CFLAGS"
+fi
+AM_CONDITIONAL(XV_NEW_REPUT, test x$XV_NEW_REPUT = xyes)
+
 AC_CONFIG_FILES([
                 Makefile
                 src/Makefile
diff --git a/src/apm_video.c b/src/apm_video.c
index 9a9bc39..42694bb 100644
--- a/src/apm_video.c
+++ b/src/apm_video.c
@@ -28,8 +28,10 @@ static int	ApmQueryImageAttributes(ScrnInfoPtr, int,
 					    unsigned short *, unsigned short *,
 					    int *, int *);
 #endif
+#ifndef XV_NEW_REPUT
 static int	A(ReputImage)(ScrnInfoPtr, short, short, RegionPtr, pointer,
 				DrawablePtr);
+#endif
 static int	A(PutImage)(ScrnInfoPtr, short, short, short, short, short,
 				short, short, short, int, unsigned char*,
 				short, short, Bool, RegionPtr, pointer,
@@ -336,7 +338,9 @@ A(SetupImageVideo)(ScreenPtr pScreen)
     adapt->GetPortAttribute = ApmGetPortAttribute;
     adapt->QueryBestSize = ApmQueryBestSize;
     adapt->PutImage = A(PutImage);
+#ifndef XV_NEW_REPUT
     adapt->ReputImage = A(ReputImage);
+#endif
     adapt->QueryImageAttributes = ApmQueryImageAttributes;
 
     pPriv->brightness = 0;
-- 
1.6.4.2



More information about the xorg-devel mailing list