xserver: Branch 'master' - 6 commits
Keith Packard
keithp at kemper.freedesktop.org
Thu Jun 3 07:03:20 PDT 2010
Xext/Makefile.am | 1 -
configure.ac | 10 ++++++----
hw/xfree86/dri2/dri2.c | 42 +++++++++++++++++++++++++++++++-----------
hw/xfree86/dri2/dri2.h | 10 ++++++++--
hw/xfree86/dri2/dri2ext.c | 1 -
include/xorg-config.h.in | 3 +++
6 files changed, 48 insertions(+), 19 deletions(-)
New commits:
commit b13d7a8e09c8e3eb5003420c3c0484431e5a052b
Merge: f0ab726... dcceb90...
Author: Keith Packard <keithp at keithp.com>
Date: Thu Jun 3 07:01:26 2010 -0700
Merge remote branch 'vignatti/for-keith'
commit dcceb90b1dccbbf5793f6ba1ed857013b71dafbc
Author: Tiago Vignatti <tiago.vignatti at nokia.com>
Date: Wed May 19 11:45:46 2010 +0200
xext: delete wrong source reference from fontcache
This should go away in 0b45ba48.
Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
Reviewed-by: Mikhail Gusarov <dottedmag at dottedmag.net>
diff --git a/Xext/Makefile.am b/Xext/Makefile.am
index fa007aa..e444fd0 100644
--- a/Xext/Makefile.am
+++ b/Xext/Makefile.am
@@ -133,7 +133,6 @@ EXTRA_DIST = \
$(XSELINUX_SRCS) \
$(XCALIBRATE_SRCS) \
$(XINERAMA_SRCS) \
- $(FONTCACHE_SRCS) \
$(BIGFONT_SRCS) \
$(DPMS_SRCS) \
$(GE_SRCS)
commit c043de3261b6e14f2446b2cd9d62dde5860d4720
Author: Tiago Vignatti <tiago.vignatti at nokia.com>
Date: Mon May 3 12:37:25 2010 +0200
configure: sha1: check libsha1 using pkg-config instead
Previously the code was using AC_CHECK_LIB, guaranteeing whether the library
is correct by tracking sha1_begin function. This paranoic checking is not
necessary given there's only one libsha1 in the market, which surely contains
such function.
Moreover, this patch now improves a bit the sha1 implementation checking
behavior using pkg-config to find the right flags that needs to link against.
Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
Reviewed-by: Mikhail Gusarov <dottedmag at dottedmag.net>
diff --git a/configure.ac b/configure.ac
index b5b638a..8976319 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1380,7 +1380,7 @@ if test "x$with_sha1" = xlibmd; then
[Use libmd SHA1 functions])
SHA1_LIBS=-lmd
fi
-AC_CHECK_LIB([sha1], [sha1_begin], [HAVE_LIBSHA1=yes])
+PKG_CHECK_MODULES([LIBSHA1], [sha1], [HAVE_LIBSHA1=yes], [HAVE_LIBSHA1=no])
if test "x$with_sha1" = x && test "x$HAVE_LIBSHA1" = xyes; then
with_sha1=libsha1
fi
commit f0ab726d8966cab4e50154c216d577db79328d77
Author: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Date: Wed Apr 21 11:07:47 2010 +0300
DRI2: Use single error path in initialization
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index e1ccdae..5562853 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -1066,18 +1066,14 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
/* Driver too old: use the old-style driverName field */
ds->numDrivers = 1;
ds->driverNames = malloc(sizeof(*ds->driverNames));
- if (!ds->driverNames) {
- free(ds);
- return FALSE;
- }
+ if (!ds->driverNames)
+ goto err_out;
ds->driverNames[0] = info->driverName;
} else {
ds->numDrivers = info->numDrivers;
ds->driverNames = malloc(info->numDrivers * sizeof(*ds->driverNames));
- if (!ds->driverNames) {
- free(ds);
- return FALSE;
- }
+ if (!ds->driverNames)
+ goto err_out;
memcpy(ds->driverNames, info->driverNames,
info->numDrivers * sizeof(*ds->driverNames));
}
commit 6eef70dc56bcc1e3047e4e488bcd6ae62c8ffac6
Author: Tiago Vignatti <tiago.vignatti at nokia.com>
Date: Fri Jan 22 18:34:36 2010 +0200
DRI2: Allow building without libdrm
Some drivers use DRI protocol but implement their own kernel rendering
manager. For these drivers, libdrm becomes useless. --disable-libdrm
configure parameter can be used to disable libdrm support in dri2.
To provide ABI/API compatibility for libdrm based drivers, libdrm call
is wrapped in ifdef.
Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>
diff --git a/configure.ac b/configure.ac
index b5b638a..0541bac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -644,6 +644,7 @@ AC_ARG_ENABLE(vgahw, AS_HELP_STRING([--enable-vgahw], [Build Xorg with
AC_ARG_ENABLE(vbe, AS_HELP_STRING([--enable-vbe], [Build Xorg with VBE module (default: enabled)]), [VBE=$enableval], [VBE=yes])
AC_ARG_ENABLE(int10-module, AS_HELP_STRING([--enable-int10-module], [Build Xorg with int10 module (default: enabled)]), [INT10MODULE=$enableval], [INT10MODULE=yes])
AC_ARG_ENABLE(windowswm, AS_HELP_STRING([--enable-windowswm], [Build XWin with WindowsWM extension (default: no)]), [WINDOWSWM=$enableval], [WINDOWSWM=no])
+AC_ARG_ENABLE(libdrm, AS_HELP_STRING([--enable-libdrm], [Build Xorg with libdrm support (default: enabled)]), [DRM=$enableval],[DRM=yes])
dnl DDXes.
AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto])
@@ -1033,9 +1034,10 @@ esac
AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)
if test "x$DRI" = xyes || test "x$DRI2" = xyes; then
- PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
- AC_SUBST(LIBDRM_CFLAGS)
- AC_SUBST(LIBDRM_LIBS)
+ if test "x$DRM" = xyes; then
+ AC_DEFINE(WITH_LIBDRM, 1, [Building with libdrm support])
+ PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
+ fi
fi
if test "x$DRI2" = xyes; then
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 03255a2..e1ccdae 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -35,7 +35,9 @@
#endif
#include <errno.h>
+#ifdef WITH_LIBDRM
#include <xf86drm.h>
+#endif
#include "xf86Module.h"
#include "list.h"
#include "scrnintstr.h"
@@ -965,7 +967,7 @@ DRI2Connect(ScreenPtr pScreen, unsigned int driverType, int *fd,
}
Bool
-DRI2Authenticate(ScreenPtr pScreen, drm_magic_t magic)
+DRI2Authenticate(ScreenPtr pScreen, uint32_t magic)
{
DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
@@ -1045,9 +1047,16 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
ds->AuthMagic = info->AuthMagic;
}
+ /*
+ * if the driver doesn't provide an AuthMagic function or the info struct
+ * version is too low, it relies on the old method (using libdrm) or fail
+ */
if (!ds->AuthMagic)
+#ifdef WITH_LIBDRM
ds->AuthMagic = drmAuthMagic;
-
+#else
+ goto err_out;
+#endif
/* Initialize minor if needed and set to minimum provied by DDX */
if (!dri2_minor || dri2_minor > cur_minor)
@@ -1087,6 +1096,12 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
}
return TRUE;
+
+err_out:
+ xf86DrvMsg(pScreen->myNum, X_WARNING,
+ "[DRI2] Initialization failed for info version %d.\n", info->version);
+ free(ds);
+ return FALSE;
}
void
diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
index 29b1d9b..f08ca29 100644
--- a/hw/xfree86/dri2/dri2.h
+++ b/hw/xfree86/dri2/dri2.h
@@ -206,7 +206,7 @@ extern _X_EXPORT Bool DRI2Connect(ScreenPtr pScreen,
const char **driverName,
const char **deviceName);
-extern _X_EXPORT Bool DRI2Authenticate(ScreenPtr pScreen, drm_magic_t magic);
+extern _X_EXPORT Bool DRI2Authenticate(ScreenPtr pScreen, uint32_t magic);
extern _X_EXPORT int DRI2CreateDrawable(ClientPtr client,
DrawablePtr pDraw,
diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c
index e6d98f5..db04268 100644
--- a/hw/xfree86/dri2/dri2ext.c
+++ b/hw/xfree86/dri2/dri2ext.c
@@ -42,7 +42,6 @@
#include "scrnintstr.h"
#include "pixmapstr.h"
#include "extnsionst.h"
-#include "xf86drm.h"
#include "xfixes.h"
#include "dri2.h"
#include "protocol-versions.h"
diff --git a/include/xorg-config.h.in b/include/xorg-config.h.in
index 8946a65..56ffda2 100644
--- a/include/xorg-config.h.in
+++ b/include/xorg-config.h.in
@@ -139,4 +139,7 @@
/* Support PC98 */
#undef SUPPORT_PC98
+/* Build with libdrm support */
+#undef WITH_LIBDRM
+
#endif /* _XORG_CONFIG_H_ */
commit cdcb575664d3d60b662c542e782de83a047165c9
Author: Tiago Vignatti <tiago.vignatti at nokia.com>
Date: Fri Jan 22 17:58:17 2010 +0200
DRI2: add AuthMagic hook for driver side support
With this new hook, drmAuthMagic becomes useless and should be deprecated.
You might want to implement AuthMagic on driver side instead.
Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 29c917f..03255a2 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -94,6 +94,7 @@ typedef struct _DRI2Screen {
DRI2ScheduleSwapProcPtr ScheduleSwap;
DRI2GetMSCProcPtr GetMSC;
DRI2ScheduleWaitMSCProcPtr ScheduleWaitMSC;
+ DRI2AuthMagicProcPtr AuthMagic;
HandleExposuresProcPtr HandleExposures;
@@ -968,8 +969,8 @@ DRI2Authenticate(ScreenPtr pScreen, drm_magic_t magic)
{
DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
- if (ds == NULL || drmAuthMagic(ds->fd, magic))
- return FALSE;
+ if (ds == NULL || (*ds->AuthMagic)(ds->fd, magic))
+ return FALSE;
return TRUE;
}
@@ -1040,6 +1041,14 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
cur_minor = 1;
}
+ if (info->version >= 5) {
+ ds->AuthMagic = info->AuthMagic;
+ }
+
+ if (!ds->AuthMagic)
+ ds->AuthMagic = drmAuthMagic;
+
+
/* Initialize minor if needed and set to minimum provied by DDX */
if (!dri2_minor || dri2_minor > cur_minor)
dri2_minor = cur_minor;
diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
index be44bdd..29b1d9b 100644
--- a/hw/xfree86/dri2/dri2.h
+++ b/hw/xfree86/dri2/dri2.h
@@ -66,6 +66,8 @@ typedef void (*DRI2CopyRegionProcPtr)(DrawablePtr pDraw,
DRI2BufferPtr pSrcBuffer);
typedef void (*DRI2WaitProcPtr)(WindowPtr pWin,
unsigned int sequence);
+typedef int (*DRI2AuthMagicProcPtr)(int fd, uint32_t magic);
+
/**
* Schedule a buffer swap
*
@@ -159,7 +161,7 @@ typedef void (*DRI2InvalidateProcPtr)(DrawablePtr pDraw,
/**
* Version of the DRI2InfoRec structure defined in this header
*/
-#define DRI2INFOREC_VERSION 4
+#define DRI2INFOREC_VERSION 5
typedef struct {
unsigned int version; /**< Version of this struct */
@@ -183,6 +185,10 @@ typedef struct {
/* array of driver names, indexed by DRI2Driver* driver types */
/* a name of NULL means that driver is not supported */
const char * const *driverNames;
+
+ /* added in version 5 */
+
+ DRI2AuthMagicProcPtr AuthMagic;
} DRI2InfoRec, *DRI2InfoPtr;
extern _X_EXPORT int DRI2EventBase;
More information about the xorg-commit
mailing list