porting XDirectFB to Xorg 7.1

Ville Syrjälä syrjala at sci.fi
Tue Sep 12 11:19:01 PDT 2006


On Tue, Sep 12, 2006 at 10:42:40PM +0800, ye janboe wrote:
> Great. Now I am working on the autotools of Xorg 7.1.
> Please mail me your patches. And welcome you to cooperate with me.

Patch series attached.

Some issues:

I'm not sure which extensions need to be disabled because they actually 
need server support. Any guidance from Xorg hackers would help...

XDirectFB supports these extension (or at least there are ifdefs for 
them in the code :)
 DPMSExtension
 MITSHM
 RANDR
 RENDER
 SHAPE
 XFreeXDGA
 XKB
 XvExtension (I wonder if XV or XvExtension should be used in the ifdefs).

I disabled these extension in xdirectfb-config.h to make it build.
 XF86DRI
 XF86MISC
 XF86VIDMODE

-- 
Ville Syrjälä
syrjala at sci.fi
http://www.sci.fi/~syrjala/
-------------- next part --------------
xorg_dont_check_dmx_xnest_modules.patch
xorg_add_xdirectfb.patch
xdirectfb_fix_includes.patch
-------------- next part --------------
Index: xorg-server-1.0.2/configure.ac
===================================================================
--- xorg-server-1.0.2.orig/configure.ac
+++ xorg-server-1.0.2/configure.ac
@@ -799,7 +799,9 @@ SERVER_DEFINES=""
 dnl DMX DDX
 
 AC_MSG_CHECKING([whether to build Xdmx DDX])
-PKG_CHECK_MODULES([DMXMODULES], [xmuu xext x11 xrender xfont xi dmxproto xau $XDMCP_MODULES], [have_dmx=yes], [have_dmx=no])
+if test "x$DMX" != xno; then
+       PKG_CHECK_MODULES([DMXMODULES], [xmuu xext x11 xrender xfont xi dmxproto xau $XDMCP_MODULES], [have_dmx=yes], [have_dmx=no])
+fi
 if test "x$DMX" = xauto; then
 	DMX="$have_dmx"
 fi
@@ -859,7 +861,9 @@ fi
 dnl Xnest DDX
 
 AC_MSG_CHECKING([whether to build Xnest DDX])
-PKG_CHECK_MODULES(XNESTMODULES, [xfont xext x11 xau $XDMCP_MODULES], [have_xnest=yes], [have_xnest=no])
+if test "x$XNEST" != xno; then
+       PKG_CHECK_MODULES(XNESTMODULES, [xfont xext x11 xau $XDMCP_MODULES], [have_xnest=yes], [have_xnest=no])
+fi
 if test "x$XNEST" = xauto; then
 	XNEST="$have_xnest"
 fi
-------------- next part --------------
Index: xorg-server-1.0.2/configure.ac
===================================================================
--- xorg-server-1.0.2.orig/configure.ac
+++ xorg-server-1.0.2/configure.ac
@@ -395,6 +395,7 @@ AC_ARG_ENABLE(xvfb,    	      AS_HELP_ST
 AC_ARG_ENABLE(xnest,   	      AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto])
 AC_ARG_ENABLE(xwin,    	      AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto])
 AC_ARG_ENABLE(xprint,         AS_HELP_STRING([--enable-xprint], [Build Xprint extension and server (default: auto)]), [XPRINT=$enableval], [XPRINT=auto])
+AC_ARG_ENABLE(xdirectfb,      AS_HELP_STRING([--enable-xdirectfb], [Build XDirectFB server (default: auto)]), [XDIRECTFB=$enableval], [XDIRECTFB=auto])
 
 dnl chown/chmod to be setuid root as part of build
 dnl Replaces InstallXserverSetUID in imake
@@ -1227,6 +1228,28 @@ AM_CONDITIONAL(XWIN_PRIMARYFB, [test "x$
 AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes])
 AM_CONDITIONAL(XWIN_XV, [test "x$XWIN" = xyes && test "x$XV" = xyes])
 
+dnl XDirectFB
+
+AC_MSG_CHECKING([whether to build XDirectFB])
+if test "x$XDIRECTFB" != xno; then
+       PKG_CHECK_MODULES([DIRECTFB], [directfb >= 0.9.26 x11], [have_directfb=yes], [have_directfb=no])
+fi
+if test "x$XDIRECTFB" = xauto; then
+       XDIRECTFB="$have_directfb"
+fi
+AC_MSG_RESULT([$XDIRECTFB])
+
+if test "x$XDIRECTFB" = xyes; then
+       if test "x$have_directfb" = xno; then
+               AC_MSG_ERROR([XDirectFB build explicitly requested, but required
+                             modules not found.])
+       fi
+       XDIRECTFB_LIBS="$DIX_LIB $FB_LIB $MI_LIB $RANDR_LIB $XKB_LIB $XKB_STUB_LIB $XEXT_LIB $OS_LIB $LBX_LIB $RENDER_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $XI_LIB $FIXES_LIB $RECORD_LIB $DBE_LIB $DAMAGE_LIB $XTRAP_LIB"
+       AC_SUBST([DIRECTFB_CFLAGS])
+       AC_SUBST([DIRECTFB_LIBS])
+       AC_SUBST([XDIRECTFB_LIBS])
+fi
+AM_CONDITIONAL(XDIRECTFB, [test "x$XDIRECTFB" = xyes])
 
 dnl these only go in xkb-config.h (which is shared by the Xorg and Xnest servers)
 AC_DEFINE(__XKBDEFRULES__, "xorg", [Default XKB rules])
@@ -1456,6 +1479,7 @@ hw/vfb/Makefile
 hw/xnest/Makefile
 hw/xwin/Makefile
 hw/darwin/Makefile
+hw/directfb/Makefile
 Xprint/Makefile
 Xprint/doc/Makefile
 Xprint/pcl/Makefile
Index: xorg-server-1.0.2/hw/Makefile.am
===================================================================
--- xorg-server-1.0.2.orig/hw/Makefile.am
+++ xorg-server-1.0.2/hw/Makefile.am
@@ -18,6 +18,10 @@ if XWIN
 XWIN_SUBDIRS = xwin
 endif
 
+if XDIRECTFB
+XDIRECTFB_SUBDIRS = directfb
+endif
+
 # need to add darwin support here
 
 SUBDIRS =			\
@@ -25,6 +29,7 @@ SUBDIRS =			\
 	$(XWIN_SUBDIRS)		\
 	$(XVFB_SUBDIRS)		\
 	$(XNEST_SUBDIRS)	\
-	$(DMX_SUBDIRS)
+	$(DMX_SUBDIRS)		\
+	$(XDIRECTFB_SUBDIRS)
 
-DIST_SUBDIRS = dmx xfree86 vfb xnest xwin darwin
+DIST_SUBDIRS = dmx xfree86 vfb xnest xwin darwin directfb
Index: xorg-server-1.0.2/hw/directfb/directfbX.c
===================================================================
--- xorg-server-1.0.2.orig/hw/directfb/directfbX.c
+++ xorg-server-1.0.2/hw/directfb/directfbX.c
@@ -408,6 +408,7 @@ HandleInputEvent (DFBInputEvent *ev)
 ===========================================================================
 */
 
+#ifdef DDXTIME
 CARD32
 GetTimeInMillis()
 {
@@ -416,6 +417,7 @@ GetTimeInMillis()
     X_GETTIMEOFDAY(&tp);
     return(tp.tv_sec * 1000) + (tp.tv_usec / 1000);
 }
+#endif
 
 /*
  * ProcessInputEvents
Index: xorg-server-1.0.2/hw/directfb/Makefile.am
===================================================================
--- /dev/null
+++ xorg-server-1.0.2/hw/directfb/Makefile.am
@@ -0,0 +1,64 @@
+bin_PROGRAMS = XDirectFB
+
+XDirectFB_SOURCES = 		\
+	directfbClipboard.c	\
+	directfbClipboard.h	\
+	directfbColor.c		\
+	directfbCursor.c	\
+	directfbCursor.h	\
+	directfbDGA.c		\
+	directfbDGA.h		\
+	directfbKeyboard.c	\
+	directfbKeyboard.h	\
+	directfbPasteboard.c	\
+	directfbPasteboard.h	\
+	directfbRandR.c		\
+	directfbRandR.h		\
+	directfbScreen.c	\
+	directfbScreen.h	\
+	directfbVideo.c		\
+	directfbVideo.h		\
+	directfbX.c		\
+	directfbX.h		\
+	rootlessCommon.c	\
+	rootlessCommon.h	\
+	rootlessDirectFB.c	\
+	rootlessDirectFB.h	\
+	rootlessGC.c		\
+	rootless.h		\
+	rootlessScreen.c	\
+	rootlessValTree.c	\
+	rootlessWindow.c	\
+	rootlessWindow.h	\
+	xdirectfb-config.h	\
+	$(top_srcdir)/fb/fbcmap.c	\
+	$(top_srcdir)/Xi/stubs.c	\
+	$(top_srcdir)/mi/miinitext.c	\
+	$(top_srcdir)/hw/xfree86/dixmods/extmod/xf86dga.c	\
+	$(top_srcdir)/hw/xfree86/dixmods/extmod/xf86dga2.c
+
+XDirectFB_LDADD =		\
+	$(XDIRECTFB_LIBS)	\
+	$(XSERVER_LIBS)		\
+	$(DIRECTFB_LIBS)
+
+AM_CPPFLAGS =						\
+	-I$(top_srcdir)/hw/xfree86/dixmods/extmod	\
+	-include $(srcdir)/xdirectfb-config.h
+
+AM_CFLAGS =			\
+	$(XSERVER_CFLAGS)	\
+	$(DIRECTFB_CFLAGS)
+
+EXTRA_DIST = 		\
+	directfbDRI.c	\
+	directfbDRI.h	\
+	dri.c		\
+	dri.h		\
+	dristruct.h	\
+	x-hash.c	\
+	x-hash.h	\
+	x-hook.c	\
+	x-hook.h	\
+	x-list.c	\
+	x-list.h
Index: xorg-server-1.0.2/hw/directfb/xdirectfb-config.h
===================================================================
--- /dev/null
+++ xorg-server-1.0.2/hw/directfb/xdirectfb-config.h
@@ -0,0 +1,52 @@
+/*
+ */
+
+#ifndef XDIRECTFB_CONFIG_H
+#define XDIRECTFB_CONFIG_H
+
+#include <dix-config.h>
+#include <xkb-config.h>
+
+//#undef BIGREQS
+//#undef COMPOSITE
+//#undef DAMAGE
+//#undef DBE
+//#undef DPSEXT
+// DPMSExtension
+//#undef EVI
+//#undef FONTCACHE
+//#undef GLXEXT
+//#undef LBX
+//#undef SCREENSAVER
+// MITSHM
+//#undef MITMISC
+//#undef MULTIBUFFER
+// RANDR
+// RENDER
+// SHAPE
+//#undef XCSECURITY
+//#undef XSYNC
+//#undef TOGCUP
+//#undef RES
+//#undef XAPPGROUP
+//#undef XCMISC
+//#undef XEVIE
+//#undef XF86BIGFONT
+// XFreeXDGA
+#undef XF86DRI
+#undef XF86MISC
+#undef XF86VIDMODE
+//#undef XFIXES
+// XKB
+//#undef PANORAMIX
+//#undef XINPUT
+//#undef XIDLE
+// XV
+//#undef XRECORD
+//#undef XPRINT
+//#undef XTEST
+//#undef XTESTEXT1
+//#undef XTRAP
+//#undef DMXEXT
+
+#endif /* XDIRECTFB_CONFIG_H */
-------------- next part --------------
Index: xorg-server-1.0.2/hw/directfb/directfbClipboard.c
===================================================================
--- xorg-server-1.0.2.orig/hw/directfb/directfbClipboard.c
+++ xorg-server-1.0.2/hw/directfb/directfbClipboard.c
@@ -43,11 +43,11 @@
 #include <unistd.h>
 
 /* X headers */
-#include "X.h"
-#include "Xatom.h"
-#include "X11/Xproto.h"
-#include "X11/Xutil.h"
-#include "X11/Xlocale.h"
+#include <X11/X.h>
+#include <X11/Xatom.h>
+#include <X11/Xproto.h>
+#include <X11/Xutil.h>
+#include <X11/Xlocale.h>
 
 #include "directfbClipboard.h"
 #include "directfbPasteboard.h"
Index: xorg-server-1.0.2/hw/directfb/directfbKeyboard.c
===================================================================
--- xorg-server-1.0.2.orig/hw/directfb/directfbKeyboard.c
+++ xorg-server-1.0.2/hw/directfb/directfbKeyboard.c
@@ -30,8 +30,8 @@
 #include <sys/stat.h>
 
 #define NEED_EVENTS
-#include "X.h"
-#include "Xproto.h"
+#include <X11/X.h>
+#include <X11/Xproto.h>
 #include "inputstr.h"
 
 #include <X11/keysym.h>
Index: xorg-server-1.0.2/hw/directfb/directfbPasteboard.c
===================================================================
--- xorg-server-1.0.2.orig/hw/directfb/directfbPasteboard.c
+++ xorg-server-1.0.2/hw/directfb/directfbPasteboard.c
@@ -42,7 +42,7 @@
 #include "directfbPasteboard.h"
 #include "directfbScreen.h"
 
-#include "Xatom.h"
+#include <X11/Xatom.h>
 #include "windowstr.h"
 #include "propertyst.h"
 #include "scrnintstr.h"
Index: xorg-server-1.0.2/hw/directfb/directfbScreen.c
===================================================================
--- xorg-server-1.0.2.orig/hw/directfb/directfbScreen.c
+++ xorg-server-1.0.2/hw/directfb/directfbScreen.c
@@ -24,8 +24,12 @@
 #include "rootlessDirectFB.h"
 
 /* X headers */
-#include "X.h"
-#include "Xproto.h"
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#ifdef MITSHM
+#define _XSHM_SERVER_
+#include <X11/extensions/XShm.h>
+#endif
 #include "os.h"
 #include "servermd.h"
 #include "inputstr.h"
Index: xorg-server-1.0.2/hw/directfb/directfbX.c
===================================================================
--- xorg-server-1.0.2.orig/hw/directfb/directfbX.c
+++ xorg-server-1.0.2/hw/directfb/directfbX.c
@@ -13,9 +13,9 @@
  **************************************************************/
 /* $XFree86: xc/programs/Xserver/hw/directfb/directfb.c,v 1.44 2002/02/05 19:16:13 torrey Exp $ */
 
-#include "X.h"
-#include "Xos.h"
-#include "Xproto.h"
+#include <X11/X.h>
+#include <X11/Xos.h>
+#include <X11/Xproto.h>
 #include "os.h"
 #include "servermd.h"
 #include "inputstr.h"
@@ -30,7 +30,7 @@
 
 #ifdef DPMSExtension
 #define DPMS_SERVER
-#include "extensions/dpms.h"
+#include <X11/extensions/dpms.h>
 #include "dpmsproc.h"
 #endif
 
Index: xorg-server-1.0.2/hw/directfb/directfbX.h
===================================================================
--- xorg-server-1.0.2.orig/hw/directfb/directfbX.h
+++ xorg-server-1.0.2/hw/directfb/directfbX.h
@@ -14,7 +14,7 @@
 #include <directfb.h>
 #include "inputstr.h"
 #include "screenint.h"
-#include "extensions/XKB.h"
+#include <X11/extensions/XKB.h>
 #include "directfbScreen.h"
 
 void xf86SetRootClip (ScreenPtr pScreen, BOOL enable);
Index: xorg-server-1.0.2/hw/directfb/rootlessCommon.h
===================================================================
--- xorg-server-1.0.2.orig/hw/directfb/rootlessCommon.h
+++ xorg-server-1.0.2/hw/directfb/rootlessCommon.h
@@ -24,6 +24,7 @@
 #include "picturestr.h"
 #endif
 
+#include "scrnintstr.h"
 
 //#define ROOTLESSDEBUG
 
Index: xorg-server-1.0.2/hw/directfb/rootlessValTree.c
===================================================================
--- xorg-server-1.0.2.orig/hw/directfb/rootlessValTree.c
+++ xorg-server-1.0.2/hw/directfb/rootlessValTree.c
@@ -91,7 +91,7 @@ in this Software without prior written a
  *		Bob Scheifler -- avoid miComputeClips for unmapped windows,
  *				 valdata changes
  */
-#include    "X.h"
+#include    <X11/X.h>
 #include    "scrnintstr.h"
 #include    "validate.h"
 #include    "windowstr.h"
Index: xorg-server-1.0.2/hw/directfb/directfbDGA.c
===================================================================
--- xorg-server-1.0.2.orig/hw/directfb/directfbDGA.c
+++ xorg-server-1.0.2/hw/directfb/directfbDGA.c
@@ -21,7 +21,7 @@
 #include "scrnintstr.h"
 #include "micmap.h"
 #ifdef XKB
-#include "XKBsrv.h"
+#include <X11/extensions/XKBsrv.h>
 #endif
 
 #include "directfbScreen.h"
Index: xorg-server-1.0.2/hw/directfb/directfbRandR.c
===================================================================
--- xorg-server-1.0.2.orig/hw/directfb/directfbRandR.c
+++ xorg-server-1.0.2/hw/directfb/directfbRandR.c
@@ -11,8 +11,8 @@
 
 #ifdef RANDR
 
-#include "X.h"
-#include "Xproto.h"
+#include <X11/X.h>
+#include <X11/Xproto.h>
 #include "scrnintstr.h"
 #include "windowstr.h"
 #include "randrstr.h"
Index: xorg-server-1.0.2/hw/directfb/directfbVideo.c
===================================================================
--- xorg-server-1.0.2.orig/hw/directfb/directfbVideo.c
+++ xorg-server-1.0.2/hw/directfb/directfbVideo.c
@@ -15,8 +15,8 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "X.h"
-#include "Xproto.h"
+#include <X11/X.h>
+#include <X11/Xproto.h>
 #include "scrnintstr.h"
 #include "regionstr.h"
 #include "windowstr.h"
@@ -27,8 +27,8 @@
 #include "gcstruct.h"
 #include "dixstruct.h"
 
-#include "Xv.h"
-#include "Xvproto.h"
+#include <X11/extensions/Xv.h>
+#include <X11/extensions/Xvproto.h>
 #include "xvdix.h"
 
 #include <directfb.h>


More information about the xorg mailing list