summaryrefslogtreecommitdiff
path: root/hw/xfree86/loader
AgeCommit message (Collapse)AuthorFilesLines
2012-08-19Fix up formatting of initializers for arrays of structsAlan Coopersmith1-7/+6
The indenter seems to have gotten confused by initializing arrays of structs with the struct defined inline - for predefined structs it did a better job, so match that. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> (cherry picked from commit 9f7ef7f7f0566f6319d8328ce0a1e6d0fa866720)
2012-08-01Look for ModuleData only in appropriate libraryMichal Srb3-1/+8
LoaderSymbol calls dlsym with RTLD_DEFAULT pseudo handle making it search in every loaded library. In addition glibc adds NODELETE flag to the library containing the symbol. It's used in doLoadModule to locate <modulename>ModuleData symbol, the module's library gets the flag and is kept in memory even after it is unloaded. This patch adds LoaderSymbolFromModule function that looks for symbol only in library specified by handle. That way the NODELETE flag isn't added. This glibc behavior doesn't seem to be documented, but even if other implementations differ, there is no reason to search ModuleData symbol outside the module's library. Signed-off-by: Michal Srb <msrb@suse.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> v2: Switch LoaderSymbolFromModule arguments order. Correct description. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 258abbf823f753757e4dddc13ef495f4024680db)
2012-03-27Introduce a consistent coding styleKeith Packard6-711/+721
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com> (cherry picked from commit 9838b7032ea9792bec21af424c53c07078636d21)
2012-01-09UnloadSubModule(): accept pointer value '1' and ignore it.Matthieu Herrb1-0/+3
Some driver modules try to unload submodules that are now built-in. Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-12-05LoaderOpen returns either a valid pointer or NULL, so don't check for < 0Alan Coopersmith1-1/+1
Fixes Sun cc warning that was recently elevated to error by the stricter default CFLAGS changes to xorg-macros: "loadmod.c", line 914: improper pointer/integer combination: op "<" Should have been changed when commit ab7f057ce9df4e905b12 changed the LoaderOpen return type from int to void *. Changes log message when file is found but dlopen() fails from: (EE) LoadModule: Module dbe does not have a dbeModuleData data object. (EE) Failed to load module "dbe" (invalid module, 0) to: (EE) Failed to load module "dbe" (loader failed, 7) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-11-23FindModule: stop copying const char *dirname to char *dirpathAlan Coopersmith1-8/+3
Not needed since 6cf844ab69926b split out the allocation/manipulation into the helper function, leaving FindModule just copying the pointer around, and causing gcc warnings and an unreachable call to free. Also no longer need to store the combined strlen results in dirlen. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-18Do not uselessly reload modules in DuplicateModuleMichal Suchanek1-9/+9
The function does not initialize the module so it has no business loading it. If some user of DuplicateModule expects a module actually loaded they should use LoadModule. Signed-off-by: Michal Suchanek <hramrach@centrum.cz> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-18Use UnloadModuleOrDriver for UnloadSubModule.Michal Suchanek1-17/+6
Signed-off-by: Michal Suchanek <hramrach@centrum.cz> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-06-23xfree86: Move sdksyms generation to ddx toplevelDan Nicholson3-441/+1
The symbols in sdksyms.c cover the entire source tree. In order to make them resolve when libxorg.la goes away, move the objects from libloader to Xorg. Unfortunately, this means sdksyms needs to get built again for the test code. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Tested-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-04-07xfree86: loader: use one exit code only for readabilityTiago Vignatti1-20/+12
No functional changes. Spaghetti code for the win! \o/ Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
2011-04-04xfree86: loader: fix memory leaks in LoaderListDirsTiago Vignatti1-0/+6
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-03loader: Don't distribute sdksyms.c and make it depend on the configKeith Packard1-3/+6
sdksyms.c is constructed by processing header files with the C preprocessor. Its contents will vary depending on the precise configuration options, and so must depend on the config header files. We have one header file which is always changed when any config option is modified called do-not-use-config.h (which may want a different name at some point), so make sdksyms.c depend on that file. Also, we don't want to ship this file; it always needs to be built. So, include it in the nodist_libloader_la_SOURCES list to prevent it from being added to the tarball. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-03-03Merge remote branch 'rjy/clientids'Keith Packard1-0/+1
2011-02-25xfree86: Allow sdksyms.dep to be included portablyDan Nicholson1-1/+2
Non-GNU makes don't deal with the sinclude or -include variants that allow Makefile stubs to be created and then included during the build. Instead, create an empty file at the end of configure so that the regular include statement can be included. This is how automake handles automatic source dependencies. In order to trick automake into not processing the include statement, a variable is used. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Tested-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-12-31loader: warning fixAdam Jackson1-1/+1
loadmod.c: In function ‘FreeSubdirs’: loadmod.c:377: warning: passing argument 1 of ‘free’ discards qualifiers from pointer target type /usr/include/stdlib.h:488: note: expected ‘void *’ but argument is of type ‘const char *’ Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-12-23os: Add facilities for client ID tracking.Rami Ylimäki1-0/+1
An interface is provided for figuring out the PID and process name of a client. Make some existing functionality from SELinux and IA extensions available for general use. Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-12-20Remove SCO supportAdam Jackson2-22/+0
This has never been buildable in any modular server release. Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-12-18Bug 21827: faulty sdksyms.c generated by the awk script in sdksyms.shDavid Barksdale1-1/+5
https://bugs.freedesktop.org/show_bug.cgi?id=21827 Tested-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: David Barksdale <david.barksdale@adcedosolutions.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-12-07Replace alloc+strcpy+strcat with asprintf() & XNFasprintf() callsAlan Coopersmith1-4/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-12-07Convert alloc+sprintf pairs into asprintf() & XNFasprintf() callsAlan Coopersmith1-6/+6
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-12-07Add asprintf() implementation for platforms without itAlan Coopersmith1-0/+1
Provides a portable implementation of this common allocating sprintf() API found in many, but not yet all, of the platforms we support. If the platform provides vasprintf() we simply wrap it, otherwise we implement it - either way callers can use it regardless of platform. Since not all platforms guarantee to NULL out the return pointer on failure, we don't either, and require callers to check the return value for -1. The old Xprintf() API is deprecated, but left for compatibility for now. The new API is added in a new header so that it can be used in parts of the server such as hw/xfree86/parser that don't include all the server headers. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-12-06Merge remote branch 'jajones/for-keith'Keith Packard1-0/+4
2010-12-06Create/Destroy/Trigger/Reset/Query Fence Sync objsJames Jones1-0/+1
Initial server side implementation of fence sync objects. Allows creation, management, and state queries of binary state objects. Currently they are not very useful as there is no way to wait for them efficiently. The basic trigger operation added here triggers relative to a given X screen's rendering operations. To perform this operation, fence sync objects must be tied to a screen. As Aaron Plattner pointed out, screens are identified but a drawable in X protocol, so a drawable argument is included in XSyncCreateFence(). The screen also could have been specified as part of the trigger operation. However, it is also desireable to associate a screen with fence sync objects at creation time so that the associated screen's driver can allocate any HW- specific resources needed by the fence object up front. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-06Add fence sync driver interfaceJames Jones1-0/+3
-Add fence sync objects -Add fence sync devPrivates -Add a X sync module screen private -Add wrappable functions to create and destroy fence sync objects -Give fence sync objects wrappable functions to trigger, test, and reset their 'triggered' value. -Give fence sync objects wrappable functions to notify driver when adding/removing triggers to/ from the sync object. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-11-30FindModuleInSubdir: Stop allocating one more byte than neededAlan Coopersmith1-3/+3
15ac25627e7239629be59 removed the "/" from the sprintf strings, but failed to remove the extra byte allocated for the '/'. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-11-30xfree86: Remove the xf8_16bpp overlay moduleAdam Jackson1-6/+0
Only one (marginal) driver was using it, and it's been fixed to just implement it directly. v2: Also fix sdksyms.sh (spotted by Jesse Adkins) v3: Also fix DESIGN.xml (spotted bu Julien Cristau) Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-30dix: Remove the backing store leftoversAdam Jackson1-2/+0
Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-01render: Delete renderedge.[ch]Søren Sandmann Pedersen1-1/+0
The functions in these files have not been used since trap rasterization was moved to pixman. They survived until now to preserve the server abi. Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Søren Sandmann <ssp@redhat.com>
2010-10-04xfree86: Do not call dlclose(NULL) [regression after ab7f057]Chris Wilson1-1/+2
During unwind following an error when attempting to a load a module, we attempt to call dlclose on a potentially NULL handle. This is a side-effect of removing the abstraction layer in ab7f057. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Adam Jackson <ajax@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-09-22loader: Remove a silly layer of reference countingAdam Jackson4-217/+51
libdl will refcount objects for us just fine, thanks. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-09-22loader: include cleanupAdam Jackson1-8/+0
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-09-22loader: Remove the handle field from LoaderOpenAdam Jackson3-19/+17
This was always 0 from all the callers. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-09-22loader: Remove unused canonical name fieldAdam Jackson3-8/+4
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-09-22loader: Remove unused module serial numberAdam Jackson2-4/+0
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-09-22loader: Merge dlloader directly into the loaderAdam Jackson5-220/+72
This lets us drop some double-tracking of loaded modules too. If your OS is too lame to have libdl, fix that first. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-09-13Delete xaaWrapper.Jamey Sharp1-1/+0
This was part of "An experimental pseudocolor emulation layer. Not fully completed, currently only works for 16bpp." Only neomagic tried to use it, and that was neutered by the removal of the fbpseudocolor portion of that emulation layer; the rest is easily removed. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2010-09-10Merge remote branch 'mattst88/master'Keith Packard2-10/+2
2010-09-10Tag sdksyms.c entries with source file and line numberAaron Plattner1-1/+8
Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
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 prototypes for non-existant functions.Jesse Adkins1-6/+0
This was obsolete from 9a0f25de7ca3c68af867b38936103d17daa92ac6 "Static cleanups, dead code deletion." (server 1.3). Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
2010-06-22Revert "mi: Remove unused overlay support"Keith Packard1-0/+1
This reverts commit 9120e58556014e514eef9dfe43cdea4b74dc66ae. Whoops, please revert this patch -- overlay is in use in nvidia drivers, and it's too late in release cycle to remove it. I feel really sorry that I kept this patch in my tree. I will submit another one, removing only XAA overlay hooks which are not used at all.
2010-06-20mi: Remove unused overlay supportMikhail Gusarov1-1/+0
The only reference to it in server and drivers is in XAA overlay code which would segfault as no miInitOverlay is called ever. No segfaults were observed "in wild", so XAA overlay is probably also unused. XAA code is modified to act as if miOverlayCopyUnderlay always returned false, because XAACopyWindow8_32 could only set doUnderlay to true if it's called from miOverlayMoveWindow or miOverlayResizeWindow, which can only be called if miInitOverlay has hooked those functions, and no driver (on fd.o) or server code calls that. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-06-11xfree86: Get rid of xstrdup when argument is definitely non-NULLMikhail Gusarov1-3/+3
ditto for XFree86 Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-06-10Remove unnecessary parentheses around return values in functionsMikhail Gusarov2-7/+7
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-06Remove more superfluous if(p) checks around free(p)Mikhail Gusarov2-12/+6
This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ -if(E) { free(E); } +free(E); Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-13Replace X-allocation functions with their C89 counterpartsMikhail Gusarov2-38/+38
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-27Remove mibank supportAdam Jackson1-1/+0
Banked framebuffers are so 1990. As of 7.4 the only drivers remaining that used this were chips, neomagic, trident, and vesa. vesa only used it when not using shadowfb, which is broadly undesirable anyway, and no longer uses it at all as of 2.3.0. neomagic never used it by default, and support for it is gone in git master. The other two effectively only ever used it for ISA chips; since ISA support is now gone from the server, they have been modified to only compile mibank support when ISA support is available. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-11.gitignore: use common defaults with custom section #24239Gaetan Nadon1-0/+3
Using common defaults will reduce errors and maintenance. Only the very small or inexistent custom section need periodic maintenance when the structure of the component changes. Do not edit defaults. Reviewed-By: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-09loader: actually stat something that has some chance of existing. (v2)Dave Airlie1-2/+5
FindModuleInSubdir seems to expect a / at the end of the subdir its finding for, so we add the / early, the stat will fail if its not a subdir, I'm leaving the S_ISDIR in just in case there is another reason it could return 0. This does look a bit silly in strace but it seems to work fine. I have a very intermittent issue where drivers loses its / that I've been seeing on/off for a while, this may or may not fix it. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-29Supply all code using dl*() with DLOPEN_LIBSMikhail Gusarov1-0/+1
Previously DLOPEN_LIBS was managed in top-level configure.ac. Instead bundle it with the code using dl*() functions to avoid breakages in uncommon configurations. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>