Re: [PATCH] dri2: Pass a ScreenPtr through to the driver's AuthMagic
On Fri, Jun 15, 2012 at 07:01:34PM +1000, Christopher James Halse Rogers wrote: xwayland drivers need access to their screen private data to authenticate. Now that drivers no longer have direct access to the global screen arrays, this needs to be passed in as function context. The way it was working was ugly, anyway. Yes, sure, but it also didn't need to extend the DRI2 API. Now that Dave's gone and locked up the screen arrays, we have a good excuse to go clean that up. Signed-off-by: Christopher James Halse Rogers christopher.halse.rog...@canonical.com --- This came up when I got around to fixing the nouveau xwayland patch review comments; with things no longer meant to access the global xf86Screens array the authmagic callback needed some other way to access driver private data. Nouveau patch using this follows; I'll send it upstream once this gets applied somewhere. CCd to xorg-devel mainly for sanity review, but could be applied; as Airlied has pointed out, there's no particular reason for the xwayland branch to diverge on core infrastructure. Yeah, this is good to go upstream. Just add a new function pointer to the struct and a new typedef though, no need to play games with casting the pointers: typedef int (*DRI2AuthMagicWithScreenProcPtr) (ScreenPtr pScreen, int fd, uint32_t magic); or something. Aside from that and the small nit-pick below, it looks good. Kristian hw/xfree86/dri2/dri2.c | 40 ++-- hw/xfree86/dri2/dri2.h |2 +- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index babf32f..0e79875 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -89,6 +89,8 @@ typedef struct _DRI2Drawable { Bool needInvalidate; } DRI2DrawableRec, *DRI2DrawablePtr; +typedef int (*DRI2LegacyAuthMagicProcPtr) (int fd, uint32_t magic); + typedef struct _DRI2Screen { ScreenPtr screen; int refcnt; @@ -105,6 +107,7 @@ typedef struct _DRI2Screen { DRI2GetMSCProcPtr GetMSC; DRI2ScheduleWaitMSCProcPtr ScheduleWaitMSC; DRI2AuthMagicProcPtr AuthMagic; +DRI2LegacyAuthMagicProcPtr LegacyAuthMagic; DRI2ReuseBufferNotifyProcPtr ReuseBufferNotify; DRI2SwapLimitValidateProcPtr SwapLimitValidate; DRI2GetParamProcPtr GetParam; @@ -1110,12 +1113,22 @@ DRI2Connect(ScreenPtr pScreen, unsigned int driverType, int *fd, return TRUE; } +static Bool +DRI2AuthMagic (ScreenPtr pScreen, int fd, uint32_t magic) +{ +DRI2ScreenPtr ds = DRI2GetScreen(pScreen); +if (ds == NULL || (*ds-LegacyAuthMagic) (ds-fd, magic)) +return FALSE; Don't need to check ds == NULL here, we're only called when ds is non-NULL. +return TRUE; +} + Bool DRI2Authenticate(ScreenPtr pScreen, uint32_t magic) { DRI2ScreenPtr ds = DRI2GetScreen(pScreen); -if (ds == NULL || (*ds-AuthMagic) (ds-fd, magic)) +if (ds == NULL || (*ds-AuthMagic) (pScreen, ds-fd, magic)) return FALSE; return TRUE; @@ -1202,9 +1215,17 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) cur_minor = 1; } -if (info-version = 5) { +if (info-version = 7) { ds-AuthMagic = info-AuthMagic; } +else if (info-version = 5) { +/* + * This cast is safe; if the driver has provided a V5 or V6 InfoRec + * then AuthMagic is of type DRI2LegacyAuthMagicProcPtr, and the C + * standard guarantees that we can typecast it back and call it. + */ +ds-LegacyAuthMagic = (DRI2LegacyAuthMagicProcPtr)info-AuthMagic; +} if (info-version = 6) { ds-ReuseBufferNotify = info-ReuseBufferNotify; @@ -1218,14 +1239,21 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) /* * 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 + * version is too low, call through LegacyAuthMagic */ -if (!ds-AuthMagic) +if (!ds-AuthMagic) { +ds-AuthMagic = DRI2AuthMagic; +/* + * If the driver doesn't provide an AuthMagic function + * it relies on the old method (using libdrm) or fails + */ +if (!ds-LegacyAuthMagic) #ifdef WITH_LIBDRM -ds-AuthMagic = drmAuthMagic; +ds-LegacyAuthMagic = drmAuthMagic; #else -goto err_out; +goto err_out; #endif +} /* Initialize minor if needed and set to minimum provied by DDX */ if (!dri2_minor || dri2_minor cur_minor) diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h index f849be6..90886a9 100644 --- a/hw/xfree86/dri2/dri2.h +++ b/hw/xfree86/dri2/dri2.h @@ -63,7 +63,7 @@ typedef void (*DRI2CopyRegionProcPtr) (DrawablePtr pDraw, DRI2BufferPtr pDestBuffer,
Re: [PATCH] dri2: Pass a ScreenPtr through to the driver's AuthMagic
On Fri, Jun 15, 2012 at 12:35:00PM +0200, Michel Dänzer wrote: On Fre, 2012-06-15 at 19:01 +1000, Christopher James Halse Rogers wrote: xwayland drivers need access to their screen private data to authenticate. Now that drivers no longer have direct access to the global screen arrays, this needs to be passed in as function context. The way it was working was ugly, anyway. Signed-off-by: Christopher James Halse Rogers christopher.halse.rog...@canonical.com --- This came up when I got around to fixing the nouveau xwayland patch review comments; with things no longer meant to access the global xf86Screens array the authmagic callback needed some other way to access driver private data. Nouveau patch using this follows; I'll send it upstream once this gets applied somewhere. CCd to xorg-devel mainly for sanity review, but could be applied; as Airlied has pointed out, there's no particular reason for the xwayland branch to diverge on core infrastructure. [...] @@ -1202,9 +1215,17 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) cur_minor = 1; } -if (info-version = 5) { +if (info-version = 7) { ds-AuthMagic = info-AuthMagic; } +else if (info-version = 5) { +/* + * This cast is safe; if the driver has provided a V5 or V6 InfoRec + * then AuthMagic is of type DRI2LegacyAuthMagicProcPtr, and the C + * standard guarantees that we can typecast it back and call it. + */ +ds-LegacyAuthMagic = (DRI2LegacyAuthMagicProcPtr)info-AuthMagic; +} This is nifty, but it's an ABI break, as servers without this change will treat the version 7 AuthMagic field incorrectly. Wouldn't it be easier to add a second AuthMagic field at the end of version 7? Drivers can use DRI2Version to see if the xserver is recent enough to understand this trick, but I agree just adding a field to the structs is simpler. Kristian ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[xserver: PATCH] config/udev: allow passing arbitrary configuration via 'ENV{x11_options.$opt}'
It is convenient to play with mouse/touchpad changes at runtime. ENV{ID_INPUT_MOUSE}==?*, ENV{x11_options.Emulate3Buttons}=True # replug the revice to see immediate effect and consistent with hal's configuration scheme. Original-patch: http://lists.debian.org/debian-x/2010/04/msg00320.html Signed-off-by: Sergei Trofimovich sly...@gentoo.org --- config/udev.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/config/udev.c b/config/udev.c index 1995184..35f682f 100644 --- a/config/udev.c +++ b/config/udev.c @@ -37,6 +37,8 @@ #include os.h #include globals.h + +#define UDEV_X11_PROP_KEY x11_options. #define UDEV_XKB_PROP_KEY xkb #define LOG_PROPERTY(path, prop, val) \ @@ -173,6 +175,10 @@ device_added(struct udev_device *udev_device) else if (!strcasecmp(tmp, options)) input_options = input_option_new(input_options, xkb_options, value); +} else if (!strncasecmp(key, UDEV_X11_PROP_KEY, sizeof(UDEV_X11_PROP_KEY) - 1)) { +tmp = key + sizeof(UDEV_X11_PROP_KEY) - 1; +input_options = +input_option_new(input_options, tmp, value); } else if (!strcmp(key, ID_VENDOR)) { LOG_PROPERTY(path, key, value); -- 1.7.8.6 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[xserver: PATCH] test/.gitignore: add hashtabletest
Signed-off-by: Sergei Trofimovich sly...@gentoo.org --- test/.gitignore |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/test/.gitignore b/test/.gitignore index 5d4fdfa..23d4c8f 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -1,4 +1,5 @@ fixes +hashtabletest input list misc -- 1.7.8.6 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH] dri2: Pass a ScreenPtr through to the driver's AuthMagic function.
xwayland drivers need access to their screen private data to authenticate. Now that drivers no longer have direct access to the global screen arrays, this needs to be passed in as function context. v2: Don't break ABI Signed-off-by: Christopher James Halse Rogers christopher.halse.rog...@canonical.com --- hw/xfree86/dri2/dri2.c | 35 --- hw/xfree86/dri2/dri2.h |9 - 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index babf32f..412feb3 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -104,7 +104,8 @@ typedef struct _DRI2Screen { DRI2ScheduleSwapProcPtr ScheduleSwap; DRI2GetMSCProcPtr GetMSC; DRI2ScheduleWaitMSCProcPtr ScheduleWaitMSC; -DRI2AuthMagicProcPtr AuthMagic; +DRI2AuthMagic2ProcPtr AuthMagic; +DRI2AuthMagicProcPtr LegacyAuthMagic; DRI2ReuseBufferNotifyProcPtr ReuseBufferNotify; DRI2SwapLimitValidateProcPtr SwapLimitValidate; DRI2GetParamProcPtr GetParam; @@ -1110,12 +,22 @@ DRI2Connect(ScreenPtr pScreen, unsigned int driverType, int *fd, return TRUE; } +static Bool +DRI2AuthMagic (ScreenPtr pScreen, int fd, uint32_t magic) +{ +DRI2ScreenPtr ds = DRI2GetScreen(pScreen); +if (ds == NULL || (*ds-LegacyAuthMagic) (ds-fd, magic)) +return FALSE; + +return TRUE; +} + Bool DRI2Authenticate(ScreenPtr pScreen, uint32_t magic) { DRI2ScreenPtr ds = DRI2GetScreen(pScreen); -if (ds == NULL || (*ds-AuthMagic) (ds-fd, magic)) +if (ds == NULL || (*ds-AuthMagic) (pScreen, ds-fd, magic)) return FALSE; return TRUE; @@ -1202,8 +1213,11 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) cur_minor = 1; } +if (info-version = 8) { +ds-AuthMagic = info-AuthMagic2; +} if (info-version = 5) { -ds-AuthMagic = info-AuthMagic; +ds-LegacyAuthMagic = info-AuthMagic; } if (info-version = 6) { @@ -1218,14 +1232,21 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) /* * 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 + * version is too low, call through LegacyAuthMagic */ -if (!ds-AuthMagic) +if (!ds-AuthMagic) { +ds-AuthMagic = DRI2AuthMagic; +/* + * If the driver doesn't provide an AuthMagic function + * it relies on the old method (using libdrm) or fails + */ +if (!ds-LegacyAuthMagic) #ifdef WITH_LIBDRM -ds-AuthMagic = drmAuthMagic; +ds-LegacyAuthMagic = drmAuthMagic; #else -goto err_out; +goto err_out; #endif +} /* Initialize minor if needed and set to minimum provied by DDX */ if (!dri2_minor || dri2_minor cur_minor) diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h index f849be6..004d286 100644 --- a/hw/xfree86/dri2/dri2.h +++ b/hw/xfree86/dri2/dri2.h @@ -64,6 +64,7 @@ typedef void (*DRI2CopyRegionProcPtr) (DrawablePtr pDraw, DRI2BufferPtr pSrcBuffer); typedef void (*DRI2WaitProcPtr) (WindowPtr pWin, unsigned int sequence); typedef int (*DRI2AuthMagicProcPtr) (int fd, uint32_t magic); +typedef int (*DRI2AuthMagic2ProcPtr) (ScreenPtr pScreen, int fd, uint32_t magic); /** * Schedule a buffer swap @@ -192,7 +193,7 @@ typedef int (*DRI2GetParamProcPtr) (ClientPtr client, /** * Version of the DRI2InfoRec structure defined in this header */ -#define DRI2INFOREC_VERSION 7 +#define DRI2INFOREC_VERSION 8 typedef struct { unsigned int version; /** Version of this struct */ @@ -229,6 +230,12 @@ typedef struct { /* added in version 7 */ DRI2GetParamProcPtr GetParam; + +/* added in version 8 */ +/* AuthMagic callback which passes extra context */ +/* If this is NULL the AuthMagic callback is used */ +/* If this is non-NULL the AuthMagic callback is ignored */ +DRI2AuthMagic2ProcPtr AuthMagic2; } DRI2InfoRec, *DRI2InfoPtr; extern _X_EXPORT int DRI2EventBase; -- 1.7.10.4 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [xserver: PATCH] test/.gitignore: add hashtabletest
On Mon, Jun 18, 2012 at 01:13:21AM +0300, Sergei Trofimovich wrote: Signed-off-by: Sergei Trofimovich sly...@gentoo.org --- test/.gitignore |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/test/.gitignore b/test/.gitignore index 5d4fdfa..23d4c8f 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -1,4 +1,5 @@ fixes +hashtabletest input list misc -- 1.7.8.6 applied, thanks Cheers, Peter ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [xserver: PATCH] config/udev: allow passing arbitrary configuration via 'ENV{x11_options.$opt}'
On Mon, Jun 18, 2012 at 01:14:00AM +0300, Sergei Trofimovich wrote: It is convenient to play with mouse/touchpad changes at runtime. ENV{ID_INPUT_MOUSE}==?*, ENV{x11_options.Emulate3Buttons}=True # replug the revice to see immediate effect and consistent with hal's configuration scheme. Original-patch: http://lists.debian.org/debian-x/2010/04/msg00320.html Signed-off-by: Sergei Trofimovich sly...@gentoo.org no, sorry. it was a conscious decision to not add this option when we merged udev/xorg.conf.d in 1.8. http://lists.x.org/archives/xorg-devel/2009-October/002859.html The main argument is that xorg configuration should be stored in xorg, not in other projects. When we used HAL we did it that way because we lacked xorg.conf.d support but it wasn't particularly good idea and we did cop a lot of flak for it. for run-time changes you can use xinput, synclient, xsetwacom or other tools, but persistent storage is in xorg.conf(.d) only. Cheers, Peter --- config/udev.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/config/udev.c b/config/udev.c index 1995184..35f682f 100644 --- a/config/udev.c +++ b/config/udev.c @@ -37,6 +37,8 @@ #include os.h #include globals.h + +#define UDEV_X11_PROP_KEY x11_options. #define UDEV_XKB_PROP_KEY xkb #define LOG_PROPERTY(path, prop, val) \ @@ -173,6 +175,10 @@ device_added(struct udev_device *udev_device) else if (!strcasecmp(tmp, options)) input_options = input_option_new(input_options, xkb_options, value); +} else if (!strncasecmp(key, UDEV_X11_PROP_KEY, sizeof(UDEV_X11_PROP_KEY) - 1)) { +tmp = key + sizeof(UDEV_X11_PROP_KEY) - 1; +input_options = +input_option_new(input_options, tmp, value); } else if (!strcmp(key, ID_VENDOR)) { LOG_PROPERTY(path, key, value); -- 1.7.8.6 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 0/4] Fixing dtrace object generation
[PATCH 1.12] was the trigger for this series, I want that on the 1.12 branch but for master the patch series applies. We've disabled a bunch of tests when building with --disable-xorg but most of those don't actually need Xorg to be built - libtool just doesn't package up dix.O and os.O into libxservertest.la. Patch 3/4 changes from a custom library that links all objects into dix.O to just using libtool to create a .lo for the dtrace parts. Not sure how permissible this is though, review very welcome. Passes make dist on my box, but I definitely want XQuartz testing for this too. Cheers, Peter ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 4/4] test: enable non-Xorg tests
Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- test/Makefile.am |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index 0b93c1c..b451286 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,11 +1,10 @@ if ENABLE_UNIT_TESTS -SUBDIRS= . -noinst_PROGRAMS = list string touch +SUBDIRS= . xi2 +noinst_PROGRAMS = list string touch xkb input xtest misc fixes if XORG # Tests that require at least some DDX functions in order to fully link # For now, requires xf86 ddx, could be adjusted to use another -SUBDIRS += xi2 -noinst_PROGRAMS += xkb input xtest misc fixes xfree86 +noinst_PROGRAMS += xfree86 endif check_LTLIBRARIES = libxservertest.la -- 1.7.10.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 2/4] mi: don't call XFree86DRIExtensionInit when not building without XORGSERVER
XF86DRI define may be defined if we're building DDX other than Xorg, so we need to special-case it here. XFreeXDGA and XFree86VidModeExtensionInit depend on Xorg in configure.ac, the others are non-ddx specific. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- mi/miinitext.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/mi/miinitext.c b/mi/miinitext.c index 6ceae05..42983db 100644 --- a/mi/miinitext.c +++ b/mi/miinitext.c @@ -459,10 +459,12 @@ InitExtensions(int argc, char *argv[]) XFree86DGAExtensionInit(); #endif #ifdef XF86DRI +#ifdef XORGSERVER /* XF86DRI may be defined when building without Xorg */ if (!noXFree86DRIExtension) XFree86DRIExtensionInit(); #endif #endif +#endif #ifdef XFIXES /* must be before Render to layer DisplayCursor correctly */ if (!noXFixesExtension) -- 1.7.10.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 1/4] AC_SUBST the GLX_SYS_LIBS
libxservertest needs -lpthread from glxapi.c's pthread_once() call. Usually this would be pulled in by the XORG_LIBS but not when building without Xorg. This commit has no visible effect on the current tree, preparation for test cleanups. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- configure.ac |1 + test/Makefile.am |2 +- test/xi2/Makefile.am |2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 763ca7a..9cf2821 100644 --- a/configure.ac +++ b/configure.ac @@ -1060,6 +1060,7 @@ if test x$GLX_USE_TLS = xyes ; then GLX_SYS_LIBS=$GLX_SYS_LIBS -lpthread fi AC_SUBST([GLX_DEFINES]) +AC_SUBST([GLX_SYS_LIBS]) AM_CONDITIONAL(DRI, test x$DRI = xyes) if test x$DRI = xyes; then diff --git a/test/Makefile.am b/test/Makefile.am index 32be00d..76e651c 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -20,7 +20,7 @@ INCLUDES += -I$(top_srcdir)/hw/xfree86/parser \ -I$(top_srcdir)/hw/xfree86/i2c -I$(top_srcdir)/hw/xfree86/modes \ -I$(top_srcdir)/hw/xfree86/ramdac endif -TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) +TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) if XORG if SPECIAL_DTRACE_OBJECTS diff --git a/test/xi2/Makefile.am b/test/xi2/Makefile.am index 913ba0f..9de7abf 100644 --- a/test/xi2/Makefile.am +++ b/test/xi2/Makefile.am @@ -18,7 +18,7 @@ TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV) AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ INCLUDES = @XORG_INCS@ -TEST_LDADD=../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) +TEST_LDADD=../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) COMMON_SOURCES=protocol-common.h protocol-common.c if SPECIAL_DTRACE_OBJECTS -- 1.7.10.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 3/4] Fix dtrace hook special object generation
With --disable-xorg, We also disabled a bunch of tests because of their perceived reliance on a DDX. The cause was libtool missing some object files that never ended up in libxservertest.la. Only the xfree86 test has a true dependency on XORG. DIX_LIB was pointing to dix.O (instead of libdix.la) when DTRACE_SPECIAL_OBJECTS was defined. libdix.la should be part of XSERVER_LIBS but dix.O is not a recognised libtool object, so it got skipped for libxservertest.a. Only in the XORG case would we add DIX_LIB and OS_LIB manually, thus forcing linkage with the dtrace-generated objects. Fix this by packaging up the dtrace-generated files as part of libdix.la/libos.la. Hilarity included to auto-create the source file (so automake will trigger the hook) and calling libtool --mode=compile so it'll recognise the dtrace-generated object files and package, suggestions welcome. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- configure.ac | 10 +++--- dix/Makefile.am | 15 +++ os/Makefile.am | 14 -- test/Makefile.am |7 --- test/xi2/Makefile.am |4 5 files changed, 18 insertions(+), 32 deletions(-) diff --git a/configure.ac b/configure.ac index 9cf2821..d2b1540 100644 --- a/configure.ac +++ b/configure.ac @@ -1314,13 +1314,9 @@ AC_DEFINE(XSYNC, 1, [Support XSync extension]) AC_DEFINE(XCMISC, 1, [Support XCMisc extension]) AC_DEFINE(BIGREQS, 1, [Support BigRequests extension]) -if test x$SPECIAL_DTRACE_OBJECTS = xyes ; then - DIX_LIB='$(top_builddir)/dix/dix.O' - OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS) $(DLOPEN_LIBS)' -else - DIX_LIB='$(top_builddir)/dix/libdix.la' - OS_LIB='$(top_builddir)/os/libos.la' -fi +DIX_LIB='$(top_builddir)/dix/libdix.la' +OS_LIB='$(top_builddir)/os/libos.la' + AC_SUBST([DIX_LIB]) AC_SUBST([OS_LIB]) diff --git a/dix/Makefile.am b/dix/Makefile.am index b7358aa..6a1e0c3 100644 --- a/dix/Makefile.am +++ b/dix/Makefile.am @@ -60,14 +60,13 @@ endif if SPECIAL_DTRACE_OBJECTS # Generate dtrace object code for probes in libdix -dtrace-dix.o: $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS) - $(AM_V_GEN)$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS:%.lo=.libs/%.o) +BUILT_SOURCES = dix-probes.dtrace +dix-probes.dtrace: $(srcdir)/Xserver.d + touch $@ -noinst_PROGRAMS = dix.O - -dix_O_SOURCES = -dix.O: dtrace-dix.o $(am_libdix_la_OBJECTS) - $(AM_V_GEN)ld -r -o $@ $(am_libdix_la_OBJECTS:%.lo=.libs/%.o) +.dtrace.lo: $(top_srcdir)/dix/Xserver.d + $(AM_V_GEN)$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS)--mode=compile $(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d +libdix_la_SOURCES += dix-probes.dtrace endif -CLEANFILES = Xserver-dtrace.h +CLEANFILES = Xserver-dtrace.h dix-probes.dtrace diff --git a/os/Makefile.am b/os/Makefile.am index 8891485..3cad763 100644 --- a/os/Makefile.am +++ b/os/Makefile.am @@ -38,12 +38,14 @@ EXTRA_DIST = $(SECURERPC_SRCS) $(XDMCP_SRCS) if SPECIAL_DTRACE_OBJECTS # Generate dtrace object code for probes in libos libdix -dtrace.o: $(top_srcdir)/dix/Xserver.d $(am_libos_la_OBJECTS) - $(AM_V_GEN)$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d .libs/*.o ../dix/.libs/*.o +BUILT_SOURCES = probes.dtrace +probes.dtrace: $(top_srcdir)/dix/Xserver.d + touch $@ -noinst_PROGRAMS = os.O +.dtrace.lo: $(top_srcdir)/dix/Xserver.d + $(AM_V_GEN)$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d -os_O_SOURCES = -os.O: dtrace.o $(am_libos_la_OBJECTS) - $(AM_V_GEN)ld -r -o $@ dtrace.o .libs/*.o +libos_la_SOURCES += probes.dtrace + +CLEANFILES = probes.dtrace endif diff --git a/test/Makefile.am b/test/Makefile.am index 76e651c..0b93c1c 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -21,13 +21,6 @@ INCLUDES += -I$(top_srcdir)/hw/xfree86/parser \ -I$(top_srcdir)/hw/xfree86/ramdac endif TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) - -if XORG -if SPECIAL_DTRACE_OBJECTS -TEST_LDADD += $(OS_LIB) $(DIX_LIB) -endif -endif - xkb_LDADD=$(TEST_LDADD) input_LDADD=$(TEST_LDADD) xtest_LDADD=$(TEST_LDADD) diff --git a/test/xi2/Makefile.am b/test/xi2/Makefile.am index 9de7abf..0ad8b10 100644 --- a/test/xi2/Makefile.am +++ b/test/xi2/Makefile.am @@ -21,10 +21,6 @@ INCLUDES = @XORG_INCS@ TEST_LDADD=../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) COMMON_SOURCES=protocol-common.h protocol-common.c -if SPECIAL_DTRACE_OBJECTS -TEST_LDADD += $(OS_LIB) $(DIX_LIB) -endif - protocol_xiqueryversion_LDADD=$(TEST_LDADD) protocol_xiquerydevice_LDADD=$(TEST_LDADD) protocol_xiselectevents_LDADD=$(TEST_LDADD) -- 1.7.10.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 1.12] build the touch test only when building Xorg
From: Dan Horák d...@danny.cz Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- test/Makefile.am |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index 32be00d..93a102a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,11 +1,11 @@ if ENABLE_UNIT_TESTS SUBDIRS= . -noinst_PROGRAMS = list string touch +noinst_PROGRAMS = list string if XORG # Tests that require at least some DDX functions in order to fully link # For now, requires xf86 ddx, could be adjusted to use another SUBDIRS += xi2 -noinst_PROGRAMS += xkb input xtest misc fixes xfree86 +noinst_PROGRAMS += xkb input xtest misc fixes xfree86 touch endif check_LTLIBRARIES = libxservertest.la -- 1.7.10.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PULL] integration tests
On Fri, Jun 15, 2012 at 03:57:15PM -0700, Keith Packard wrote: Peter Hutterer peter.hutte...@who-t.net writes: The current tests need to be run as root to work, they require uinput devices to be created. If not run as root, the tests will succeed anyway (with a messsage) so make check won't just error out all the time. These tests need the evdev driver installed, along with correctly functioning udev and other bits. As such, they need to not get run in the general 'make check' process, but should instead be called from a new 'make integration-check' target (thanks to Peter for the name btw). I've also been unable to run these tests on debian unstable; I can package and upload whatever additional bits are needed to make that work by default. the main package that you'll likely need is utouch-evemu. Not sure if that's packaged in debian. afaict, for the gtest sources, well, you need the actual sources somewhere locally and point configure to it. The goal of doing integration testing to make sure the server works with various drivers is laudable though; let's make sure it's usable by most people (or at least by me :-) so that testing happens on a regular basis. atm it's less of a driver testing and more of an expansion of the existing unit tests. too many of them require a fully set up cursor to check for certain tests and that's not easy to do without running the actual server. I really consider the integration tests XTS-like. don't expect XTS to be ported to gtest tough :) Cheers, Peter ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel