xserver: Branch 'master' - 11 commits

George Sapountzis gsap7 at kemper.freedesktop.org
Wed Apr 23 08:13:57 PDT 2008


 GL/Makefile.am                              |    4 
 GL/glx/glxglcore.c                          |   83 ++++
 GL/mesa/.gitignore                          |   32 -
 GL/mesa/Makefile.am                         |   18 
 GL/mesa/X/Makefile.am                       |   27 -
 GL/mesa/glapi/Makefile.am                   |   20 -
 GL/mesa/main/Makefile.am                    |   86 ----
 GL/mesa/math/Makefile.am                    |   27 -
 GL/mesa/shader/Makefile.am                  |   39 --
 GL/mesa/shader/grammar/Makefile.am          |   20 -
 GL/mesa/shader/slang/Makefile.am            |   41 --
 GL/mesa/swrast/Makefile.am                  |   50 --
 GL/mesa/swrast_setup/Makefile.am            |   20 -
 GL/mesa/tnl/Makefile.am                     |   37 --
 GL/mesa/vbo/Makefile.am                     |   35 -
 GL/symlink-mesa.sh                          |  164 --------
 Xext/EVIstruct.h                            |   58 ---
 configure.ac                                |   41 --
 hw/kdrive/ati/Makefile.am                   |    4 
 hw/kdrive/chips/Makefile.am                 |    4 
 hw/kdrive/ephyr/GL/internal/dri_interface.h |  517 ----------------------------
 hw/kdrive/ephyr/Makefile.am                 |  107 ++---
 hw/kdrive/ephyr/XF86dri.c                   |    7 
 hw/kdrive/ephyr/ephyr.c                     |   18 
 hw/kdrive/ephyr/ephyrdri.c                  |    7 
 hw/kdrive/ephyr/ephyrdriext.c               |    4 
 hw/kdrive/ephyr/ephyrglxext.c               |    5 
 hw/kdrive/ephyr/ephyrhostglx.c              |    4 
 hw/kdrive/ephyr/hostx.c                     |   11 
 hw/kdrive/ephyr/hostx.h                     |    4 
 hw/kdrive/ephyr/xf86dri.h                   |  120 ++++++
 hw/kdrive/epson/Makefile.am                 |    4 
 hw/kdrive/fake/Makefile.am                  |    4 
 hw/kdrive/fbdev/Makefile.am                 |    4 
 hw/kdrive/i810/Makefile.am                  |    4 
 hw/kdrive/mach64/Makefile.am                |    4 
 hw/kdrive/mga/Makefile.am                   |    4 
 hw/kdrive/neomagic/Makefile.am              |    4 
 hw/kdrive/nvidia/Makefile.am                |    4 
 hw/kdrive/pm2/Makefile.am                   |    4 
 hw/kdrive/r128/Makefile.am                  |    4 
 hw/kdrive/sdl/Makefile.am                   |    4 
 hw/kdrive/sis300/Makefile.am                |    4 
 hw/kdrive/smi/Makefile.am                   |    4 
 hw/kdrive/vesa/Makefile.am                  |    4 
 hw/kdrive/via/Makefile.am                   |    4 
 hw/xfree86/dixmods/GLcoremodule.c           |   63 ---
 hw/xfree86/dixmods/Makefile.am              |    6 
 hw/xfree86/dixmods/glxmodule.c              |   37 --
 include/dix-config.h.in                     |    2 
 50 files changed, 354 insertions(+), 1428 deletions(-)

New commits:
commit 00effad583713e882c3f2518bcd3da51bf4db716
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Wed Apr 23 17:46:30 2008 +0300

    xephyr: XEPHYR_DRI is identical to XF86DRI

diff --git a/configure.ac b/configure.ac
index 21c1d91..51ab4c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1925,11 +1925,6 @@ if test "$KDRIVE" = yes; then
     if test "x$XEPHYR" = xauto; then
         XEPHYR=$xephyr
     fi
-    XEPHYR_DRI=no
-    if test x$XEPHYR = xyes -a x$DRI = xyes && test "x$GLX" = xyes; then
-        XEPHYR_DRI=yes
-        AC_DEFINE(XEPHYR_DRI,1,[enable DRI extension in xephyr])
-    fi
 
     # Xephyr needs nanosleep() which is in librt on Solaris
     AC_CHECK_FUNC([nanosleep], [],
@@ -1984,7 +1979,6 @@ AM_CONDITIONAL(KDRIVEFBDEV, [test "x$XFBDEV" = xyes])
 AM_CONDITIONAL(XSDLSERVER, [test x"$XSDL" = xyes])
 AM_CONDITIONAL(XEPHYR, [test "x$KDRIVE" = xyes && test "x$XEPHYR" = xyes])
 AM_CONDITIONAL(BUILD_KDRIVEFBDEVLIB, [test "x$KDRIVE" = xyes && test "x$KDRIVEFBDEVLIB" = xyes])
-AM_CONDITIONAL(XEPHYR_HAS_DRI, [test x$XEPHYR_DRI = xyes])
 AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes])
 
 dnl these only go in xkb-config.h (which is shared by the Xorg and Xnest servers)
diff --git a/hw/kdrive/ephyr/Makefile.am b/hw/kdrive/ephyr/Makefile.am
index 90fd4d8..5269876 100644
--- a/hw/kdrive/ephyr/Makefile.am
+++ b/hw/kdrive/ephyr/Makefile.am
@@ -11,7 +11,7 @@ if XV
 LIBXEPHYR_HOSTXV=libxephyr-hostxv.a
 endif
 
-if XEPHYR_HAS_DRI
+if DRI
 LIBXEPHYR_HOSTDRI=libxephyr-hostdri.a
 endif
 
@@ -53,7 +53,7 @@ if XV
 libxephyr_hostxv_a_SOURCES = $(HOSTVIDEO_SRCS)
 endif
 
-if XEPHYR_HAS_DRI
+if DRI
 libxephyr_hostdri_a_SOURCES = $(HOSTDRI_SRCS)
 endif
 
diff --git a/hw/kdrive/ephyr/XF86dri.c b/hw/kdrive/ephyr/XF86dri.c
index a5fc9bd..be65edf 100644
--- a/hw/kdrive/ephyr/XF86dri.c
+++ b/hw/kdrive/ephyr/XF86dri.c
@@ -46,8 +46,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include <kdrive-config.h>
 #endif
 
-#ifdef XEPHYR_DRI
-
 /* THIS IS NOT AN X CONSORTIUM STANDARD */
 
 #define NEED_REPLIES
@@ -639,5 +637,3 @@ XF86DRICloseFullScreen(Display *dpy, int screen, Drawable drawable)
     (void) drawable;
     return True;
 }
-#endif /*EPHYR_DRI*/
-
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index b02f990..d69e148 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -32,11 +32,11 @@
 #include "scrnintstr.h"
 #include "ephyrlog.h"
 
-#ifdef XEPHYR_DRI
+#ifdef XF86DRI
 #include "ephyrdri.h"
 #include "ephyrdriext.h"
 #include "ephyrglxext.h"
-#endif /*XEPHYR_DRI*/
+#endif /* XF86DRI */
 
 extern int KdTsPhyScreen;
 #ifdef GLXEXT
@@ -631,7 +631,7 @@ ephyrInitScreen (ScreenPtr pScreen)
   }
 #endif /*XV*/
 
-#ifdef XEPHYR_DRI
+#ifdef XF86DRI
   if (!ephyrNoDRI && !hostx_has_dri ()) {
       EPHYR_LOG ("host x does not support DRI. Disabling DRI forwarding\n") ;
       ephyrNoDRI = TRUE ;
@@ -841,7 +841,7 @@ miPointerScreenFuncRec ephyrPointerScreenFuncs =
   ephyrWarpCursor
 };
 
-#ifdef XEPHYR_DRI
+#ifdef XF86DRI
 /**
  * find if the remote window denoted by a_remote
  * is paired with an internal Window within the Xephyr server.
@@ -873,7 +873,7 @@ ephyrExposePairedWindow (int a_remote)
     screen->WindowExposures (pair->local, &reg, NullRegion);
     REGION_UNINIT (screen, &reg);
 }
-#endif /*XEPHYR_DRI*/
+#endif /* XF86DRI */
 
 void
 ephyrPoll(void)
@@ -908,14 +908,14 @@ ephyrPoll(void)
             else
               {
                   int x=0, y=0;
-#ifdef XEPHYR_DRI
+#ifdef XF86DRI
                   EphyrWindowPair *pair = NULL;
 #endif
                   EPHYR_LOG ("enqueuing mouse motion:%d\n", ephyrCurScreen) ;
                   x = ev.data.mouse_motion.x;
                   y = ev.data.mouse_motion.y;
                   EPHYR_LOG ("initial (x,y):(%d,%d)\n", x, y) ;
-#ifdef XEPHYR_DRI
+#ifdef XF86DRI
                   EPHYR_LOG ("is this window peered by a gl drawable ?\n") ;
                   if (findWindowPairFromRemote (ev.data.mouse_motion.window,
                                                 &pair))
@@ -972,7 +972,7 @@ ephyrPoll(void)
 	  KdEnqueueKeyboardEvent (ephyrKbd, ev.data.key_up.scancode, TRUE);
 	  break;
 
-#ifdef XEPHYR_DRI
+#ifdef XF86DRI
 	case EPHYR_EV_EXPOSE:
 	  /*
 	   * We only receive expose events when the expose event have
@@ -982,7 +982,7 @@ ephyrPoll(void)
 	   */
 	  ephyrExposePairedWindow (ev.data.expose.window);
 	  break;
-#endif /*XEPHYR_DRI*/
+#endif /* XF86DRI */
 
 	default:
 	  break;
diff --git a/hw/kdrive/ephyr/ephyrdri.c b/hw/kdrive/ephyr/ephyrdri.c
index bb4f6a1..9aa68b1 100644
--- a/hw/kdrive/ephyr/ephyrdri.c
+++ b/hw/kdrive/ephyr/ephyrdri.c
@@ -29,11 +29,8 @@
 #include <kdrive-config.h>
 #endif
 
-#ifdef XEPHYR_DRI
-
 #include <X11/Xutil.h>
 #include <X11/Xlibint.h>
-/*#define _XF86DRI_SERVER_*/
 #include <GL/glx.h>
 #include "xf86dri.h"
 #include "hostx.h"
@@ -287,5 +284,3 @@ ephyrDRIGetDeviceInfo (int a_screen,
     EPHYR_LOG ("leave:%d\n", is_ok) ;
     return is_ok ;
 }
-#endif /*EPHYR_DRI*/
-
diff --git a/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c
index fafe56d..883e330 100644
--- a/hw/kdrive/ephyr/ephyrdriext.c
+++ b/hw/kdrive/ephyr/ephyrdriext.c
@@ -32,8 +32,6 @@
 #include <kdrive-config.h>
 #endif
 
-#ifdef XEPHYR_DRI
-
 #include <string.h>
 
 #define NEED_REPLIES
@@ -1439,5 +1437,3 @@ SProcXF86DRIDispatch (register ClientPtr client)
         }
     }
 }
-
-#endif /*XEPHYR_DRI*/
diff --git a/hw/kdrive/ephyr/ephyrglxext.c b/hw/kdrive/ephyr/ephyrglxext.c
index 43a634d..2e08e39 100644
--- a/hw/kdrive/ephyr/ephyrglxext.c
+++ b/hw/kdrive/ephyr/ephyrglxext.c
@@ -42,8 +42,6 @@
 #include "hostx.h"
 
 
-#ifdef XEPHYR_DRI
-
 #ifndef TRUE
 #define TRUE 1
 #endif
@@ -727,6 +725,3 @@ ephyrGLXIsDirectSwap (__GLXclientState *a_cl, GLbyte *a_pc)
 {
     return ephyrGLXIsDirectReal (a_cl, a_pc, TRUE) ;
 }
-
-#endif /*XEPHYR_DRI*/
-
diff --git a/hw/kdrive/ephyr/ephyrhostglx.c b/hw/kdrive/ephyr/ephyrhostglx.c
index f5db5be..6d783d2 100644
--- a/hw/kdrive/ephyr/ephyrhostglx.c
+++ b/hw/kdrive/ephyr/ephyrhostglx.c
@@ -41,7 +41,6 @@
 #include "ephyrlog.h"
 #include "hostx.h"
 
-#ifdef XEPHYR_DRI
 enum VisualConfRequestType {
     EPHYR_GET_FB_CONFIG,
     EPHYR_VENDOR_PRIV_GET_FB_CONFIG_SGIX,
@@ -687,6 +686,3 @@ out:
     EPHYR_LOG ("leave\n") ;
     return is_ok ;
 }
-
-#endif /*XEPHYR_DRI*/
-
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index 1a71d06..74f9f16 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -45,12 +45,12 @@
 #include <X11/keysym.h>
 #include <X11/extensions/XShm.h>
 #include <X11/extensions/shape.h>
-#ifdef XEPHYR_DRI
+#ifdef XF86DRI
 #include <GL/glx.h>
-#endif /*XEPHYR_DRI*/
+#endif /* XF86DRI */
 #include "ephyrlog.h"
 
-#ifdef XEPHYR_DRI
+#ifdef XF86DRI
 extern Bool XF86DRIQueryExtension (Display *dpy,
                                    int *event_basep,
                                    int *error_basep);
@@ -1315,7 +1315,7 @@ hostx_has_xshape (void)
     return TRUE;
 }
 
-#ifdef XEPHYR_DRI
+#ifdef XF86DRI
 typedef struct {
     int is_valid ;
     int local_id ;
@@ -1418,5 +1418,4 @@ hostx_has_glx (void)
     return TRUE ;
 }
 
-#endif /*XEPHYR_DRI*/
-
+#endif /* XF86DRI */
diff --git a/hw/kdrive/ephyr/hostx.h b/hw/kdrive/ephyr/hostx.h
index 47ba61b..c1b1958 100644
--- a/hw/kdrive/ephyr/hostx.h
+++ b/hw/kdrive/ephyr/hostx.h
@@ -244,7 +244,7 @@ int hostx_set_window_clipping_rectangles (int a_window,
                                           int a_num_rects) ;
 int hostx_has_xshape (void) ;
 
-#ifdef XEPHYR_DRI
+#ifdef XF86DRI
 int hostx_lookup_peer_window (void *a_local_window,
                               int *a_host_peer /*out parameter*/) ;
 int
@@ -256,6 +256,6 @@ hostx_get_resource_id_peer (int a_local_resource_id,
 int hostx_has_dri (void) ;
 
 int hostx_has_glx (void) ;
-#endif /*XEPHYR_DRI*/
+#endif /* XF86DRI */
 
 #endif /*_XLIBS_STUFF_H_*/
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 1779082..135d3d8 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -419,8 +419,6 @@
 /* Support DRI extension */
 #undef XF86DRI
 
-#undef XEPHYR_DRI
-
 /* Build DRI2 extension */
 #undef DRI2
 
commit 6a9f7f28ec455d2879ca1a315ce77c48af49e7f4
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Wed Apr 23 17:46:15 2008 +0300

    xephyr: sync with mesa

diff --git a/hw/kdrive/ephyr/GL/internal/dri_interface.h b/hw/kdrive/ephyr/GL/internal/dri_interface.h
deleted file mode 100644
index 8d24e31..0000000
--- a/hw/kdrive/ephyr/GL/internal/dri_interface.h
+++ /dev/null
@@ -1,517 +0,0 @@
-/*
- * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file dri_interface.h
- *
- * This file contains all the types and functions that define the interface
- * between a DRI driver and driver loader.  Currently, the most common driver
- * loader is the XFree86 libGL.so.  However, other loaders do exist, and in
- * the future the server-side libglx.a will also be a loader.
- * 
- * \author Kevin E. Martin <kevin at precisioninsight.com>
- * \author Ian Romanick <idr at us.ibm.com>
- */
-
-#ifndef DRI_INTERFACE_H
-#define DRI_INTERFACE_H
-
-#include <GL/internal/glcore.h>
-#include <drm.h>
-
-/**
- * \name DRI interface structures
- *
- * The following structures define the interface between the GLX client
- * side library and the DRI (direct rendering infrastructure).
- */
-/*@{*/
-typedef struct __DRIdisplayRec  __DRIdisplay;
-typedef struct __DRIscreenRec   __DRIscreen;
-typedef struct __DRIcontextRec  __DRIcontext;
-typedef struct __DRIdrawableRec __DRIdrawable;
-typedef struct __DRIdriverRec   __DRIdriver;
-typedef struct __DRIframebufferRec __DRIframebuffer;
-typedef struct __DRIversionRec     __DRIversion;
-typedef struct __DRIinterfaceMethodsRec  __DRIinterfaceMethods;
-typedef unsigned long __DRIid;
-typedef void __DRInativeDisplay;
-/*@}*/
-
-
-/**
- * \name Functions provided by the driver loader.
- */
-/*@{*/
-/**
- * Type of a pointer to \c glXGetScreenDriver, as returned by
- * \c glXGetProcAddress.  This function is used to get the name of the DRI
- * driver for the specified screen of the specified display.  The driver
- * name is typically used with \c glXGetDriverConfig.
- *
- * \sa glXGetScreenDriver, glXGetProcAddress, glXGetDriverConfig
- */
-typedef const char * (* PFNGLXGETSCREENDRIVERPROC) (__DRInativeDisplay *dpy, int scrNum);
-
-/**
- * Type of a pointer to \c glXGetDriverConfig, as returned by
- * \c glXGetProcAddress.  This function is used to get the XML document
- * describing the configuration options available for the specified driver.
- *
- * \sa glXGetDriverConfig, glXGetProcAddress, glXGetScreenDriver
- */
-typedef const char * (* PFNGLXGETDRIVERCONFIGPROC) (const char *driverName);
-
-/**
- * Type of a pointer to \c glxEnableExtension, as returned by
- * \c __DRIinterfaceMethods::getProcAddress.  This function is used to enable
- * a GLX extension on the specified screen.
- */
-typedef void (* PFNGLXSCRENABLEEXTENSIONPROC) ( void *psc, const char * name );
-/*@}*/
-
-
-/**
- * \name Functions and data provided by the driver.
- */
-/*@{*/
-
-typedef void *(CREATENEWSCREENFUNC)(__DRInativeDisplay *dpy, int scrn,
-    __DRIscreen *psc, const __GLcontextModes * modes,
-    const __DRIversion * ddx_version, const __DRIversion * dri_version,
-    const __DRIversion * drm_version, const __DRIframebuffer * frame_buffer,
-    void * pSAREA, int fd, int internal_api_version,
-    const __DRIinterfaceMethods * interface,
-    __GLcontextModes ** driver_modes);
-typedef CREATENEWSCREENFUNC* PFNCREATENEWSCREENFUNC;
-extern CREATENEWSCREENFUNC __driCreateNewScreen_20050727;
-
-
-/**
- * XML document describing the configuration options supported by the
- * driver.
- */
-extern const char __driConfigOptions[];
-
-/*@}*/
-
-
-/**
- * Stored version of some component (i.e., server-side DRI module, kernel-side
- * DRM, etc.).
- * 
- * \todo
- * There are several data structures that explicitly store a major version,
- * minor version, and patch level.  These structures should be modified to
- * have a \c __DRIversionRec instead.
- */
-struct __DRIversionRec {
-    int    major;        /**< Major version number. */
-    int    minor;        /**< Minor version number. */
-    int    patch;        /**< Patch-level. */
-};
-
-
-typedef void (*__DRIfuncPtr)(void);
-
-struct __DRIinterfaceMethodsRec {
-    /**
-     * Get pointer to named function.
-     */
-    __DRIfuncPtr (*getProcAddress)( const char * proc_name );
-
-    /**
-     * Create a list of \c __GLcontextModes structures.
-     */
-    __GLcontextModes * (*createContextModes)(unsigned count,
-        size_t minimum_bytes_per_struct);
-
-    /**
-     * Destroy a list of \c __GLcontextModes structures.
-     *
-     * \todo
-     * Determine if the drivers actually need to call this.
-     */
-    void (*destroyContextModes)( __GLcontextModes * modes );
-
-    /**
-     * Get the \c __DRIscreen for a given display and screen number.
-     */
-    __DRIscreen *(*getScreen)(__DRInativeDisplay *dpy, int screenNum);
-
-
-    /**
-     * \name Client/server protocol functions.
-     *
-     * These functions implement the DRI client/server protocol for
-     * context and drawable operations.  Platforms that do not implement
-     * the wire protocol (e.g., EGL) will implement glorified no-op functions.
-     */
-    /*@{*/
-    /**
-     * Determine if the specified window ID still exists.
-     * 
-     * \note
-     * Implementations may assume that the driver will only pass an ID into
-     * this function that actually corresponds to a window.  On
-     * implementations where windows can only be destroyed by the DRI driver
-     * (e.g., EGL), this function is allowed to always return \c GL_TRUE.
-     */
-    GLboolean (*windowExists)(__DRInativeDisplay *dpy, __DRIid draw);
-
-    /**
-     * Create the server-side portion of the GL context.
-     */
-    GLboolean (* createContext)( __DRInativeDisplay *dpy, int screenNum,
-        int configID, void * contextID, drm_context_t * hw_context );
-
-    /**
-     * Destroy the server-side portion of the GL context.
-     */
-    GLboolean (* destroyContext)( __DRInativeDisplay *dpy, int screenNum,
-        __DRIid context );
-
-    /**
-     * Create the server-side portion of the drawable.
-     */
-    GLboolean (*createDrawable)( __DRInativeDisplay * ndpy, int screen,
-        __DRIid drawable, drm_drawable_t * hHWDrawable );
-
-    /**
-     * Destroy the server-side portion of the drawable.
-     */
-    GLboolean (*destroyDrawable)( __DRInativeDisplay * ndpy, int screen,
-        __DRIid drawable );
-
-    /**
-     * This function is used to get information about the position, size, and
-     * clip rects of a drawable.
-     */
-    GLboolean (* getDrawableInfo) ( __DRInativeDisplay *dpy, int scrn,
-        __DRIid draw, unsigned int * index, unsigned int * stamp,
-        int * x, int * y, int * width, int * height,
-        int * numClipRects, drm_clip_rect_t ** pClipRects,
-        int * backX, int * backY,
-        int * numBackClipRects, drm_clip_rect_t ** pBackClipRects );
-    /*@}*/
-
-
-    /**
-     * \name Timing related functions.
-     */
-    /*@{*/
-    /**
-     * Get the 64-bit unadjusted system time (UST).
-     */
-    int (*getUST)(int64_t * ust);
-
-    /**
-     * Get the media stream counter (MSC) rate.
-     * 
-     * Matching the definition in GLX_OML_sync_control, this function returns
-     * the rate of the "media stream counter".  In practical terms, this is
-     * the frame refresh rate of the display.
-     */
-    GLboolean (*getMSCRate)(__DRInativeDisplay * dpy, __DRIid drawable,
-        int32_t * numerator, int32_t * denominator);
-    /*@}*/
-
-    /**
-     * Reports areas of the given drawable which have been modified by the
-     * driver.
-     *
-     * \param drawable which the drawing was done to.
-     * \param rects rectangles affected, with the drawable origin as the
-     *	      origin.
-     * \param x X offset of the drawable within the screen (used in the
-     *	      front_buffer case)
-     * \param y Y offset of the drawable within the screen.
-     * \param front_buffer boolean flag for whether the drawing to the
-     * 	      drawable was actually done directly to the front buffer (instead
-     *	      of backing storage, for example)
-     */
-    void (*reportDamage)(__DRInativeDisplay * dpy, int screen,
-			 __DRIid drawable,
-			 int x, int y,
-			 drm_clip_rect_t *rects, int num_rects,
-			 int front_buffer);
-};
-
-   
-/**
- * Framebuffer information record.  Used by libGL to communicate information
- * about the framebuffer to the driver's \c __driCreateNewScreen function.
- * 
- * In XFree86, most of this information is derrived from data returned by
- * calling \c XF86DRIGetDeviceInfo.
- *
- * \sa XF86DRIGetDeviceInfo __DRIdisplayRec::createNewScreen
- *     __driUtilCreateNewScreen CallCreateNewScreen
- *
- * \bug This structure could be better named.
- */
-struct __DRIframebufferRec {
-    unsigned char *base;    /**< Framebuffer base address in the CPU's
-			     * address space.  This value is calculated by
-			     * calling \c drmMap on the framebuffer handle
-			     * returned by \c XF86DRIGetDeviceInfo (or a
-			     * similar function).
-			     */
-    int size;               /**< Framebuffer size, in bytes. */
-    int stride;             /**< Number of bytes from one line to the next. */
-    int width;              /**< Pixel width of the framebuffer. */
-    int height;             /**< Pixel height of the framebuffer. */
-    int dev_priv_size;      /**< Size of the driver's dev-priv structure. */
-    void *dev_priv;         /**< Pointer to the driver's dev-priv structure. */
-};
-
-
-/**
- * Screen dependent methods.  This structure is initialized during the
- * \c __DRIdisplayRec::createScreen call.
- */
-struct __DRIscreenRec {
-    /**
-     * Method to destroy the private DRI screen data.
-     */
-    void (*destroyScreen)(__DRInativeDisplay *dpy, int scrn, void *screenPrivate);
-
-    /**
-     * Method to create the private DRI drawable data and initialize the
-     * drawable dependent methods.
-     */
-    void *(*createNewDrawable)(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
-			       __DRIid draw, __DRIdrawable *pdraw,
-			       int renderType, const int *attrs);
-
-    /**
-     * Method to return a pointer to the DRI drawable data.
-     */
-    __DRIdrawable *(*getDrawable)(__DRInativeDisplay *dpy, __DRIid draw,
-				  void *drawablePrivate);
-
-    /**
-     * Opaque pointer to private per screen direct rendering data.  \c NULL
-     * if direct rendering is not supported on this screen.  Never
-     * dereferenced in libGL.
-     */
-    void *private;
-
-    /**
-     * Get the number of vertical refreshes since some point in time before
-     * this function was first called (i.e., system start up).
-     * 
-     * \since Internal API version 20030317.
-     */
-    int (*getMSC)( void *screenPrivate, int64_t *msc );
-
-    /**
-     * Opaque pointer that points back to the containing 
-     * \c __GLXscreenConfigs.  This data structure is shared with DRI drivers
-     * but \c __GLXscreenConfigs is not. However, they are needed by some GLX
-     * functions called by DRI drivers.
-     *
-     * \since Internal API version 20030813.
-     */
-    void *screenConfigs;
-
-    /**
-     * Functions associated with MESA_allocate_memory.
-     *
-     * \since Internal API version 20030815.
-     */
-    /*@{*/
-    void *(*allocateMemory)(__DRInativeDisplay *dpy, int scrn, GLsizei size,
-			    GLfloat readfreq, GLfloat writefreq,
-			    GLfloat priority);
-   
-    void (*freeMemory)(__DRInativeDisplay *dpy, int scrn, GLvoid *pointer);
-   
-    GLuint (*memoryOffset)(__DRInativeDisplay *dpy, int scrn, const GLvoid *pointer);
-    /*@}*/
-
-    /**
-     * Method to create the private DRI context data and initialize the
-     * context dependent methods.
-     *
-     * \since Internal API version 20031201.
-     */
-    void * (*createNewContext)(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
-			       int render_type,
-			       void *sharedPrivate, __DRIcontext *pctx);
-
-    /**
-     * Method to override base texture image with a driver specific 'offset'.
-     * The depth passed in allows e.g. to ignore the alpha channel of texture
-     * images where the non-alpha components don't occupy a whole texel.
-     *
-     * For GLX_EXT_texture_from_pixmap with AIGLX.
-     *
-     * \since Internal API version 20070121.
-     */
-    void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname,
-			 unsigned long long offset, GLint depth, GLuint pitch);
-};
-
-/**
- * Context dependent methods.  This structure is initialized during the
- * \c __DRIscreenRec::createContext call.
- */
-struct __DRIcontextRec {
-    /**
-     * Method to destroy the private DRI context data.
-     */
-    void (*destroyContext)(__DRInativeDisplay *dpy, int scrn, void *contextPrivate);
-
-    /**
-     * Opaque pointer to private per context direct rendering data.
-     * \c NULL if direct rendering is not supported on the display or
-     * screen used to create this context.  Never dereferenced in libGL.
-     */
-    void *private;
-
-    /**
-     * Pointer to the mode used to create this context.
-     *
-     * \since Internal API version 20040317.
-     */
-    const __GLcontextModes * mode;
-
-    /**
-     * Method to bind a DRI drawable to a DRI graphics context.
-     *
-     * \since Internal API version 20050727.
-     */
-    GLboolean (*bindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
-			 __DRIid read, __DRIcontext *ctx);
-
-    /**
-     * Method to unbind a DRI drawable from a DRI graphics context.
-     *
-     * \since Internal API version 20050727.
-     */
-    GLboolean (*unbindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
-			   __DRIid read, __DRIcontext *ctx);
-};
-
-/**
- * Drawable dependent methods.  This structure is initialized during the
- * \c __DRIscreenRec::createDrawable call.  \c createDrawable is not called
- * by libGL at this time.  It's currently used via the dri_util.c utility code
- * instead.
- */
-struct __DRIdrawableRec {
-    /**
-     * Method to destroy the private DRI drawable data.
-     */
-    void (*destroyDrawable)(__DRInativeDisplay *dpy, void *drawablePrivate);
-
-    /**
-     * Method to swap the front and back buffers.
-     */
-    void (*swapBuffers)(__DRInativeDisplay *dpy, void *drawablePrivate);
-
-    /**
-     * Opaque pointer to private per drawable direct rendering data.
-     * \c NULL if direct rendering is not supported on the display or
-     * screen used to create this drawable.  Never dereferenced in libGL.
-     */
-    void *private;
-
-    /**
-     * Get the number of completed swap buffers for this drawable.
-     *
-     * \since Internal API version 20030317.
-     */
-    int (*getSBC)(__DRInativeDisplay *dpy, void *drawablePrivate, int64_t *sbc );
-
-    /**
-     * Wait for the SBC to be greater than or equal target_sbc.
-     *
-     * \since Internal API version 20030317.
-     */
-    int (*waitForSBC)( __DRInativeDisplay * dpy, void *drawablePriv,
-		       int64_t target_sbc,
-		       int64_t * msc, int64_t * sbc );
-
-    /**
-     * Wait for the MSC to equal target_msc, or, if that has already passed,
-     * the next time (MSC % divisor) is equal to remainder.  If divisor is
-     * zero, the function will return as soon as MSC is greater than or equal
-     * to target_msc.
-     * 
-     * \since Internal API version 20030317.
-     */
-    int (*waitForMSC)( __DRInativeDisplay * dpy, void *drawablePriv,
-		       int64_t target_msc, int64_t divisor, int64_t remainder,
-		       int64_t * msc, int64_t * sbc );
-
-    /**
-     * Like \c swapBuffers, but does NOT have an implicit \c glFlush.  Once
-     * rendering is complete, waits until MSC is equal to target_msc, or
-     * if that has already passed, waits until (MSC % divisor) is equal
-     * to remainder.  If divisor is zero, the swap will happen as soon as
-     * MSC is greater than or equal to target_msc.
-     * 
-     * \since Internal API version 20030317.
-     */
-    int64_t (*swapBuffersMSC)(__DRInativeDisplay *dpy, void *drawablePrivate,
-			      int64_t target_msc,
-			      int64_t divisor, int64_t remainder);
-
-    /**
-     * Enable or disable frame usage tracking.
-     * 
-     * \since Internal API version 20030317.
-     */
-    int (*frameTracking)(__DRInativeDisplay *dpy, void *drawablePrivate, GLboolean enable);
-
-    /**
-     * Retrieve frame usage information.
-     * 
-     * \since Internal API version 20030317.
-     */
-    int (*queryFrameTracking)(__DRInativeDisplay *dpy, void *drawablePrivate,
-			      int64_t * sbc, int64_t * missedFrames,
-			      float * lastMissedUsage, float * usage );
-
-    /**
-     * Used by drivers that implement the GLX_SGI_swap_control or
-     * GLX_MESA_swap_control extension.
-     *
-     * \since Internal API version 20030317.
-     */
-    unsigned swap_interval;
-
-    /**
-     * Used by drivers that implement the GLX_MESA_copy_sub_buffer extension.
-     *
-     * \since Internal API version 20060314.
-     */
-    void (*copySubBuffer)(__DRInativeDisplay *dpy, void *drawablePrivate,
-			  int x, int y, int w, int h);
-};
-
-#endif
diff --git a/hw/kdrive/ephyr/Makefile.am b/hw/kdrive/ephyr/Makefile.am
index d13bbae..90fd4d8 100644
--- a/hw/kdrive/ephyr/Makefile.am
+++ b/hw/kdrive/ephyr/Makefile.am
@@ -34,6 +34,7 @@ HOSTDRI_SRCS =			\
 	ephyrdri.c		\
 	ephyrdri.h		\
 	XF86dri.c		\
+	xf86dri.h		\
 	ephyrglxext.c		\
 	ephyrglxext.h		\
 	ephyrhostglx.c		\
diff --git a/hw/kdrive/ephyr/XF86dri.c b/hw/kdrive/ephyr/XF86dri.c
index e656ff5..a5fc9bd 100644
--- a/hw/kdrive/ephyr/XF86dri.c
+++ b/hw/kdrive/ephyr/XF86dri.c
@@ -55,9 +55,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include <X11/extensions/Xext.h>
 #include <X11/extensions/extutil.h>
 #include <GL/glx.h>
-#include <X11/dri/xf86dri.h>
+#include "xf86dri.h"
 #include <X11/dri/xf86dristr.h>
-#include "GL/internal/dri_interface.h"
 
 static XExtensionInfo _xf86dri_info_data;
 static XExtensionInfo *xf86dri_info = &_xf86dri_info_data;
diff --git a/hw/kdrive/ephyr/ephyrdri.c b/hw/kdrive/ephyr/ephyrdri.c
index 53a96ba..bb4f6a1 100644
--- a/hw/kdrive/ephyr/ephyrdri.c
+++ b/hw/kdrive/ephyr/ephyrdri.c
@@ -35,7 +35,7 @@
 #include <X11/Xlibint.h>
 /*#define _XF86DRI_SERVER_*/
 #include <GL/glx.h>
-#include <X11/dri/xf86dri.h>
+#include "xf86dri.h"
 #include "hostx.h"
 #include "ephyrdri.h"
 #define _HAVE_XALLOC_DECLS
diff --git a/hw/kdrive/ephyr/xf86dri.h b/hw/kdrive/ephyr/xf86dri.h
new file mode 100644
index 0000000..cd650b5
--- /dev/null
+++ b/hw/kdrive/ephyr/xf86dri.h
@@ -0,0 +1,120 @@
+/* $XFree86: xc/lib/GL/dri/xf86dri.h,v 1.8 2002/10/30 12:51:25 alanh Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+Copyright 2000 VA Linux Systems, Inc.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/**
+ * \file xf86dri.h
+ * Protocol numbers and function prototypes for DRI X protocol.
+ *
+ * \author Kevin E. Martin <martin at valinux.com>
+ * \author Jens Owen <jens at tungstengraphics.com>
+ * \author Rickard E. (Rik) Faith <faith at valinux.com>
+ */
+
+#ifndef _XF86DRI_H_
+#define _XF86DRI_H_
+
+#include <X11/Xfuncproto.h>
+#include <xf86drm.h>
+
+#define X_XF86DRIQueryVersion			0
+#define X_XF86DRIQueryDirectRenderingCapable	1
+#define X_XF86DRIOpenConnection			2
+#define X_XF86DRICloseConnection		3
+#define X_XF86DRIGetClientDriverName		4
+#define X_XF86DRICreateContext			5
+#define X_XF86DRIDestroyContext			6
+#define X_XF86DRICreateDrawable			7
+#define X_XF86DRIDestroyDrawable		8
+#define X_XF86DRIGetDrawableInfo		9
+#define X_XF86DRIGetDeviceInfo			10
+#define X_XF86DRIAuthConnection                 11
+#define X_XF86DRIOpenFullScreen                 12   /* Deprecated */
+#define X_XF86DRICloseFullScreen                13   /* Deprecated */
+
+#define XF86DRINumberEvents		0
+
+#define XF86DRIClientNotLocal		0
+#define XF86DRIOperationNotSupported	1
+#define XF86DRINumberErrors		(XF86DRIOperationNotSupported + 1)
+
+#ifndef _XF86DRI_SERVER_
+
+_XFUNCPROTOBEGIN
+
+Bool XF86DRIQueryExtension( Display *dpy, int *event_base, int *error_base );
+
+Bool XF86DRIQueryVersion( Display *dpy, int *majorVersion, int *minorVersion,
+    int *patchVersion );
+
+Bool XF86DRIQueryDirectRenderingCapable( Display *dpy, int screen,
+    Bool *isCapable );
+
+Bool XF86DRIOpenConnection( Display *dpy, int screen, drm_handle_t *hSAREA,
+    char **busIDString );
+
+Bool XF86DRIAuthConnection( Display *dpy, int screen, drm_magic_t magic );
+
+Bool XF86DRICloseConnection( Display *dpy, int screen );
+
+Bool XF86DRIGetClientDriverName( Display *dpy, int screen,
+    int *ddxDriverMajorVersion, int *ddxDriverMinorVersion,
+    int *ddxDriverPatchVersion, char **clientDriverName );
+
+Bool XF86DRICreateContext( Display *dpy, int screen, Visual *visual,
+    XID *ptr_to_returned_context_id, drm_context_t *hHWContext );
+
+Bool XF86DRICreateContextWithConfig( Display *dpy, int screen, int configID,
+    XID *ptr_to_returned_context_id, drm_context_t *hHWContext );
+
+extern GLboolean XF86DRIDestroyContext( Display *dpy, int screen,
+    XID context_id );
+
+extern GLboolean XF86DRICreateDrawable( Display *dpy, int screen,
+    XID drawable, drm_drawable_t *hHWDrawable );
+
+extern GLboolean XF86DRIDestroyDrawable( Display *dpy, int screen, 
+    XID drawable);
+
+Bool XF86DRIGetDrawableInfo( Display *dpy, int screen, Drawable drawable,
+    unsigned int *index, unsigned int *stamp, 
+    int *X, int *Y, int *W, int *H,
+    int *numClipRects, drm_clip_rect_t ** pClipRects,
+    int *backX, int *backY,
+    int *numBackClipRects, drm_clip_rect_t **pBackClipRects );
+
+Bool XF86DRIGetDeviceInfo( Display *dpy, int screen,
+    drm_handle_t *hFrameBuffer, int *fbOrigin, int *fbSize,
+    int *fbStride, int *devPrivateSize, void **pDevPrivate );
+
+_XFUNCPROTOEND
+
+#endif /* _XF86DRI_SERVER_ */
+
+#endif /* _XF86DRI_H_ */
+
commit 7ffc68c5cc7108c9e56af25f9f9b4398f5b027df
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Wed Apr 23 17:45:54 2008 +0300

    xephyr: libGL is client lib

diff --git a/configure.ac b/configure.ac
index c1c10f7..21c1d91 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1917,6 +1917,10 @@ if test "$KDRIVE" = yes; then
     if test "x$XV" = xyes; then
         XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xv"
     fi
+    if test "x$DRI" = xyes && test "x$GLX" = xyes; then
+        XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS gl libdrm"
+    fi
+
     PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS, [xephyr="yes"], [xephyr="no"])
     if test "x$XEPHYR" = xauto; then
         XEPHYR=$xephyr
@@ -1924,10 +1928,6 @@ if test "$KDRIVE" = yes; then
     XEPHYR_DRI=no
     if test x$XEPHYR = xyes -a x$DRI = xyes && test "x$GLX" = xyes; then
         XEPHYR_DRI=yes
-        XEPHYR_DRI_LIBS=-lGL
-        AC_SUBST(XEPHYR_DRI_LIBS)
-    fi
-    if test x$XEPHYR_DRI = xyes ; then
         AC_DEFINE(XEPHYR_DRI,1,[enable DRI extension in xephyr])
     fi
 
@@ -1965,9 +1965,6 @@ if test "$KDRIVE" = yes; then
     KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB $OS_LIB"
     KDRIVE_LIBS="$TSLIB_LIBS $KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS"
 
-    # check if we can build Xephyr
-    PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS, [xephyr="yes"], [xephyr="no"])
-
     AC_SUBST([XEPHYR_LIBS])
     AC_SUBST([XEPHYR_INCS])
     AC_SUBST([XSDL_LIBS])
diff --git a/hw/kdrive/ephyr/Makefile.am b/hw/kdrive/ephyr/Makefile.am
index dc0144a..d13bbae 100644
--- a/hw/kdrive/ephyr/Makefile.am
+++ b/hw/kdrive/ephyr/Makefile.am
@@ -2,15 +2,11 @@ INCLUDES = 			\
 	@KDRIVE_INCS@		\
 	@KDRIVE_CFLAGS@		\
 	@XEPHYR_INCS@		\
+	@XEPHYR_CFLAGS@		\
+	@DRIPROTO_CFLAGS@	\
 	-I$(top_srcdir)		\
 	-I$(top_srcdir)/exa
 
-if XEPHYR_HAS_DRI
-INCLUDES +=			\
-	@LIBDRM_CFLAGS@		\
-	@DRIPROTO_CFLAGS@
-endif
-
 if XV
 LIBXEPHYR_HOSTXV=libxephyr-hostxv.a
 endif
@@ -76,9 +72,7 @@ Xephyr_LDADD = 						\
 	$(LIBXEPHYR_HOSTDRI)				\
 	$(top_builddir)/exa/libexa.la			\
 	@KDRIVE_LIBS@					\
-	@XEPHYR_LIBS@ 					\
-	@LIBDRM_LIBS@					\
-	@XEPHYR_DRI_LIBS@
+	@XEPHYR_LIBS@
 
 Xephyr_DEPENDENCIES =	\
 	libxephyr.a					\
commit a27c244d72603e27766ff3900ab28fe094f7397e
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Wed Apr 23 17:45:37 2008 +0300

    xephyr: Makefile cleanup 2

diff --git a/hw/kdrive/ephyr/Makefile.am b/hw/kdrive/ephyr/Makefile.am
index f0182d5..dc0144a 100644
--- a/hw/kdrive/ephyr/Makefile.am
+++ b/hw/kdrive/ephyr/Makefile.am
@@ -23,19 +23,16 @@ noinst_LIBRARIES = libxephyr-hostx.a $(LIBXEPHYR_HOSTXV) $(LIBXEPHYR_HOSTDRI) li
 
 bin_PROGRAMS = Xephyr
 
-libxephyr_hostx_a_SOURCES =	\
+HOSTX_SRCS =			\
 	hostx.c			\
 	hostx.h
 
-if XV
-libxephyr_hostxv_a_SOURCES=	\
+HOSTVIDEO_SRCS =		\
 	ephyrvideo.c		\
 	ephyrhostvideo.c	\
 	ephyrhostvideo.h
-endif
 
-if XEPHYR_HAS_DRI
-libxephyr_hostdri_a_SOURCES=	\
+HOSTDRI_SRCS =			\
 	ephyrdriext.c		\
 	ephyrdriext.h		\
 	ephyrdri.c		\
@@ -45,15 +42,26 @@ libxephyr_hostdri_a_SOURCES=	\
 	ephyrglxext.h		\
 	ephyrhostglx.c		\
 	ephyrhostglx.h
-endif
 
-libxephyr_a_SOURCES =		\
+XEPHYR_SRCS =			\
 	ephyr.c			\
 	ephyr.h			\
 	ephyrlog.h		\
 	ephyr_draw.c		\
 	os.c
 
+libxephyr_hostx_a_SOURCES = $(HOSTX_SRCS)
+
+if XV
+libxephyr_hostxv_a_SOURCES = $(HOSTVIDEO_SRCS)
+endif
+
+if XEPHYR_HAS_DRI
+libxephyr_hostdri_a_SOURCES = $(HOSTDRI_SRCS)
+endif
+
+libxephyr_a_SOURCES = $(XEPHYR_SRCS)
+
 Xephyr_SOURCES = \
 	ephyrinit.c
 
@@ -81,3 +89,7 @@ Xephyr_DEPENDENCIES =	\
 
 relink:
 	rm -f $(bin_PROGRAMS) && make $(bin_PROGRAMS)
+
+EXTRA_DIST = \
+	$(HOSTVIDEO_SRCS) \
+	$(HOSTDRI_SRCS)
commit d4d19b2f22002b1579438cb9cf08dd580c7ec005
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Wed Apr 23 17:45:19 2008 +0300

    xephyr: Makefile cleanup 1

diff --git a/hw/kdrive/ephyr/Makefile.am b/hw/kdrive/ephyr/Makefile.am
index 7ef22a3..f0182d5 100644
--- a/hw/kdrive/ephyr/Makefile.am
+++ b/hw/kdrive/ephyr/Makefile.am
@@ -1,68 +1,58 @@
-INCLUDES = 					\
-	@KDRIVE_INCS@				\
-	@KDRIVE_CFLAGS@				\
-	-I$(srcdir)/../../../exa
+INCLUDES = 			\
+	@KDRIVE_INCS@		\
+	@KDRIVE_CFLAGS@		\
+	@XEPHYR_INCS@		\
+	-I$(top_srcdir)		\
+	-I$(top_srcdir)/exa
+
+if XEPHYR_HAS_DRI
+INCLUDES +=			\
+	@LIBDRM_CFLAGS@		\
+	@DRIPROTO_CFLAGS@
+endif
 
 if XV
-    LIBXEPHYR_HOSTXV=libxephyr-hostxv.a
-else
-    LIBXEPHYR_HOSTXV=
+LIBXEPHYR_HOSTXV=libxephyr-hostxv.a
 endif
 
 if XEPHYR_HAS_DRI
-    LIBXEPHYR_HOSTDRI=libxephyr-hostdri.a
-else
-    LIBXEPHYR_HOSTDRI=
+LIBXEPHYR_HOSTDRI=libxephyr-hostdri.a
 endif
 
 noinst_LIBRARIES = libxephyr-hostx.a $(LIBXEPHYR_HOSTXV) $(LIBXEPHYR_HOSTDRI) libxephyr.a
 
 bin_PROGRAMS = Xephyr
 
-libxephyr_hostx_a_SOURCES =                             \
-	hostx.c                                         \
+libxephyr_hostx_a_SOURCES =	\
+	hostx.c			\
 	hostx.h
 
-libxephyr_hostxv_a_INCLUDES = @XEPHYR_INCS@
-
 if XV
-libxephyr_hostxv_a_SOURCES=				\
-	ephyrhostvideo.c \
+libxephyr_hostxv_a_SOURCES=	\
+	ephyrvideo.c		\
+	ephyrhostvideo.c	\
 	ephyrhostvideo.h
 endif
 
 if XEPHYR_HAS_DRI
-
-libxephyr_hostdri_a_SOURCES= \
-ephyrdriext.c	\
-ephyrdriext.h	\
-ephyrdri.c	\
-ephyrdri.h	\
-XF86dri.c	\
-ephyrglxext.c	\
-ephyrglxext.h	\
-ephyrhostglx.c	\
-ephyrhostglx.h	
-
-libxephyr_hostdri_a_CFLAGS= \
--I$(top_srcdir)		\
- at LIBDRM_CFLAGS@ 	\
- at DRIPROTO_CFLAGS@
-
+libxephyr_hostdri_a_SOURCES=	\
+	ephyrdriext.c		\
+	ephyrdriext.h		\
+	ephyrdri.c		\
+	ephyrdri.h		\
+	XF86dri.c		\
+	ephyrglxext.c		\
+	ephyrglxext.h		\
+	ephyrhostglx.c		\
+	ephyrhostglx.h
 endif
 
-libxephyr_a_SOURCES =	\
-	ephyr.c		\
-	ephyr_draw.c	\
-	ephyrvideo.c	\
-	os.c		\
-	hostx.h         \
-	ephyr.h		\
-	ephyrlog.h
-
-libxephyr_a_CFLAGS = \
--I$(top_srcdir) \
- at LIBDRM_CFLAGS@
+libxephyr_a_SOURCES =		\
+	ephyr.c			\
+	ephyr.h			\
+	ephyrlog.h		\
+	ephyr_draw.c		\
+	os.c
 
 Xephyr_SOURCES = \
 	ephyrinit.c
@@ -73,18 +63,18 @@ endif
 
 Xephyr_LDADD = 						\
 	libxephyr.a					\
-	libxephyr-hostx.a			        \
+	libxephyr-hostx.a				\
 	$(LIBXEPHYR_HOSTXV)				\
 	$(LIBXEPHYR_HOSTDRI)				\
-	../../../exa/libexa.la				\
+	$(top_builddir)/exa/libexa.la			\
 	@KDRIVE_LIBS@					\
-        @XEPHYR_LIBS@ 					\
+	@XEPHYR_LIBS@ 					\
 	@LIBDRM_LIBS@					\
 	@XEPHYR_DRI_LIBS@
 
 Xephyr_DEPENDENCIES =	\
 	libxephyr.a					\
-	libxephyr-hostx.a			        \
+	libxephyr-hostx.a				\
 	$(LIBXEPHYR_HOSTXV)				\
 	$(LIBXEPHYR_HOSTDRI)				\
 	@KDRIVE_LOCAL_LIBS@
commit cdc4571b580a8f4fd279404215bff0fb9a5b4816
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Sun Apr 20 17:06:26 2008 +0300

    drop TOGCUP remnants

diff --git a/configure.ac b/configure.ac
index aba4619..c1c10f7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -547,7 +547,6 @@ AC_ARG_ENABLE(xcsecurity,     AS_HELP_STRING([--disable-xcsecurity], [Build Secu
 AC_ARG_ENABLE(xcalibrate,     AS_HELP_STRING([--enable-xcalibrate], [Build XCalibrate extension (default: disabled)]), [XCALIBRATE=$enableval], [XCALIBRATE=no])
 AC_ARG_ENABLE(tslib,          AS_HELP_STRING([--enable-tslib], [Build kdrive tslib touchscreen support (default: disabled)]), [TSLIB=$enableval], [TSLIB=no])
 AC_ARG_ENABLE(xevie,          AS_HELP_STRING([--disable-xevie], [Build XEvIE extension (default: enabled)]), [XEVIE=$enableval], [XEVIE=yes])
-AC_ARG_ENABLE(cup,            AS_HELP_STRING([--disable-cup], [Build TOG-CUP extension (default: enabled)]), [CUP=$enableval], [CUP=yes])
 AC_ARG_ENABLE(multibuffer,    AS_HELP_STRING([--enable-multibuffer], [Build Multibuffer extension (default: disabled)]), [MULTIBUFFER=$enableval], [MULTIBUFFER=no])
 AC_ARG_ENABLE(fontcache,      AS_HELP_STRING([--enable-fontcache], [Build FontCache extension (default: disabled)]), [FONTCACHE=$enableval], [FONTCACHE=no])
 AC_ARG_ENABLE(dbe,            AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes])
@@ -930,12 +929,6 @@ if test "x$XEVIE" = xyes; then
 	REQUIRED_MODULES="$REQUIRED_MODULES evieproto"
 fi
 
-AM_CONDITIONAL(CUP, [test "x$CUP" = xyes])
-if test "x$CUP" = xyes; then
-	AC_DEFINE(TOGCUP, 1, [Build TOG-CUP extension])
-	# Requires xextproto which is always required
-fi
-
 AM_CONDITIONAL(MULTIBUFFER, [test "x$MULTIBUFFER" = xyes])
 if test "x$MULTIBUFFER" = xyes; then
 	AC_DEFINE(MULTIBUFFER, 1, [Build Multibuffer extension])
commit 6cd9287aed3c128d9c10b9b042ba7b864143d522
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Sun Apr 20 16:58:51 2008 +0300

    drop EVI remnants

diff --git a/Xext/EVIstruct.h b/Xext/EVIstruct.h
deleted file mode 100644
index e658190..0000000
--- a/Xext/EVIstruct.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/************************************************************
-Copyright (c) 1997 by Silicon Graphics Computer Systems, Inc.
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-********************************************************/
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef EVI_STRUCT_H
-#define EVI_STRUCT_H
-
-/*
- ******************************************************************************
- ** Per-ddx data
- ******************************************************************************
- */
-
-typedef int (*GetVisualInfoProc)(
-	VisualID32*,
-	int,
-	xExtendedVisualInfo**,
-	int*,
-	VisualID32**,
-	int*
-);
-
-typedef void (*FreeVisualInfoProc)(
-    xExtendedVisualInfo*,
-    VisualID32*
-);
-typedef struct _EviPrivRec {
-    GetVisualInfoProc getVisualInfo;
-    FreeVisualInfoProc freeVisualInfo;
-} EviPrivRec, *EviPrivPtr;
-
-extern EviPrivPtr eviDDXInit(void);
-extern void eviDDXReset(void);
-
-#endif /* EVI_STRUCT_H */
commit a88c6b66465c039bf92a54a496516fee4d900784
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Fri Apr 18 17:47:16 2008 +0300

    glcore: drop GLcore (files)

diff --git a/GL/mesa/.gitignore b/GL/mesa/.gitignore
deleted file mode 100644
index 6b92b24..0000000
--- a/GL/mesa/.gitignore
+++ /dev/null
@@ -1,32 +0,0 @@
-X/drivers
-X/glxheader.h
-X/xm*.h
-X/xm*.c
-mesa/drivers
-mesa/glxheader.h
-mesa/xm*.c
-glapi/*.c
-glapi/*.h
-main/*.c
-main/*.h
-math/*.c
-math/*.h
-ppc
-shader/*.c
-shader/*.h
-shader/slang/*.c
-shader/slang/*.h
-shader/slang/library
-shader/grammar/*.c
-shader/grammar/*.h
-sparc
-swrast/*.c
-swrast/*.h
-swrast_setup/*.c
-swrast_setup/*.h
-tnl/*.c
-tnl/*.h
-x86
-x86-64
-vbo/*.c
-vbo/*.h
diff --git a/GL/mesa/Makefile.am b/GL/mesa/Makefile.am
deleted file mode 100644
index 7f27c58..0000000
--- a/GL/mesa/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@
-SUBDIRS = X
-SUBDIRS += main math swrast swrast_setup tnl shader glapi vbo
-
-noinst_LTLIBRARIES = libGLcore.la
-
-libGLcore_la_SOURCES = dummy.c
-MESA_LIBS           = main/libmain.la \
-                      math/libmath.la \
-                      swrast/libswrast.la \
-                      swrast_setup/libss.la \
-                      tnl/libtnl.la \
-                      shader/libshader.la \
-		      shader/grammar/libgrammar.la \
-		      shader/slang/libslang.la \
-                      vbo/libvbo.la
-
-libGLcore_la_LIBADD = $(MESA_LIBS) \
-                      X/libX.la
diff --git a/GL/mesa/X/Makefile.am b/GL/mesa/X/Makefile.am
deleted file mode 100644
index d8abbc6..0000000
--- a/GL/mesa/X/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-noinst_LTLIBRARIES = libX.la
-
-INCLUDES = -I at MESA_SOURCE@/include \
-           -I. \
-           -I at MESA_SOURCE@/src/mesa/glapi \
-           -I at MESA_SOURCE@/src/mesa/main \
-           -I at MESA_SOURCE@/src/mesa
-
-# -DXFree86Server is required because the X11 driver in Mesa thinks that
-# symbol means "being built in the server"
-AM_CFLAGS = \
-	$(DIX_CFLAGS) \
-	-DXFree86Server \
-	@GLX_DEFINES@
-
-XM_SOURCES = \
-	xm_api.c \
-	xm_buffer.c \
-	xm_dd.c \
-	xm_image.c \
-	xm_line.c \
-	xm_span.c \
-	xm_tri.c
-
-XM_SOURCES += drivers/common/driverfuncs.c
-
-nodist_libX_la_SOURCES = $(XM_SOURCES)
diff --git a/GL/mesa/dummy.c b/GL/mesa/dummy.c
deleted file mode 100644
index e69de29..0000000
diff --git a/GL/mesa/glapi/Makefile.am b/GL/mesa/glapi/Makefile.am
deleted file mode 100644
index db79114..0000000
--- a/GL/mesa/glapi/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-noinst_LTLIBRARIES = libglapi.la
-
-AM_CFLAGS = \
-	$(DIX_CFLAGS) \
-	-DXFree86Server \
-	@GLX_DEFINES@
-
-INCLUDES = -I at MESA_SOURCE@/include \
-           -I../X \
-           -I../glapi \
-           -I../main \
-           -I../math \
-           -I../shader \
-           -I../swrast \
-           -I../swrast_setup \
-           -I../tnl \
-           -I.. \
-           -I$(top_srcdir)/hw/xfree86/os-support
-
-nodist_libglapi_la_SOURCES = glapi.c glthread.c
diff --git a/GL/mesa/main/Makefile.am b/GL/mesa/main/Makefile.am
deleted file mode 100644
index f8ce137..0000000
--- a/GL/mesa/main/Makefile.am
+++ /dev/null
@@ -1,86 +0,0 @@
-noinst_LTLIBRARIES = libmain.la
-
-AM_CFLAGS = \
-	$(DIX_CFLAGS) \
-	-DXFree86Server \
-	@GLX_DEFINES@
-
-INCLUDES = -I at MESA_SOURCE@/include \
-           -I../X \
-           -I../glapi \
-           -I../main \
-           -I../math \
-           -I../shader \
-           -I../swrast \
-           -I../swrast_setup \
-           -I../tnl \
-           -I.. \
-           -I$(top_srcdir)/hw/xfree86/os-support
-
-if NEED_VSNPRINTF
-VSNPRINTF_SOURCES = vsnprintf.c
-endif
-
-nodist_libmain_la_SOURCES = accum.c \
-                    api_arrayelt.c \
-                    api_loopback.c \
-                    api_noop.c \
-                    api_validate.c \
-                    arrayobj.c \
-                    attrib.c \
-                    blend.c \
-                    bufferobj.c \
-                    buffers.c \
-                    clip.c \
-                    colortab.c \
-                    context.c \
-                    convolve.c \
-                    debug.c \
-                    depth.c \
-		    depthstencil.c \
-                    dlist.c \
-                    drawpix.c \
-                    enable.c \
-                    enums.c \
-                    eval.c \
-                    execmem.c \
-                    extensions.c \
-                    fbobject.c \
-                    feedback.c \
-                    fog.c \
-                    framebuffer.c \
-                    get.c \
-                    getstring.c \
-                    hash.c \
-                    hint.c \
-                    histogram.c \
-                    image.c \
-                    imports.c \
-                    light.c \
-                    lines.c \
-                    matrix.c \
-                    mipmap.c \
-                    mm.c \
-                    pixel.c \
-                    points.c \
-                    polygon.c \
-		    queryobj.c \
-                    rastpos.c \
-                    rbadaptors.c \
-                    renderbuffer.c \
-                    shaders.c \
-                    state.c \
-                    stencil.c \
-                    texcompress.c \
-                    texcompress_fxt1.c \
-                    texcompress_s3tc.c \
-                    texenvprogram.c \
-                    texformat.c \
-                    teximage.c \
-                    texobj.c \
-                    texrender.c \
-                    texstate.c \
-                    texstore.c \
-                    varray.c \
-                    $(VSNPRINTF_SOURCES) \
-                    vtxfmt.c
diff --git a/GL/mesa/math/Makefile.am b/GL/mesa/math/Makefile.am
deleted file mode 100644
index c7c5642..0000000
--- a/GL/mesa/math/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-noinst_LTLIBRARIES = libmath.la
-
-AM_CFLAGS = \
-	$(DIX_CFLAGS) \
-	-DXFree86Server \
-	@GLX_DEFINES@
-
-INCLUDES = -I at MESA_SOURCE@/include \
-           -I../X \
-           -I../glapi \
-           -I../main \
-           -I../math \
-           -I../shader \
-           -I../swrast \
-           -I../swrast_setup \
-           -I../tnl \
-           -I.. \
-           -I$(top_srcdir)/hw/xfree86/os-support
-
-nodist_libmath_la_SOURCES = m_debug_clip.c \
-                       m_debug_norm.c \
-                       m_debug_xform.c \
-                       m_eval.c \
-                       m_matrix.c \
-                       m_translate.c \
-                       m_vector.c \
-                       m_xform.c
diff --git a/GL/mesa/shader/Makefile.am b/GL/mesa/shader/Makefile.am
deleted file mode 100644
index abde275..0000000
--- a/GL/mesa/shader/Makefile.am
+++ /dev/null
@@ -1,39 +0,0 @@
-SUBDIRS = grammar slang
-
-noinst_LTLIBRARIES = libshader.la
-
-AM_CFLAGS = \
-	$(DIX_CFLAGS) \
-	-DXFree86Server \
-	@GLX_DEFINES@
-
-INCLUDES = -I at MESA_SOURCE@/include \
-           -I../X \
-           -I../glapi \
-           -I../main \
-           -I../math \
-           -I../shader \
-	   -I../shader/grammar \
-	   -I../shader/slang \
-           -I../swrast \
-           -I../swrast_setup \
-           -I../tnl \
-           -I.. \
-           -I$(top_srcdir)/hw/xfree86/os-support
-
-nodist_libshader_la_SOURCES = \
-                      arbprogparse.c \
-                      arbprogram.c \
-                      atifragshader.c \
-                      nvfragparse.c \
-                      nvprogram.c \
-                      nvvertparse.c \
-                      prog_debug.c \
-                      prog_execute.c \
-                      prog_instruction.c \
-                      prog_parameter.c \
-                      prog_print.c \
-                      program.c \
-                      programopt.c \
-                      prog_statevars.c \
-                      shader_api.c
diff --git a/GL/mesa/shader/grammar/Makefile.am b/GL/mesa/shader/grammar/Makefile.am
deleted file mode 100644
index 332c8e9..0000000
--- a/GL/mesa/shader/grammar/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-noinst_LTLIBRARIES = libgrammar.la
-
-AM_CFLAGS = \
-	$(DIX_CFLAGS) \
-	-DXFree86Server \
-	@GLX_DEFINES@
-
-INCLUDES = -I at MESA_SOURCE@/include \
-           -I../../X \
-           -I../../glapi \
-           -I../../main \
-           -I../../math \
-           -I../../shader \
-           -I../../swrast \
-           -I../../swrast_setup \
-           -I../../tnl \
-           -I../.. \
-           -I$(top_srcdir)/hw/xfree86/os-support
-
-nodist_libgrammar_la_SOURCES = grammar_mesa.c
diff --git a/GL/mesa/shader/slang/Makefile.am b/GL/mesa/shader/slang/Makefile.am
deleted file mode 100644
index 71498ee..0000000
--- a/GL/mesa/shader/slang/Makefile.am
+++ /dev/null
@@ -1,41 +0,0 @@
-noinst_LTLIBRARIES = libslang.la
-
-AM_CFLAGS = \
-	$(DIX_CFLAGS) \
-	-DXFree86Server \
-	@GLX_DEFINES@
-
-INCLUDES = -I at MESA_SOURCE@/include \
-           -I../grammar \
-           -I../../X \
-           -I../../glapi \
-           -I../../main \
-           -I../../math \
-           -I../../shader \
-           -I../../swrast \
-           -I../../swrast_setup \
-           -I../../tnl \
-           -I../.. \
-           -I$(top_srcdir)/hw/xfree86/os-support
-
-nodist_libslang_la_SOURCES = slang_builtin.c \
-		      slang_codegen.c \
-		      slang_compile.c \
-		      slang_compile_function.c \
-		      slang_compile_operation.c \
-		      slang_compile_struct.c \
-		      slang_compile_variable.c \
-		      slang_emit.c \
-		      slang_ir.c \
-		      slang_label.c \
-		      slang_library_noise.c \
-		      slang_link.c \
-		      slang_log.c \
-		      slang_mem.c \
-		      slang_preprocess.c \
-		      slang_print.c \
-		      slang_simplify.c \
-		      slang_storage.c \
-		      slang_typeinfo.c \
-		      slang_utility.c \
-		      slang_vartable.c
diff --git a/GL/mesa/swrast/Makefile.am b/GL/mesa/swrast/Makefile.am
deleted file mode 100644
index bffb1e7..0000000
--- a/GL/mesa/swrast/Makefile.am
+++ /dev/null
@@ -1,50 +0,0 @@
-noinst_LTLIBRARIES = libswrast.la
-
-AM_CFLAGS = \
-	$(DIX_CFLAGS) \
-	-DXFree86Server \
-	@GLX_DEFINES@
-
-INCLUDES = -I at MESA_SOURCE@/include \
-           -I../X \
-           -I../glapi \
-           -I../main \
-           -I../math \
-           -I../shader \
-           -I../shader/slang \
-	   -I../shader/slang \
-           -I../swrast \
-           -I../swrast_setup \
-           -I../tnl \
-           -I.. \
-           -I$(top_srcdir)/hw/xfree86/os-support
-
-nodist_libswrast_la_SOURCES = s_aaline.c \
-                      s_aatriangle.c \
-                      s_accum.c \
-                      s_alpha.c \
-                      s_atifragshader.c \
-                      s_bitmap.c \
-                      s_blend.c \
-                      s_blit.c \
-                      s_buffers.c \
-                      s_context.c \
-                      s_copypix.c \
-                      s_depth.c \
-                      s_drawpix.c \
-                      s_feedback.c \
-                      s_fog.c \
-		      s_fragprog.c \
-                      s_imaging.c \
-                      s_lines.c \
-                      s_logic.c \
-                      s_masking.c \
-                      s_points.c \
-                      s_readpix.c \
-                      s_span.c \
-                      s_stencil.c \
-		      s_texcombine.c \
-		      s_texfilter.c \
-                      s_texstore.c \
-                      s_triangle.c \
-                      s_zoom.c
diff --git a/GL/mesa/swrast_setup/Makefile.am b/GL/mesa/swrast_setup/Makefile.am
deleted file mode 100644
index 1f3c031..0000000
--- a/GL/mesa/swrast_setup/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-noinst_LTLIBRARIES = libss.la
-
-AM_CFLAGS = \
-	$(DIX_CFLAGS) \
-	-DXFree86Server \
-	@GLX_DEFINES@
-
-INCLUDES = -I at MESA_SOURCE@/include \
-           -I../X \
-           -I../glapi \
-           -I../main \
-           -I../math \
-           -I../shader \
-           -I../swrast \
-           -I../swrast_setup \
-           -I../tnl \
-           -I.. \
-           -I$(top_srcdir)/hw/xfree86/os-support
-
-nodist_libss_la_SOURCES = ss_context.c ss_triangle.c
diff --git a/GL/mesa/tnl/Makefile.am b/GL/mesa/tnl/Makefile.am
deleted file mode 100644
index b3c8206..0000000
--- a/GL/mesa/tnl/Makefile.am
+++ /dev/null
@@ -1,37 +0,0 @@
-noinst_LTLIBRARIES = libtnl.la
-
-AM_CFLAGS = \
-	$(DIX_CFLAGS) \
-	-DXFree86Server \
-	@GLX_DEFINES@
-
-INCLUDES = -I at MESA_SOURCE@/include \
-           -I../X \
-           -I../glapi \
-           -I../main \
-           -I../math \
-           -I../shader \
-           -I../shader/slang \
-           -I../swrast \
-           -I../swrast_setup \
-           -I../tnl \
-           -I.. \
-           -I$(top_srcdir)/hw/xfree86/os-support
-
-nodist_libtnl_la_SOURCES = t_context.c \
-                      t_draw.c \
-                      t_pipeline.c \
-                      t_vb_cull.c \
-                      t_vb_fog.c \
-                      t_vb_light.c \
-                      t_vb_normals.c \
-                      t_vb_points.c \
-                      t_vb_program.c \
-                      t_vb_render.c \
-                      t_vb_texgen.c \
-                      t_vb_texmat.c \
-                      t_vb_vertex.c \
-                      t_vertex.c \
-                      t_vertex_generic.c \
-                      t_vertex_sse.c \
-                      t_vp_build.c
diff --git a/GL/mesa/vbo/Makefile.am b/GL/mesa/vbo/Makefile.am
deleted file mode 100644
index 9943f2a..0000000
--- a/GL/mesa/vbo/Makefile.am
+++ /dev/null
@@ -1,35 +0,0 @@
-noinst_LTLIBRARIES = libvbo.la
-
-AM_CFLAGS = \
-	$(DIX_CFLAGS) \
-	-DXFree86Server \
-	@GLX_DEFINES@
-
-INCLUDES = -I at MESA_SOURCE@/include \
-           -I../X \
-           -I../glapi \
-           -I../main \
-           -I../math \
-           -I../shader \
-           -I../shader/slang \
-	   -I../shader/slang \
-           -I../swrast \
-           -I../swrast_setup \
-           -I../tnl \
-           -I.. \
-           -I$(top_srcdir)/hw/xfree86/os-support
-
-nodist_libvbo_la_SOURCES = vbo_context.c \
-			vbo_exec_api.c \
-			vbo_exec_array.c \
-			vbo_exec.c \
-			vbo_exec_draw.c \
-			vbo_exec_eval.c \
-			vbo_rebase.c \
-			vbo_save_api.c \
-			vbo_save.c \
-			vbo_save_draw.c \
-			vbo_save_loopback.c \
-			vbo_split.c \
-			vbo_split_copy.c \
-			vbo_split_inplace.c
diff --git a/GL/symlink-mesa.sh b/GL/symlink-mesa.sh
index d611fcf..8deaa43 100755
--- a/GL/symlink-mesa.sh
+++ b/GL/symlink-mesa.sh
@@ -58,169 +58,6 @@ main() {
 
 ## actual symlinking
 
-symlink_mesa_glapi() {
-    src_dir src/mesa/glapi
-    dst_dir mesa/glapi
-
-    for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
-        action `basename $src`
-    done
-}
-
-symlink_mesa_main() {
-    src_dir src/mesa/main
-    dst_dir mesa/main
-
-    for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
-        action `basename $src`
-    done
-}
-
-symlink_mesa_math() {
-    src_dir src/mesa/math
-    dst_dir mesa/math
-
-    for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
-        action `basename $src`
-    done
-}
-
-symlink_mesa_swrast() {
-    src_dir src/mesa/swrast
-    dst_dir mesa/swrast
-
-    for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
-        action `basename $src`
-    done
-}
-
-symlink_mesa_ss() {
-    src_dir src/mesa/swrast_setup
-    dst_dir mesa/swrast_setup
-
-    for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
-        action `basename $src`
-    done
-}
-
-symlink_mesa_tnl() {
-    src_dir src/mesa/tnl
-    dst_dir mesa/tnl
-
-    for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
-        action `basename $src`
-    done
-}
-
-symlink_mesa_shader() {
-    src_dir src/mesa/shader
-    dst_dir mesa/shader
-
-    for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
-        action `basename $src`
-    done
-}
-
-symlink_mesa_shader_grammar() {
-    src_dir src/mesa/shader/grammar
-    dst_dir mesa/shader/grammar
-
-    for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
-        action `basename $src`
-    done
-}
-
-symlink_mesa_shader_slang() {
-    src_dir src/mesa/shader/slang
-    dst_dir mesa/shader/slang
-
-    for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
-        action `basename $src`
-    done
-}
-
-symlink_mesa_shader_slang_library() {
-    src_dir src/mesa/shader/slang/library
-    dst_dir mesa/shader/slang/library
-
-    for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
-        action `basename $src`
-    done
-}        
-
-symlink_mesa_vbo() {
-    src_dir src/mesa/vbo
-    dst_dir mesa/vbo
-
-    for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
-        action `basename $src`
-    done
-}
-
-symlink_mesa_x() {
-    src_dir src/mesa/drivers/x11
-    dst_dir mesa/X
-
-    # action glxapi.h
-    action glxheader.h
-    # action realglx.h
-    # action xfonts.h
-    action xm_api.c
-    action xm_buffer.c
-    action xm_dd.c
-    action xm_image.c
-    action xm_image.h
-    action xm_line.c
-    action xm_span.c
-    action xm_tri.c
-    action xmesaP.h
-
-    # another hack
-    src_dir src/mesa/drivers/common
-    dst_dir mesa/X/drivers/common
-    action driverfuncs.c
-    action driverfuncs.h
-}
-
-symlink_mesa_ppc() {
-    src_dir src/mesa/ppc
-    dst_dir mesa/ppc
-}
-
-symlink_mesa_sparc() {
-    src_dir src/mesa/sparc
-    dst_dir mesa/sparc
-}
-
-symlink_mesa_x86() {
-    src_dir src/mesa/x86
-    dst_dir mesa/x86
-}
-
-symlink_mesa_x8664() {
-    src_dir src/mesa/x86-64
-    dst_dir mesa/x86-64
-}
-
-symlink_mesa() {
-    symlink_mesa_main
-    symlink_mesa_math
-    symlink_mesa_swrast
-    symlink_mesa_ss
-    symlink_mesa_tnl
-    symlink_mesa_shader
-    symlink_mesa_shader_grammar
-    symlink_mesa_shader_slang
-    symlink_mesa_shader_slang_library
-    symlink_mesa_x
-    symlink_mesa_glapi
-    symlink_mesa_ppc
-    symlink_mesa_sparc
-    symlink_mesa_vbo
-    symlink_mesa_x86
-    symlink_mesa_x8664
-}
-
 symlink_glx() {
     # this is... unpleasant
     src_dir src/glx/x11
diff --git a/hw/xfree86/dixmods/GLcoremodule.c b/hw/xfree86/dixmods/GLcoremodule.c
deleted file mode 100644
index d55cb78..0000000
--- a/hw/xfree86/dixmods/GLcoremodule.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- *   Kevin E. Martin <kevin at precisioninsight.com>
- *
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(GLcoreSetup);
-
-static XF86ModuleVersionInfo VersRec =
-{
-        "GLcore",
-        MODULEVENDORSTRING,
-        MODINFOSTRING1,
-        MODINFOSTRING2,
-        XORG_VERSION_CURRENT,
-        1, 0, 0,
-        ABI_CLASS_EXTENSION,
-        ABI_EXTENSION_VERSION,
-        MOD_CLASS_NONE,
-        {0,0,0,0}
-};
-
-_X_EXPORT XF86ModuleData GLcoreModuleData = { &VersRec, GLcoreSetup, NULL };
-
-static pointer
-GLcoreSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
-    /* Need a non-NULL return value to indicate success */
-    return (pointer)1;
-}
commit dd7a53f8f21e41e1ab43f7e684ba586abc97ef7e
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Fri Apr 18 17:47:01 2008 +0300

    glcore: drop GLcore (build system)

diff --git a/GL/Makefile.am b/GL/Makefile.am
index 29d03f2..44fca18 100644
--- a/GL/Makefile.am
+++ b/GL/Makefile.am
@@ -2,8 +2,8 @@ if XQUARTZ
 XQUARTZ_SUBDIRS = apple
 endif
 
-SUBDIRS = glx mesa $(XQUARTZ_SUBDIRS)
-DIST_SUBDIRS = glx mesa apple
+SUBDIRS = glx $(XQUARTZ_SUBDIRS)
+DIST_SUBDIRS = glx apple
 
 WINDOWS_EXTRAS = \
 	windows/ChangeLog \
diff --git a/GL/symlink-mesa.sh b/GL/symlink-mesa.sh
index 47afdcd..d611fcf 100755
--- a/GL/symlink-mesa.sh
+++ b/GL/symlink-mesa.sh
@@ -267,7 +267,6 @@ run() {
     # $1 what to do
     # $2 explanation
 
-    ACTION=$1 EXPLANATION=$2 run_module mesa
     ACTION=$1 EXPLANATION=$2 run_module glx
 }
 
diff --git a/configure.ac b/configure.ac
index 5da56b5..aba4619 100644
--- a/configure.ac
+++ b/configure.ac
@@ -837,7 +837,7 @@ if test "x$GLX" = xyes && ! test "x$MESA_SOURCE" = x; then
 	PKG_CHECK_MODULES([GL], [glproto >= 1.4.9])
 	AC_SUBST(XLIB_CFLAGS)
 	AC_DEFINE(GLXEXT, 1, [Build GLX extension])
-	GLX_LIBS='$(top_builddir)/GL/glx/libglx.la $(top_builddir)/GL/mesa/libGLcore.la'
+	GLX_LIBS='$(top_builddir)/GL/glx/libglx.la'
 	test -d GL || mkdir GL
 	case $host_os in
 	  solaris*) 	
@@ -2105,18 +2105,6 @@ Makefile
 GL/Makefile
 GL/apple/Makefile
 GL/glx/Makefile
-GL/mesa/Makefile
-GL/mesa/glapi/Makefile
-GL/mesa/main/Makefile
-GL/mesa/math/Makefile
-GL/mesa/shader/Makefile
-GL/mesa/shader/grammar/Makefile
-GL/mesa/shader/slang/Makefile
-GL/mesa/swrast/Makefile
-GL/mesa/swrast_setup/Makefile
-GL/mesa/tnl/Makefile
-GL/mesa/vbo/Makefile
-GL/mesa/X/Makefile
 include/Makefile
 afb/Makefile
 composite/Makefile
diff --git a/hw/xfree86/dixmods/Makefile.am b/hw/xfree86/dixmods/Makefile.am
index 67967c5..beff9b1 100644
--- a/hw/xfree86/dixmods/Makefile.am
+++ b/hw/xfree86/dixmods/Makefile.am
@@ -3,7 +3,7 @@ noinst_LTLIBRARIES = libdixmods.la libxorgxkb.la
 SUBDIRS = extmod
 
 if GLX
-GLXMODS = libglx.la libGLcore.la
+GLXMODS = libglx.la
 endif
 
 if XTRAP
@@ -48,10 +48,6 @@ INCLUDES = @XORG_INCS@ \
            -I$(top_srcdir)/miext/shadow \
            -I$(top_srcdir)/GL/glx
 
-libGLcore_la_LDFLAGS = -avoid-version
-libGLcore_la_LIBADD = $(top_builddir)/GL/mesa/libGLcore.la
-libGLcore_la_SOURCES = GLcoremodule.c
-
 libafb_la_LDFLAGS = -avoid-version
 libafb_la_LIBADD = $(top_builddir)/afb/libafb.la
 libafb_la_SOURCES = afbmodule.c
commit 567d389d47dee233a973b101e04ce41c47a68f34
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Fri Apr 18 17:46:18 2008 +0300

    glcore: build from mesa, dlopen from xorg
    
    * The GLcore interface is disposable
    * GLcore is installed in DRI_DRIVER_INSTALL_DIR which is overloaded for
      GLX_PROVIDER_INSTALL_DIR

diff --git a/GL/glx/glxglcore.c b/GL/glx/glxglcore.c
index c8a2514..dafa9bc 100644
--- a/GL/glx/glxglcore.c
+++ b/GL/glx/glxglcore.c
@@ -37,7 +37,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #endif
 
 #include <string.h>
+#include <dlfcn.h>
 
+#define _NEED_GL_CORE_IF
 #include <GL/xmesa.h>
 #include <GL/internal/glcore.h>
 #include <glxserver.h>
@@ -48,6 +50,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "os.h"
 
+#define XMesaCreateVisual       (*glcore->XMesaCreateVisual)
+#define XMesaDestroyVisual      (*glcore->XMesaDestroyVisual)
+
+#define XMesaCreateWindowBuffer (*glcore->XMesaCreateWindowBuffer)
+#define XMesaCreatePixmapBuffer (*glcore->XMesaCreatePixmapBuffer)
+#define XMesaDestroyBuffer      (*glcore->XMesaDestroyBuffer)
+#define XMesaSwapBuffers        (*glcore->XMesaSwapBuffers)
+#define XMesaResizeBuffers      (*glcore->XMesaResizeBuffers)
+
+#define XMesaCreateContext      (*glcore->XMesaCreateContext)
+#define XMesaDestroyContext     (*glcore->XMesaDestroyContext)
+#define XMesaCopyContext        (*glcore->XMesaCopyContext)
+#define XMesaMakeCurrent2       (*glcore->XMesaMakeCurrent2)
+#define XMesaForceCurrent       (*glcore->XMesaForceCurrent)
+#define XMesaLoseCurrent        (*glcore->XMesaLoseCurrent)
+
 typedef struct __GLXMESAscreen   __GLXMESAscreen;
 typedef struct __GLXMESAcontext  __GLXMESAcontext;
 typedef struct __GLXMESAdrawable __GLXMESAdrawable;
@@ -55,8 +73,11 @@ typedef struct __GLXMESAdrawable __GLXMESAdrawable;
 struct __GLXMESAscreen {
     __GLXscreen   base;
     int           index;
-    int		  num_vis;
+    int           num_vis;
     XMesaVisual  *xm_vis;
+    void         *driver;
+
+    const __GLcoreModule *glcore;
 };
 
 struct __GLXMESAcontext {
@@ -65,8 +86,9 @@ struct __GLXMESAcontext {
 };
 
 struct __GLXMESAdrawable {
-    __GLXdrawable base;
-    XMesaBuffer   xm_buf;
+    __GLXdrawable    base;
+    XMesaBuffer      xm_buf;
+    __GLXMESAscreen *screen;
 };
 
 static XMesaVisual find_mesa_visual(__GLXscreen *screen, XID fbconfigID);
@@ -76,6 +98,7 @@ static void
 __glXMesaDrawableDestroy(__GLXdrawable *base)
 {
     __GLXMESAdrawable *glxPriv = (__GLXMESAdrawable *) base;
+    const __GLcoreModule *glcore = glxPriv->screen->glcore;
 
     if (glxPriv->xm_buf != NULL)
       XMesaDestroyBuffer(glxPriv->xm_buf);
@@ -86,6 +109,7 @@ static GLboolean
 __glXMesaDrawableResize(__GLXdrawable *base)
 {
     __GLXMESAdrawable *glxPriv = (__GLXMESAdrawable *) base;
+    const __GLcoreModule *glcore = glxPriv->screen->glcore;
 
     XMesaResizeBuffers(glxPriv->xm_buf);
 
@@ -96,6 +120,7 @@ static GLboolean
 __glXMesaDrawableSwapBuffers(__GLXdrawable *base)
 {
     __GLXMESAdrawable *glxPriv = (__GLXMESAdrawable *) base;
+    const __GLcoreModule *glcore = glxPriv->screen->glcore;
 
     /* This is terrifying: XMesaSwapBuffers() ends up calling CopyArea
      * to do the buffer swap, but this assumes that the server holds
@@ -121,6 +146,8 @@ __glXMesaScreenCreateDrawable(__GLXscreen *screen,
 			      XID drawId,
 			      __GLXconfig *modes)
 {
+    __GLXMESAscreen *mesaScreen = (__GLXMESAscreen *) screen;
+    const __GLcoreModule *glcore = mesaScreen->glcore;
     __GLXMESAdrawable *glxPriv;
     XMesaVisual xm_vis;
 
@@ -130,6 +157,7 @@ __glXMesaScreenCreateDrawable(__GLXscreen *screen,
 
     memset(glxPriv, 0, sizeof *glxPriv);
 
+    glxPriv->screen = mesaScreen;
     if (!__glXDrawableInit(&glxPriv->base, screen,
 			   pDraw, type, drawId, modes)) {
         xfree(glxPriv);
@@ -166,6 +194,8 @@ static void
 __glXMesaContextDestroy(__GLXcontext *baseContext)
 {
     __GLXMESAcontext *context = (__GLXMESAcontext *) baseContext;
+    __GLXMESAscreen *screen = (__GLXMESAscreen *) context->base.pGlxScreen;
+    const __GLcoreModule *glcore = screen->glcore;
 
     XMesaDestroyContext(context->xmesa);
     __glXContextDestroy(&context->base);
@@ -179,6 +209,8 @@ __glXMesaContextMakeCurrent(__GLXcontext *baseContext)
     __GLXMESAcontext *context = (__GLXMESAcontext *) baseContext;
     __GLXMESAdrawable *drawPriv = (__GLXMESAdrawable *) context->base.drawPriv;
     __GLXMESAdrawable *readPriv = (__GLXMESAdrawable *) context->base.readPriv;
+    __GLXMESAscreen *screen = (__GLXMESAscreen *) context->base.pGlxScreen;
+    const __GLcoreModule *glcore = screen->glcore;
 
     return XMesaMakeCurrent2(context->xmesa,
 			     drawPriv->xm_buf,
@@ -189,6 +221,8 @@ static int
 __glXMesaContextLoseCurrent(__GLXcontext *baseContext)
 {
     __GLXMESAcontext *context = (__GLXMESAcontext *) baseContext;
+    __GLXMESAscreen *screen = (__GLXMESAscreen *) context->base.pGlxScreen;
+    const __GLcoreModule *glcore = screen->glcore;
 
     return XMesaLoseCurrent(context->xmesa);
 }
@@ -200,6 +234,8 @@ __glXMesaContextCopy(__GLXcontext *baseDst,
 {
     __GLXMESAcontext *dst = (__GLXMESAcontext *) baseDst;
     __GLXMESAcontext *src = (__GLXMESAcontext *) baseSrc;
+    __GLXMESAscreen *screen = (__GLXMESAscreen *) dst->base.pGlxScreen;
+    const __GLcoreModule *glcore = screen->glcore;
 
     return XMesaCopyContext(src->xmesa, dst->xmesa, mask);
 }
@@ -208,6 +244,8 @@ static int
 __glXMesaContextForceCurrent(__GLXcontext *baseContext)
 {
     __GLXMESAcontext *context = (__GLXMESAcontext *) baseContext;
+    __GLXMESAscreen *screen = (__GLXMESAscreen *) context->base.pGlxScreen;
+    const __GLcoreModule *glcore = screen->glcore;
 
     /* GlxSetRenderTables() call for XGL moved in XMesaForceCurrent() */
 
@@ -219,6 +257,8 @@ __glXMesaScreenCreateContext(__GLXscreen *screen,
 			     __GLXconfig *config,
 			     __GLXcontext *baseShareContext)
 {
+    __GLXMESAscreen *mesaScreen = (__GLXMESAscreen *) screen;
+    const __GLcoreModule *glcore = mesaScreen->glcore;
     __GLXMESAcontext *context;
     __GLXMESAcontext *shareContext = (__GLXMESAcontext *) baseShareContext;
     XMesaVisual xm_vis;
@@ -261,6 +301,7 @@ static void
 __glXMesaScreenDestroy(__GLXscreen *screen)
 {
     __GLXMESAscreen *mesaScreen = (__GLXMESAscreen *) screen;
+    const __GLcoreModule *glcore = mesaScreen->glcore;
     int i;
 
     if (mesaScreen->xm_vis) {
@@ -272,6 +313,8 @@ __glXMesaScreenDestroy(__GLXscreen *screen)
 	xfree(mesaScreen->xm_vis);
     }
 
+    dlclose(mesaScreen->driver);
+
     __glXScreenDestroy(screen);
 
     xfree(screen);
@@ -373,6 +416,7 @@ createFBConfigs(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
 static void
 createMesaVisuals(__GLXMESAscreen *pMesaScreen)
 {
+    const __GLcoreModule *glcore = pMesaScreen->glcore;
     __GLXconfig *config;
     ScreenPtr pScreen;
     VisualPtr visual = NULL;
@@ -409,15 +453,35 @@ createMesaVisuals(__GLXMESAscreen *pMesaScreen)
     }
 }
 
+static const char dri_driver_path[] = DRI_DRIVER_PATH;
+
 static __GLXscreen *
 __glXMesaScreenProbe(ScreenPtr pScreen)
 {
     __GLXMESAscreen *screen;
+    char filename[128];
 
     screen = xalloc(sizeof *screen);
     if (screen == NULL)
 	return NULL;
 
+    snprintf(filename, sizeof filename, "%s/%s.so",
+             dri_driver_path, "libGLcore");
+
+    screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
+    if (screen->driver == NULL) {
+        LogMessage(X_ERROR, "GLX error: dlopen of %s failed (%s)\n",
+                   filename, dlerror());
+        goto handle_error;
+    }
+
+    screen->glcore = dlsym(screen->driver, __GL_CORE);
+    if (screen->glcore == NULL) {
+        LogMessage(X_ERROR, "GLX error: dlsym for %s failed (%s)\n",
+                   __GL_CORE, dlerror());
+        goto handle_error;
+    }
+
     /*
      * Find the GLX visuals that are supported by this screen and create
      * XMesa's visuals.
@@ -435,7 +499,20 @@ __glXMesaScreenProbe(ScreenPtr pScreen)
     screen->base.swapInterval  = NULL;
     screen->base.pScreen       = pScreen;
 
+    LogMessage(X_INFO, "GLX: Loaded and initialized %s\n", filename);
+
     return &screen->base;
+
+handle_error:
+
+    if (screen->driver)
+        dlclose(screen->driver);
+
+    xfree(screen);
+
+    FatalError("GLX: could not load software renderer\n");
+
+    return NULL;
 }
 
 __GLXprovider __glXMesaProvider = {
diff --git a/hw/xfree86/dixmods/glxmodule.c b/hw/xfree86/dixmods/glxmodule.c
index a1a0886..88091cd 100644
--- a/hw/xfree86/dixmods/glxmodule.c
+++ b/hw/xfree86/dixmods/glxmodule.c
@@ -72,37 +72,6 @@ static XF86ModuleVersionInfo VersRec =
 
 _X_EXPORT XF86ModuleData glxModuleData = { &VersRec, glxSetup, NULL };
 
-/* We do a little proxy dance here, so we can avoid loading GLcore
- * unless we really need to.*/
-
-static pointer glxModule;
-
-static __GLXscreen *
-__glXMesaProxyScreenProbe(ScreenPtr pScreen)
-{
-  pointer GLcore;
-  static __GLXprovider *provider;
-
-  if (provider == NULL) {
-    GLcore = LoadSubModule(glxModule, "GLcore", NULL, NULL, NULL, NULL, 
-			   NULL, NULL);
-    if (GLcore == NULL)
-      return NULL;
-
-    provider = LoaderSymbol("__glXMesaProvider");
-    if (provider == NULL)
-      return NULL;
-  }
-
-  return provider->screenProbe(pScreen);
-}
-
-static __GLXprovider __glXMesaProxyProvider = {
-    __glXMesaProxyScreenProbe,
-    "MESA-PROXY",
-    NULL
-};
-
 static pointer
 glxSetup(pointer module, pointer opts, int *errmaj, int *errmin)
 {
@@ -116,8 +85,10 @@ glxSetup(pointer module, pointer opts, int *errmaj, int *errmin)
 
     setupDone = TRUE;
 
-    glxModule = module;
-    GlxPushProvider(&__glXMesaProxyProvider);
+    provider = LoaderSymbol("__glXMesaProvider");
+    if (provider == NULL)
+	return NULL;
+    GlxPushProvider(provider);
 
     xf86Msg(xf86Info.aiglxFrom, "AIGLX %s\n", 
 	    xf86Info.aiglx ? "enabled" : "disabled");
commit efb723e166e5fa89e90c7b400fb4c7979b1f50c0
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Fri Apr 18 17:45:53 2008 +0300

    glcore: prepare for dynamic loading
    
    glcore gets linked with -ldl, -lpthread for s3tc and glapi
    xserver needs
            DLOPEN_LIBS - to dlopen the glcore dso
            LD_EXPORT_SYMBOLS_FLAG - to export symbols for glcore to use
    
    the ld flag is added to kdrive only when GLX is enabled, the net overhead for
    Xephyr is ~155KB, could be reduced with --dynamic-list.

diff --git a/configure.ac b/configure.ac
index 995a652..5da56b5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -848,6 +848,7 @@ if test "x$GLX" = xyes && ! test "x$MESA_SOURCE" = x; then
 	if test $? -ne 0; then
 		AC_MSG_ERROR([Failed to link Mesa source tree.  Please specify a proper path to Mesa sources, or disable GLX.])
 	fi
+	GLX_SYS_LIBS="$GLX_SYS_LIBS $DLOPEN_LIBS"
 else
         GLX=no
 fi
@@ -1969,7 +1970,7 @@ if test "$KDRIVE" = yes; then
     KDRIVE_LOCAL_LIBS="$DIX_LIB $KDRIVE_LIB $KDRIVE_STUB_LIB $CONFIG_LIB"
     KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS"
     KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB $OS_LIB"
-    KDRIVE_LIBS="$TSLIB_LIBS $KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS"
+    KDRIVE_LIBS="$TSLIB_LIBS $KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS"
 
     # check if we can build Xephyr
     PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS, [xephyr="yes"], [xephyr="no"])
diff --git a/hw/kdrive/ati/Makefile.am b/hw/kdrive/ati/Makefile.am
index 8429250..31462bb 100644
--- a/hw/kdrive/ati/Makefile.am
+++ b/hw/kdrive/ati/Makefile.am
@@ -58,6 +58,10 @@ ATI_LIBS =				\
 	$(DRI_LIBS)			\
 	@KDRIVE_LIBS@
 
+if GLX
+Xati_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+endif
+
 Xati_LDADD = \
 	$(ATI_LIBS)			\
 	@KDRIVE_LIBS@
diff --git a/hw/kdrive/chips/Makefile.am b/hw/kdrive/chips/Makefile.am
index 51b0edf..46e1760 100644
--- a/hw/kdrive/chips/Makefile.am
+++ b/hw/kdrive/chips/Makefile.am
@@ -20,6 +20,10 @@ CHIPS_LIBS =					 \
 	$(top_builddir)/hw/kdrive/vesa/libvesa.a \
 	@KDRIVE_LIBS@
 
+if GLX
+Xchips_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+endif
+
 Xchips_LDADD = \
 	$(CHIPS_LIBS)				\
 	@KDRIVE_LIBS@
diff --git a/hw/kdrive/ephyr/Makefile.am b/hw/kdrive/ephyr/Makefile.am
index 81d3d69..7ef22a3 100644
--- a/hw/kdrive/ephyr/Makefile.am
+++ b/hw/kdrive/ephyr/Makefile.am
@@ -67,6 +67,10 @@ libxephyr_a_CFLAGS = \
 Xephyr_SOURCES = \
 	ephyrinit.c
 
+if GLX
+Xephyr_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+endif
+
 Xephyr_LDADD = 						\
 	libxephyr.a					\
 	libxephyr-hostx.a			        \
diff --git a/hw/kdrive/epson/Makefile.am b/hw/kdrive/epson/Makefile.am
index 2a44014..14bb049 100644
--- a/hw/kdrive/epson/Makefile.am
+++ b/hw/kdrive/epson/Makefile.am
@@ -20,6 +20,10 @@ EPSON_LIBS =					\
 	libepson.a 				\
 	@KDRIVE_LIBS@
 
+if GLX
+Xepson_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+endif
+
 Xepson_LDADD = \
 	$(EPSON_LIBS)			       \
 	@KDRIVE_LIBS@
diff --git a/hw/kdrive/fake/Makefile.am b/hw/kdrive/fake/Makefile.am
index 09d179e..0f88656 100644
--- a/hw/kdrive/fake/Makefile.am
+++ b/hw/kdrive/fake/Makefile.am
@@ -16,6 +16,10 @@ libfake_a_SOURCES =	\
 Xfake_SOURCES = \
 	fakeinit.c
 
+if GLX
+Xfake_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+endif
+
 Xfake_LDADD = 						\
 	libfake.a					\
 	@KDRIVE_LIBS@					\
diff --git a/hw/kdrive/fbdev/Makefile.am b/hw/kdrive/fbdev/Makefile.am
index 420855b..c77f146 100644
--- a/hw/kdrive/fbdev/Makefile.am
+++ b/hw/kdrive/fbdev/Makefile.am
@@ -14,6 +14,10 @@ bin_PROGRAMS = Xfbdev
 Xfbdev_SOURCES = \
 	fbinit.c
 
+if GLX
+Xfbdev_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+endif
+
 Xfbdev_LDADD = 						\
 	libfbdev.a					\
 	@KDRIVE_LIBS@
diff --git a/hw/kdrive/i810/Makefile.am b/hw/kdrive/i810/Makefile.am
index ea02cb6..30919fa 100644
--- a/hw/kdrive/i810/Makefile.am
+++ b/hw/kdrive/i810/Makefile.am
@@ -23,6 +23,10 @@ I810_LIBS =						\
 	libi810.a 					\
 	@KDRIVE_LIBS@
 
+if GLX
+Xi810_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+endif
+
 Xi810_LDADD = \
 	$(I810_LIBS)					\
 	@KDRIVE_LIBS@
diff --git a/hw/kdrive/mach64/Makefile.am b/hw/kdrive/mach64/Makefile.am
index 746ffff..6ca376a 100644
--- a/hw/kdrive/mach64/Makefile.am
+++ b/hw/kdrive/mach64/Makefile.am
@@ -27,6 +27,10 @@ MACH64_LIBS =						\
 	$(top_builddir)/hw/kdrive/vesa/libvesa.a        
 
 
+if GLX
+Xmach64_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+endif
+
 Xmach64_LDADD = 					\
 	$(MACH64_LIBS)					\
 	@KDRIVE_LIBS@
diff --git a/hw/kdrive/mga/Makefile.am b/hw/kdrive/mga/Makefile.am
index 37bc50c..a7dd2cb 100644
--- a/hw/kdrive/mga/Makefile.am
+++ b/hw/kdrive/mga/Makefile.am
@@ -22,6 +22,10 @@ MGA_LIBS =						\
 	$(top_builddir)/hw/kdrive/vesa/libvesa.a	\
 	@KDRIVE_LIBS@
 
+if GLX
+Xmga_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+endif
+
 Xmga_LDADD = \
 	$(MGA_LIBS)					\
 	@KDRIVE_LIBS@
diff --git a/hw/kdrive/neomagic/Makefile.am b/hw/kdrive/neomagic/Makefile.am
index 95f0e1e..b449c37 100644
--- a/hw/kdrive/neomagic/Makefile.am
+++ b/hw/kdrive/neomagic/Makefile.am
@@ -32,6 +32,10 @@ NEOMAGIC_LIBS =                 \
 	${VESA_LIBS}                \
 	@KDRIVE_LIBS@
 
+if GLX
+Xneomagic_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+endif
+
 Xneomagic_LDADD = \
 	$(NEOMAGIC_LIBS)            \
 	@KDRIVE_LIBS@               \
diff --git a/hw/kdrive/nvidia/Makefile.am b/hw/kdrive/nvidia/Makefile.am
index b380e44..81736c3 100644
--- a/hw/kdrive/nvidia/Makefile.am
+++ b/hw/kdrive/nvidia/Makefile.am
@@ -23,6 +23,10 @@ NVIDIA_LIBS =					\
 	$(top_builddir)/hw/kdrive/vesa/libvesa.a \
 	@KDRIVE_LIBS@
 
+if GLX
+Xnvidia_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+endif
+
 Xnvidia_LDADD = \
 	$(NVIDIA_LIBS)				\
 	@KDRIVE_LIBS@
diff --git a/hw/kdrive/pm2/Makefile.am b/hw/kdrive/pm2/Makefile.am
index 208d031..cb28de6 100644
--- a/hw/kdrive/pm2/Makefile.am
+++ b/hw/kdrive/pm2/Makefile.am
@@ -21,6 +21,10 @@ PM2_LIBS =					\
 	$(top_builddir)/hw/kdrive/vesa/libvesa.a \
 	@KDRIVE_LIBS@
 
+if GLX
+Xpm2_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+endif
+
 Xpm2_LDADD = \
 	$(PM2_LIBS)				\
 	@KDRIVE_LIBS@
diff --git a/hw/kdrive/r128/Makefile.am b/hw/kdrive/r128/Makefile.am
index 62c1fcf..344fbeb 100644
--- a/hw/kdrive/r128/Makefile.am
+++ b/hw/kdrive/r128/Makefile.am
@@ -20,6 +20,10 @@ R128_LIBS =					\
 	$(top_builddir)/hw/kdrive/vesa/libvesa.a \
 	@KDRIVE_LIBS@
 
+if GLX
+Xr128_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+endif
+
 Xr128_LDADD = \
 	$(R128_LIBS)				\
 	@KDRIVE_LIBS@
diff --git a/hw/kdrive/sdl/Makefile.am b/hw/kdrive/sdl/Makefile.am
index fe9309e..a70d147 100644
--- a/hw/kdrive/sdl/Makefile.am
+++ b/hw/kdrive/sdl/Makefile.am
@@ -7,6 +7,10 @@ bin_PROGRAMS = Xsdl
 
 Xsdl_SOURCES = sdl.c
 
+if GLX
+Xsdl_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+endif
+
 Xsdl_LDADD = \
 	@KDRIVE_LIBS@                                  \
 	@XSDL_LIBS@
diff --git a/hw/kdrive/sis300/Makefile.am b/hw/kdrive/sis300/Makefile.am
index 3e8ce90..af2500a 100644
--- a/hw/kdrive/sis300/Makefile.am
+++ b/hw/kdrive/sis300/Makefile.am
@@ -34,6 +34,10 @@ SIS_LIBS =				\
 	$(VESA_LIBS)			\
 	@KDRIVE_LIBS@
 
+if GLX
+Xsis_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+endif
+
 Xsis_LDADD = \
 	$(SIS_LIBS)				\
 	@KDRIVE_LIBS@                          \
diff --git a/hw/kdrive/smi/Makefile.am b/hw/kdrive/smi/Makefile.am
index a4d6624..bd7077c 100644
--- a/hw/kdrive/smi/Makefile.am
+++ b/hw/kdrive/smi/Makefile.am
@@ -25,6 +25,10 @@ SMI_LIBS =					\
 	$(top_builddir)/hw/kdrive/vesa/libvesa.a \
 	@KDRIVE_LIBS@
 
+if GLX
+Xsmi_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+endif
+
 Xsmi_LDADD = \
 	$(SMI_LIBS)				\
 	@KDRIVE_LIBS@
diff --git a/hw/kdrive/vesa/Makefile.am b/hw/kdrive/vesa/Makefile.am
index ac50d2b..ec35c1e 100644
--- a/hw/kdrive/vesa/Makefile.am
+++ b/hw/kdrive/vesa/Makefile.am
@@ -19,6 +19,10 @@ libvesa_a_SOURCES = \
 Xvesa_SOURCES = \
 	vesainit.c
 
+if GLX
+Xvesa_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+endif
+
 Xvesa_LDADD = \
 	libvesa.a 				\
 	@KDRIVE_LIBS@
diff --git a/hw/kdrive/via/Makefile.am b/hw/kdrive/via/Makefile.am
index 249b3f3..c659379 100644
--- a/hw/kdrive/via/Makefile.am
+++ b/hw/kdrive/via/Makefile.am
@@ -21,6 +21,10 @@ VIA_LIBS =	\
 	libvia.a	\
 	$(top_builddir)/hw/kdrive/vesa/libvesa.a
 
+if GLX
+Xvia_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+endif
+
 Xvia_LDADD =						\
 	$(VIA_LIBS)					\
 	@KDRIVE_LIBS@


More information about the xorg-commit mailing list