summaryrefslogtreecommitdiff
path: root/hw/xfree86/os-support/linux/lnx_init.c
AgeCommit message (Collapse)AuthorFilesLines
2011-11-23Convert a bunch of sprintf to snprintf callsAlan Coopersmith1-1/+1
This batch is the straightforward set - others are more complex and need more analysis to determine right size to pass. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-18Fix drain_console unregistrationTomáš Trnka1-8/+6
Bug introduced by 9dca441670d261a9a9fb6108960ed48f3d58fb7f xfree86: add a hook to replace the new console handler. console_handler was not being set, making the server eat up CPU spinning in WaitForSomething selecting consoleFd over and over again, every time trying to unregister drain_console without success due to console_handler being NULL. Let's just fix the unregistration in xf86SetConsoleHandler() and use that. But wait, there could be a catch: If some driver replaced the handler using xf86SetConsoleHandler(), the unregistration in xf86CloseConsole will unregister that one. I don't understand Xorg well enough to know whether this poses a problem (could mess up driver deinit somehow or something like that). As it is, xf86SetConsoleHandler() doesn't offer any way to prevent this (i.e. check which handler is currently registered). I had been using it for two days on my machine that previously hit 100% CPU several times a day. That has now gone away without any new problems appearing. Signed-off-by: Tomas Trnka <tomastrnka@gmx.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-16xfree86: move -novtswitch & -sharevts argument handling up to common layerAlan Coopersmith1-19/+6
Stop duplicating in each os-support variant before it gets replicated even further. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
2011-04-22linux: Retry VT ioctls while errno == EINTRAaron Plattner1-34/+49
When the smart scheduler is enabled, the VT ioctls (particularly VT_WAITACTIVE) can be interrupted by the smart scheduler's SIGALRMs. Previously, this caused the server to immediately continue on to ScreenInit, almost certainly causing a crash or failure because the X server that owned the VT hadn't finished cleaning up. As of commit 7ee965a300c9eddcc1acacf9414cfe3e589222a8, it causes a FatalError instead. Retrying the ioctl as long as it fails with errno == EINTR fixes the problem and allows server regenerations to trigger VT switches that actually succeed. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Cyril Brulebois <kibi@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-11-30linux: Refactor VT switch on {re,}generation and shutdownAdam Jackson1-24/+14
This makes more things fatal than were fatal before, but that's correct; if you need the VT, then failing to get it on regeneration means things are about to go very very badly. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-30linux: Don't muck about with tty permissionsAdam Jackson1-62/+0
This is not X's job. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-30linux: Remove redundant variableAdam Jackson1-5/+3
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-19linux: Fix CPU usage bug in console fd flushingAdam Jackson1-1/+5
If the vt gets a vhangup from under us, then the tty will appear ready in select(), but trying to tcflush() it will return -EIO, so we'll spin around at 100% CPU for no reason. Notice this condition and unregister the handler if it happens. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-09-10xfree86: add a hook to replace the new console handler.Peter Hutterer1-3/+1
This hook is only necessary for the keyboard driver to remove the race condition between drain_console() and the driver's ReadInput (Bug 29969). The idea is that a driver that needs to handle events from the console calls xf86ReplaceConsoleHandler() with it's own ReadInput (or NULL) and thus removes the drain_console call. It's the driver's responsibility to restore the previous behaviour when the driver is unloaded. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> CC: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-09-10linux: Don't lose console events on non-evdev drivers (#29969)Thomas Hellstrom1-2/+3
The drain_console() function will race with new keyboard events being added by the hardware causing the server to lose keyboard events if the console fd is used for input. Only use the drain_console() when AllowEmptyInput is off which is the best indicator we have for whether the keyboard driver will be used. This patch will only fix the bug when hotplugging is disabled. What we really need is a way to figure out either whether we're _not_ using the keyboard driver (not predictable) or a way for the keyboard driver to disable drain_console(). X.Org Bug 29969 <http://bugs.freedesktop.org/show_bug.cgi?id=29969> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 71972c2534d490284d3d42b456c2f34b964b2894)
2010-06-10Remove unnecessary parentheses around return values in functionsMikhail Gusarov1-6/+6
This patch was generated by the following Perl code: perl -i -pe 's/([^_])return\s*\(\s*([^(]+?)\s*\)s*;(\s+(\n))?/$1return $2;$4/g;' Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-06Remove lnx_font.c and lnx.hMatt Turner1-28/+2
I couldn't find any version of the X xserver that ever used lnx_font.c so let's delete it. I tried contacting its author, Egbert, multiple times on IRC and email [*] but never got any response. It also hasn't been seriously touched since January 2005. [*] http://lists.x.org/archives/xorg-devel/2009-October/002855.html Signed-off-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-09-14xfree86: fix VT_WAITACTIVE control flow (#11477)Peter Hutterer1-1/+1
Move misplaced } to get the flow of if (!ShareVTs) { VT_ACTIVATE VT_WAITACTIVE } X.Org Bug 11477 <http://bugs.freedesktop.org/show_bug.cgi?id=11477> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Daniel Stone <daniel@fooishbar.org>
2009-09-01XFree86: Linux: Fix 100% CPU usage with ShareVTs and kbdMichael Witrant1-4/+4
Leave consoleFd open over the course of the server, even though any use of it in this context is likely to be disastrous. Signed-off-by: Michael Witrant <mike@lepton.fr> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2009-08-18xfree86/linux: don't change VT perms unless we're running as rootJesse Barnes1-17/+21
In non-setuid root installations, we shouldn't try to adjust VT/tty ownership. It will fail, and shouldn't be necessary anyway (since startup scripts or PAM should be handling perms for us in that case). Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-04-01input: Remove xf86ReloadInputDevs hackAdam Jackson1-1/+0
We have input hotplug now, no need to fake it.
2009-02-16Linux: Remove dead USE_DEV_FB #ifdefsAdam Jackson1-34/+0
2009-01-16xfree86: always force RAW mode under linux.Peter Hutterer1-35/+25
The previous check for AEI on left us with the possibility that AEI is forced off in the config, but devices are added through evdev nonetheless. A keyboard added this way can CTRL+C the server. Even when we use kbd, we can set the mode to RAW, so it's safer alround to to so. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-11xfree86: ANSI cleanupsJulien Cristau1-2/+2
2008-12-19xfree86: don't restore the TTY mode if we didn't initialize it ourselvesPeter Hutterer1-2/+4
Restoring it unconditionally means we restore to whatever tty_mode has as default value (i.e. 0). K_RAW happens to be 0x00, so we always restore to raw mode if allowEmptyInput is off. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Julien Cristau <jcristau@debian.org>
2008-12-03Rework symbol visibility for easier maintenancePaulo Cesar Pereira de Andrade1-4/+4
Save in a few special cases, _X_EXPORT should not be used in C source files. Instead, it should be used in headers, and the proper C source include that header. Some special cases are symbols that need to be shared between modules, but not expected to be used by external drivers, and symbols that are accessible via LoaderSymbol/dlopen. This patch also adds conditionally some new sdk header files, depending on extensions enabled. These files were added to match pattern for other extensions/modules, that is, have the headers "deciding" symbol visibility in the sdk. These headers are: o Xext/panoramiXsrv.h, Xext/panoramiX.h o fbpict.h (unconditionally) o vidmodeproc.h o mioverlay.h (unconditionally, used only by xaa) o xfixes.h (unconditionally, symbols required by dri2) LoaderSymbol and similar functions now don't have different prototypes, in loaderProcs.h and xf86Module.h, so that both headers can be included, without the need of defining IN_LOADER. xf86NewInputDevice() device prototype readded to xf86Xinput.h, but not exported (and with a comment about it).
2008-11-29Export symbols defined in the sdk.Paulo Cesar Pereira de Andrade1-4/+4
This is the biggest "visibility" patch. Instead of doing a "export" symbol on demand, export everything in the sdk, so that if some module fails due to an unresolved symbol, it is because it is using a symbol not in the sdk. Most exported symbols shouldn't really be made visible, neither advertised in the sdk, as they are only used by a single shared object. Symbols in the sdk (or referenced in sdk macros), but not defined anywhere include: XkbBuildCoreState() XkbInitialMap XkbXIUnsupported XkbCheckActionVMods() XkbSendCompatNotify() XkbDDXFakePointerButton() XkbDDXApplyConfig() _XkbStrCaseCmp() _XkbErrMessages[] _XkbErrCode _XkbErrLocation _XkbErrData XkbAccessXDetailText() XkbNKNDetailMaskText() XkbLookupGroupAndLevel() XkbInitAtoms() XkbGetOrderedDrawables() XkbFreeOrderedDrawables() XkbConvertXkbComponents() XkbWriteXKBSemantics() XkbWriteXKBLayout() XkbWriteXKBKeymap() XkbWriteXKBFile() XkbWriteCFile() XkbWriteXKMFile() XkbWriteToServer() XkbMergeFile() XkmFindTOCEntry() XkmReadFileSection() XkmReadFileSectionName() InitExtInput() xf86CheckButton() xf86SwitchCoreDevice() RamDacSetGamma() RamDacRestoreDACValues() xf86Bpp xf86ConfigPix24 xf86MouseCflags[] xf86SupportedMouseTypes[] xf86NumMouseTypes xf86ChangeBusIndex() xf86EntityEnter() xf86EntityLeave() xf86WrapperInit() xf86RingBell() xf86findOptionBoolean() xf86debugListOptions() LoadSubModuleLocal() LoaderSymbolLocal() getInt10Rec() xf86CurrentScreen xf86ReallocatePciResources() xf86NewSerialNumber() xf86RandRSetInitialMode() fbCompositeSolidMask_nx1xn fbCompositeSolidMask_nx8888x0565C fbCompositeSolidMask_nx8888x8888C fbCompositeSolidMask_nx8x0565 fbCompositeSolidMask_nx8x0888 fbCompositeSolidMask_nx8x8888 fbCompositeSrc_0565x0565 fbCompositeSrc_8888x0565 fbCompositeSrc_8888x0888 fbCompositeSrc_8888x8888 fbCompositeSrcAdd_1000x1000 fbCompositeSrcAdd_8000x8000 fbCompositeSrcAdd_8888x8888 fbGeneration fbIn fbOver fbOver24 fbOverlayGeneration fbRasterizeEdges fbRestoreAreas fbSaveAreas composeFunctions VBEBuildVbeModeList() VBECalcVbeModeIndex() TIramdac3030CalculateMNPForClock() shadowBufPtr shadowFindBuf() miRRGetScreenInfo() RRSetScreenConfig() RRModePruneUnused() PixmanImageFromPicture() extern int miPointerGetMotionEvents() miClipPicture() miRasterizeTriangle() fbPush1toN() fbInitializeBackingStore() ddxBeforeReset() SetupSprite() InitSprite() DGADeliverEvent() SPECIAL CASES o defined as _X_INTERNAL xf86NewInputDevice() o defined as static fbGCPrivateKey fbOverlayScreenPrivateKey fbScreenPrivateKey fbWinPrivateKey o defined in libXfont.so, but declared in xorg/dixfont.h GetGlyphs() QueryGlyphExtents() QueryTextExtents() ParseGlyphCachingMode() InitGlyphCaching() SetGlyphCachingMode()
2008-11-05linux: Drain the console fd of data when using evdev for keyboardsAdam Jackson1-0/+17
Works around a silly bug in the kernel that causes wakeup storms after too many keypresses. Should fix the kernel bug too, but this at least keeps the idle wakeup count below 1000/sec.
2008-10-16xfree86: if AllowEmptyInput is true, enable RAW mode on the console.Peter Hutterer1-1/+34
Usually, the console is set to RAW in the kbd driver. If we hotplug all input devices (i.e. the evdev driver for keyboards) and the console is left as-is. As a result, the evdev driver must put an EVIOCGRAB on the device to avoid characters leaking onto the console. This again breaks many things, amongst them lirc, in-kernel mouse button emulation and HAL. This patch sets the console to RAW if AllowEmptyInput is on. Use-cases: 1. AEI is off 1.1. Only kbd driver is used - behaviour as-is. 1.2. kbd and evdev driver is used: if evdev does not grab the device, duplicate events are generated. 2. AEI is on 2.1. Only evdev driver is used - behaviour as-is, but evdev does not need to grab the device anymore. 2.2. evdev and kbd are used: duplicate key events are generated if evdev does not grab the device. 1.2 is a marginal use-case that can be fixed by adding a "grab" option to the evdev driver (update of xorg.conf is needed). 2.2 is an issue. If we have no ServerLayout section, AEI is on, but devices specified in the xorg.conf are still added [1], resulting in duplicate events. This is a common configuration and needs sorting out. [1] 2eaed4a10fe5bf727579bca4ab8d4a47c8763a7d Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2007-06-29Death to RCS tags.Adam Jackson1-1/+0
2007-04-09VT activate or waitactive are fatal if they fail.Adam Jackson1-5/+9
Also, be sure to waitactive on the way down, to make sure we're off the VT before exiting.
2006-07-21Remove RCS tags. Fix Xprint makefile braindamage.Adam Jackson1-2/+0
2005-08-26Subvert SIGUSR2 to reload all input devices. (Ubuntu #020)Daniel Stone1-0/+1
2005-07-04Bug #2216: Multiseat support. From various Debian and Ubuntu patches byAdam Jackson1-86/+129
Aivils Stoss, Andreas Schuldei, Branden Robinson, and Daniel Stone.
2005-07-03Add Xtrans definitions (FONT_t, TRANS_CLIENT) to clean up warnings.Daniel Stone1-0/+4
Add XSERV_t, TRANS_SERVER, TRANS_REOPEN to quash warnings. Add #include <dix-config.h> or <xorg-config.h>, as appropriate, to all source files in the xserver/xorg tree, predicated on defines of HAVE_{DIX,XORG}_CONFIG_H. Change all Xfont includes to <X11/fonts/foo.h>.
2005-07-01Change all misc.h and os.h references to <X11/foo.h>.Daniel Stone1-1/+1
2005-04-20Fix includes right throughout the Xserver tree:Daniel Stone1-3/+3
change "foo.h" to <X11/foo.h> for core headers, e.g. X.h, Xpoll.h; change "foo.h", "extensions/foo.h" and "X11/foo.h" to <X11/extensions/foo.h> for extension headers, e.g. Xv.h; change "foo.[ch]" to <X11/Xtrans/foo.[ch]> for Xtrans files.
2005-01-28Modifying X.Org Xserver DDX to allow to run X with ordinary userEgbert Eich1-90/+110
permissions when no access to HW registers is required. For API changes which mostly involve the modifications to make the RRFunc (introduced with 6.8) more flexible please check Bugzilla #2407. NOTE: This patch applies changes to OS specific files for other OSes which I cannot test.
2005-01-14Let the OS instead of X save/restore text console fonts on Linux. So far weEgbert Eich1-16/+78
relied on the generic VGA layer to restore text console fonts for us when shutting down the server or VT switching back to the text console. This has worked rather well but it has some downsides on Linux: a. Many people use fbdev as console text mode. In this case it is not necessary to save/restore console fonts as the console is running in graphics mode anyway. b. Some architectures don't have a fbdev console but require a full POST of even the primary card (ie. IA64). This posting has to take place before we even have a chance to save anything. Therefore the fonts we save are the once written to the chip by POST, not what has been programmed by the user. c. Certain chipsets utilize the BIOS to perform mode setting. This may interfer with the vga save/restore font function in a strange way. It would therefore be preferrable to let the OS - which has been used to set up the font in the first place - take care of saving/restoring the data. I will attach a patch which will do so for Linux. To make this fully functional a small patch needs to be applied to the Linux kernel. To disable this feature add: #define DoOSFontRestore NO to your host.def. (Bugzilla #2277)
2004-06-16DRI XFree86-4_3_99_12-merge importDRI-XFree86-4_3_99_12-mergeEric Anholt1-62/+16
2004-04-23Merging XORG-CURRENT into trunkEgbert Eich1-1/+2
2004-03-14Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004xf86-4_4_99_1Egbert Eich1-1/+1
2004-03-03Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004xf86-4_4_0Egbert Eich1-1/+1
2004-02-26readding XFree86's cvs IDsxf86-4_3_99_903Egbert Eich1-1/+1
2004-02-26Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004Egbert Eich1-1/+1
2003-12-04XFree86 4.3.99.901 (RC 1)xf86-4_3_99_901Kaleb Keithley1-17/+62
2003-11-14XFree86 4.3.0.1xf86-4_3_0_1PRE_xf86-4_3_0_1Kaleb Keithley1-54/+65
2003-11-14R6.6 is the Xorg base-lineXORG-MAINKaleb Keithley1-0/+274