summaryrefslogtreecommitdiff
path: root/hw/xfree86/common/xf86Init.c
AgeCommit message (Collapse)AuthorFilesLines
2010-09-10os/xfree86: remove macro checking for POSIX symbolsTiago Vignatti1-10/+0
We assume already that our X implementation is POSIX compliant anyway. So remove those redundant checking. SA_SIGINFO is left there. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-08-27Replace malloc/strlen/strcpy with strdup.Matt Turner1-4/+2
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
2010-08-27xfree86: Remove comments about unable to use malloc.Jesse Adkins1-5/+0
These are leftovers from when X still used Xmalloc and friends for allocation. Now that those are gone, these comments are just confusing. Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Matt Turner <mattst88@gmail.com>
2010-06-10Remove unnecessary parentheses around return values in functionsMikhail Gusarov1-1/+1
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>
2010-06-06Replace deprecated bzero with memsetMikhail Gusarov1-2/+2
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Marcin Baczyński <marbacz@gmail.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-06-05Change the devPrivates API to require dixRegisterPrivateKeyKeith Packard1-0/+10
This patch only changes the API, not the implementation of the devPrivates infrastructure. This will permit a new devPrivates implementation to be layed into the server without requiring simultaneous changes in every devPrivates user. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-05-19xfree86: remove PCI dependency from InitOutputTiago Vignatti1-305/+5
All functions that touch PCI and BUS were moved to their own files, organizing the mess inside the InitOutput. Now, inside InitOutput, mostly accesses to buses are coordinated by the new xf86BusConfig. Two PCI probe functions just changed the name and a procedure to receive the isolate devices parameters was created also, named xf86PciIsolateDevice. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19xfree86: bus: simplify entity related hooksTiago Vignatti1-1/+0
Remove some out dated commentaries either. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19xfree86: remove unused xf86AccessInit()Tiago Vignatti1-3/+1
The function was only initializing the boolean xf86ResAccessEnter, which couldn't get any other value in the life of the server. The only possible, though suspicious, code was in xf86AccessLeave(), which could be triggered if AbortDDX is called before xf86AccessInit(). Even so, such change is safety because no driver would have configured any entity leave procedure at this point. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-13Replace X-allocation functions with their C89 counterpartsMikhail Gusarov1-7/+7
The only remaining X-functions used in server are XNF*, the rest is converted to plain alloc/calloc/realloc/free/strdup. X* functions are still exported from server and x* macros are still defined in header file, so both ABI and API are not affected by this change. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-23xfree86: no need to assign numScreens againTiago Vignatti1-3/+0
numScreens is always being assigned to 0 in dix for any server generation. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-19unifdef -B -DRENDER to always include RENDER codeKeith Packard1-10/+0
This patch was created with: git ls-files '*.[ch]' | while read f; do unifdef -B -DRENDER -o $f $f; done Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-02xfree86: die gracefully in the vga arbiter if AddScreen failsTiago Vignatti1-0/+2
vga arbiter will be locked in one device while AbortDDX will call LeaveVT routines from the other device. Fail! Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-17os: Prevent core dump from being truncated.Rami Ylimaki1-1/+1
The problem fixed by this patch can be reproduced on Linux with the following steps. - Access NULL pointer intentionally in ProcessOtherEvent on key press. - Instead of saving core dump to a file, write it into a pipe. echo "|/usr/sbin/my-core-dumper" > /proc/sys/kernel/core_pattern - Dump the core by pressing a key. While the core is being dumped into the pipe, the smart schedule timer will cause a pending SIGALRM. Linux kernel stops writing data to the pipe when there are pending signals. This causes the core dump to be truncated. On my system I'm expecting a 6 MB dump but the size will be 60 kB instead. The problem is solved if we block the SIGALRM caused by expired smart schedule timer. I haven't been able to reproduce this problem in the following cases. - Save core dump to a file instead of a pipe. - kill -SEGV `pidof Xorg` - Press a key to dump core while gdb is attached to Xorg. - Give option -dumbSched to Xorg. Also note that the fix works only when NoTrapSignals has the default value FALSE. The problem can still be reproduced if error signals aren't trapped. In addition to pending SIGALRM, there is a similar problem with pending SIGIO from the keyboard driver during core dump. Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-15dix: move config_init into the DDX.Peter Hutterer1-0/+10
The only DDX currently using hotplugging is the xfree86 one and it looks like it'll stay that way for a bit. Move the initialization to the DDX, since Xephyr, Xnest, and friends don't need HAL or udev notifications. Add CloseInput (counterpart to InitInput) to be able to clean up the config initialization from the DDX as well. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2009-12-22xfree86: Allow config directory to be specified on command lineDan Nicholson1-0/+15
Add a new command line parameter, -configdir, to specify the config directory to be used. Rules are the same as -config for root vs. user privileges. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
2009-12-16xfree86: fix -quiet option behaviourTiago Vignatti1-1/+1
Previously it was trying to set the same value as the default one. Sigh. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Acked-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-16xfree86: spam output but with verbose level checked insteadTiago Vignatti1-21/+25
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Acked-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-17xfree86: set a sane umask before opening the logJulien Cristau1-1/+3
Xorg creates its log file following the umask of the user running startx, which may result in a world-writable log. Set umask to 022 to prevent this. Debian bug#555308 <http://bugs.debian.org/555308> See also http://thread.gmane.org/gmane.comp.security.oss.general/2299 Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-28Add video driver flag to indicate that console access is not needed.Jamey Sharp1-11/+21
Existing video drivers will get the console enabled by default. Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-09-20xf86Xinput.c: get DIX event queue pointer once at InitInput timeKeith Packard1-0/+2
The DIX event queue is allocated before InitInput is called, so fetch the pointer there and not randomly at other times. This avoids failing to fetch the pointer sometimes during server regen and then smashing memory through the stale pointer from the previous server generation. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-20probe_devices_from_device_sections: don't leak list of devicesKeith Packard1-1/+1
xf86MatchDevice returned malloc'd storage containing the list of devices to look at; make sure that gets freed. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-11xfree86: vgaarb: close and cleanup vga arbiterTiago Vignatti1-0/+2
So far there are no apparently issues on not closing the fd. But let's do the right job here. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Acked-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-31xfree86: removal of some dead code due VGA arbiter's inclusionTiago Vignatti1-4/+0
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2009-08-28xf86 ddx: add vga arbiter support.Dave Airlie1-3/+8
This adds support for using the libpciaccess interface for vga arbitration support on top of a kernel which supports it. Currently patches are queued for kernel 2.6.32 in jbarnes pci tree, and shipping in Fedora kernel. Co-authors: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-08-20xfree86: dump /proc/cmdline in the log on LinuxAdam Jackson1-0/+15
2009-07-28xfree86: delete devices probe code (-probe and -probeonly options)Tiago Vignatti1-127/+2
Inside a windowing system, it's not the place to probe for devices. Goodbye -probe and -probeonly. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2009-07-28xfree86: delete stupid video driver dump (-modalias option)Tiago Vignatti1-92/+1
Such stupid and ugly way to dump PCI information! Oh boy... Anyway, this doesn't belong to the X server at all. Go away! Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2009-07-28xserver: remove RAC/resource handling code.Dave Airlie1-7/+0
This changes the ABI, but since the video ABI is at 6 already it should be fine. driver changes are in the pipeline after this. Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-07-15Update to xextproto 7.0.99.1.Peter Hutterer1-2/+1
xextproto had Xlib client headers moved into libXext. Protocol header files are named fooproto.h, header files with constants foo.h or fooconst.h where foo.h was already in use for client-side headers.
2009-07-06Unclaim PCI slot if driver probing fails.Matthias Hopf1-1/+2
Otherwise no subsequent driver will be able to claim this pci slot. Example for this: fbdev tries to claim, but framebuffer device is not available. Later on VESA cannot claim the device.
2009-06-19Use pixman_version_string() instead of PIXMAN_VERSION_STRINGSøren Sandmann Pedersen1-1/+1
Pointed out by Julien Cristau.
2009-06-18Print the current version of pixman.Søren Sandmann Pedersen1-0/+1
2009-05-16xfree86: Remove superfluous ifdef DEBUG checks.Peter Hutterer1-13/+5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-09Lift fatal signal handlers from DDX'es up to a common DIX implementationAlan Coopersmith1-8/+10
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-02-17Add XkbDir to Files config file sectionKeith Packard1-0/+7
The XKB base directory was not configuable through the config file. Signed-off-by: Keith Packard <keithp@keithp.com>
2009-02-04Bus: Delete some obfuscatory macrosAdam Jackson1-1/+1
2009-01-11xfree86: ANSI cleanupsJulien Cristau1-8/+6
2009-01-05XFree86: Fix build with DGA disabledDaniel Stone1-0/+2
It's optional, so we might as well work when it's disabled. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2008-12-23Remove obsolete XF86_DATE & xf86Date.hAlan Coopersmith1-2/+1
2008-12-23Remove unused CLOG_DATE (leftover from pre-git ChangeLog)Alan Coopersmith1-14/+0
2008-12-12Remove #define NEED_EVENTS and NEED_REPLIESPeter Hutterer1-1/+0
A grep on xorg/* revealed there's no consumer of this define. Quote Alan Coopersmith: "The consumer was in past versions of the headers now located in proto/x11proto - for instance, in X11R6.0's xc/include/Xproto.h, all the event definitions were only available if NEED_EVENTS were defined, and all the reply definitions required NEED_REPLIES. Looks like Xproto.h dropped them by X11R6.3, which didn't have the #ifdef's anymore, so these are truly ancient now." Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-12-08xfree86: init EQ before trying to initialise the devices (#18890)Peter Hutterer1-2/+2
The kbd driver may send events during device initialisation, and these events need the EQ set up already. X.Org Bug 18890 <http://bugs.freedesktop.org/show_bug.cgi?id=18890> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-12-03Rework symbol visibility for easier maintenancePaulo Cesar Pereira de Andrade1-14/+14
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-12-02Don't need to check uid/euid for every commandline argumentAlan Coopersmith1-5/+5
Check uid/euid only when handling the arguments that are restricted to root/non-setuid users
2008-12-02xfree86: don't FatalError on "too many input devices".Peter Hutterer1-1/+3
Just ignore devices after MAXDEVICES has been reached, but warn the user that the devices are ignored. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-29Export symbols defined in the sdk.Paulo Cesar Pereira de Andrade1-12/+12
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-25Code motion: subsume xf86DoProbe.c into xf86Init.cAdam Jackson1-0/+69
2008-11-24Bus: Remove ISA support.Adam Jackson1-2/+2
No, really. PCI is old enough to drive now. If you want this, get the kernel to expose a framebuffer device.
2008-11-24xfree86: Split the working code of NIDR into new xf86NewInputDevice.Peter Hutterer1-32/+2
The xfree86 server previously hat NewInputDeviceRequest and InitInput, and both basically did the same thing. Reduce NIDR to parameter checking and use xf86NewInputDevice from both InitInput and NIDR to actually create the device. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com>