Xext/xtest.c | 9 Xext/xvmc.c | 11 Xi/exevents.c | 28 config/udev.c | 20 configure.ac | 33 dev/null |binary dix/.gitignore | 1 dix/Makefile.am | 6 dix/dixutils.c | 10 dix/events.c | 113 dix/getevents.c | 68 dix/grabs.c | 112 dix/main.c | 2 dix/window.c | 151 doc/Xserver-spec.xml | 4 doc/dtrace/Makefile.am | 2 docbook.am | 7 exa/exa.c | 4 exa/exa_accel.c | 6 exa/exa_classic.c | 2 exa/exa_driver.c | 2 exa/exa_migration_classic.c | 4 exa/exa_migration_mixed.c | 2 exa/exa_mixed.c | 2 exa/exa_unaccel.c | 4 fb/fb24_32.c | 4 fb/fbarc.c | 9 fb/fbfill.c | 6 fb/fbgc.c | 4 fb/fbpush.c | 2 glx/Makefile.am | 7 glx/glapi.h | 3 glx/glapi_gentable.c | 7589 ++++++++++ glx/glxdri2.c | 9 glx/glxscreens.c | 7 glx/glxscreens.h | 1 hw/dmx/config/xdmxconfig.c | 8 hw/dmx/dmxinit.c | 6 hw/dmx/dmxinput.c | 1 hw/dmx/examples/xbell.c | 3 hw/dmx/glxProxy/glxscreens.h | 1 hw/dmx/input/dmxinputinit.c | 3 hw/dmx/man/Xdmx.man | 30 hw/kdrive/ephyr/ephyr.c | 2 hw/kdrive/ephyr/ephyr.h | 2 hw/kdrive/ephyr/ephyr_draw.c | 2 hw/kdrive/ephyr/ephyrinit.c | 3 hw/kdrive/ephyr/hostx.c | 2 hw/kdrive/ephyr/hostx.h | 2 hw/kdrive/ephyr/man/Xephyr.man | 2 hw/kdrive/ephyr/os.c | 2 hw/kdrive/fake/fakeinit.c | 1 hw/kdrive/fake/kbd.c | 2 hw/kdrive/fbdev/fbdev.c | 2 hw/kdrive/fbdev/fbdev.h | 2 hw/kdrive/fbdev/fbinit.c | 3 hw/kdrive/linux/keyboard.c | 8 hw/kdrive/linux/linux.c | 2 hw/kdrive/linux/mouse.c | 2 hw/kdrive/linux/ps2.c | 2 hw/kdrive/linux/tslib.c | 10 hw/kdrive/src/kcmap.c | 2 hw/kdrive/src/kdrive.c | 6 hw/kdrive/src/kdrive.h | 4 hw/kdrive/src/kinfo.c | 2 hw/kdrive/src/kinput.c | 11 hw/kdrive/src/kshadow.c | 2 hw/vfb/InitInput.c | 1 hw/vfb/InitOutput.c | 6 hw/xfree86/.gitignore | 4 hw/xfree86/Makefile.am | 47 hw/xfree86/common/xf86Config.c | 3 hw/xfree86/common/xf86Configure.c | 2 hw/xfree86/common/xf86Helper.c | 4 hw/xfree86/common/xf86Init.c | 41 hw/xfree86/common/xf86Option.c | 2 hw/xfree86/common/xf86Priv.h | 2 hw/xfree86/common/xf86ShowOpts.c | 2 hw/xfree86/common/xf86Xinput.c | 1 hw/xfree86/dixmods/xkbPrivate.c | 15 hw/xfree86/dri2/dri2.c | 1 hw/xfree86/dri2/dri2.h | 2 hw/xfree86/dri2/dri2ext.c | 7 hw/xfree86/exa/examodule.c | 2 hw/xfree86/loader/.gitignore | 3 hw/xfree86/loader/Makefile.am | 14 hw/xfree86/loader/sdksyms.sh | 425 hw/xfree86/man/Xorg.man | 1 hw/xfree86/modes/xf86Modes.h | 2 hw/xfree86/modes/xf86cvt.c | 4 hw/xfree86/os-support/.gitignore | 2 hw/xfree86/os-support/Makefile.am | 7 hw/xfree86/os-support/shared/posix_tty.c | 2 hw/xfree86/os-support/solaris/sun_agp.c | 4 hw/xfree86/sdksyms.sh | 425 hw/xnest/Init.c | 7 hw/xquartz/GL/indirect.c | 1106 - hw/xquartz/X11Application.h | 3 hw/xquartz/X11Application.m | 76 hw/xquartz/X11Controller.h | 2 hw/xquartz/X11Controller.m | 18 hw/xquartz/bundle/Resources/Dutch.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/Dutch.lproj/locversion.plist | 4 hw/xquartz/bundle/Resources/Dutch.lproj/main.nib/designable.nib | 7414 ++++----- hw/xquartz/bundle/Resources/Dutch.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/bundle/Resources/English.lproj/locversion.plist | 14 hw/xquartz/bundle/Resources/French.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/French.lproj/locversion.plist | 4 hw/xquartz/bundle/Resources/French.lproj/main.nib/designable.nib | 633 hw/xquartz/bundle/Resources/French.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/bundle/Resources/German.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/German.lproj/locversion.plist | 4 hw/xquartz/bundle/Resources/German.lproj/main.nib/designable.nib | 586 hw/xquartz/bundle/Resources/German.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/bundle/Resources/Italian.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/Italian.lproj/locversion.plist | 4 hw/xquartz/bundle/Resources/Italian.lproj/main.nib/designable.nib | 7417 ++++----- hw/xquartz/bundle/Resources/Italian.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/bundle/Resources/Japanese.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/Japanese.lproj/locversion.plist | 4 hw/xquartz/bundle/Resources/Japanese.lproj/main.nib/designable.nib | 583 hw/xquartz/bundle/Resources/Japanese.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/bundle/Resources/Spanish.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/Spanish.lproj/locversion.plist | 4 hw/xquartz/bundle/Resources/Spanish.lproj/main.nib/designable.nib | 7430 ++++----- hw/xquartz/bundle/Resources/Spanish.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/bundle/Resources/ar.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/ar.lproj/locversion.plist | 4 hw/xquartz/bundle/Resources/ar.lproj/main.nib/designable.nib | 375 hw/xquartz/bundle/Resources/ar.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/bundle/Resources/da.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/da.lproj/locversion.plist | 4 hw/xquartz/bundle/Resources/da.lproj/main.nib/designable.nib | 652 hw/xquartz/bundle/Resources/da.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/bundle/Resources/el.lproj/InfoPlist.strings |binary hw/xquartz/bundle/Resources/el.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/el.lproj/locversion.plist | 14 hw/xquartz/bundle/Resources/el.lproj/main.nib/designable.nib | 3521 ++++ hw/xquartz/bundle/Resources/el.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/bundle/Resources/fi.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/fi.lproj/locversion.plist | 4 hw/xquartz/bundle/Resources/fi.lproj/main.nib/designable.nib | 421 hw/xquartz/bundle/Resources/fi.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/bundle/Resources/he.lproj/InfoPlist.strings |binary hw/xquartz/bundle/Resources/he.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/he.lproj/locversion.plist | 14 hw/xquartz/bundle/Resources/he.lproj/main.nib/designable.nib | 3523 ++++ hw/xquartz/bundle/Resources/he.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/bundle/Resources/ko.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/ko.lproj/locversion.plist | 4 hw/xquartz/bundle/Resources/ko.lproj/main.nib/designable.nib | 7371 ++++----- hw/xquartz/bundle/Resources/ko.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/bundle/Resources/no.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/no.lproj/locversion.plist | 4 hw/xquartz/bundle/Resources/no.lproj/main.nib/designable.nib | 325 hw/xquartz/bundle/Resources/no.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/bundle/Resources/pl.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/pl.lproj/locversion.plist | 4 hw/xquartz/bundle/Resources/pl.lproj/main.nib/designable.nib | 7446 ++++----- hw/xquartz/bundle/Resources/pl.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/bundle/Resources/pt.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/pt.lproj/locversion.plist | 4 hw/xquartz/bundle/Resources/pt.lproj/main.nib/designable.nib | 7417 ++++----- hw/xquartz/bundle/Resources/pt.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/bundle/Resources/pt_PT.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/pt_PT.lproj/locversion.plist | 4 hw/xquartz/bundle/Resources/pt_PT.lproj/main.nib/designable.nib | 416 hw/xquartz/bundle/Resources/pt_PT.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/bundle/Resources/ru.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/ru.lproj/locversion.plist | 4 hw/xquartz/bundle/Resources/ru.lproj/main.nib/designable.nib | 7444 ++++----- hw/xquartz/bundle/Resources/ru.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/bundle/Resources/sk.lproj/InfoPlist.strings |binary hw/xquartz/bundle/Resources/sk.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/sk.lproj/locversion.plist | 14 hw/xquartz/bundle/Resources/sk.lproj/main.nib/designable.nib | 3522 ++++ hw/xquartz/bundle/Resources/sk.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/bundle/Resources/sv.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/sv.lproj/locversion.plist | 4 hw/xquartz/bundle/Resources/sv.lproj/main.nib/designable.nib | 327 hw/xquartz/bundle/Resources/sv.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/bundle/Resources/zh_CN.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/zh_CN.lproj/locversion.plist | 4 hw/xquartz/bundle/Resources/zh_CN.lproj/main.nib/designable.nib | 7389 +++++---- hw/xquartz/bundle/Resources/zh_CN.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/bundle/Resources/zh_TW.lproj/InfoPlist.strings |binary hw/xquartz/bundle/Resources/zh_TW.lproj/Localizable.strings |binary hw/xquartz/bundle/Resources/zh_TW.lproj/locversion.plist | 4 hw/xquartz/bundle/Resources/zh_TW.lproj/main.nib/designable.nib | 581 hw/xquartz/bundle/Resources/zh_TW.lproj/main.nib/keyedobjects.nib |binary hw/xquartz/darwin.c | 16 hw/xquartz/darwin.h | 6 hw/xquartz/darwinEvents.c | 4 hw/xquartz/darwinEvents.h | 1 hw/xquartz/darwinXinput.c | 5 hw/xquartz/mach-startup/Makefile.am | 6 hw/xquartz/man/Xquartz.man | 3 hw/xquartz/pbproxy/app-main.m | 11 hw/xquartz/pbproxy/pbproxy.h | 15 hw/xquartz/pbproxy/x-selection.m | 27 hw/xquartz/xpr/dri.c | 61 hw/xquartz/xpr/xpr.h | 5 hw/xquartz/xpr/xprCursor.c | 1 hw/xquartz/xpr/xprEvent.c | 1 hw/xquartz/xpr/xprScreen.c | 1 hw/xwin/InitInput.c | 1 hw/xwin/InitOutput.c | 10 hw/xwin/Makefile.am | 22 hw/xwin/XWin.rc | 2 hw/xwin/glx/Makefile.am | 6 hw/xwin/glx/gen_gl_wrappers.py | 2 hw/xwin/glx/indirect.c | 102 hw/xwin/glx/wgl_ext_api.c | 13 hw/xwin/glx/winpriv.c | 5 hw/xwin/man/XWin.man | 7 hw/xwin/man/XWinrc.man | 2 hw/xwin/windialogs.c | 2 hw/xwin/winerror.c | 2 hw/xwin/winmultiwindowwindow.c | 64 hw/xwin/winmultiwindowwndproc.c | 72 hw/xwin/winwindow.h | 4 hw/xwin/xlaunch/COPYING | 25 hw/xwin/xlaunch/Makefile | 79 hw/xwin/xlaunch/config.cc | 282 hw/xwin/xlaunch/config.h | 60 hw/xwin/xlaunch/main.cc | 700 hw/xwin/xlaunch/resources/dialog.rc | 118 hw/xwin/xlaunch/resources/images.rc | 29 hw/xwin/xlaunch/resources/resources.h | 99 hw/xwin/xlaunch/resources/resources.rc | 30 hw/xwin/xlaunch/resources/strings.rc | 108 hw/xwin/xlaunch/window/dialog.cc | 86 hw/xwin/xlaunch/window/dialog.h | 54 hw/xwin/xlaunch/window/util.cc | 1112 - hw/xwin/xlaunch/window/util.h | 53 hw/xwin/xlaunch/window/window.cc | 284 hw/xwin/xlaunch/window/window.h | 114 hw/xwin/xlaunch/window/wizard.cc | 244 hw/xwin/xlaunch/window/wizard.h | 59 include/dix.h | 5 include/dixgrabs.h | 3 include/input.h | 9 include/os.h | 13 include/window.h | 2 man/Xserver.man | 2 manpages.am | 5 mi/mipointer.c | 2 miext/shadow/shadow.c | 2 miext/shadow/shpacked.c | 2 miext/shadow/shplanar.c | 2 miext/shadow/shplanar8.c | 2 miext/shadow/shrotate.c | 2 miext/shadow/shrotpack.h | 2 miext/shadow/shrotpackYX.h | 2 os/.gitignore | 2 os/Makefile.am | 6 os/log.c | 6 randr/rrcrtc.c | 2 randr/rrproperty.c | 2 test/.gitignore | 17 test/Makefile.am | 13 test/input.c | 3 test/xi2/.gitignore | 10 test/xi2/protocol-common.c | 2 test/xi2/protocol-eventconvert.c | 18 xfixes/cursor.c | 4 xfixes/region.c | 2 xkb/xkb.c | 19 xkb/xkbfmisc.c | 48 xkb/xkmread.c | 31 270 files changed, 51986 insertions(+), 37807 deletions(-)
New commits: commit 08dfff92e8d0c2b1726634392c147f6634d1706d Author: Aaron Plattner <[email protected]> Date: Fri Jul 29 16:12:06 2011 -0700 randr: Compare all the bytes in RRPostPendingProperties RRPostPendingProperties tries to compare the pending and current property values to decide whether they're actually changing. However, it does this using a memcmp that passes in pending_value->size as the number of bytes. This is actually the number of elements, where each element is (pending_value->format / 8) bytes long. This causes the pending value to not be propagated if the first pending_value->size bytes are the same and only the end of it is changing. Fix this by computing the total number of bytes to compare in the memcmp. Signed-off-by: Aaron Plattner <[email protected]> Reviewed-by: Keith Packard <[email protected]> Signed-off-by: Keith Packard <[email protected]> diff --git a/randr/rrproperty.c b/randr/rrproperty.c index ba04c16..61e7bb4 100644 --- a/randr/rrproperty.c +++ b/randr/rrproperty.c @@ -283,7 +283,7 @@ RRPostPendingProperties (RROutputPtr output) pending_value->format == current_value->format && pending_value->size == current_value->size && !memcmp (pending_value->data, current_value->data, - pending_value->size)) + pending_value->size * (pending_value->format / 8))) continue; if (RRChangeOutputProperty (output, property->propertyName, commit f51e42f583073bde0bc8131887cb7220636c8855 Author: Peter Hutterer <[email protected]> Date: Wed Jul 20 13:09:05 2011 +1000 Terminate the log with one last message. Instead of just closing the log when everything is done, put one more message in stating that we're actually terminating. Users or scripts that look at the Xorg.log will then know that a) the server has terminated properly and b) why the server terminated (to some degree, given that most real-world errors will be caused by AbortServer()). Acked-by: Gaetan Nadon <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Tested-by: Jeremy Huddleston <[email protected]> Reviewed-by: Jeremy Huddleston <[email protected]> Tested-by: Jon TURNEY <[email protected]> Reviewed-by: Jon TURNEY <[email protected]> Signed-off-by: Peter Hutterer <[email protected]> diff --git a/dix/main.c b/dix/main.c index 955b7ea..16575ce 100644 --- a/dix/main.c +++ b/dix/main.c @@ -347,7 +347,7 @@ int main(int argc, char *argv[], char *envp[]) if (dispatchException & DE_TERMINATE) { - ddxGiveUp(); + ddxGiveUp(EXIT_NO_ERROR); break; } diff --git a/doc/Xserver-spec.xml b/doc/Xserver-spec.xml index 7d7f915..b14e489 100644 --- a/doc/Xserver-spec.xml +++ b/doc/Xserver-spec.xml @@ -4680,8 +4680,8 @@ An Example implementation is miPushPixels() in Xserver/mi/mipushpxl.c.</para> <title>Shutdown Procedures</title> <para> <blockquote><programlisting> - void AbortDDX() - void ddxGiveUp() + void AbortDDX(enum ExitCode error) + void ddxGiveUp(enum ExitCode error) </programlisting></blockquote> Some hardware may require special work to be done before the server exits so that it is not left in an intermediate state. As explained diff --git a/hw/dmx/dmxinit.c b/hw/dmx/dmxinit.c index 74b3582..bc1509b 100644 --- a/hw/dmx/dmxinit.c +++ b/hw/dmx/dmxinit.c @@ -821,7 +821,7 @@ static void dmxSetDefaultFontPath(char *fp) /** This function is called in Xserver/os/utils.c from \a AbortServer(). * We must ensure that backend and console state is restored in the * event the server shutdown wasn't clean. */ -void AbortDDX(void) +void AbortDDX(enum ExitCode error) { int i; @@ -842,9 +842,9 @@ void ddxBeforeReset(void) /** This function is called in Xserver/dix/main.c from \a main() when * dispatchException & DE_TERMINATE (which is the only way to exit the * main loop without an interruption. */ -void ddxGiveUp(void) +void ddxGiveUp(enum ExitCode error) { - AbortDDX(); + AbortDDX(error); } /** This function is called in Xserver/os/osinit.c from \a OsInit(). */ diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c index f034ce4..8dd039e 100644 --- a/hw/kdrive/src/kdrive.c +++ b/hw/kdrive/src/kdrive.c @@ -232,7 +232,7 @@ KdProcessSwitch (void) } void -AbortDDX(void) +AbortDDX(enum ExitCode error) { KdDisableScreens (); if (kdOsFuncs) @@ -249,9 +249,9 @@ AbortDDX(void) } void -ddxGiveUp (void) +ddxGiveUp (enum ExitCode error) { - AbortDDX (); + AbortDDX (error); } Bool kdDumbDriver; diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c index 53f82f9..31ed505 100644 --- a/hw/vfb/InitOutput.c +++ b/hw/vfb/InitOutput.c @@ -150,7 +150,7 @@ vfbBitsPerPixel(int depth) } void -ddxGiveUp(void) +ddxGiveUp(enum ExitCode error) { int i; @@ -201,9 +201,9 @@ ddxGiveUp(void) } void -AbortDDX(void) +AbortDDX(enum ExitCode error) { - ddxGiveUp(); + ddxGiveUp(error); } #ifdef __APPLE__ diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c index 9752669..ab07515 100644 --- a/hw/xfree86/common/xf86Configure.c +++ b/hw/xfree86/common/xf86Configure.c @@ -749,7 +749,7 @@ DoConfigure(void) bail: OsCleanup(TRUE); - AbortDDX(); + AbortDDX(EXIT_ERR_CONFIGURE); fflush(stderr); exit(0); } diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 3cdffdb..f8e6c8b 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -1198,9 +1198,9 @@ xf86LogInit(void) } void -xf86CloseLog(void) +xf86CloseLog(enum ExitCode error) { - LogClose(); + LogClose(error); } diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 5347bbf..71926f8 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -902,7 +902,7 @@ OsVendorInit(void) */ void -ddxGiveUp(void) +ddxGiveUp(enum ExitCode error) { int i; @@ -929,7 +929,7 @@ ddxGiveUp(void) if (xorgHWOpenConsole) xf86CloseConsole(); - xf86CloseLog(); + xf86CloseLog(error); /* If an unexpected signal was caught, dump a core for debugging */ if (xf86Info.caughtSignal) @@ -946,7 +946,7 @@ ddxGiveUp(void) */ void -AbortDDX(void) +AbortDDX(enum ExitCode error) { int i; @@ -979,7 +979,7 @@ AbortDDX(void) * This is needed for an abnormal server exit, since the normal exit stuff * MUST also be performed (i.e. the vt must be left in a defined state) */ - ddxGiveUp(); + ddxGiveUp(error); } void diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h index 5d91ab3..1fe3d7e 100644 --- a/hw/xfree86/common/xf86Priv.h +++ b/hw/xfree86/common/xf86Priv.h @@ -140,7 +140,7 @@ extern _X_EXPORT pmWait (*xf86PMConfirmEventToOs)(int fd,pmEvent event); /* xf86Helper.c */ extern _X_EXPORT void xf86LogInit(void); -extern _X_EXPORT void xf86CloseLog(void); +extern _X_EXPORT void xf86CloseLog(enum ExitCode error); /* xf86Init.c */ extern _X_EXPORT Bool xf86LoadModules(char **list, pointer *optlist); diff --git a/hw/xfree86/common/xf86ShowOpts.c b/hw/xfree86/common/xf86ShowOpts.c index c0fa80a..a805916 100644 --- a/hw/xfree86/common/xf86ShowOpts.c +++ b/hw/xfree86/common/xf86ShowOpts.c @@ -124,7 +124,7 @@ void DoShowOptions (void) { } bail: OsCleanup (TRUE); - AbortDDX (); + AbortDDX (EXIT_ERR_DRIVERS); fflush (stderr); exit (0); } diff --git a/hw/xnest/Init.c b/hw/xnest/Init.c index ea0669a..af57518 100644 --- a/hw/xnest/Init.c +++ b/hw/xnest/Init.c @@ -114,16 +114,16 @@ CloseInput(void) /* * DDX - specific abort routine. Called by AbortServer(). */ -void AbortDDX(void) +void AbortDDX(enum ExitCode error) { xnestDoFullGeneration = True; xnestCloseDisplay(); } /* Called by GiveUp(). */ -void ddxGiveUp(void) +void ddxGiveUp(enum ExitCode error) { - AbortDDX(); + AbortDDX(error); } #ifdef __APPLE__ diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c index 73685b0..f19d7bf 100644 --- a/hw/xquartz/darwin.c +++ b/hw/xquartz/darwin.c @@ -766,9 +766,9 @@ void ddxUseMsg( void ) * ddxGiveUp -- * Device dependent cleanup. Called by dix before normal server death. */ -void ddxGiveUp( void ) +void ddxGiveUp( enum ExitCode error ) { - ErrorF( "Quitting Xquartz\n" ); + LogClose(error); } @@ -779,7 +779,7 @@ void ddxGiveUp( void ) * are closed. */ _X_NORETURN -void AbortDDX( void ) { +void AbortDDX( enum ExitCode error ) { ErrorF( " AbortDDX\n" ); OsAbort(); } diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index 22ef8da..4fe5053 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -191,7 +191,7 @@ ddxBeforeReset (void) /* See Porting Layer Definition - p. 57 */ void -ddxGiveUp (void) +ddxGiveUp (enum ExitCode error) { int i; @@ -228,7 +228,7 @@ ddxGiveUp (void) g_pszLogFile = LogInit (g_pszLogFile, NULL); g_fLogInited = TRUE; } - LogClose (); + LogClose (error); /* * At this point we aren't creating any new screens, so @@ -258,12 +258,12 @@ ddxGiveUp (void) /* See Porting Layer Definition - p. 57 */ void -AbortDDX (void) +AbortDDX (enum ExitCode error) { #if CYGDEBUG winDebug ("AbortDDX\n"); #endif - ddxGiveUp (); + ddxGiveUp (error); } #ifdef __CYGWIN__ @@ -901,7 +901,7 @@ ddxUseMsg(void) g_pszLogFile = LogInit (g_pszLogFile, NULL); g_fLogInited = TRUE; } - LogClose (); + LogClose (EXIT_NO_ERROR); /* Notify user where UseMsg text can be found.*/ if (!g_fNoHelpMessageBox) diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c index 5e32d09..0440d13 100644 --- a/hw/xwin/winerror.c +++ b/hw/xwin/winerror.c @@ -81,7 +81,7 @@ OsVendorFatalError (void) g_fLogInited = TRUE; g_pszLogFile = LogInit (g_pszLogFile, NULL); } - LogClose (); + LogClose (EXIT_ERR_ABORT); winMessageBoxF ( "A fatal error has occurred and " PROJECT_NAME " will now exit.\n" \ diff --git a/include/os.h b/include/os.h index 506dc5d..a553f57 100644 --- a/include/os.h +++ b/include/os.h @@ -459,8 +459,15 @@ typedef struct { /* stuff for FlushCallback */ extern _X_EXPORT CallbackListPtr FlushCallback; -extern _X_EXPORT void AbortDDX(void); -extern _X_EXPORT void ddxGiveUp(void); +enum ExitCode { + EXIT_NO_ERROR = 0, + EXIT_ERR_ABORT = 1, + EXIT_ERR_CONFIGURE = 2, + EXIT_ERR_DRIVERS = 3, +}; + +extern _X_EXPORT void AbortDDX(enum ExitCode error); +extern _X_EXPORT void ddxGiveUp(enum ExitCode error); extern _X_EXPORT int TimeSinceLastInputEvent(void); /* strcasecmp.c */ @@ -508,7 +515,7 @@ typedef enum { } MessageType; extern _X_EXPORT const char *LogInit(const char *fname, const char *backup); -extern _X_EXPORT void LogClose(void); +extern _X_EXPORT void LogClose(enum ExitCode error); extern _X_EXPORT Bool LogSetParameter(LogParameter param, int value); extern _X_EXPORT void LogVWrite(int verb, const char *f, va_list args) _X_ATTRIBUTE_PRINTF(2,0); extern _X_EXPORT void LogWrite(int verb, const char *f, ...) _X_ATTRIBUTE_PRINTF(2,3); diff --git a/os/log.c b/os/log.c index 4a310e6..f519762 100644 --- a/os/log.c +++ b/os/log.c @@ -231,9 +231,11 @@ LogInit(const char *fname, const char *backup) } void -LogClose(void) +LogClose(enum ExitCode error) { if (logFile) { + ErrorF("Server terminated %s (%d). Closing log file.\n", + (error == EXIT_NO_ERROR) ? "successfully" : "with error", error); fclose(logFile); logFile = NULL; } @@ -411,7 +413,7 @@ AbortServer(void) CloseWellKnownConnections(); OsCleanup(TRUE); CloseDownDevices(); - AbortDDX(); + AbortDDX(EXIT_ERR_ABORT); fflush(stderr); if (CoreDump) OsAbort(); commit 01de08c7d2c00eef238adba6665896ea3cd7d511 Author: Julien Cristau <[email protected]> Date: Tue Jul 26 20:40:38 2011 +0200 configure: set default xkb rules to evdev on Linux If config/udev was enabled, this would default to base, which means that after regen the devices would get the wrong rules, and hilarity would ensue. It's probably safe to default to evdev unconditionally on Linux by now. Reported-by: Bastian Blank <[email protected]> Signed-off-by: Julien Cristau <[email protected]> Reviewed-by: Peter Hutterer <[email protected]> Signed-off-by: Peter Hutterer <[email protected]> diff --git a/configure.ac b/configure.ac index 4656a83..2438825 100644 --- a/configure.ac +++ b/configure.ac @@ -1187,11 +1187,7 @@ if test "x$XKB_DFLT_RULES" = x; then case $host_os in linux*) dnl doesn't take AutoAddDevices into account, but whatever. - if test "x$CONFIG_HAL" = xyes; then - XKB_DFLT_RULES="evdev" - else - XKB_DFLT_RULES="base" - fi + XKB_DFLT_RULES="evdev" ;; *) XKB_DFLT_RULES="base" commit 3798dd379c1ecf325f9907128fb66d20372f6876 Author: Peter Hutterer <[email protected]> Date: Wed Jul 20 09:00:18 2011 +1000 Initialize the fd to -1 for xorg.conf input devices. For hotplugged devices, xf86AllocateInput does that for us but the xorg.conf path is different. Since not all drivers reset the fd during PreInit but may still call close(pInfo->fd) in all cases, this can terminate the logging early. Reproducible: add a wacom driver InputDevice section with no Option Device. Signed-off-by: Peter Hutterer <[email protected]> Reviewed-by: Daniel Stone <[email protected]> diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 114bdc3..58b30dd 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -1222,6 +1222,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) devs = xnfrealloc(servlayoutp->inputs, (count + 1) * sizeof(InputInfoPtr)); devs[count - 1] = xnfalloc(sizeof(InputInfoRec)); + Pointer.fd = -1; *devs[count - 1] = Pointer; devs[count - 1]->options = xf86addNewOption(devs[count -1]->options, @@ -1267,6 +1268,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) devs = xnfrealloc(servlayoutp->inputs, (count + 1) * sizeof(InputInfoPtr)); devs[count - 1] = xnfalloc(sizeof(InputInfoRec)); + Pointer.fd = -1; *devs[count - 1] = Pointer; devs[count - 1]->options = xf86addNewOption(NULL, xnfstrdup("AlwaysCore"), NULL); @@ -1363,6 +1365,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) devs = xnfrealloc(servlayoutp->inputs, (count + 1) * sizeof(InputInfoPtr)); devs[count - 1] = xnfalloc(sizeof(InputInfoRec)); + Keyboard.fd = -1; *devs[count - 1] = Keyboard; devs[count - 1]->options = xf86addNewOption(devs[count - 1]->options, commit f2a6735cfc07789cca81852b24a85578f200d83d Author: Peter Hutterer <[email protected]> Date: Mon Jul 4 12:34:32 2011 +1000 xfree86: NULL option values are technically valid, don't strdup them Signed-off-by: Peter Hutterer <[email protected]> Reviewed-by: Daniel Stone <[email protected]> diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c index 480f386..a3a836f 100644 --- a/hw/xfree86/common/xf86Option.c +++ b/hw/xfree86/common/xf86Option.c @@ -340,7 +340,7 @@ pointer xf86AddNewOption(pointer head, const char *name, const char *val) { /* XXX These should actually be allocated in the parser library. */ - char *tmp = strdup(val); + char *tmp = val ? strdup(val) : NULL; char *tmp_name = strdup(name); return xf86addNewOption(head, tmp_name, tmp); commit f0d7e9db28c374a3db359bcb63a7ce79fd84b541 Author: Peter Hutterer <[email protected]> Date: Mon Jul 4 14:14:39 2011 +1000 xfree86: duplicate xorg.conf device information before xf86NewInputDevice xf86ConfigLayout.inputs contains the information from the xorg.conf file. Passing this into xf86NewInputDevice means the device will get cleaned up on exit and the pointers in xf86ConfigLayout.inputs are left dangling. In the second server generation, this results in a server crash. Also, rename pDev to pInfo. pDev is pretty much reserved for DeviceIntPtr types. Reproducible: AutoAddDevices off and xorg.conf input sections, trigger server regeneration. Signed-off-by: Peter Hutterer <[email protected]> Reviewed-by: Daniel Stone <[email protected]> diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 15fdbc3..5347bbf 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -791,6 +791,21 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) NULL); } +static InputInfoPtr +duplicateDevice(InputInfoPtr pInfo) +{ + InputInfoPtr dup = calloc(1, sizeof(InputInfoRec)); + if (dup) { + dup->name = strdup(pInfo->name); + dup->driver = strdup(pInfo->driver); + dup->options = xf86OptionListDuplicate(pInfo->options); + /* type_name is a const string */ + dup->type_name = pInfo->type_name; + dup->fd = -1; + } + return dup; +} + /* * InitInput -- * Initialize all supported input devices. @@ -799,7 +814,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) void InitInput(int argc, char **argv) { - InputInfoPtr* pDev; + InputInfoPtr* pInfo; DeviceIntPtr dev; xf86Info.vtRequestsPending = FALSE; @@ -807,14 +822,21 @@ InitInput(int argc, char **argv) mieqInit(); /* Initialize all configured input devices */ - for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) { + for (pInfo = xf86ConfigLayout.inputs; pInfo && *pInfo; pInfo++) { + InputInfoPtr dup; /* Replace obsolete keyboard driver with kbd */ - if (!xf86NameCmp((*pDev)->driver, "keyboard")) { - strcpy((*pDev)->driver, "kbd"); + if (!xf86NameCmp((*pInfo)->driver, "keyboard")) { + strcpy((*pInfo)->driver, "kbd"); } + /* Data passed into xf86NewInputDevice will be freed on shutdown. + * Duplicate from xf86ConfigLayout.inputs, otherwise we don't have any + * xorg.conf input devices in the second generation + */ + dup = duplicateDevice(*pInfo); + /* If one fails, the others will too */ - if (xf86NewInputDevice(*pDev, &dev, TRUE) == BadAlloc) + if (xf86NewInputDevice(dup, &dev, TRUE) == BadAlloc) break; } commit 8ffddbcf72170e246826ee0f39f18989a29fa218 Author: Peter Hutterer <[email protected]> Date: Mon Jun 27 16:30:28 2011 +1000 xfree86: Remove devices that failed to enable on startup Devices that succeeded during PreInit and DEVICE_INIT but failed in DEVICE_ON would be deleted through xf86DeleteInput but not removed from the list of input devices (and not turned off). The result was a double free on server shutdown. Fix this by calling RemoveDevice if EnableDevice fails. Signed-off-by: Peter Hutterer <[email protected]> Reviewed-by: Daniel Stone <[email protected]> diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 26051ad..d22fdc8 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -844,6 +844,7 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable) { OsReleaseSignals(); xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name); + RemoveDevice(dev, TRUE); rval = BadMatch; goto unwind; } commit 6cea28fe4b7a4a22ad270d8c71403db84a9bfb2c Author: Lennart Poettering <[email protected]> Date: Mon Jul 18 21:18:27 2011 +0200 config: don't fail if a device vanished by the time we managed to look at it The nature of hotplug is that a device we enumerated might already be gone by the time we look at it, so don't assume otherwise. Signed-off-by: Lennart Poettering <[email protected]> Reviewed-by: Peter Hutterer <[email protected]> Signed-off-by: Peter Hutterer <[email protected]> diff --git a/config/udev.c b/config/udev.c index 0763cc9..e7383dc 100644 --- a/config/udev.c +++ b/config/udev.c @@ -301,6 +301,11 @@ config_udev_init(void) udev_list_entry_foreach(device, devices) { const char *syspath = udev_list_entry_get_name(device); struct udev_device *udev_device = udev_device_new_from_syspath(udev, syspath); + + /* Device might be gone by the time we try to open it */ + if (!udev_device) + continue; + device_added(udev_device); udev_device_unref(udev_device); } commit f13de9ca1b7c4dd0dd5c08037c6bd53f88ac30f5 Author: Lennart Poettering <[email protected]> Date: Mon Jul 18 21:17:49 2011 +0200 config: limit the kernel subsystems we look for devices in Don't enumerate/monitor all devices of the system (since that can be quite a few), but limit our search to devices from the "input" subsystem, as well as the "tty" subsystem (to cover Wacom tablets). This should make X start up a bit faster and reduce the number of unnecessary wake-ups of the X server. Signed-off-by: Lennart Poettering <[email protected]> Reviewed-by: Peter Hutterer <[email protected]> Signed-off-by: Peter Hutterer <[email protected]> diff --git a/config/udev.c b/config/udev.c index 5ac52a1..0763cc9 100644 --- a/config/udev.c +++ b/config/udev.c @@ -281,6 +281,9 @@ config_udev_init(void) if (!udev_monitor) return 0; + udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "input", NULL); + udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "tty", NULL); /* For Wacom serial devices */ + if (udev_monitor_enable_receiving(udev_monitor)) { ErrorF("config/udev: failed to bind the udev monitor\n"); return 0; @@ -289,6 +292,10 @@ config_udev_init(void) enumerate = udev_enumerate_new(udev); if (!enumerate) return 0; + + udev_enumerate_add_match_subsystem(enumerate, "input"); + udev_enumerate_add_match_subsystem(enumerate, "tty"); + udev_enumerate_scan_devices(enumerate); devices = udev_enumerate_get_list_entry(enumerate); udev_list_entry_foreach(device, devices) { commit 882e3c2680c339ad7aa0d664e0b0f02b8a05b11d Author: Lennart Poettering <[email protected]> Date: Mon Jul 18 21:17:10 2011 +0200 config: process udev "changed" and "add" events in the same code paths udev gives no guarantee that before each "changed" event for a device there's an "add" event, or that before each "remove" is an "add", or that before each "add" there was no "add" already and so on. Users can trigger these events at any time with "udevadm trigger", and netlink is a lossy transport, hence the events can come in unexpected ordering. With other words: regardless which event is generated, the X server must not choke on it and make the best of it, hence make sure that if we get an "add" event for an existing device we don't add the device a second time. Signed-off-by: Lennart Poettering <[email protected]> Reviewed-by: Peter Hutterer <[email protected]> Signed-off-by: Peter Hutterer <[email protected]> -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected] Archive: http://lists.debian.org/[email protected]

