Re: [PATCH v2] xf86: Fix non-PCI configuration-less setups
On Wed, Oct 17, 2012 at 12:06:47PM +0200, Thierry Reding wrote: For non-PCI video devices, such as those found on many ARM embedded systems, the X server currently requires the BusID option to specify the full path to the DRM device's sysfs node in order to properly match it against the probed platform devices. In order to allow X to start up properly if either the BusID option was omitted or no configuration is present at all, the first video device is used by default. Signed-off-by: Thierry Reding thierry.red...@avionic-design.de --- Changes in v2: - Add additional checks for safety (I don't think numDevs will ever be 0 since a default will be generated if no configuration is present, but it doesn't hurt to check anyway). Without these checks there is a possibility of the X server crashing if no platform devices have been found. hw/xfree86/common/xf86platformBus.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c index 0525e39..599d84a 100644 --- a/hw/xfree86/common/xf86platformBus.c +++ b/hw/xfree86/common/xf86platformBus.c @@ -377,6 +377,14 @@ xf86platformProbeDev(DriverPtr drvp) continue; } +/* + * If all of the above fails, which can happen if X was started without + * configuration or if BusID wasn't set for non-PCI devices, use the first + * device by default. + */ +if (!foundScreen xf86_num_platform_devices 0 numDevs 0) +foundScreen = probeSingleDevice(xf86_platform_devices[0], drvp, devList[0], 0); + /* if autoaddgpu devices is enabled then go find a few more and add them as GPU screens */ if (xf86Info.autoAddGPU numDevs) { for (j = 0; j xf86_num_platform_devices; j++) { Can anyone review this patch? I think it is also a candidate for 1.13, since it fixes a regression from the 1.12 series. Thierry pgpIfvRWYOWRj.pgp Description: PGP signature ___ 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 xf86-video-modesetting 1/2] build: Put m4 macros in m4 subdirectory
This silences a warning from libtoolize when running the autogen.sh script. Signed-off-by: Thierry Reding thierry.red...@avionic-design.de --- Makefile.am | 2 ++ autogen.sh | 1 + configure.ac | 1 + 3 files changed, 4 insertions(+) diff --git a/Makefile.am b/Makefile.am index 8e4dfdb..a7ab3e0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,6 +18,8 @@ # 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. +ACLOCAL_AMFLAGS = -I m4 + SUBDIRS = src man MAINTAINERCLEANFILES = ChangeLog INSTALL diff --git a/autogen.sh b/autogen.sh index 904cd67..f83ed27 100755 --- a/autogen.sh +++ b/autogen.sh @@ -5,6 +5,7 @@ test -z $srcdir srcdir=. ORIGDIR=`pwd` cd $srcdir +test -d m4 || mkdir m4 autoreconf -v --install || exit 1 cd $ORIGDIR || exit $? diff --git a/configure.ac b/configure.ac index b6815c4..58b1666 100644 --- a/configure.ac +++ b/configure.ac @@ -28,6 +28,7 @@ AC_INIT([xf86-video-modesetting], [xf86-video-modesetting]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR(.) AC_SYS_LARGEFILE -- 1.8.0 ___ 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 xf86-video-modesetting 2/2] Remove call to miInitializeBackingStore()
Recent versions of the X server no longer provide this function, which has been obsolete for over 2 years now. Signed-off-by: Thierry Reding thierry.red...@avionic-design.de --- src/driver.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/driver.c b/src/driver.c index 38a1c09..4866585 100644 --- a/src/driver.c +++ b/src/driver.c @@ -897,7 +897,6 @@ ScreenInit(SCREEN_INIT_ARGS_DECL) xf86SetBlackWhitePixels(pScreen); -miInitializeBackingStore(pScreen); xf86SetBackingStore(pScreen); xf86SetSilkenMouse(pScreen); miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); -- 1.8.0 ___ 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/7] Various DIX patches
Various DIX patches Patches #2, #4 and #7 touch Xquartz to adjust for these changes, and I have tried to ensure that they do the right thing, but I am not able to test that Xquartz builds with those changes. Jon TURNEY (7): os: Remove any old logfile before trying to write to it Allow DDX to provide a main() glx: Synchronize Xserver glx/rensize.c with mesa src/glx/compsize.c Move pseudoramiX code where it can be shared between Xwin and Xquartz Build dpmsstubs.c once as a convenience library, rather than once for each DDX which wants to use it Build Xi/stubs.c once as a convenience library, rather than once for each DDX which wants to use it Add a screen PaintWindow wrapper Makefile.am |2 + Xext/Makefile.am |4 ++- Xi/Makefile.am|5 ++- composite/compwindow.c|2 +- configure.ac |3 +- dix/Makefile.am |3 +- dix/main.c|6 + dix/stubmain.c| 33 +++ dix/window.c |3 +- glx/rensize.c |2 + hw/dmx/doc/dmx.xml|2 +- hw/vfb/Makefile.am|6 ++-- hw/xnest/Makefile.am |6 ++-- hw/xquartz/Makefile.am|4 +- hw/xquartz/quartz.c |2 +- hw/xwin/InitOutput.c |6 + hw/xwin/Makefile.am |9 --- hw/xwin/winrandr.c|2 +- include/scrnintstr.h |5 mi/miexpose.c | 28 +- mi/mioverlay.c| 12 +- mi/miscrinit.c|1 + mi/miwindow.c |4 +- miext/rootless/rootlessCommon.h |1 + miext/rootless/rootlessScreen.c |3 +- miext/rootless/rootlessWindow.c | 35 + miext/rootless/rootlessWindow.h |1 + os/log.c |3 ++ pseudoramiX/Makefile.am |7 + {hw/xquartz = pseudoramiX}/pseudoramiX.c |0 {hw/xquartz = pseudoramiX}/pseudoramiX.h |0 test/Makefile.am |6 ++-- 32 files changed, 140 insertions(+), 66 deletions(-) create mode 100644 dix/stubmain.c create mode 100644 pseudoramiX/Makefile.am rename {hw/xquartz = pseudoramiX}/pseudoramiX.c (100%) rename {hw/xquartz = pseudoramiX}/pseudoramiX.h (100%) -- 1.7.9 ___ 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/7] os: Remove any old logfile before trying to write to it
If we are not backing up logfiles, remove the old logfile before trying to write a new logfile, as otherwise the operation may fail if the previous logfile was created by a different user. This change is useful when: - The DDX doesn't use the logfile backup mechanism (i.e. not Xorg) - The DDX is run by a non-root user, and then by a different non-root user - The logfile directory doesn't have the restricted-deletion flag set Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk Acked-by: Yaakov Selkowitz yselkow...@users.sourceforge.net Reviewed-by: Yaakov Selkowitz yselkow...@users.sourceforge.net --- os/log.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/os/log.c b/os/log.c index 4820e9a..15271eb 100644 --- a/os/log.c +++ b/os/log.c @@ -216,6 +216,9 @@ LogInit(const char *fname, const char *backup) free(oldLog); } } +else { +unlink(logFileName); +} if ((logFile = fopen(logFileName, w)) == NULL) FatalError(Cannot open log file \%s\\n, logFileName); setvbuf(logFile, NULL, _IONBF, 0); -- 1.7.9 ___ 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/7] Allow DDX to provide a main()
XQuartz already conditionally renames main() as dix_main() so it can provide it's own main(). This isn't ideal as it prevents libdix built this way from being useful with any other DDX. So instead, always name that function dix_main(), and provide a stub main() which just calls it where needed. Add a main() to XWin. It's no longer neccessary to link XWin and XQuartz with libmain. Future work: prototype dix_main() somewhere, without it ending up in sdksyms... Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk --- configure.ac |2 +- dix/Makefile.am |3 ++- dix/main.c |6 +- dix/stubmain.c | 33 + hw/xwin/InitOutput.c |6 ++ hw/xwin/Makefile.am |4 ++-- 6 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 dix/stubmain.c diff --git a/configure.ac b/configure.ac index 38ac240..e6f9cb7 100644 --- a/configure.ac +++ b/configure.ac @@ -1960,7 +1960,7 @@ if test x$XQUARTZ = xyes; then AC_DEFINE(XQUARTZ,1,[Have Quartz]) AC_DEFINE(ROOTLESS,1,[Build Rootless code]) - XQUARTZ_LIBS=$MAIN_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB + XQUARTZ_LIBS=$FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB AC_SUBST([XQUARTZ_LIBS]) AC_CHECK_LIB([Xplugin],[xp_init],[:]) diff --git a/dix/Makefile.am b/dix/Makefile.am index b7358aa..e7ca236 100644 --- a/dix/Makefile.am +++ b/dix/Makefile.am @@ -4,7 +4,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include AM_CFLAGS = $(DIX_CFLAGS) libmain_la_SOURCES =\ - main.c + stubmain.c libdix_la_SOURCES =\ atom.c \ @@ -14,6 +14,7 @@ libdix_la_SOURCES = \ dispatch.c \ dispatch.h \ dixfonts.c \ + main.c \ dixutils.c \ enterleave.c\ enterleave.h\ diff --git a/dix/main.c b/dix/main.c index fb935c9..82b5ee7 100644 --- a/dix/main.c +++ b/dix/main.c @@ -125,14 +125,10 @@ BOOL serverRunning = FALSE; pthread_mutex_t serverRunningMutex = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t serverRunningCond = PTHREAD_COND_INITIALIZER; -int dix_main(int argc, char *argv[], char *envp[]); +#endif int dix_main(int argc, char *argv[], char *envp[]) -#else -int -main(int argc, char *argv[], char *envp[]) -#endif { int i; HWEventQueueType alwaysCheckForInput[2]; diff --git a/dix/stubmain.c b/dix/stubmain.c new file mode 100644 index 000..25ef50d --- /dev/null +++ b/dix/stubmain.c @@ -0,0 +1,33 @@ +/*** + +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, sublicense, +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 NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS 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. + +**/ + +int dix_main(int argc, char *argv[], char *envp[]); + +/* + A default implementation of main, which can be overridden by the DDX + */ +int +main(int argc, char *argv[], char *envp[]) +{ +return dix_main(argc, argv, envp); +} diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index 4bcd3a0..fe8dcd4 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -186,6 +186,12 @@ ddxBeforeReset(void) } #endif +int +main(int argc, char *argv[], char *envp[]) +{ +return dix_main(argc, argv, envp); +} + /* See Porting Layer Definition - p. 57 */ void ddxGiveUp(enum ExitCode error) diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index 3fcaf9d..6aac6a9 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -149,8 +149,8 @@ INCLUDES = -I$(top_srcdir)/miext/rootless XWIN_SYS_LIBS += -ldxguid -XWin_DEPENDENCIES = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) -XWin_LDADD = $(MULTIWINDOWEXTWM_LIBS)
[PATCH 3/7] glx: Synchronize Xserver glx/rensize.c with mesa src/glx/compsize.c
https://bugs.freedesktop.org/show_bug.cgi?id=30102 Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk Reviewed-by: Colin Harrison colin.harri...@virgin.net --- glx/rensize.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/glx/rensize.c b/glx/rensize.c index bcc3a53..a78e60c 100644 --- a/glx/rensize.c +++ b/glx/rensize.c @@ -226,12 +226,14 @@ __glXImageSize(GLenum format, GLenum type, GLenum target, case GL_INTENSITY: elementsPerGroup = 1; break; +case GL_RG: case GL_422_EXT: case GL_422_REV_EXT: case GL_422_AVERAGE_EXT: case GL_422_REV_AVERAGE_EXT: case GL_DEPTH_STENCIL_NV: case GL_DEPTH_STENCIL_MESA: +case GL_YCBCR_422_APPLE: case GL_YCBCR_MESA: case GL_LUMINANCE_ALPHA: elementsPerGroup = 2; -- 1.7.9 ___ 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/7] Move pseudoramiX code where it can be shared between Xwin and Xquartz
Move pseudoramiX code to a separate top-level directory. Link Xwin and Xquartz with libPseudoramiX I'm not sure moving this to a top-level directory is appropriate, but I'm not sure where else it fits. Future work: pseudoramiX can probably be consolidated with the rrxinerama code (which I think provides fake xinerama data when real XINERAMA is disabled and we only have one screen) v2: fix distcheck Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk --- Makefile.am |2 ++ configure.ac |1 + hw/xquartz/Makefile.am|4 ++-- hw/xwin/Makefile.am |1 + pseudoramiX/Makefile.am |7 +++ {hw/xquartz = pseudoramiX}/pseudoramiX.c |0 {hw/xquartz = pseudoramiX}/pseudoramiX.h |0 7 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 pseudoramiX/Makefile.am rename {hw/xquartz = pseudoramiX}/pseudoramiX.c (100%) rename {hw/xquartz = pseudoramiX}/pseudoramiX.h (100%) diff --git a/Makefile.am b/Makefile.am index 9a62853..7be4271 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,6 +27,7 @@ SUBDIRS = \ Xext \ miext \ os \ + pseudoramiX \ randr \ render \ Xi \ @@ -77,6 +78,7 @@ DIST_SUBDIRS = \ Xext \ miext \ os \ + pseudoramiX \ randr \ render \ Xi \ diff --git a/configure.ac b/configure.ac index e6f9cb7..3ad9ca5 100644 --- a/configure.ac +++ b/configure.ac @@ -2237,6 +2237,7 @@ miext/damage/Makefile miext/shadow/Makefile miext/rootless/Makefile os/Makefile +pseudoramiX/Makefile randr/Makefile render/Makefile xkb/Makefile diff --git a/hw/xquartz/Makefile.am b/hw/xquartz/Makefile.am index a7cc012..2e894d7 100644 --- a/hw/xquartz/Makefile.am +++ b/hw/xquartz/Makefile.am @@ -28,7 +28,6 @@ libXquartz_la_SOURCES = \ darwinEvents.c \ darwinXinput.c \ keysym2ucs.c \ - pseudoramiX.c \ quartz.c \ quartzCocoa.m \ quartzKeyboard.c \ @@ -36,6 +35,8 @@ libXquartz_la_SOURCES = \ quartzRandR.c \ console_redirect.c +libXquartz_la_LIBADD = $(top_builddir)/pseudoramiX/libPseudoramiX.la + EXTRA_DIST = \ X11Application.h \ X11Controller.h \ @@ -44,7 +45,6 @@ EXTRA_DIST = \ darwinfb.h \ darwinEvents.h \ keysym2ucs.h \ - pseudoramiX.h \ quartz.h \ quartzCommon.h \ quartzKeyboard.h \ diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index 6aac6a9..e00434c 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -148,6 +148,7 @@ XWin_SOURCES = $(SRCS) INCLUDES = -I$(top_srcdir)/miext/rootless XWIN_SYS_LIBS += -ldxguid +XWIN_LIBS += $(top_builddir)/pseudoramiX/libPseudoramiX.la XWin_DEPENDENCIES = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(XSERVER_LIBS) XWin_LDADD = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) diff --git a/pseudoramiX/Makefile.am b/pseudoramiX/Makefile.am new file mode 100644 index 000..17b664b --- /dev/null +++ b/pseudoramiX/Makefile.am @@ -0,0 +1,7 @@ +# Fake Xinerama extension + +AM_CFLAGS = $(DIX_CFLAGS) + +noinst_LTLIBRARIES = libPseudoramiX.la + +libPseudoramiX_la_SOURCES = pseudoramiX.c pseudoramiX.h diff --git a/hw/xquartz/pseudoramiX.c b/pseudoramiX/pseudoramiX.c similarity index 100% rename from hw/xquartz/pseudoramiX.c rename to pseudoramiX/pseudoramiX.c diff --git a/hw/xquartz/pseudoramiX.h b/pseudoramiX/pseudoramiX.h similarity index 100% rename from hw/xquartz/pseudoramiX.h rename to pseudoramiX/pseudoramiX.h -- 1.7.9 ___ 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 5/7] Build dpmsstubs.c once as a convenience library, rather than once for each DDX which wants to use it
Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk --- Xext/Makefile.am |4 +++- hw/vfb/Makefile.am |4 ++-- hw/xnest/Makefile.am |4 ++-- hw/xwin/Makefile.am |4 ++-- test/Makefile.am |2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Xext/Makefile.am b/Xext/Makefile.am index 8e31f13..a9a4468 100644 --- a/Xext/Makefile.am +++ b/Xext/Makefile.am @@ -1,4 +1,4 @@ -noinst_LTLIBRARIES = libXext.la +noinst_LTLIBRARIES = libXext.la libXextdpmsstubs.la AM_CFLAGS = $(DIX_CFLAGS) @@ -96,6 +96,8 @@ endif libXext_la_SOURCES = $(BUILTIN_SRCS) libXext_la_LIBADD =$(BUILTIN_LIBS) +libXextdpmsstubs_la_SOURCES = dpmsstubs.c + EXTRA_DIST = \ $(MITSHM_SRCS) \ $(XV_SRCS) \ diff --git a/hw/vfb/Makefile.am b/hw/vfb/Makefile.am index 9f4992c..c9f6957 100644 --- a/hw/vfb/Makefile.am +++ b/hw/vfb/Makefile.am @@ -9,7 +9,6 @@ AM_CFLAGS = -DHAVE_DIX_CONFIG_H \ SRCS = InitInput.c \ InitOutput.c \ - $(top_srcdir)/Xext/dpmsstubs.c \ $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/mi/miinitext.c @@ -22,7 +21,8 @@ XVFB_LIBS = \ @XVFB_LIBS@ \ libfbcmap.a \ $(MAIN_LIB) \ - $(XSERVER_LIBS) + $(XSERVER_LIBS) \ + $(top_builddir)/Xext/libXextdpmsstubs.la Xvfb_LDADD = $(XVFB_LIBS) $(XVFB_SYS_LIBS) $(XSERVER_SYS_LIBS) Xvfb_DEPENDENCIES = $(XVFB_LIBS) diff --git a/hw/xnest/Makefile.am b/hw/xnest/Makefile.am index 3c099cd..c5560fd 100644 --- a/hw/xnest/Makefile.am +++ b/hw/xnest/Makefile.am @@ -42,7 +42,6 @@ SRCS =Args.c \ XNPixmap.h \ XNWindow.h \ xnest-config.h \ - $(top_srcdir)/Xext/dpmsstubs.c \ $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/mi/miinitext.c @@ -51,7 +50,8 @@ libfbcmap_a_CFLAGS = $(AM_CFLAGS) XNEST_LIBS = \ @XNEST_LIBS@ \ - libfbcmap.a + libfbcmap.a \ + $(top_builddir)/Xext/libXextdpmsstubs.la Xnest_SOURCES = $(SRCS) diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index e00434c..a5f2348 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -122,7 +122,6 @@ SRCS = InitInput.c \ winresource.h \ winwindow.h \ XWin.rc \ - $(top_srcdir)/Xext/dpmsstubs.c \ $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/mi/miinitext.c \ $(top_srcdir)/fb/fbcmap_mi.c \ @@ -148,7 +147,8 @@ XWin_SOURCES = $(SRCS) INCLUDES = -I$(top_srcdir)/miext/rootless XWIN_SYS_LIBS += -ldxguid -XWIN_LIBS += $(top_builddir)/pseudoramiX/libPseudoramiX.la +XWIN_LIBS += $(top_builddir)/pseudoramiX/libPseudoramiX.la \ +$(top_builddir)/Xext/libXextdpmsstubs.la XWin_DEPENDENCIES = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(XSERVER_LIBS) XWin_LDADD = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) diff --git a/test/Makefile.am b/test/Makefile.am index 34f53fc..0c1e595 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -68,7 +68,6 @@ else nodist_libxservertest_la_SOURCES = \ ddxstubs.c \ $(top_srcdir)/mi/miinitext.c \ -$(top_srcdir)/Xext/dpmsstubs.c \ $(top_srcdir)/Xi/stubs.c libxservertest_la_LIBADD += \ @@ -80,6 +79,7 @@ libxservertest_la_LIBADD += \ $(top_builddir)/randr/librandr.la \ $(top_builddir)/render/librender.la \ $(top_builddir)/Xext/libXext.la \ +$(top_builddir)/Xext/libXextdpmsstubs.la \ $(top_builddir)/Xi/libXi.la \ $(top_builddir)/xfixes/libxfixes.la \ $(top_builddir)/xkb/libxkb.la \ -- 1.7.9 ___ 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 6/7] Build Xi/stubs.c once as a convenience library, rather than once for each DDX which wants to use it
Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk --- Xi/Makefile.am |5 +++-- hw/vfb/Makefile.am |4 ++-- hw/xnest/Makefile.am |4 ++-- hw/xwin/Makefile.am |4 ++-- test/Makefile.am |4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Xi/Makefile.am b/Xi/Makefile.am index 69c7886..026824b 100644 --- a/Xi/Makefile.am +++ b/Xi/Makefile.am @@ -1,4 +1,4 @@ -noinst_LTLIBRARIES = libXi.la +noinst_LTLIBRARIES = libXi.la libXistubs.la AM_CFLAGS = $(DIX_CFLAGS) @@ -105,4 +105,5 @@ libXi_la_SOURCES = \ xiwarppointer.c \ xiwarppointer.h -EXTRA_DIST = stubs.c +libXistubs_la_SOURCES =\ + stubs.c diff --git a/hw/vfb/Makefile.am b/hw/vfb/Makefile.am index c9f6957..a02a438 100644 --- a/hw/vfb/Makefile.am +++ b/hw/vfb/Makefile.am @@ -9,7 +9,6 @@ AM_CFLAGS = -DHAVE_DIX_CONFIG_H \ SRCS = InitInput.c \ InitOutput.c \ - $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/mi/miinitext.c libfbcmap_a_CFLAGS = $(AM_CFLAGS) @@ -22,7 +21,8 @@ XVFB_LIBS = \ libfbcmap.a \ $(MAIN_LIB) \ $(XSERVER_LIBS) \ - $(top_builddir)/Xext/libXextdpmsstubs.la + $(top_builddir)/Xext/libXextdpmsstubs.la \ + $(top_builddir)/Xi/libXistubs.la Xvfb_LDADD = $(XVFB_LIBS) $(XVFB_SYS_LIBS) $(XSERVER_SYS_LIBS) Xvfb_DEPENDENCIES = $(XVFB_LIBS) diff --git a/hw/xnest/Makefile.am b/hw/xnest/Makefile.am index c5560fd..bb8d3d8 100644 --- a/hw/xnest/Makefile.am +++ b/hw/xnest/Makefile.am @@ -42,7 +42,6 @@ SRCS =Args.c \ XNPixmap.h \ XNWindow.h \ xnest-config.h \ - $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/mi/miinitext.c libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap_mi.c @@ -51,7 +50,8 @@ libfbcmap_a_CFLAGS = $(AM_CFLAGS) XNEST_LIBS = \ @XNEST_LIBS@ \ libfbcmap.a \ - $(top_builddir)/Xext/libXextdpmsstubs.la + $(top_builddir)/Xext/libXextdpmsstubs.la \ + $(top_builddir)/Xi/libXistubs.la Xnest_SOURCES = $(SRCS) diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index a5f2348..2e45c57 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -122,7 +122,6 @@ SRCS = InitInput.c \ winresource.h \ winwindow.h \ XWin.rc \ - $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/mi/miinitext.c \ $(top_srcdir)/fb/fbcmap_mi.c \ $(SRCS_CLIPBOARD) \ @@ -148,7 +147,8 @@ INCLUDES = -I$(top_srcdir)/miext/rootless XWIN_SYS_LIBS += -ldxguid XWIN_LIBS += $(top_builddir)/pseudoramiX/libPseudoramiX.la \ -$(top_builddir)/Xext/libXextdpmsstubs.la +$(top_builddir)/Xext/libXextdpmsstubs.la \ +$(top_builddir)/Xi/libXistubs.la XWin_DEPENDENCIES = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(XSERVER_LIBS) XWin_LDADD = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) diff --git a/test/Makefile.am b/test/Makefile.am index 0c1e595..06e5538 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -67,8 +67,7 @@ endif else nodist_libxservertest_la_SOURCES = \ ddxstubs.c \ -$(top_srcdir)/mi/miinitext.c \ -$(top_srcdir)/Xi/stubs.c +$(top_srcdir)/mi/miinitext.c libxservertest_la_LIBADD += \ $(top_builddir)/damageext/libdamageext.la \ @@ -81,6 +80,7 @@ libxservertest_la_LIBADD += \ $(top_builddir)/Xext/libXext.la \ $(top_builddir)/Xext/libXextdpmsstubs.la \ $(top_builddir)/Xi/libXi.la \ +$(top_builddir)/Xi/libXistubs.la \ $(top_builddir)/xfixes/libxfixes.la \ $(top_builddir)/xkb/libxkb.la \ $(top_builddir)/xkb/libxkbstubs.la -- 1.7.9 ___ 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 7/7] Add a screen PaintWindow wrapper
Revisit b3415187e92960cbff784108b5a3a8d130dc34c5, which shoves some rootless specific code directly into miPaintWindow. Unfortunately as written, this means that dix mi/libmi (when built with ROOTLESS defined) must be linked into a ddx which links with miext/rootless/librootless, which makes it impossible to build rootless supporting DDX (XWin and XQuartz) and non-rootless supporting DDX (the rest) at the same time. This is a pain when developing for XWin, as you have to re-./configure to check if changes have broken other DDXs, and is also a bit inconvenient for packaging and tinderboxing. Instead, add a way to wrap the PaintWindow function, so DDXs which have the rootless extension can install a wrapper which does the the neccesary checking which rootless needs to do. DDXs which don't support rootless won't install the hook, but the DIX remains compatible with them, so they can be built at the same time. This is kind of reverting part of what e4d11e58ce349dfe6af2f73ff341317f9b39684c Remove the PaintWindow optimization did in removing the PaintWindowBackground and PaintWindowBorder hooks, but it doesn't resurrect the problematic optimization which made use of those hooks. See [1] for admission that code as it stands is a horrible hack :-). But some comments in that email make me wonder if this code is in the right place at all. [1] http://lists.macosforge.org/pipermail/xquartz-dev/2009-September/002551.html Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk --- composite/compwindow.c |2 +- dix/window.c|3 +-- hw/dmx/doc/dmx.xml |2 +- hw/xquartz/quartz.c |2 +- hw/xwin/winrandr.c |2 +- include/scrnintstr.h|5 + mi/miexpose.c | 28 ++-- mi/mioverlay.c | 12 ++-- mi/miscrinit.c |1 + mi/miwindow.c |4 ++-- miext/rootless/rootlessCommon.h |1 + miext/rootless/rootlessScreen.c |3 ++- miext/rootless/rootlessWindow.c | 35 +++ miext/rootless/rootlessWindow.h |1 + 14 files changed, 60 insertions(+), 41 deletions(-) diff --git a/composite/compwindow.c b/composite/compwindow.c index 0be7a1b..f61600e 100644 --- a/composite/compwindow.c +++ b/composite/compwindow.c @@ -104,7 +104,7 @@ compRepaintBorder(ClientPtr pClient, pointer closure) RegionNull(exposed); RegionSubtract(exposed, pWindow-borderClip, pWindow-winSize); -miPaintWindow(pWindow, exposed, PW_BORDER); +(*pWindow-drawable.pScreen-PaintWindow)(pWindow, exposed, PW_BORDER); RegionUninit(exposed); } return TRUE; diff --git a/dix/window.c b/dix/window.c index e70531a..c78d171 100644 --- a/dix/window.c +++ b/dix/window.c @@ -122,7 +122,6 @@ Equipment Corporation. #endif #include dixevents.h #include globals.h -#include mi.h /* miPaintWindow */ #ifdef COMPOSITE #include compint.h #endif @@ -1466,7 +1465,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) RegionNull(exposed); RegionSubtract(exposed, pWin-borderClip, pWin-winSize); -miPaintWindow(pWin, exposed, PW_BORDER); +(*pWin-drawable.pScreen-PaintWindow)(pWin, exposed, PW_BORDER); RegionUninit(exposed); } return error; diff --git a/hw/dmx/doc/dmx.xml b/hw/dmx/doc/dmx.xml index 6d7df41..c6c8544 100644 --- a/hw/dmx/doc/dmx.xml +++ b/hw/dmx/doc/dmx.xml @@ -1268,7 +1268,7 @@ default routine is chosen during GC validation. paraNote that some pointers to functions that draw to the screen are stored in the Screen structure. They include GetImage(), GetSpans(), -CopyWindow() and RestoreAreas(). +PaintWindow(), CopyWindow() and RestoreAreas(). /para /sect3 diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c index 31b0e61..e7f30e6 100644 --- a/hw/xquartz/quartz.c +++ b/hw/xquartz/quartz.c @@ -300,7 +300,7 @@ QuartzUpdateScreens(void) quartzProcs-UpdateScreen(pScreen); /* miPaintWindow needs to be called after RootlessUpdateScreenPixmap (from xprUpdateScreen) */ -miPaintWindow(pRoot, pRoot-borderClip, PW_BACKGROUND); +pScreen-PaintWindow(pRoot, pRoot-borderClip, PW_BACKGROUND); /* Tell RandR about the new size, so new connections get the correct info */ RRScreenSizeNotify(pScreen); diff --git a/hw/xwin/winrandr.c b/hw/xwin/winrandr.c index 1b34085..5624e75 100644 --- a/hw/xwin/winrandr.c +++ b/hw/xwin/winrandr.c @@ -104,7 +104,7 @@ winDoRandRScreenSetSize(ScreenPtr pScreen, SetRootClip(pScreen, TRUE); // and arrange for it to be repainted -miPaintWindow(pRoot, pRoot-borderClip, PW_BACKGROUND); +pScreen-PaintWindow(pRoot, pRoot-borderClip, PW_BACKGROUND); /* Indicate that a screen size change took place */ RRScreenSizeNotify(pScreen); diff --git a/include/scrnintstr.h b/include/scrnintstr.h index
[PATCH 1/4] xfree86: Remove some unused variables
GCC complains about these variables being set but not used, so they can just as well be removed. Signed-off-by: Thierry Reding thierry.red...@avionic-design.de --- hw/xfree86/common/xf86Helper.c | 4 +--- hw/xfree86/modes/xf86RandR12.c | 14 -- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 721159d..841b8d5 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -421,7 +421,6 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp, * Check for DefaultDepth and DefaultFbBpp options in the * Device sections. */ -int i; GDevPtr device; Bool found = FALSE; @@ -1068,9 +1067,8 @@ void xf86EnableDisableFBAccess(ScrnInfoPtr pScrnInfo, Bool enable) { ScreenPtr pScreen = pScrnInfo-pScreen; -PixmapPtr pspix; -pspix = (*pScreen-GetScreenPixmap) (pScreen); +(*pScreen-GetScreenPixmap) (pScreen); if (enable) { /* * Restore all of the clip lists on the screen diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 3530abf..6f487bb 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -453,7 +453,6 @@ xf86RandR12GetInfo(ScreenPtr pScreen, Rotation * rotations) ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); DisplayModePtr mode; -int refresh0 = 60; int maxX = 0, maxY = 0; *rotations = randrp-supported_rotations; @@ -478,8 +477,6 @@ xf86RandR12GetInfo(ScreenPtr pScreen, Rotation * rotations) if (maxY mode-VDisplay) maxY = mode-VDisplay; } -if (mode == scrp-modes) -refresh0 = refresh; pSize = RRRegisterSize(pScreen, mode-HDisplay, mode-VDisplay, randrp-mmWidth, randrp-mmHeight); @@ -683,7 +680,6 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen, WindowPtr pRoot = pScreen-root; PixmapPtr pScrnPix; Bool ret = FALSE; -Bool panning = FALSE; int c; if (xf86RandR12Key) { @@ -715,7 +711,6 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen, crtc-panningTrackingArea.y2 += height - pScreen-height; xf86RandR13VerifyPanningArea(crtc, width, height); xf86RandR13Pan(crtc, randrp-pointerX, randrp-pointerY); - panning = TRUE; } } @@ -945,8 +940,6 @@ xf86RandR12SetRotations(ScreenPtr pScreen, Rotation rotations) void xf86RandR12SetTransformSupport(ScreenPtr pScreen, Bool transforms) { -XF86RandRInfoPtr randrp; - #if RANDR_13_INTERFACE ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); int c; @@ -956,7 +949,6 @@ xf86RandR12SetTransformSupport(ScreenPtr pScreen, Bool transforms) if (xf86RandR12Key == NULL) return; -randrp = XF86RANDRINFO(pScreen); #if RANDR_13_INTERFACE for (c = 0; c config-num_crtc; c++) { xf86CrtcPtr crtc = config-crtc[c]; @@ -1454,7 +1446,6 @@ xf86RandR12SetInfo12(ScreenPtr pScreen) RRCrtcPtr *crtcs; int ncrtc; int o, c, l; -RRCrtcPtr randr_crtc; int nclone; clones = malloc(config-num_output * sizeof(RROutputPtr)); @@ -1467,11 +1458,6 @@ xf86RandR12SetInfo12(ScreenPtr pScreen) if (output-possible_crtcs (1 c)) crtcs[ncrtc++] = config-crtc[c]-randr_crtc; -if (output-crtc) -randr_crtc = output-crtc-randr_crtc; -else -randr_crtc = NULL; - if (!RROutputSetCrtcs(output-randr_output, crtcs, ncrtc)) { free(crtcs); free(clones); -- 1.8.0 ___ 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] xfree86: Override physical output size only if EDID is available
The output's physical dimensions may be set by the driver, which is the case at least for xf86-video-modesetting. It makes no sense to overwrite it with 0 if EDID is unavailable because it will cause the only source of this information to be lost. Signed-off-by: Thierry Reding thierry.red...@avionic-design.de --- hw/xfree86/modes/xf86Crtc.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 177f7ac..93c741c 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -2960,8 +2960,10 @@ xf86OutputSetEDID(xf86OutputPtr output, xf86MonPtr edid_mon) free(output-MonInfo); output-MonInfo = edid_mon; -output-mm_width = 0; -output-mm_height = 0; +if (edid_mon) { +output-mm_width = 0; +output-mm_height = 0; +} if (debug_modes) { xf86DrvMsg(scrn-scrnIndex, X_INFO, EDID for output %s\n, -- 1.8.0 ___ 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] HACK: xfree86: modes: Recompute DPI when the screen size changes
The X server start up with the assumption that the display has 96 DPI unless configured otherwise. However under the proper circumstances, it can compute the correct value from the information provided by output resources. This commit adds this computation directly in xf86RandR12ScreenSetSize() because it is the only place where enough information is available. The xf86SetDpi() helper cannot be reused because it is based on the assumption that the DPI is either configured (on the command-line or via the configuration file) or computes it based on EDID data only. Signed-off-by: Thierry Reding thierry.red...@avionic-design.de --- hw/xfree86/modes/xf86RandR12.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index e18f357..dfbeb8d 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -723,6 +723,21 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen, xf86SetViewport(pScreen, pScreen-width - 1, pScreen-height - 1); xf86SetViewport(pScreen, 0, 0); +/* HACK: recompute DPI */ +if (mmWidth 0 mmHeight 0) { +pScrn-xDpi = (width * 254) / (mmWidth * 10); +pScrn-yDpi = (height * 254) / (mmHeight * 10); + +if (pScrn-xDpi 0 pScrn-yDpi = 0) +pScrn-yDpi = pScrn-xDpi; + +if (pScrn-yDpi 0 pScrn-xDpi = 0) +pScrn-xDpi = pScrn-yDpi; + +xf86DrvMsg(pScrn-scrnIndex, X_INFO, DPI set to (%d, %d)\n, + pScrn-xDpi, pScrn-yDpi); +} + finish: update_desktop_dimensions(); -- 1.8.0 ___ 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] xfree86: Use physical dimensions provided by output
If an output provides its physical dimensions, they should be used in preference to computing them on the assumption that the display has a default DPI setting. Signed-off-by: Thierry Reding thierry.red...@avionic-design.de --- hw/xfree86/modes/xf86RandR12.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 6f487bb..e18f357 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -806,10 +806,16 @@ xf86RandR12CreateScreenResources(ScreenPtr pScreen) } else { /* - * Otherwise, just set the screen to DEFAULT_DPI + * Otherwise, just set the screen to DEFAULT_DPI unless the + * output knows its physical dimensions. */ -mmWidth = width * 25.4 / DEFAULT_DPI; -mmHeight = height * 25.4 / DEFAULT_DPI; +if (output-mm_width == 0 || output-mm_height == 0) { +mmWidth = width * 25.4 / DEFAULT_DPI; +mmHeight = height * 25.4 / DEFAULT_DPI; +} else { +mmWidth = output-mm_width; +mmHeight = output-mm_height; +} } } xf86DrvMsg(pScrn-scrnIndex, X_INFO, -- 1.8.0 ___ 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: [PATCH 1/7] os: Remove any old logfile before trying to write to it
Am 08.11.2012 14:41, schrieb Jon TURNEY: If we are not backing up logfiles, remove the old logfile before trying to write a new logfile, as otherwise the operation may fail if the previous logfile was created by a different user. what are the permissions of that file ? normally you can not remove any file that is not worn by your. I would print an advive to use rm /logfile if the creation failed. just my 2 cents re, wh This change is useful when: - The DDX doesn't use the logfile backup mechanism (i.e. not Xorg) - The DDX is run by a non-root user, and then by a different non-root user - The logfile directory doesn't have the restricted-deletion flag set Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk Acked-by: Yaakov Selkowitz yselkow...@users.sourceforge.net Reviewed-by: Yaakov Selkowitz yselkow...@users.sourceforge.net --- os/log.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/os/log.c b/os/log.c index 4820e9a..15271eb 100644 --- a/os/log.c +++ b/os/log.c @@ -216,6 +216,9 @@ LogInit(const char *fname, const char *backup) free(oldLog); } } +else { +unlink(logFileName); +} if ((logFile = fopen(logFileName, w)) == NULL) FatalError(Cannot open log file \%s\\n, logFileName); setvbuf(logFile, NULL, _IONBF, 0); ___ 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: [PATCH 1/7] os: Remove any old logfile before trying to write to it
On 08/11/12 18:21, walter harms wrote: Am 08.11.2012 14:41, schrieb Jon TURNEY: If we are not backing up logfiles, remove the old logfile before trying to write a new logfile, as otherwise the operation may fail if the previous logfile was created by a different user. what are the permissions of that file ? normally you can not remove any file that is not worn by your. I would print an advive to use rm /logfile if the creation failed. just my 2 cents re, wh It's not the permissions of the file what matters, but those of the folder where it lives. If you can write in that folder, and it doesn't have the sticky bit set, you can also delete files. Extended attributes and security modules could change that, obviously. I find the commit message quite clear in what it expects and its limitations. I tried to make up a use case where the logfile was being used by a user and removing it actually made it fail because it couldn't be recreated, but then, the it's unlikely that unlink() would have worked. It would have to be a setup with multiple users on a sticky folder. ___ 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
Possible regression with GLX+Xvfb after 5f5bbbe?
Hey there, everyone. I've recently had to test some code which relies on GLX using Xvfb on xorg-server 1.13.0, but it looks like it is not loaded anymore after commit 5f5bbbe543f65c48ecbb5cce80116a86ca3fbe86. It turns out that this commit removed a duplicate code path in miinitext.c which was used by Xvfb and was responsible for calling GlxExtensionInit(). Right now, even passing `+extension GLX' does not help, since the contents of ExtensionToggleList are not read in InitExtensions(). Furthermore, commit aad428b8e21c77397c623b78706eb64b1fea77c9, makes attempts to call GlxExtensionInit() in miinitext.c fail when linking the unit tests. Before working on a patch (or hoping someone else does that :-), I'd like to clarify whether this side-effect was not really intentional. ___ 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: [PATCH 1/4] xfree86: Remove some unused variables
These all seem fine to me. For the series, Reviewed-by: Aaron Plattner aplatt...@nvidia.com -- Aaron On 11/08/2012 05:50 AM, Thierry Reding wrote: GCC complains about these variables being set but not used, so they can just as well be removed. Signed-off-by: Thierry Reding thierry.red...@avionic-design.de --- hw/xfree86/common/xf86Helper.c | 4 +--- hw/xfree86/modes/xf86RandR12.c | 14 -- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 721159d..841b8d5 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -421,7 +421,6 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp, * Check for DefaultDepth and DefaultFbBpp options in the * Device sections. */ -int i; GDevPtr device; Bool found = FALSE; @@ -1068,9 +1067,8 @@ void xf86EnableDisableFBAccess(ScrnInfoPtr pScrnInfo, Bool enable) { ScreenPtr pScreen = pScrnInfo-pScreen; -PixmapPtr pspix; -pspix = (*pScreen-GetScreenPixmap) (pScreen); +(*pScreen-GetScreenPixmap) (pScreen); if (enable) { /* * Restore all of the clip lists on the screen diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 3530abf..6f487bb 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -453,7 +453,6 @@ xf86RandR12GetInfo(ScreenPtr pScreen, Rotation * rotations) ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); DisplayModePtr mode; -int refresh0 = 60; int maxX = 0, maxY = 0; *rotations = randrp-supported_rotations; @@ -478,8 +477,6 @@ xf86RandR12GetInfo(ScreenPtr pScreen, Rotation * rotations) if (maxY mode-VDisplay) maxY = mode-VDisplay; } -if (mode == scrp-modes) -refresh0 = refresh; pSize = RRRegisterSize(pScreen, mode-HDisplay, mode-VDisplay, randrp-mmWidth, randrp-mmHeight); @@ -683,7 +680,6 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen, WindowPtr pRoot = pScreen-root; PixmapPtr pScrnPix; Bool ret = FALSE; -Bool panning = FALSE; int c; if (xf86RandR12Key) { @@ -715,7 +711,6 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen, crtc-panningTrackingArea.y2 += height - pScreen-height; xf86RandR13VerifyPanningArea(crtc, width, height); xf86RandR13Pan(crtc, randrp-pointerX, randrp-pointerY); - panning = TRUE; } } @@ -945,8 +940,6 @@ xf86RandR12SetRotations(ScreenPtr pScreen, Rotation rotations) void xf86RandR12SetTransformSupport(ScreenPtr pScreen, Bool transforms) { -XF86RandRInfoPtr randrp; - #if RANDR_13_INTERFACE ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); int c; @@ -956,7 +949,6 @@ xf86RandR12SetTransformSupport(ScreenPtr pScreen, Bool transforms) if (xf86RandR12Key == NULL) return; -randrp = XF86RANDRINFO(pScreen); #if RANDR_13_INTERFACE for (c = 0; c config-num_crtc; c++) { xf86CrtcPtr crtc = config-crtc[c]; @@ -1454,7 +1446,6 @@ xf86RandR12SetInfo12(ScreenPtr pScreen) RRCrtcPtr *crtcs; int ncrtc; int o, c, l; -RRCrtcPtr randr_crtc; int nclone; clones = malloc(config-num_output * sizeof(RROutputPtr)); @@ -1467,11 +1458,6 @@ xf86RandR12SetInfo12(ScreenPtr pScreen) if (output-possible_crtcs (1 c)) crtcs[ncrtc++] = config-crtc[c]-randr_crtc; -if (output-crtc) -randr_crtc = output-crtc-randr_crtc; -else -randr_crtc = NULL; - if (!RROutputSetCrtcs(output-randr_output, crtcs, ncrtc)) { free(crtcs); free(clones); ___ 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: [PATCH xorg-gtest 01/11] Drop .gz tarballs, bz2 is enough
On Mon, Oct 29, 2012 at 6:38 PM, Peter Hutterer peter.hutte...@who-t.netwrote: Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 59fd496..e3afde3 100644 --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,7 @@ AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_MACRO_DIR([m4]) # Initialize Automake -AM_INIT_AUTOMAKE([foreign dist-bzip2]) +AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip]) AM_MAINTAINER_MODE([enable]) # Checks for programs. Sorry for the delay in reviewing these. Ubuntu developer summit and time off got in the way... All the patches in this series look reasonable to me. Reviewed-by: Chase Douglas chase.doug...@ubuntu.com ___ 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: [PATCH 0/3] Fix pointer emulation on non-ownership windows
On Thu, Nov 1, 2012 at 10:17 PM, Peter Hutterer peter.hutte...@who-t.netwrote: https://bugs.freedesktop.org/show_bug.cgi?id=56557 Pointer emulation on the root window does not work correctly. We currently only deliver to window owners, but no client owns the root window. The real bug here is that even though the events are registered for, the listener lookup fails and we never send emulated pointer events to the client. Fix this by storing the resource type of the listener with the touch so we know what to actually look up. And to make this work we need a resource type for active grabs, and we need to store implicit passive grabs in the resource system as well. oh, and having the second argument to FreeResource() be don't free the resource data if the resource type to remove equals this type is an interesting choice of an API. I'm slowly losing my memory of the internals of X :(. While I can't make out exactly how this works immediately, it looks like a proper solution all around. Reviewed-by: Chase Douglas chase.doug...@ubuntu.com ___ 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: [PATCH xorg-gtest] Expand on the default 'failed to open connection to display' error
On Mon, Nov 5, 2012 at 5:28 PM, Peter Hutterer peter.hutte...@who-t.netwrote: Virtually everyone trying the tests the first time will run into this issue since we cannot check if the ABI for dummy and whatever else is needed actually matches the server (well, we have a test for that, but unless you run that one first...) So be at least more verbose about the potential reasons and provide some basic debugging help. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- src/test.cpp | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/test.cpp b/src/test.cpp index c7b69bc..a484787 100644 --- a/src/test.cpp +++ b/src/test.cpp @@ -50,8 +50,15 @@ void xorg::testing::Test::SetUp() { dpy = d_-display_string.c_str(); d_-display = XOpenDisplay(dpy); - if (!d_-display) -throw std::runtime_error(Failed to open connection to display); + if (!d_-display) { +std::stringstream ss; +ss Failed to open connection to display; +if (dpy != NULL) ss dpy; +ss .\nThis usually means that your X server did not start properly.\n; +ss Check the log file, or set XORG_GTEST_CHILD_STDOUT to see the server's\n + error messages when starting.; +throw std::runtime_error(ss.str()); + } } void xorg::testing::Test::TearDown() { This should be very helpful for newbies :). Reviewed-by: Chase Douglas chase.doug...@ubuntu.com ___ 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: [PATCH libXi] man: add generation of missing man pages for XIGrabTouchBegin
On Tue, Nov 6, 2012 at 2:52 PM, Peter Hutterer peter.hutte...@who-t.netwrote: The man page itself already contained the description, but it was missing from NAME so the shadow man pages were not generated. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- man/Makefile.am | 6 -- man/XIGrabButton.txt | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/man/Makefile.am b/man/Makefile.am index 28211a1..af63952 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -89,7 +89,9 @@ XI2_shadows = \ XIGetSelectedEvents.man \ XIDeleteProperty.man\ XIGetProperty.man \ - XIFreeDeviceInfo.man + XIFreeDeviceInfo.man\ + XIGrabTouchBegin.man\ + XIUngrabTouchBegin.man libman_shadows = \ XGetDeviceDontPropagateList.man \ @@ -141,7 +143,7 @@ XDeleteDeviceProperty.man: XGetDeviceProperty.man # Dependencies for X Input v2 shadow pages XIUndefineCursor.man: XIDefineCursor.man -XIUngrabButton.man XIGrabKeycode.man XIUngrabKeycode.man: XIGrabButton.man +XIUngrabButton.man XIGrabKeycode.man XIUngrabKeycode.man XIGrabTouchBegin.man XIUngrabTouchBegin.man: XIGrabButton.man XIGetClientPointer.man: XISetClientPointer.man XIGetFocus.man: XISetFocus.man XIUngrabDevice.man: XIGrabDevice.man diff --git a/man/XIGrabButton.txt b/man/XIGrabButton.txt index a046ac7..c5100fb 100644 --- a/man/XIGrabButton.txt +++ b/man/XIGrabButton.txt @@ -4,8 +4,7 @@ XIGRABBUTTON(libmansuffix) NAME - XIGrabButton, XIUngrabButton, XIGrabKeycode, XIUngrabKeycode - - grab/ungrab buttons or keys + XIGrabButton, XIUngrabButton, XIGrabKeycode, XIUngrabKeycode, XIGrabTouchBegin, XIUngrabTouchBegin - grab/ungrab buttons or keys SYNOPSIS Looks right. Reviewed-by: Chase Douglas chase.doug...@ubuntu.com ___ 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: [PATCH xorg-gtest 2/2] xserver: install default X error handler
On Tue, Nov 6, 2012 at 7:57 PM, Peter Hutterer peter.hutte...@who-t.netwrote: Xlib's default error handler prints the error and calls exit(1). Tests that accidentally trigger an error thus quit without cleaning up properly. Install a default error handler that prints the basic info and continue with the test. Clients that expect to trigger errors should set a custom error handler. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- include/xorg/gtest/xorg-gtest-xserver.h | 13 ++ src/xserver.cpp | 54 +++- test/xserver-test.cpp | 73 + 3 files changed, 139 insertions(+), 1 deletion(-) diff --git a/include/xorg/gtest/xorg-gtest-xserver.h b/include/xorg/gtest/xorg-gtest-xserver.h index 8bf7996..11fc93d 100644 --- a/include/xorg/gtest/xorg-gtest-xserver.h +++ b/include/xorg/gtest/xorg-gtest-xserver.h @@ -265,6 +265,19 @@ class XServer : public xorg::testing::Process { */ static void RegisterXIOErrorHandler(); +/** + * Install a default XErrorHandler. That error handler will cause a test + * failure if called. + * + * This function is called automatically by XServer::Start(). Usually, + * you will not need to call this function unless your test does not + * instantiate and Start() an XServer object. + * + * This function will only install a new error handler if the currently + * installed XErrorHandler is not the default handler used by Xlib. + */ +static void RegisterXErrorHandler(); + private: struct Private; std::auto_ptrPrivate d_; diff --git a/src/xserver.cpp b/src/xserver.cpp index ad018a1..4faa8e9 100644 --- a/src/xserver.cpp +++ b/src/xserver.cpp @@ -394,6 +394,40 @@ const std::string xorg::testing::XServer::GetVersion(void) { return d_-version; } +static int _x_error_handler(Display *dpy, XErrorEvent *err) +{ + std::stringstream error; + switch(err-error_code) { +case BadRequest: error BadRequest; break; +case BadValue: error BadValue; break; +case BadWindow: error BadWindow; break; +case BadPixmap: error BadPixmap; break; +case BadAtom: error BadAtom; break; +case BadCursor: error BadCursor; break; +case BadFont: error BadFont; break; +case BadMatch: error BadMatch; break; +case BadDrawable: error BadDrawable; break; +case BadAccess: error BadAccess; break; +case BadAlloc: error BadAlloc; break; +case BadColor: error BadColor; break; +case BadGC: error BadGC; break; +case BadIDChoice: error BadIDChoice; break; +case BadName: error BadName; break; +case BadLength: error BadLength; break; +case BadImplementation: error BadImplementation; break; +default: + error err-error_code; + break; + } + + ADD_FAILURE() XError received: error.str() , request +(int)err-request_code ( (int)err-minor_code ), detail: + err-resourceid \nThis error handler is likely to be triggered +more than once.\nCheck the first error for the real error; + return 0; +} + + static int _x_io_error_handler(Display *dpy) _X_NORETURN; static int _x_io_error_handler(Display *dpy) { @@ -409,6 +443,15 @@ void xorg::testing::XServer::RegisterXIOErrorHandler() XSetIOErrorHandler(old_handler); } +void xorg::testing::XServer::RegisterXErrorHandler() +{ + XErrorHandler old_handler; + old_handler = XSetErrorHandler(_x_error_handler); + + if (old_handler != _XDefaultError) +XSetErrorHandler(old_handler); +} + void xorg::testing::XServer::Start(const std::string program) { TestStartup(); @@ -464,7 +507,15 @@ void xorg::testing::XServer::Start(const std::string program) { args.push_back(it-second); } -Process::Start(program.empty() ? d_-path_to_server : program, args); +std::string server_binary = program.empty() ? d_-path_to_server : program; + +if (getenv(XORG_GTEST_XSERVER_USE_VALGRIND)) { + args.insert(args.begin(), server_binary); + server_binary = valgrind; + args.insert(args.begin(), --leak-check=full); +} While this looks totally cool, it probably belongs in a separate commit :). Without this hunk: Reviewed-by: Chase Douglas chase.doug...@ubuntu.com You can also add my Reviewed-by tag to a separate commit for just this hunk. You might want to consider allowing for some standard options like --show-reachable -- Chase ___ 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: [PATCH xorg-gtest 1/2] gtest: add gtest-spi.h header
On Tue, Nov 6, 2012 at 7:57 PM, Peter Hutterer peter.hutte...@who-t.netwrote: This header is for self-testing, specifically EXPECT_FATAL_FAILURE Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- gtest/include/Makefile.am | 2 +- gtest/include/gtest/gtest-spi.h | 232 2 files changed, 233 insertions(+), 1 deletion(-) create mode 100644 gtest/include/gtest/gtest-spi.h diff --git a/gtest/include/Makefile.am b/gtest/include/Makefile.am index 54d3088..6456b01 100644 --- a/gtest/include/Makefile.am +++ b/gtest/include/Makefile.am @@ -22,4 +22,4 @@ # SOFTWARE. # -nobase_include_HEADERS = gtest/gtest.h +nobase_include_HEADERS = gtest/gtest.h gtest/gtest-spi.h diff --git a/gtest/include/gtest/gtest-spi.h b/gtest/include/gtest/gtest-spi.h new file mode 100644 index 000..f63fa9a --- /dev/null +++ b/gtest/include/gtest/gtest-spi.h @@ -0,0 +1,232 @@ +// Copyright 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: w...@google.com (Zhanyong Wan) +// +// Utilities for testing Google Test itself and code that uses Google Test +// (e.g. frameworks built on top of Google Test). + +#ifndef GTEST_INCLUDE_GTEST_GTEST_SPI_H_ +#define GTEST_INCLUDE_GTEST_GTEST_SPI_H_ + +#include gtest/gtest.h + +namespace testing { + +// This helper class can be used to mock out Google Test failure reporting +// so that we can test Google Test or code that builds on Google Test. +// +// An object of this class appends a TestPartResult object to the +// TestPartResultArray object given in the constructor whenever a Google Test +// failure is reported. It can either intercept only failures that are +// generated in the same thread that created this object or it can intercept +// all generated failures. The scope of this mock object can be controlled with +// the second argument to the two arguments constructor. +class GTEST_API_ ScopedFakeTestPartResultReporter +: public TestPartResultReporterInterface { + public: + // The two possible mocking modes of this object. + enum InterceptMode { +INTERCEPT_ONLY_CURRENT_THREAD, // Intercepts only thread local failures. +INTERCEPT_ALL_THREADS // Intercepts all failures. + }; + + // The c'tor sets this object as the test part result reporter used + // by Google Test. The 'result' parameter specifies where to report the + // results. This reporter will only catch failures generated in the current + // thread. DEPRECATED + explicit ScopedFakeTestPartResultReporter(TestPartResultArray* result); + + // Same as above, but you can choose the interception scope of this object. + ScopedFakeTestPartResultReporter(InterceptMode intercept_mode, + TestPartResultArray* result); + + // The d'tor restores the previous test part result reporter. + virtual ~ScopedFakeTestPartResultReporter(); + + // Appends the TestPartResult object to the TestPartResultArray + // received in the constructor. + // + // This method is from the TestPartResultReporterInterface + // interface. + virtual void ReportTestPartResult(const TestPartResult result); + private: + void Init(); + + const InterceptMode intercept_mode_; + TestPartResultReporterInterface* old_reporter_; + TestPartResultArray* const result_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedFakeTestPartResultReporter);
Re: [PATCH v2] xf86: Fix non-PCI configuration-less setups
On Wed, Oct 17, 2012 at 8:06 PM, Thierry Reding thierry.red...@avionic-design.de wrote: For non-PCI video devices, such as those found on many ARM embedded systems, the X server currently requires the BusID option to specify the full path to the DRM device's sysfs node in order to properly match it against the probed platform devices. In order to allow X to start up properly if either the BusID option was omitted or no configuration is present at all, the first video device is used by default. Signed-off-by: Thierry Reding thierry.red...@avionic-design.de Looks fine to me! Reviewed-by: Dave Airlie airl...@redhat.com Dave. ___ 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: [PATCH xorg-gtest 01/11] Drop .gz tarballs, bz2 is enough
On 30 October 2012 12:38, Peter Hutterer peter.hutte...@who-t.net wrote: --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,7 @@ AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_MACRO_DIR([m4]) # Initialize Automake -AM_INIT_AUTOMAKE([foreign dist-bzip2]) +AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip]) How about enabling .xz too? Cheers, Daniel ___ 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: [PATCH xorg-gtest 01/11] Drop .gz tarballs, bz2 is enough
On Fri, Nov 09, 2012 at 01:44:16PM +1100, Daniel Stone wrote: On 30 October 2012 12:38, Peter Hutterer peter.hutte...@who-t.net wrote: --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,7 @@ AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_MACRO_DIR([m4]) # Initialize Automake -AM_INIT_AUTOMAKE([foreign dist-bzip2]) +AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip]) How about enabling .xz too? I disabled .gz because IMO one tarball is enough, we don't need two if one is likely never used anyway. A similar situation would apply to xz, we'd have two tarballs but no real need. And the space savings aren't that huge that it switching from bz2 to xz alone really makes a difference. 365522 xorg-gtest-0.6.0.tar.bz2 308152 xorg-gtest-0.6.0.tar.xz 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: [PATCH xorg-gtest 2/2] xserver: install default X error handler
On Thu, Nov 08, 2012 at 05:46:12PM -0800, Chase Douglas wrote: On Tue, Nov 6, 2012 at 7:57 PM, Peter Hutterer peter.hutte...@who-t.netwrote: Xlib's default error handler prints the error and calls exit(1). Tests that accidentally trigger an error thus quit without cleaning up properly. Install a default error handler that prints the basic info and continue with the test. Clients that expect to trigger errors should set a custom error handler. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- include/xorg/gtest/xorg-gtest-xserver.h | 13 ++ src/xserver.cpp | 54 +++- test/xserver-test.cpp | 73 + 3 files changed, 139 insertions(+), 1 deletion(-) diff --git a/include/xorg/gtest/xorg-gtest-xserver.h b/include/xorg/gtest/xorg-gtest-xserver.h index 8bf7996..11fc93d 100644 --- a/include/xorg/gtest/xorg-gtest-xserver.h +++ b/include/xorg/gtest/xorg-gtest-xserver.h @@ -265,6 +265,19 @@ class XServer : public xorg::testing::Process { */ static void RegisterXIOErrorHandler(); +/** + * Install a default XErrorHandler. That error handler will cause a test + * failure if called. + * + * This function is called automatically by XServer::Start(). Usually, + * you will not need to call this function unless your test does not + * instantiate and Start() an XServer object. + * + * This function will only install a new error handler if the currently + * installed XErrorHandler is not the default handler used by Xlib. + */ +static void RegisterXErrorHandler(); + private: struct Private; std::auto_ptrPrivate d_; diff --git a/src/xserver.cpp b/src/xserver.cpp index ad018a1..4faa8e9 100644 --- a/src/xserver.cpp +++ b/src/xserver.cpp @@ -394,6 +394,40 @@ const std::string xorg::testing::XServer::GetVersion(void) { return d_-version; } +static int _x_error_handler(Display *dpy, XErrorEvent *err) +{ + std::stringstream error; + switch(err-error_code) { +case BadRequest: error BadRequest; break; +case BadValue: error BadValue; break; +case BadWindow: error BadWindow; break; +case BadPixmap: error BadPixmap; break; +case BadAtom: error BadAtom; break; +case BadCursor: error BadCursor; break; +case BadFont: error BadFont; break; +case BadMatch: error BadMatch; break; +case BadDrawable: error BadDrawable; break; +case BadAccess: error BadAccess; break; +case BadAlloc: error BadAlloc; break; +case BadColor: error BadColor; break; +case BadGC: error BadGC; break; +case BadIDChoice: error BadIDChoice; break; +case BadName: error BadName; break; +case BadLength: error BadLength; break; +case BadImplementation: error BadImplementation; break; +default: + error err-error_code; + break; + } + + ADD_FAILURE() XError received: error.str() , request +(int)err-request_code ( (int)err-minor_code ), detail: + err-resourceid \nThis error handler is likely to be triggered +more than once.\nCheck the first error for the real error; + return 0; +} + + static int _x_io_error_handler(Display *dpy) _X_NORETURN; static int _x_io_error_handler(Display *dpy) { @@ -409,6 +443,15 @@ void xorg::testing::XServer::RegisterXIOErrorHandler() XSetIOErrorHandler(old_handler); } +void xorg::testing::XServer::RegisterXErrorHandler() +{ + XErrorHandler old_handler; + old_handler = XSetErrorHandler(_x_error_handler); + + if (old_handler != _XDefaultError) +XSetErrorHandler(old_handler); +} + void xorg::testing::XServer::Start(const std::string program) { TestStartup(); @@ -464,7 +507,15 @@ void xorg::testing::XServer::Start(const std::string program) { args.push_back(it-second); } -Process::Start(program.empty() ? d_-path_to_server : program, args); +std::string server_binary = program.empty() ? d_-path_to_server : program; + +if (getenv(XORG_GTEST_XSERVER_USE_VALGRIND)) { + args.insert(args.begin(), server_binary); + server_binary = valgrind; + args.insert(args.begin(), --leak-check=full); +} While this looks totally cool, it probably belongs in a separate commit :). oh, that's where that hunk ended up :) I was wondering which branch it was on, and could not find the git commit referring to it. got committed by accident. Without this hunk: Reviewed-by: Chase Douglas chase.doug...@ubuntu.com You can also add my Reviewed-by tag to a separate commit for just this hunk. You might want to consider allowing for some standard options like --show-reachable yeah, it's not complete yet, that's why I hadn't intended to send this one out just yet :)