summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-12-09xfree86: bump the input ABIPeter Hutterer1-1/+1
The last few patches broke the ABI, bump it for convenience. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-09input: swap the server over to use the XI2mask structPeter Hutterer7-59/+98
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-09Add a new XI2Mask struct and a few helper functions.Peter Hutterer6-1/+332
The current XI2 mask handling is handy for copying (fixed size arrays) but a pain to deal with otherwise. Add a struct for XI2 masks and the required accessors. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-09dix: switch the dev->deviceGrab.activeGrab from GrabRec to GrabPtrPeter Hutterer3-5/+8
This breaks the input ABI. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-09dix: allocate temporary grabs on the heapPeter Hutterer5-142/+184
Once grabs start having nested memory locations, we can't just use the GrabRec on the stack anymore, we need to alloc/copy/free the grabs. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-09dix: add CopyGrab() functionPeter Hutterer3-2/+37
Not really needed at this point, but will be once touch support is added. Since grabs are now expected to be allocated/freed with AllocGrab and FreeGrab, CopyGrab must increase the refcount and duplicate the modifier masks. Until the callers are switched to use FreeGrab, this introduces memleaks. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-09dix: add AllocGrab helper functionPeter Hutterer2-2/+13
Not needed since the GrabRec is a self-contained struct but will be needed for the xi2 input mask rework. FreeGrab already exists, make it available to other callers. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-09dix: switch the syncEvent queue to a struct listPeter Hutterer4-28/+92
No effective functionality change, just cleanup to make this code slightly more sane. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-07test: update .gitignore with xfree86 and sort alphabeticallyGaetan Nadon1-3/+4
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-12-07Merge remote-tracking branch 'airlied/reviewed-fixes'Keith Packard7-20/+17
2011-12-07Merge remote-tracking branch 'alanc/master'Keith Packard23-170/+142
2011-12-07hw/xfree86: fix segfault in config parser when config dir is missingKeith Packard1-0/+4
Treat a scandir error from a missing (or unusable) directory return as if it simply returned no files at all, which is what we want. cc: Paulo Zanoni <przanoni@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-12-06kdrive: drop screen crossing code.Dave Airlie1-6/+0
The only kdrive server we probably care about anymore is Xephyr, and this screen enable/disable code totally breaks it in multi-screen mode. When you are in one screen the other stops updating. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=757457 Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-06hal: free tmp_val in one missing caseDave Airlie1-0/+1
Pointed out by coverity scan. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-12-06xv: test correct number of requests. (v2)Dave Airlie1-2/+2
Pointed out by coverity. v2: fix swapped as well, as pointed out by Alan Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-12-06xaa: avoid possible freed pointer reuse in epilogueDave Airlie1-0/+1
If the pGCPriv->flags == 2, then we try to assign the freed pGCPriv->XAAOps avoid this by clearing the flags in to be destroyed pGCPriv. Reported by coverity. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-06Xi: avoid overrun of callback array.Dave Airlie1-2/+2
This code had an off-by-one and would allow writing one past the end of the callbacks array. Pointed out by coverity. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-06xext: don't free uninitialised pointer when malloc fails. (v2)Dave Airlie1-2/+1
Initialise the pAttr->values to values so if the values allocation fails it just ends up as free(NULL). Pointed out by coverity. v2: use Alan's suggestion. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-06fbdevhw: iterate over all modes that match a mode. (v3)Adam Jackson1-8/+10
So on RHEL5 anaconda sets an xorg.conf with a fixed 800x600 mode in it, we run radeonfb and fbdev since ati won't work in userspace due to domain issues in the older codebase. On certain pseries blades the built-in KVM can't accept an 800x600-43 mode, it requires the 800x600-60 mode, so we have to have the kernel radeonfb driver reject the 800x600-43 mode when it sees it. However then fbdev doesn't try any of the other 800x600 modes in the modelist, and we end up getting a default 640x480 mode we don't want. This patch changes the mode validation loop to continue on with the other modes that match to find one that works. v2: move code around to avoid extra loop, after comment from Jamey. v3: move loop setup back into loop as per Jeremy's review. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-06include: rename "foos" to "list_of_foos" in the struct list documentationPeter Hutterer1-15/+15
Makes things a little easier to read. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-06include: update struct list documentation to use one set of structs onlyPeter Hutterer1-17/+11
The example at the top of the file used a struct bar and a list of struct foos. Use those two throughout instead of a different struct foo for the examples and for the API documentation. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-06include: a new list element does not need initialization, state soPeter Hutterer1-1/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-06include: point to the tests in list.c as examplesPeter Hutterer1-0/+1
Even with the documentation, the list.c tests are the best examples. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-06include: add list_last_entry to get the tail of a listPeter Hutterer2-0/+21
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-06include: add list_append()Peter Hutterer2-0/+53
The existing list_add() prepends to the list, but in some cases we need the list ordered in the way we append the elements. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-05autoconf: the minimum required level for autoconf is 2.60Gaetan Nadon1-1/+1
The toolchain requirements are documented here: http://www.x.org/wiki/ModularDevelopersGuide#Required_Tools Note that autoconf features only found in versions later than 2.60 must not be used. Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-12-05autoconf: remove redundant AC_PROG_MAKE_SETGaetan Nadon1-1/+0
Already included during Automake initialization. After the patch, no change: configure:3893: checking whether make sets $(MAKE) configure:3915: result: yes Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-12-05Fix builds of Xnest & Xephyr with Solaris Studio compilersAlan Coopersmith2-0/+10
Required in order to build with Studio cc now that xorg-macros is setting -errwarn=E_FUNC_HAS_NO_RETURN_STMT since a bug in the Solaris system headers causes the noreturn attribute to not be correctly applied to the exit() prototype in <stdlib.h> when building with Studio instead of gcc. Otherwise compiler exits with errors: "Display.c", line 65: Function has no return statement : x_io_error_handler "hostx.c", line 341: Function has no return statement : x_io_error_handler Uses Studio-specific pragma instead of adding another exit() prototype with a noreturn attribute to avoid causing gcc to warn about having a redundant prototype for the exit() function. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
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-12-05Fix gcc warnings about redundant declarations of fallback functionsAlan Coopersmith3-0/+26
Ensure ffs, strndup, strlcat, etc. aren't defined by our headers if they're already defined in the system headers. This does export the HAVE_FFS, HAVE_STRNDUP, etc. definitions to drivers, but if you built the Xserver with a libc that had those, and then build the drivers with a less capable libc, you're going to have problems anyway, and this should solve some reported problems with conflicts between our strndup definition and gcc magic for it. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-12-05Move to autoconf standard function name checks & definesAlan Coopersmith15-128/+85
Replace multiple methods of checking for functions with AC_CHECK_FUNCS Replace multiple methods of selecting fallback funcs with AC_REPLACE_FUNCS Replace HAS_* and NEED_* #defines with autogenerated HAVE_* Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-12-03Remove unused function checks from configure.ac & include/*.h.inAlan Coopersmith3-38/+2
The code that used getisax to check for MMX support was moved to pixman and removed from the X server by commit eb2d7fe02f9cbc. The code that used HAVE_MKSTEMP was deleted by the Xprint removal in commit 1c8bd318fbaf. All alloca calls were removed by the patch series end in commit 5e363500c8, and used custom X checks instead of the autoconf HAVE_ALLOCA anyway. I can find no record of HAVE_GETUID, HAVE_GETEUID, HAVE_LINK, HAVE_MEMMOVE, HAVE_MEMSET, HAVE_STRCHR, HAVE_STRRCHR, HAVE_GETOPT, HAVE_GETOPT_LONG, HAVE_DOPRNT, or HAVE_VPRINTF ever being used, and the calls to those functions are not wrapped in #ifdefs. (Most of those are in our baseline requirements of C89 & Unix98 anyway.) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-12-02Disable building of tests requiring DDX functions when Xorg is not builtAlan Coopersmith1-7/+21
Some test cases require linking with some sort of DDX - ideally we'd have a stub ddx for testing, but for now, since we link with the Xorg ddx, disable those tests when configured with --disable-xorg Fixes https://bugs.freedesktop.org/show_bug.cgi?id=43320 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-02config: conftest needs an include directive to locate X11/Xfuncproto.hGaetan Nadon1-1/+2
The compiler option -fvisibility=hidden is erroneously missing due to a faulty configuration test. The gcc command is unable to locate X11/Xfuncproto.h unless the build occurs on a system where X11 development headers are installed. configure:21294: checking for symbol visibility support configure:21323: gcc -std=gnu99 -c -g -O2 -fvisibility=hidden conftest.c >&5 conftest.c:144:28: fatal error: X11/Xfuncproto.h: No such file or directory The solution is to add an include directive to obtain the location of X11/Xfuncproto.h which may or may not be the system installed headers. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-12-02Limit the number of screens Xvfb will attempt to allocate memory forAlan Coopersmith1-1/+3
Commit f9e3a2955d2ca7 removing the MAXSCREEN limit left the screen number too unlimited, and allowed any positive int for a screen number: Xvfb :1 -screen 2147483647 1024x1024x8 Fatal server error: Not enough memory for screen 2147483647 Found by Parfait 0.3.7: Error: Integer overflow (CWE 190) Integer parameter of memory allocation function realloc() may overflow due to multiplication with constant value 1112 at line 293 of hw/vfb/InitOutput.c in function 'ddxProcessArgument'. Since the X11 connection setup only has a CARD8 for number of SCREENS, limit to 255 screens, which is also low enough to avoid overflow on the sizeof(*vfbScreens) * (screenNum + 1) calculation for realloc. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-12-01Save major/minor opcodes in ClientRec for RecordAReplyKeith Packard7-36/+20
The record extension needs the major and minor opcodes in the reply hook, but the request buffer may have been freed by the time the hook is invoked. Saving the request major and minor codes as the request is executed avoids fetching from the defunct request buffer. This patch also eliminates the public MinorOpcodeOfRequest function, inlining it into Dispatch. Usages of that function have been replaced with direct access to the new ClientRec field. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-12-01Merge remote-tracking branch 'jcristau/for-keith'Keith Packard1-1/+1
2011-12-01Merge remote-tracking branch 'whot/for-keith'Keith Packard7-40/+70
2011-12-01Remove another if (E != NULL) check around free(E)Matt Turner1-2/+0
I wonder if there are any other patterns we haven't seen yet? Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-11-29test: remove unneeded printf statements from misc.cPeter Hutterer1-3/+0
Leftover from debugging, is not really needeed in a test. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-11-29include: add BUG_WARN macro for internal bug cases.Peter Hutterer1-0/+7
There are plenty of cases that can only be triggered by a real bug in the server and doing the ErrorF dance manually everywhere is a tad painful and the error message is usually used only to find the spot in the file anyway. Plus, reading BUG_WARN somewhere is a good indicator to the casual reader that this isn't intended behaviour. Note that this is intentionally different to the BUG_ON behaviour on the kernel, we do not FatalError the server. It's just a warning + stacktrace. If the bug is really fatal, call FatalError. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-11-29Xi: add FreeInputMask functionPeter Hutterer1-2/+10
Does what it says on the box, complements MakeInputMask. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-11-29Xi: add helper functions to alloc/free InputClientPtrsPeter Hutterer1-5/+18
Currently not needed since the InputClientRec is a self-contained struct. As part of the touch rework that won't be the case in the future and a function to allocate/free memory appropriately is required. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-11-29dix: use a single return statement in CheckPassiveGrabsOnWindowPeter Hutterer1-6/+6
No functional change. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-11-29dix: rename GetWindowXI2Mask to WindowXI2MaskIssetPeter Hutterer2-7/+8
And let it return a boolean value, that's all the callers need anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-11-29Xi: use single return code from XIPassiveGrabDevicePeter Hutterer1-16/+20
Some failures returned status but the actual return code was "ret". Use "ret" consistently and move status to the local block is used in. [the goto isn't necessary yet, but for a future patch] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-11-29include: fix mask size calculationPeter Hutterer1-1/+1
Same bug as inputproto-2.0.1-9-gb1149ab, if the XI2LASTEVENT was a multiple of 8, the mask was one bit too short. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-11-24dmx: Build fix for -Werror=implicit-function-declaration on linuxJeremy Huddleston1-0/+1
Fixes regression introduced by: 6e6d732bac3c21cb85f8e998908f9b393630e5f8 Found-by: Tinderbox Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> CC: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-11-24parser: free val.str after xstrtokenizePaulo Zanoni1-0/+9
After we tokenize val.str, we discard it. This is just one example: 6 bytes in 1 blocks are definitely lost in loss record 24 of 652 at 0x4C2779D: malloc (in vgpreload_memcheck-amd64-linux.so) by 0x4D744D: xf86getToken (scan.c:400) by 0x4D75F1: xf86getSubToken (scan.c:462) by 0x4DB060: xf86parseInputClassSection (InputClass.c:145) by 0x4D664C: xf86readConfigFile (read.c:184) by 0x490556: xf86HandleConfigFile (xf86Config.c:2360) by 0x49AA77: InitOutput (xf86Init.c:365) by 0x425A7A: main (main.c:204) Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-11-24parser: free val.str after xf86getBoolValuePaulo Zanoni1-0/+6
After we convert the value to a boolean, we discard the string. This is just one example: 3 bytes in 1 blocks are definitely lost in loss record 5 of 657 at 0x4C2779D: malloc (vgpreload_memcheck-amd64-linux.so) by 0x4D744D: xf86getToken (scan.c:400) by 0x4D75F1: xf86getSubToken (scan.c:462) by 0x4DB3E0: xf86parseInputClassSection (InputClass.c:189) by 0x4D664C: xf86readConfigFile (read.c:184) by 0x490556: xf86HandleConfigFile (xf86Config.c:2360) by 0x49AA77: InitOutput (xf86Init.c:365) by 0x425A7A: main (main.c:204) Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>