Commit b71dc543 authored by Kristian Høgsberg's avatar Kristian Høgsberg Committed by Kristian Høgsberg

Add DRI2 module.

parent 005e31d3
......@@ -368,6 +368,7 @@ AM_CONDITIONAL(PPC_VIDEO, [test "x$PPC_VIDEO" = xyes])
AM_CONDITIONAL(SPARC64_VIDEO, [test "x$SPARC64_VIDEO" = xyes])
DRI=no
DRI2=no
KDRIVE_HW=no
dnl it would be nice to autodetect these *CONS_SUPPORTs
case $host_os in
......@@ -380,6 +381,7 @@ case $host_os in
AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console])
AC_DEFINE(SYSCONS_SUPPORT, 1, [System has syscons console])
DRI=yes
DRI2=yes
;;
*netbsd*)
AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
......@@ -387,6 +389,7 @@ case $host_os in
AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console])
AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console])
DRI=yes
DRI2=yes
;;
*openbsd*)
AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
......@@ -395,6 +398,7 @@ case $host_os in
;;
*linux*)
DRI=yes
DRI2=yes
KDRIVE_HW=yes
;;
*solaris*)
......@@ -535,6 +539,7 @@ AC_ARG_ENABLE(xdmcp, AS_HELP_STRING([--disable-xdmcp], [Build XDMCP ext
AC_ARG_ENABLE(xdm-auth-1, AS_HELP_STRING([--disable-xdm-auth-1], [Build XDM-Auth-1 extension (default: auto)]), [XDMAUTH=$enableval], [XDMAUTH=auto])
AC_ARG_ENABLE(glx, AS_HELP_STRING([--disable-glx], [Build GLX extension (default: enabled)]), [GLX=$enableval], [GLX=yes])
AC_ARG_ENABLE(dri, AS_HELP_STRING([--enable-dri], [Build DRI extension (default: auto)]), [DRI=$enableval])
AC_ARG_ENABLE(dri2, AS_HELP_STRING([--enable-dri2], [Build DRI2 extension (default: auto)]), [DRI2=$enableval])
AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--disable-xinerama], [Build Xinerama extension (default: enabled)]), [XINERAMA=$enableval], [XINERAMA=yes])
AC_ARG_ENABLE(xf86vidmode, AS_HELP_STRING([--disable-xf86vidmode], [Build XF86VidMode extension (default: auto)]), [XF86VIDMODE=$enableval], [XF86VIDMODE=auto])
AC_ARG_ENABLE(xf86misc, AS_HELP_STRING([--disable-xf86misc], [Build XF86Misc extension (default: auto)]), [XF86MISC=$enableval], [XF86MISC=auto])
......@@ -857,6 +862,14 @@ if test "x$DRI" = xyes; then
AC_SUBST(GL_CFLAGS)
fi
AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)
if test "x$DRI2" = xyes; then
# FIXME: Bump the versions once we have releases of these.
AC_DEFINE(DRI2, 1, [Build DRI2 extension])
PKG_CHECK_MODULES([DRIPROTO], [xf86driproto >= 2.0.3])
PKG_CHECK_MODULES([LIBDRM], [libdrm >= 2.3.1])
fi
AM_CONDITIONAL(XINERAMA, [test "x$XINERAMA" = xyes])
if test "x$XINERAMA" = xyes; then
AC_DEFINE(XINERAMA, 1, [Support Xinerama extension])
......@@ -2129,6 +2142,7 @@ hw/xfree86/doc/devel/Makefile
hw/xfree86/doc/man/Makefile
hw/xfree86/doc/sgml/Makefile
hw/xfree86/dri/Makefile
hw/xfree86/dri2/Makefile
hw/xfree86/dummylib/Makefile
hw/xfree86/exa/Makefile
hw/xfree86/fbdevhw/Makefile
......
......@@ -4,6 +4,10 @@ if DRI
DRI_SUBDIR = dri
endif
if DRI2
DRI2_SUBDIR = dri2
endif
if XF86UTILS
XF86UTILS_SUBDIR = utils
endif
......@@ -21,11 +25,11 @@ DOC_SUBDIR = doc
SUBDIRS = common ddc dummylib i2c x86emu int10 fbdevhw os-support parser rac \
ramdac shadowfb vbe vgahw xaa $(MFB_SUBDIR) $(CFB_SUBDIR) \
xf8_16bpp loader dixmods exa modes \
$(DRI_SUBDIR) $(XF86UTILS_SUBDIR) $(DOC_SUBDIR)
$(DRI_SUBDIR) $(DRI2_SUBDIR) $(XF86UTILS_SUBDIR) $(DOC_SUBDIR)
DIST_SUBDIRS = common ddc dummylib i2c x86emu int10 fbdevhw os-support \
parser rac ramdac shadowfb vbe vgahw xaa xf1bpp xf4bpp \
xf8_16bpp xf8_32bpp loader dixmods dri exa modes \
xf8_16bpp xf8_32bpp loader dixmods dri dri2 exa modes \
utils doc
bin_PROGRAMS = Xorg
......
libdri2_la_LTLIBRARIES = libdri2.la
libdri2_la_CFLAGS = \
-DHAVE_XORG_CONFIG_H \
-I@MESA_SOURCE@/include \
@DIX_CFLAGS@ @DRIPROTO_CFLAGS@ @LIBDRM_CFLAGS@ \
-I$(top_srcdir)/hw/xfree86/common \
-I$(top_srcdir)/hw/xfree86/os-support/bus
libdri2_la_LDFLAGS = -module -avoid-version @LIBDRM_LIBS@
libdri2_ladir = $(moduledir)/extensions
libdri2_la_SOURCES = \
dri2.c \
dri2.h
sdk_HEADERS = dri2.h
This diff is collapsed.
/*
* Copyright © 2007 Red Hat, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Soft-
* ware"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, provided that the above copyright
* notice(s) and this permission notice appear in all copies of the Soft-
* ware and that both the above copyright notice(s) and this permission
* notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
* ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
* RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
* THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
* QUENTIAL 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 PERFOR-
* MANCE OF THIS SOFTWARE.
*
* Except as contained in this notice, the name of a copyright holder shall
* not be used in advertising or otherwise to promote the sale, use or
* other dealings in this Software without prior written authorization of
* the copyright holder.
*
* Authors:
* Kristian Høgsberg (krh@redhat.com)
*/
#ifndef _DRI2_H_
#define _DRI2_H_
typedef unsigned int (*DRI2GetPixmapHandleProcPtr)(PixmapPtr p,
unsigned int *flags);
typedef void (*DRI2BeginClipNotifyProcPtr)(ScreenPtr pScreen);
typedef void (*DRI2EndClipNotifyProcPtr)(ScreenPtr pScreen);
typedef struct {
unsigned int version; /* Version of this struct */
int fd;
size_t driverSareaSize;
const char *driverName;
int ddxVersionMajor, ddxVersionMinor, ddxVersionPatch;
DRI2GetPixmapHandleProcPtr getPixmapHandle;
DRI2BeginClipNotifyProcPtr beginClipNotify;
DRI2EndClipNotifyProcPtr endClipNotify;
} DRI2InfoRec, *DRI2InfoPtr;
void *DRI2ScreenInit(ScreenPtr pScreen,
DRI2InfoPtr info);
void DRI2CloseScreen(ScreenPtr pScreen);
Bool DRI2Connect(ScreenPtr pScreen,
int *fd,
const char **driverName,
int *ddxMajor,
int *ddxMinor,
int *ddxPatch,
unsigned int *sareaHandle);
void DRI2Lock(ScreenPtr pScreen);
void DRI2Unlock(ScreenPtr pScreen);
Bool DRI2CreateDrawable(ScreenPtr pScreen,
DrawablePtr pDraw,
drm_drawable_t *pDrmDrawable);
void DRI2DestroyDrawable(ScreenPtr pScreen,
DrawablePtr pDraw);
void DRI2ExtensionInit(void);
#endif
......@@ -436,6 +436,9 @@
#undef XEPHYR_DRI
/* Build DRI2 extension */
#undef DRI2
/* Build DBE support */
#undef DBE
......
......@@ -54,6 +54,9 @@
/* Building DRI-capable DDX. */
#undef XF86DRI
/* Build DRI2 extension */
#undef DRI2
/* Solaris 8 or later? */
#undef __SOL8__
......
......@@ -142,6 +142,9 @@
/* Build DRI extension */
#undef XF86DRI
/* Build DRI2 extension */
#undef DRI2
/* Build Xorg server */
#undef XORGSERVER
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment