Commit Graph

5929 Commits

Author SHA1 Message Date
Jon TURNEY
3d3114d55a hw/xwin: Handle the virtual key code generated by the Fn key on IBM Lenovo laptops
Apparently, IBM Leonovo laptops can generate a key-press event for the Fn
key, with virtual key code 0xFF and scan code extended 0x63

Handle this specially, rather than just passing on key code 0x63 (delete),
so you don't delete what you just typed when you adjust the screen brightness,
etc. :-)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26 14:40:26 +00:00
Jon TURNEY
74af860f9a hw/xwin: turn on -emulate3buttons if less than 3 mouse buttons are reported
Try to be more intelligent with default options, turn on -emulate3buttons by
default if less than 3 mouse buttons are reported by Windows

Also, add -noemulate3buttons option so this default setting can be reversed
if desired

Also, correctly report the number of mouse buttons windows is reporting, rather
than always at least 3

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26 14:40:25 +00:00
Jon TURNEY
c0f3709501 hw/xwin: In multiwindow mode, don't grab native input focus for new windows which hint they don't want it
In multiwindow mode, avoid grabbing the input focus for newly
created windows which have InputHint FALSE

(this is used by e.g. glean to avoid every test window grabbing
the focus)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26 14:40:23 +00:00
Jon TURNEY
25caa8565d hw/xwin: Remove some redundant OS version reporting
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26 14:40:20 +00:00
Roland Cassard
a9aca218f5 hw/xwin: Don't assume we'll always have converted the clipboard selection after 2 attempts
Rather than knowing we have to call winProcessXEventsTimeout() for up to 2 WIN_XEVENTS_CONVERT messages, process
all messages in winProcessXEventsTimeout() until either: (i) the time out expired, (ii) an error occurred, or
(iii) received a WIN_XEVENTS_NOTIFY messaage indicating the data has been to put on the clipboard.

Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26 14:38:52 +00:00
Michel Hummel
75fe336b6c hw/xwin: Mitigate a race condition in clipboard thread initialization
Remove the variables g_fClipboardLaunched and g_fClipboardStarted from
winInitializeGlobals(), as their re-initialization is handled in the
file hw/xwin/InitOutput.c.

Re-initializing g_fClipboardLaunched and g_fClipboardStarted during
the server reset procedure can lead to the clipboard thread being
launched two times and sometimes leads to a crash of the X server...

Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26 14:10:48 +00:00
Jon TURNEY
95b1391fe3 hw/xwin: Chain IOError handlers to avoid longjmp across threads
Avoid crashes on shutdown due to the undefined behaviour of calling longjmp() on the
result of setjmp() from a different thread, by chaining IOError handlers and only
jumping back up to the frame for this thread

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26 14:10:24 +00:00
Yaakov Selkowitz
0659437f5e hw/xwin: Improve XWinrc loading and error recovery
If $HOME/.XWinrc is present but badly formed, ignore it and try
system.XWinrc instead.  If neither file is present or both are badly
formed, provide a built-in default which gives the user the chance to
load their new or fixed configuration without restarting.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26 14:10:12 +00:00
Michel Hummel
47c7b6d3e6 hw/xwin: Remove no-longer needed tricks used to prevent the clipboard client from being killed
Remove no-longer needed tricks used to hide the clipboard client from XDM to prevent
it from being killed

- Delete XQuery wrapper used to hide clipboard client
- Delete XDMCP mode heuristic which waits until some magic number of connections have
been established before starting the clipboard

We still need the EstablishConnection wrapper to ensure that the clipboard client isn't
the first client (causing a server restart if it disconnects)

Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26 14:09:35 +00:00
Michel Hummel
c1bf3baa44 hw/xwin: Automatically restart clipboard thread
Automatically restart clipboard thread on unexpected exit

Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26 14:09:02 +00:00
Jon TURNEY
ae981341a9 hw/xwin: Give the X window for the clipboard integration client a name
This makes it a bit easier to find when staring at the output of
'xwininfo -tree -root'

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26 13:42:06 +00:00
Adam Jackson
02775efb89 int10: Fix unmapping of the BIOS scratch area
342f3eac84 introduced a bug, 'base' is
incremented before use.  The old code corrected this when unmapping, so
the new code should too.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-01-25 09:26:23 -08:00
Jeremy Huddleston
ba0f5cc196 xfree86: Don't link libxorgxkb against libdix.la
libdix.a is already provided by XSERVER_LIBS.  Including it in libxorgxkb
results can result in duplicate symbols landing in the Xorg binary on some
configurations (buggy glibtool on darwin).

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-01-15 02:28:27 -08:00
Jeremy Huddleston
2387fb2385 sdksyms.sh: Exit on error rather than building an empty symbol table
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2012-01-15 02:28:07 -08:00
Peter Hutterer
a6273cc85c xfree86: mention udev in the xorg.conf manpage AutoAddDevices section
And point out what "hotplugging" means.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2012-01-13 09:04:44 +10:00
Keith Packard
d9eeede52f Revert "dix: Pull client-is-local flag up to the ClientRec"
This reverts commit 49d38b75c8.

ABI change pended for 1.13
2012-01-12 12:09:59 -08:00
Keith Packard
e722ad6c3e Merge remote-tracking branch 'jturney/rpavlik-xwin-fixes' 2012-01-09 13:22:28 -08:00
Adam Jackson
a55214d119 Always install xaa sdk headers
Always install XAA SDK headers so drivers still build even with
--disable-xaa

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-01-09 13:09:49 -08:00
Matthieu Herrb
dafc327f3c UnloadSubModule(): accept pointer value '1' and ignore it.
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>
2012-01-09 13:09:49 -08:00
Adam Jackson
8db029064b vgahw: Fix DACDelay() macro to use the driver's vtable
We don't want to unconditionally use I/O routines here, since if the
driver is using mmap'd VGA ports then the I/O handle won't be set up.

Tested-by: Jeff Chua <jeff.chua.linux@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-01-09 13:09:49 -08:00
Arthur Taylor
ff891bbf68 linux: Use K_OFF VT KB mode over K_RAW if available.
Linux kernels since 2.6.38 (March 2011) have an VT KB mode K_OFF in
which special keys (like Ctrl+C) are not interpreted and input is not
buffered. Use of this mode over K_RAW removes the need for a
xf86ConsoleHandler to drain the VT input buffer, removing the grief it
causes when it goes wrong or is (de)initialized out-of-order. (This
also saves a few needless context switches per key event.)

If K_OFF is not defined or not understood by the kernel, K_RAW and the
previous method is used as a fall-back.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Arthur Taylor <art@ified.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-01-09 13:09:48 -08:00
Keith Packard
0b113f7cdf Merge commit '777bf90abeac37087a3d0538b847742523d5acf2' 2012-01-09 13:07:25 -08:00
Keith Packard
0b2c6491c5 Merge remote-tracking branch 'whot/for-keith' 2012-01-09 11:40:23 -08:00
Keith Packard
1f5587e144 Merge remote-tracking branch 'kibi/master' 2012-01-09 11:37:59 -08:00
Jeremy Huddleston
a97252db24 XQuartz: GL: Buildfix for recent GLX changes
dispatch.h was leftover from an earlier implementation and is no longer
needed, so remove it since including it causes a build failure due to
conflicts between GL/gl.h and OpenGL/gl.h

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-08 23:23:14 -08:00
Ryan Pavlik
4e44580efd hw/xwin: Include manifest file in the dist tarball
Commit c02638fd added the manifest file, but didn't add it to EXTRA_DIST.

Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07 22:50:48 +00:00
Ryan Pavlik
c763fe51b8 hw/xwin: Fix duplicate definition of HAS_WINSOCK when building for MinGW
hw/xwin: Fix duplicate definition of HAS_WINSOCK when building for MinGW
but still provide it if building for Win32 without autotools

xserver/hw/xwin/winclipboard.h:42:0: warning: "HAS_WINSOCK" redefined
../../include/xwin-config.h:11:0: note: this is the location of the previous definition

Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07 22:50:17 +00:00
Ryan Pavlik
3d80f202b0 hw/xwin: Fix possible null ptr deref in winMWExtWMDecorateWindow()
Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07 22:50:13 +00:00
Ryan Pavlik
c824004b45 hw/xwin: Fix possible null ptr deref in winMWExtWMRestackFrame()
Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07 22:50:11 +00:00
Ryan Pavlik
3c501691a0 hw/xwin: Fix possible null ptr deref in winActivateAppPrimaryDD()
Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07 22:50:09 +00:00
Ryan Pavlik
a492c02649 hw/xwin: Fix possible null ptr deref in winActivateAppNativeGDI()
Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07 22:50:08 +00:00
Ryan Pavlik
b907079596 hw/xwin: Clarify an if statement mixed with ifdef in winSetEngine()
Use the same pattern as elsewhere so it's a bit clearer what we
are checking

Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07 22:50:06 +00:00
Ryan Pavlik
5c35dd7be7 hw/xwin: Fix rrScreenSetSize function pointer mismatch
winrandr.c: In function ‘winRandRInit’:
winrandr.c:218:31: warning: assignment from incompatible pointer type

Fix winRandRScreenSetSize() function signature to match RRScreenSetSizeProcPtr type,
to align with commit fd9331f6 'Revert "Separate out screen size and screen pixmap
sizes in RRScreenSizeSet"'

This is fall-out from the late revert of RANDR 1.4 in the 1.10 release cycle, it will
probably need to be reverted if/when that goes back in again.

Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07 22:50:04 +00:00
Ryan Pavlik
aa07d82908 hw/xwin: Remove an empty #if 0/#endif
Um... yeah

Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07 22:50:02 +00:00
Ryan Pavlik
d459f42e64 hw/xwin: Fix double-free in error path in winQueryRGBBitsAndMasks()
Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07 22:50:01 +00:00
Ryan Pavlik
cc7dedd6b5 hw/xwin: Fix a memory leak in error path in winInitWM()
Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07 22:49:51 +00:00
Adam Jackson
777bf90abe xfree86: Remove the pretense of EDID v2 support
We don't do anything with EDID v2 blocks besides publish them on the
root window.  Worse, the check deleted by this patch would attempt to
take a checksum of arbitrary memory if the rawData array isn't 256+
bytes long (and, for the monitors mentioned, it probably is only 128).

Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-01-06 14:46:03 -05:00
Adam Jackson
49d38b75c8 dix: Pull client-is-local flag up to the ClientRec
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-01-06 13:29:53 -05:00
Peter Hutterer
75953ccb9e xfree86: split warning about missing identifier or input driver
Check for identifier first and bail if it's missing (also remove the current
identifier check after we've already bailed due to missing identifiers)

If a driver is missing, warn but also say that we may have added this device
already. I see too many bugreports with incorrectly shortened log files.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
2012-01-05 11:10:33 +10:00
Cyril Brulebois
644efb43e0 linux/ia64: Fix regression after domain I/O support code removal.
Side effect of aa0bfb0f133481c57762012e8e30c05ffa151423:
|   CCLD   Xorg
| sdksyms.o:(.data.rel+0x27d8): undefined reference to `outl'
| collect2: ld returned 1 exit status

Since the linux/ia64 domain I/O support code got removed in that
commit, there's no reason to keep on declaring those functions
(inb, inl, inw, outb, outl, outw).

Bugzilla: https://bugs.freedesktop.org/43985

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Cyril Brulebois <kibi@debian.org>
2011-12-31 02:34:55 +01:00
Keith Packard
8dedf9831b Merge remote-tracking branch 'kibi/master' 2011-12-27 13:13:48 -08:00
Cyril Brulebois
cf96183122 xorg.conf.man: Fix bad whatis entry.
Debian's QA tool “lintian” reported a bad whatis entry for the
xorg.conf(.d) manpages.

It comes with the following pointers:
  For manual pages that document multiple programs, functions, files, or
  other things, the part before "\-" should list each separated by a
  comma and a space. […]

  Refer to the lexgrog(1) manual page, the groff_man(7) manual page, and
  the groff_mdoc(7) manual page for details.

Indeed, the current situation is:
  $ whatis xorg.conf; whatis xorg.conf.d
  xorg.conf (5)        - (unknown subject)
  xorg.conf.d (5)      - (unknown subject)

With this patch:
  xorg.conf (5)        - configuration files for Xorg X server
  xorg.conf.d (5)      - configuration files for Xorg X server

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Cyril Brulebois <kibi@debian.org>
2011-12-22 16:00:31 +01:00
Peter Hutterer
e395efc25f Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into multitouch
Conflicts:
	configure.ac
	dix/inpututils.c

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-22 09:29:59 +10:00
Keith Packard
2d34b34ed7 Merge remote-tracking branch 'jeremyhu/master' 2011-12-20 00:23:33 -08:00
Ville Syrjälä
4df65d247b dri2: Invalidate window pixmaps
While a redirected window is flipped, its pixmap may still be used as
and EGL image and should also get invalidated. When sending invalidate
events for a window, also send the events for its pixmap.

Signed-off-by: Ville Syrjälä <syrjala@sci.fi>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-12-19 22:32:33 -08:00
Keith Packard
e8fd23fad0 dri2: Invalidate DRI2 buffers for all windows with the same pixmap on swap
Without this, when a compositing manager unredirects a fullscreen window which
uses DRI2 and page flipping, the DRI2 buffer information for the compositing
manager's output window (typically the Composite Overlay Window or root window)
may become stale, resulting in all kinds of hilarity.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=35452 .

[Original patch by Michel Dänzer <michel@daenzer.net>]
[Tree walk optimized version by Keith Packard <keithp@keithp.com>]

Signed-off-by: Ville Syrjälä <syrjala@sci.fi>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-12-19 22:31:14 -08:00
Michel Dänzer
6f916ffec7 dri2: Always re-generate front buffer information when asked for it.
Otherwise we might keep stale cached information, e.g. after the driver
performed page flipping.

This is part of the fix for
https://bugs.freedesktop.org/show_bug.cgi?id=35452 .

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-12-19 22:31:01 -08:00
Rami Ylimäki
603fcb3abf dri2: Initialize needInvalidate member of DRI2Drawable.
If the client is not behaving correctly and swaps buffers before
getting them, Valgrind will complain about uninitialized memory being
used in DRI2InvalidateDrawable.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Reviewed-by: Ville Syrjälä <syrjala@sci.fi>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-12-19 22:30:11 -08:00
Peter Hutterer
3aca819940 dmx: force -fno-strict-aliasing for xinput example
Compiler warning:
xinput.c:272: warning: dereferencing pointer 'e' does break strict-aliasing
rules

The code itself is the usual XInput client-side code:
        XEvent event;
        XDeviceMotionEvent *e = (XDeviceMotionEvent *)&event;
        XNextEvent(display, &event);
        printf("%d\n", e->type);

Since XDeviceMotionEvent is not guaranteed the same size as XEvent, clients
must use pointer aliasing as above when using the XNextEvent API. Disable
strict aliasing for this example.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-12-19 22:27:17 -08:00
Jeremy Huddleston
1deede3c48 kdrive/linux: Fix compilation with -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast
Reported-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-12-19 21:44:19 -08:00
Jeremy Huddleston
511beddffa XQuartz: Provide in-tree implementation of strndup(3) if needed
This function was added to Mac OS X 10.7, so we need to provide it
for earlier releases.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-19 21:43:29 -08:00
Peter Hutterer
1a133eb8b1 xfree86: bump the input ABI for the touch changes
New additions to the API:
- InitTouchClassDeviceStruct
- xf86PostTouchEvent

Changes to the ABI:
- DeviceIntRec now contains a TouchClassPtr

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-19 09:08:36 +10:00
Daniel Stone
098b837440 Add the touch input API stubs
xf86PostTouchEvent is the driver API to submit touch events to the server.
This API doesn't do anything yet though but now we can at least bump the
API.

For valuators, drivers should use the existing xf86InitValuatorAxisStruct
function.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-19 09:08:36 +10:00
Antoine Martin
ead968a430 xserver: check for elevated privileges not uid=0
This allows us to run the server as a normal user whilst still
being able to use the -modulepath, -logfile and -config switches
We define a xf86PrivsElevated which will do the checks and cache
the result in case it is called more than once.
Also renamed the paths #defines to match their new meaning.
Original discussion which led to this patch can be found here:
http://lists.freedesktop.org/archives/xorg-devel/2011-September/025853.html

Signed-off-by: Antoine Martin <antoine@nagafix.co.uk>
Tested-by: Michal Suchanek <hramrach at centrum.cz>
Reviewed-by: Jamey Sharp <jamey at minilop.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-12-16 15:38:13 -08:00
Gaetan Nadon
2c1d0a539c dmx: fix distcheck failure, missing compsize.h in Makefile.am
which was added in commit:
dmx: Build fix for -Werror=implicit-function-declaration

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-12-15 14:17:16 -08:00
Keith Packard
7da7aa96a0 Merge remote-tracking branch 'whot/for-keith' 2011-12-14 11:40:10 -08:00
Alan Coopersmith
b79de3f42f xf86 parser: convert Error to a varargs macro to clear gcc format warnings
Previously it always passed a format string with exactly one argument,
using NULL when the format string needed none.   Now pass the right number
of arguments to clear gcc warnings of 'too many arguments for format'.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12 17:03:13 -08:00
Alan Coopersmith
7801b3dcd6 Add some printf format attributes suggested by gcc
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12 17:03:12 -08:00
Alan Coopersmith
f68df9dfd2 xf86Priv.h: Add some noreturn attributes suggested by gcc
Both functions call exit() at the end and have no other return path.
Also correct comment/heading to reflect commit 6450f6ca7e moving
DoShowOptions into xf86Configure.c.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12 17:03:12 -08:00
Alan Coopersmith
3823eedf3c Remove duplicate declarations of KdAdd*Driver in kdrive.h
Clears gcc warnings in every file that includes kdrive.h:
kdrive.h:507:1: warning: redundant redeclaration of 'KdAddPointerDriver'
kdrive.h:225:6: note: previous declaration of 'KdAddPointerDriver' was here
kdrive.h:510:1: warning: redundant redeclaration of 'KdAddKeyboardDriver'
kdrive.h:284:6: note: previous declaration of 'KdAddKeyboardDriver' was here

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12 17:03:12 -08:00
Alan Coopersmith
471e5373b6 Remove duplicate declaration of xf86ValidateModesFlags in xf86Modes.h
Clears gcc warning in every file that includes xf86Modes.h:
xf86Modes.h:102:1: warning: redundant redeclaration of 'xf86ValidateModesFlags'
xf86Modes.h:72:1: note: previous declaration of 'xf86ValidateModesFlags' was here

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12 17:03:12 -08:00
Alan Coopersmith
9edfa47bd5 KdParseFindNext: Constify delim argument
It's only used as input to strchr to find the delimiters, never
written to.

Clears a bunch of gcc warnings of the form:
kdrive.c:323:2: warning: passing argument 2 of 'KdParseFindNext' discards qualifiers from pointer target type
kdrive.c:261:1: note: expected 'char *' but argument is of type 'const char *'

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12 17:03:11 -08:00
Alan Coopersmith
ff64ad6c74 Convert KdDoSwitchCmd to use asprintf instead of malloc/strcat/etc.
Also fix the reason argument to be const char * to clear several gcc
warnings of:
kdrive.c:151:2: warning: passing argument 1 of 'KdDoSwitchCmd' discards qualifiers from pointer target type
kdrive.c:116:1: note: expected 'char *' but argument is of type 'const char *'

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12 17:03:11 -08:00
Alan Coopersmith
5bc590bde2 DoShowOptions: preserve constness of options list as we walk it
Since all we do with the option list is walk down the list printing
the names, there's no need to cast away its constness.

Clears gcc warning:
xf86Configure.c: In function 'DoShowOptions':
xf86Configure.c:781:4: warning: cast discards qualifiers from pointer target type

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12 17:03:11 -08:00
Alan Coopersmith
71efd86828 x86emu: constify debug strings
Strings are all pointers to literal constants, just used as input
to printf calls when debugging is enabled.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12 17:03:11 -08:00
Alan Coopersmith
b2bc38e4a5 Even more correctly free config file names
If we didn't go into the if (!autoconfig) { } block, the filename,
dirname, and sysdirname pointers were never initialized, but we
freed them outside the block, leading to potential memory corruption.

Move the frees inside the block where they're initialized to avoid this.

To avoid similar problems, move the declarations of the variables that
are only used in this block inside the block.

Regression introduced by commit 3d635fe84d

Found by gcc warning:
xf86Config.c: In function 'xf86HandleConfigFile':
xf86Config.c:2303:11: warning: 'filename' may be used uninitialized in this function
xf86Config.c:2303:22: warning: 'dirname' may be used uninitialized in this function
xf86Config.c:2303:32: warning: 'sysdirname' may be used uninitialized in this function

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2011-12-12 16:50:25 -08:00
Alan Coopersmith
33d6e6743d xf86RegisterRootWindowProperty is confused about xnfcalloc
It will never return NULL, so don't try to handle a NULL condition,
since that just confuses programmers and static analyzers.

It uses calloc, so all the allocated memory is cleared, so there's
no point looping over the memory to manually initialize it NULL.

And just because it's annoying, it doesn't need to be the only
place in this file to do if (NULL==...) instead of if (... == NULL).

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2011-12-10 11:51:03 -08:00
Peter Hutterer
e5aa00989c Change GetXI2/XI/CoreType to just take a type argument
Avoids the dummy-event dance if we have an event type and need to get the
matching XI2 type.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-10 17:54:34 +10:00
Keith Packard
522f8bcc03 Merge remote-tracking branch 'whot/for-keith' 2011-12-08 20:57:26 -08:00
Peter Hutterer
4fc797f375 xfree86: include xorg-config.h from xaalocal.h
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-12-09 14:56:24 +10:00
Peter Hutterer
9b570ecbda xfree86: bump the input ABI
The last few patches broke the ABI, bump it for convenience.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-09 14:56:23 +10:00
Keith Packard
3ab8ee3247 Merge remote-tracking branch 'airlied/reviewed-fixes' 2011-12-07 12:42:17 -08:00
Keith Packard
22a666f995 Merge remote-tracking branch 'alanc/master' 2011-12-07 12:27:23 -08:00
Keith Packard
3824f558cc hw/xfree86: fix segfault in config parser when config dir is missing
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-07 12:13:37 -08:00
Dave Airlie
98c4a888a4 kdrive: drop screen crossing code.
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-06 16:04:56 +00:00
Dave Airlie
1049139499 xaa: avoid possible freed pointer reuse in epilogue
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-06 16:00:35 +00:00
Adam Jackson
22605effd1 fbdevhw: iterate over all modes that match a mode. (v3)
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-06 16:00:35 +00:00
Alan Coopersmith
c19c55a93a Fix builds of Xnest & Xephyr with Solaris Studio compilers
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-05 14:33:00 -08:00
Alan Coopersmith
e4dcf580f0 LoaderOpen returns either a valid pointer or NULL, so don't check for < 0
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 ab7f057ce9 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-05 14:33:00 -08:00
Alan Coopersmith
8b6a750097 Fix gcc warnings about redundant declarations of fallback functions
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-05 14:32:59 -08:00
Alan Coopersmith
d829a7c5cb Move to autoconf standard function name checks & defines
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-05 14:32:45 -08:00
Alan Coopersmith
feebf67463 Limit the number of screens Xvfb will attempt to allocate memory for
Commit f9e3a2955d 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-02 00:17:28 -08:00
Matt Turner
2dc5ba4a1b Remove another if (E != NULL) check around free(E)
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-12-01 14:24:54 +00:00
Jeremy Huddleston
b2015a2c01 dmx: Build fix for -Werror=implicit-function-declaration on linux
Fixes regression introduced by: 6e6d732bac
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-24 21:15:32 -08:00
Paulo Zanoni
873a1ace36 parser: free val.str after xstrtokenize
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-24 17:47:37 -02:00
Paulo Zanoni
d41987d77c parser: free val.str after xf86getBoolValue
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>
2011-11-24 17:47:37 -02:00
Paulo Zanoni
d5c7338b3e parser: free scandir's list
v2: move the free()s to the function that calls scandir

80 bytes in 1 blocks are definitely lost in loss record 411 of 631
   at 0x4C2779D: malloc (vgpreload_memcheck-amd64-linux.so)
   by 0x4C27927: realloc (vgpreload_memcheck-amd64-linux.so)
   by 0x696A80D: scandir (scandir.c:108)
   by 0x4D8828: OpenConfigDir (scan.c:854)
   by 0x4D8A43: xf86openConfigDirFiles (scan.c:952)
   by 0x49031F: xf86HandleConfigFile (xf86Config.c:2327)
   by 0x49A9E3: 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>
2011-11-24 17:47:37 -02:00
Paulo Zanoni
3d635fe84d Correctly free config file names
We call xf86penConfigDirFiles twice, so we overwrite the configDirPath
variable, losing the pointer. If we move the pointer management to the
upper layer (the function callers), they will be able to call these
functions as many times as they want, but they'll have to free those
returned values.

v2: don't leak inside XWin

4,097 bytes in 1 blocks are definitely lost in loss record 625 of 632
   at 0x4C2779D: malloc (in vgpreload_memcheck-amd64-linux.so)
   by 0x4D7899: DoSubstitution (scan.c:615)
   by 0x4D87B0: OpenConfigDir (scan.c:845)
   by 0x4D8A2D: xf86openConfigDirFiles (scan.c:955)
   by 0x49031F: xf86HandleConfigFile (xf86Config.c:2327)
   by 0x49A9BF: InitOutput (xf86Init.c:365)
   by 0x425A7A: main (main.c:204)

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-11-24 17:47:37 -02:00
Jeremy Huddleston
f405dfffe7 dmx: Build fix for -Werror=implicit-function-declaration
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-11-23 12:15:07 -08:00
Alan Coopersmith
632d205b30 Fix gcc -Wwrite-strings warnings in xf86Modes code
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:07 -08:00
Alan Coopersmith
09e4b78f79 Fix gcc -Wwrite-strings warnings in xf86 ddx
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:07 -08:00
Alan Coopersmith
8e4556f560 FindModule: stop copying const char *dirname to char *dirpath
Not needed since 6cf844ab69 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-11-23 12:15:07 -08:00
Alan Coopersmith
0bc41d5f8d Remove redundant redeclarations of functions in the same header file
Exposed by recent addition of -Wredundant-decls to default CWARNFLAGS

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:07 -08:00
Alan Coopersmith
285133a35e sun_agp: cast key to uintptr_t before casting to (int *)
Matches what linux_agp already does and prevents gcc from throwing up:

sun_agp.c: In function 'xf86DeallocateGARTMemory':
sun_agp.c:236:40: error: cast to pointer from integer of different size

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:06 -08:00
Alan Coopersmith
05d8a7f7a7 Convert a bunch of sprintf to snprintf calls
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-11-23 12:15:06 -08:00
Alan Coopersmith
b967bf2af2 Remove xf86FormatPciBusNumber from API, inline the one place its used
Found no calls from current driver modules

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:06 -08:00
Alan Coopersmith
6450f6ca7e Move DoShowOptions to xf86Configure.c, delete xf86ShowOpts.c
Gets rid of duplicate static copy of optionTypeToString by putting
both callers of that helper function in the same source file.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:06 -08:00
Alan Coopersmith
43fa127426 Remove bad code from DoShowOptions (Xorg -showopts handler)
When we want to print a string, it's okay to just print it.
We don't need to first allocate a buffer 2 bytes bigger than the
string, copy the entire string unmodified to the buffer, print the
buffer, and then leak the buffer (though we AbortDDX 8 lines later,
and then just in case we survived that, call exit as well, so the
leak is short lived, just oh so pointless).

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:06 -08:00
Alan Coopersmith
03ddca6f71 Convert dmxSetDefaultFontPath to use strdup instead of malloc+strncpy
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:05 -08:00
Alan Coopersmith
d9243777c7 matchDriverFromFiles: use one snprintf instead of strncpy/cat series
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:05 -08:00
Alan Coopersmith
6e6d732bac Convert strncpy/strncat to strlcpy/strlcat
As long as we're carrying around a compatibility copy in os/strl*.c,
might as well use them.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:05 -08:00
Alan Coopersmith
08093c25a9 Convert some malloc + strncpy pairs into strndup calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:05 -08:00
Alan Coopersmith
0e6b88db7f Don't fallback to wsfb or fbdev on Solaris
We don't ship either one, so don't waste time and make confusing log
entries trying to load them.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-11-23 12:15:04 -08:00
Alan Coopersmith
7b0f53f0a5 Fix Xdmx build on Linux to work with strlcpy changes
Include strlcpy.c in the  libdmxconfig.a library with the other functions
shared among the xdmx configuration programs.

Also add a #include "os.h" to the scanner.l file that now calls strlcpy
to include the prototype from $(top_srcdir)/include/os.h.

(To be squashed into
http://cgit.freedesktop.org/~alanc/xserver/commit/?id=c19f0ff5223d428f8ad2ab3c563c974c96a521ba
before next PULL request to avoid breaking bisection.)

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-11-23 11:06:34 -08:00
Gaetan Nadon
922c1d8170 docs: spell "X Server Version" consistently in titles. Add where missing.
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-11-21 10:34:23 -08:00
Ross Burton
58864146fb edid: Add quirk for Acer Aspire One 110
At least one revision of the AAO reports a 190x110mm maximum size but a
451x113mm mode.

X.Org Bug 41141 <https://bugs.freedesktop.org/show_bug.cgi?id=41141>

Signed-off-by: Ross Burton <ross@linux.intel.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-18 11:26:03 -08:00
Chris Wilson
34b0e4eee9 dri2: Register the DRI2DrawableType after server regeneration
The Resource database is reset upon regeneration and so the dri2 module
needs to re-register its RESTYPE for the drawable or else it will
clobber the next unsuspecting user of the database. Fortunately, DRI2 is
loaded late in the initialisation sequence and was last up until
xf86-video-intel started using the Resource database to track
outstanding swaps...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2011-11-18 11:26:03 -08:00
Chris Wilson
bfa1a0dd19 DRI2: Avoid a NULL pointer dereference
Bugzilla:  https://bugs.freedesktop.org/show_bug.cgi?id=41211

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-18 11:26:02 -08:00
Chris Wilson
eeb21a133b VidMode: prevent crash with no modes
Bugzilla:  https://bugs.freedesktop.org/show_bug.cgi?id=17431

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-18 11:26:02 -08:00
Jeremy Huddleston
1f5baa924a xfree86: Deprecate the use of xf86PciInfo.h
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Tormod Volden <debian.tormod@gmail.com>
2011-11-18 11:26:02 -08:00
Jeremy Huddleston
eb3377ffb8 xfree86: Fix powerpc build with -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast
memType is a uint64_t on powerpc. Using memType only really makes
sense for *physical* addresses, which can be 64-bit for 32-bit
systems running on 64-bit hardware.

However, unmapVidMem() only deals with *virtual* addresses, which
are guaranteed to fit into an uintptr_t.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2011-11-18 11:26:02 -08:00
Pierre-Loup A. Griffais
a551f126cc xfree86: Fix RandR rotation across server generations
245cb8e94f fixed xf86RotateDestroy() to actually run its teardown
code, causing the Damage object to properly be re-allocated after a
server regeneration. However the block that does that still thinks the
Rotate layer BlockHandler is wrapped from the last generation, meaning
the shadow pixmap is never re-allocated and the Damage object is never
re-registered, causing a blank screen, and potentially a driver crash
on the next teardown after the server asks it to free a 0x0 Pixmap.

Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-11-14 09:14:20 -08:00
Keith Packard
bfa2a1857a Merge remote-tracking branch 'whot/for-keith' 2011-11-14 09:07:06 -08:00
Peter Hutterer
35ec24cf24 input: replace remaining GetPairedDevice() with GetMaster()
Wherever it's obvious which device we need (keyboard or pointer), use
GetMaster() instead of GetPairedDevice(). It is more reliable in actually
getting the device type we want.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-11-09 13:26:47 +10:00
Derek Buitenhuis
f0d50cc665 Fix vesa's VBE PanelID interpretation
xserver's VESA driver's VBE (Vesa BIOS Extensions) code
includes a PanelID probe, which can get a monitor's native
resolution. From this, using CVT formulas, it derives
horizontal sync rate and a vertical refresh rate ranges.

It however, only derives the upper bounds of the ranges, and
the lower bounds cannot de derived. By default, they are set
to hardcoded constants which represent the lowest supported
resolution: 640x480. The constants in vbe.c however, were
not actually derived from forulas, but carried over from
other code from the bad old days, and are not relevant
to flat panel displays. This caused, for example, EEEPC701's
panel, with a native resolution of 800x480, to end up with
a upper bound of the horizontal sync rate that was lower
than the hardcoded lower bound, which of course broke things.

These numbers have been rederived using both my own CVT tool
based on xf86CVTMode(), and using the provided 'cvt' tool
that comes with xserver.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-11-06 16:41:44 -08:00
Peter Hutterer
c643c2b7bf xfree86: duplicate name and driver from pInfo for NewInputDeviceRequest
xorg.conf devices had the name and driver set in the DDX's InputInfoPtr list
but not in the option list for those devices. That information was lost when
passing the options into NewInputDeviceRequest. NIDR then refused to start
the devices.

Introduced in xorg-server-1.11.0-250-ge4cd24e

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: James Cloos <cloos@jhcloos.com>
2011-11-04 07:46:58 +10:00
Keith Packard
548c6fe044 Merge remote-tracking branch 'jturney/master' 2011-11-02 21:35:31 -07:00
Gaetan Nadon
3881b0bf1c mi: remove deprecated miPointerAbsoluteCursor from design doc
Function was removed from the code by commit f5409aa026

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-11-02 21:23:14 -07:00
Keith Packard
d91aa0e660 Merge remote-tracking branch 'whot/two-screen-coordinates' 2011-11-02 21:20:07 -07:00
Keith Packard
8df3a9ca5a Merge remote-tracking branch 'koba/reviewed' 2011-11-02 21:18:16 -07:00
Colin Harrison
ffe8ec86db hw/xwin: Fix a typo in ddraw.h
Fix a (fortunately benign) typo in ddraw.h

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-11-02 14:10:41 +00:00
Yaakov Selkowitz
48fda3c52b hw/xwin: Revert "Fix bug #5735, Serious flaw in CygwinX clipboard"
This commit wreaks havoc with other programs which manage the clipboard,
such as MS Office Clipboard or Win32 VNC viewers:

http://sourceware.org/bugzilla/show_bug.cgi?id=9910

This reverts commit 70ddd0f39d.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-11-02 14:08:34 +00:00
Jon TURNEY
3ead1d810b hw/xwin: Stop pretending we work on NT4
We already link directly to some functions not available in NT4, so stop
pretending we will work on NT4 and link directly to EnumDisplayMonitors()
and SHGetFolderPath()

Also remove mentions of NT4 & Win95 from error messages

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-11-02 14:08:06 +00:00
Jon TURNEY
ee19853867 hw/xwin: Link directly to TrackMouseEvent()
TrackMouseEvent has existed in user32 since at least NT4, so
don't bother with jumping through all the ancient compatibility hoops
of finding if _TrackMouseEvent() exists in comctl32 so it can check
if TrackMouseEvent() exists in user32 to see if it needs to emulate
it...

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-11-02 14:05:34 +00:00
Jon TURNEY
e2e6fab1ef Cygwin/X: Make default DPI match native DPI
Make the default DPI match the current Windows DPI setting. If that
setting can't be retrieved, change the fallback DPI value from 75 dpi
to 96 dpi.

Mark the application as dpiAware in the manifest, which prevents
dpi virtualization for high (>96) dpi values on Vista and later.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-11-02 13:56:22 +00:00
Keith Packard
132545ff57 Merge remote-tracking branch 'whot/for-keith' 2011-10-30 16:57:58 -07:00
Servaas Vandenberghe
820d9040f5 xfree86: fix potential buffer overflow
The patch below fixes a potential buffer overflow in xf86addComment().
This occurs if  curlen > 0 && eol_seen == 0 && iscomment == 0 , as
follows from the code:

char *xf86addComment(char *cur, char *add)

<...>

        len = strlen(add);
        endnewline = add[len - 1] == '\n';
        len +=  1 + iscomment + (!hasnewline) + (!endnewline) + eol_seen;

        if ((str = realloc(cur, len + curlen)) == NULL)
                return cur;

        cur = str;

        if (eol_seen || (curlen && !hasnewline))
                cur[curlen++] = '\n';
        if (!iscomment)
                cur[curlen++] = '#';
        strcpy(cur + curlen, add);
        if (!endnewline)
                strcat(cur, "\n");

Signed-off-by: Servaas Vandenberghe <vdb@picaros.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>

[whot: added buffer overflow test case]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-31 09:39:04 +10:00
Peter Hutterer
63e87b8639 xfree86: reduce calls to input_option_get_key/value
No functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-10-31 09:39:04 +10:00
Anssi Hannula
d0c6732a99 xfree86: add nouveau as the first automatic driver for NVIDIA hardware
Add nouveau as the first driver on linux for NVIDIA hardware when
driver autoconfiguration is done, as it is more capable than nv.

nv is also kept in the list as it is more widely supported and because
some old cards are not supported by nouveau.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-29 17:19:46 -07:00
Alexandr Shadchin
ef895484c8 bsd: alpha_video: Remove unused variables
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29 02:13:28 +06:00
Alexandr Shadchin
fea7c7a8c0 bsd: alpha_video: Simplify #include
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29 02:13:28 +06:00
Alexandr Shadchin
93a3a28f2c bsd: alpha_video: Function sethae() need only for FreeBSD
Return value sethae() is becoming void because no caller used it. Also old
msb_set static checked by each caller is replaced by the p.hae static checked
in sethae() when it's called.

Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29 02:13:28 +06:00
Alexandr Shadchin
05b41e2dc6 Move check definition MAP_FAILED in xf86_OSlib.h
Also remove odd definition MAP_FAILED.

Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29 02:13:27 +06:00
Alexandr Shadchin
af56e502f5 Remove odd definition DEV_MEM
DEV_MEM defined in xf86_OSlib.h

Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29 02:13:27 +06:00
Alexandr Shadchin
0481e9d3d1 Remove BSDi support
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29 02:13:27 +06:00
Alexandr Shadchin
8838a86fd3 Remove unused VT_SYSREQ_DEFAULT
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29 02:13:27 +06:00
Alexandr Shadchin
219bcec73d bsd: Remove odd message about -sharevts
This is missing in commit 'xfree86: move -novtswitch & -sharevts argument
handling up to common layer'

Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-28 13:09:50 -07:00
Jeremy Huddleston
286fa9bf9b XWin: windowswm: Correct byte swapping in event notifications
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-10-26 10:41:51 -07:00
Jeremy Huddleston
dc054fefc5 XQuartz: appledri: Correct byte swapping in event notifications
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-26 00:42:19 -07:00
Jeremy Huddleston
d5fee2b638 XQuartz: applewm: Correct byte swapping in event notifications
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-26 00:42:04 -07:00
Keith Packard
5701ab4a44 Merge remote-tracking branch 'whot/for-keith' 2011-10-24 22:09:00 -07:00
Peter Hutterer
a41214bc9a kdrive: check for null memory, fix OOB
If key/value allocation failed, don't bother adding another InputOption. And
make sure the memory allocated is large enough for the trailing \0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-25 14:06:41 +10:00
Peter Hutterer
6f33593dc0 xfree86 doc: replace driver "keyboard" with "kbd"
We've deprecated keyboard a long time ago

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-25 14:06:41 +10:00
Peter Hutterer
e4cd24e717 xfree86: use NewInputDeviceRequest for xorg.conf devices too
Only use one init path for input devices - through NIDR.

This requires that inp_driver and inp_identifier from the
XF86ConfInputRec are copied over into the options for NIDR to see them.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25 14:06:41 +10:00
Peter Hutterer
f9067c1dd8 xfree86: Fix a comment, the old function doesn't exist anymore
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25 14:06:40 +10:00
Peter Hutterer
aeab26e9e1 xfree86: use xf86AddNewOption instead of xf86addNewOption
The former strdups for us. If the strdup fails we miss out on the
CorePointer option (default on anyway) and we're likely to fall over soon
anyway, so let's pretend this is the same behaviour.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25 14:06:40 +10:00
Peter Hutterer
c39c8d3428 input: switch InputOption to use XF86OptionRec storage.
Use the same struct for both InputOption and XF86OptionRec so we don't need
to convert to and fro the two in the config backends.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25 14:06:39 +10:00
Peter Hutterer
16ac78a53c kdrive: switch to new InputOption API.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2011-10-25 14:02:06 +10:00
Christopher Yeleighton
7d50211ab5 Bug 38420: Xvfb crashes in miInitVisuals() when started with depth=2
https://bugs.freedesktop.org/show_bug.cgi?id=38420

Exit with fatal error message, not segfault.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-24 18:59:56 -07:00
Keith Packard
d9d3a01ffc Merge remote-tracking branch 'jeremyhu/master' 2011-10-24 18:12:23 -07:00
Dave Airlie
17416e88dc xf86Crtc: handle no outputs with no modes harder.
If you started an X server with no connected outputs, we pick a default
1024x768 mode, however if you then ran an xvidmode using app against that
server it would segfault the server due to not finding any valid modes.

This was due to the no output mode set code, only adding the modes to the
scrn->modes once, when something called randr 1.2 xf86SetScrnInfoModes would
get called and remove all the modes and we'd end up with 0.

This change fixes xf86SetScrnInfoModes to always report a scrn mode of at
least 1024x768, and pushes the initial configuration to just call it instead
of setting up the mode itself.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=746926

I've seen other bugs like this on other distros so it might also actually fix them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-24 18:09:35 -07:00
Jeremy Huddleston
fb55f8f790 XQuartz: Fix the filename of our log file
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-24 16:45:36 -07:00
Jeremy Huddleston
1c8bda798b XQuartz: appledri: Allow byte swapped requests
Even though it's only valid when local, it is possible for a local
client and the server to not match endianness, such as when running
a ppc application under Rosetta.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-21 10:34:36 -07:00
Jeremy Huddleston
14205ade0c XQuartz: appledri: Fix byte swapping in replies
Even though it's only valid when local, it is possible for a local
client and the server to not match endianness, such as when running
a ppc application under Rosetta.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-21 10:29:56 -07:00
Jeremy Huddleston
2ba0ac202a XQuartz: appledri: Set the correct reply length for XAppleDRICreatePixmap
http://xquartz.macosforge.org/trac/ticket/508

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-21 10:29:56 -07:00
Jeremy Huddleston
e4f257748b XQuartz: appledri: Change whitespace in appledristr.h to match mesa
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-21 10:29:56 -07:00
Jeremy Huddleston
83fef4235d Xnest: Match the host's keymap
This was a regression.

Introduced by: 08363c5830 and
               32db27a7f8
Masked by: 1e69fd4a60

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-21 10:29:51 -07:00
Jeremy Huddleston
8db554d2d8 Xnest: Fix DestroyNotify handler
This partially reverts the unwanted changes that crept into
c13a48e74e

Reported-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2011-10-21 00:32:03 -07:00
Keith Packard
af3f64fb77 Merge remote-tracking branch 'hramrach/pull' 2011-10-19 17:33:07 -07:00
Keith Packard
15bbdc103b Merge remote-tracking branch 'whot/for-keith' 2011-10-19 17:26:50 -07:00
Gaetan Nadon
e4787ec20b XWinrc.man: fix warning: tab character in unquoted macro argument #35054
Spaces or tabs do not affect the text output layout.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-19 17:22:26 -07:00
Gaetan Nadon
321873f804 xorg.conf.man: fix 382: warning: missing )' (got R') #35054
http://www.gnu.org/software/groff/manual/html_node/Man-usage.html

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-10-19 17:22:18 -07:00
Jesse Barnes
3e145d3d67 crtc: match full preferred modes if possible when choosing an initial config
It's fairly common to have multiple, identical monitors plugged in.  In
that case, it's preferable to run the monitor's preferred mode on each
output, rather than just matching the width & height and end up with
different timings or refresh rates.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-19 17:19:44 -07:00
Michal Suchanek
df0dd36dee Do not uselessly reload modules in DuplicateModule
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-18 14:21:32 +02:00
Michal Suchanek
24d435163e Use UnloadModuleOrDriver for UnloadSubModule.
Signed-off-by: Michal Suchanek <hramrach@centrum.cz>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-18 13:18:33 +02:00
Michal Suchanek
0d4bb5442c Unload submodules.
Signed-off-by: Michal Suchanek <hramrach@centrum.cz>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-18 12:49:29 +02:00
Tomáš Trnka
323869f329 Fix drain_console unregistration
Bug introduced by 9dca441670
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-10-18 09:15:54 +10:00
Jeremy Huddleston
679c84bce9 Bump ABI_VIDEODRV_VERSION to 12
The ABI changed in the previous series of changes, so bump the ABI version for
the next release.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:48 -07:00
Jeremy Huddleston
a89cdcee4e xfree86: Deprecate xf86MapVidMem and friends
Drivers should transition over to using libpciaccess's instead.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-15 21:18:48 -07:00
Jeremy Huddleston
43d730c0e4 xfree86: Link modules with -module
This makes a difference on darwin (and apparently nowhere else)

https://www.gnu.org/s/libtool/manual/libtool.html#Modules-for-libltdl

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-10-15 21:18:47 -07:00
Jeremy Huddleston
f7edc00a2a xfree86: fbdevhw: Remove unused include of pciaccess.h
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:47 -07:00
Tiago Vignatti
6817050f31 configure: wrap PCI code with macro and set it at build time
--disable-pciaccess, used together with --disable-module-int10, can be used to
disable all pci code inside the server.

Note that XSERVER_LIBPCIACCESS was previously used only in the driver side and
now it defines also whether the library is used inside the server. Also,
XORG_BUS_PCI automake variable is introduced to track PCI code needs.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-15 21:18:47 -07:00
Tiago Vignatti
a319e9e697 configure: change PCI function checking by a meaningful version of the library
People that don't want VGA arbiter active can go to the library and enable the
stubs there.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:47 -07:00
Jeremy Huddleston
b3ca84430d xfree86: Work around issue where ar may be told to make an archive with no contents
Automake:

 "Be careful when selecting library components conditionally. Because building
 an empty library is not portable, you should ensure that any library
 always contains at least one object."

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-10-15 21:18:47 -07:00
Jeremy Huddleston
e8bafb9d8c xfree86: Add stubs for os-support to help adding new architecture support
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-10-15 21:18:47 -07:00
Adam Jackson
342f3eac84 int10: Port internal users off xf86MapVidMem
This API is apparently semi-deprecated even by XFree86 standards, and
there are only four drivers left using it.  Let's start chopping it off.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-10-15 21:18:46 -07:00
Adam Jackson
7757b80924 pci: Remove xf86MapDomainMemory
This is slightly draconian, but that API is just awful.  In all but
one case in the callers it's used to get a map of some legacy VGA
memory, and it would be cleaner for the caller to just call
pci_device_map_legacy.

The sole exception is in the vesa driver, which uses it to avoid having
to look up which device the BAR belongs to.  That's similarly trivial to
fix.

Having done that, Linux's PCI layer is now very small indeed.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-10-15 21:18:46 -07:00
Adam Jackson
6f5041d0b8 int10: Use pciaccess rom fetch for !PC machines
... instead of rolling our own, badly.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:46 -07:00
Adam Jackson
492ed3e53b pci: Deprecate the PCITAG type
It is kept around to help drivers through the API transition and will be
removed at some point in the future.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:46 -07:00
Adam Jackson
a248fa3a33 xfree86: Remove unused bios_devmem.c
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:46 -07:00
Adam Jackson
aa0bfb0f13 linux: Remove ia64 domain I/O support code
pciaccess handles this now.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:46 -07:00
Adam Jackson
95b6935637 linux: Remove pre-2.6 PCI interface support
If you haven't ported 2.6 to your architecture in the intervening seven
years, you can keep running older servers.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:46 -07:00
Adam Jackson
769f583783 bus: remove some dead struct fields
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:46 -07:00
Adam Jackson
dd72b3c1f1 linux: Use pci_device_get_parent_bridge instead of open-coding it
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:46 -07:00
Adam Jackson
858fbbb40d pci: Port xf86MapLegacyIO to pciaccess
Per-domain I/O is now something drivers must manually request, and must
keep track of within their own state rather than in the ScrnInfoRec.
It's not really possible to split that into two steps without an
additional intermediate ABI break, so don't even try.  Drivers that want
source compatibility should ifdef on the presence of xf86UnmapLegacyIO.

As a fringe benefit, domain-aware I/O is now OS-independent, relying
only on support in pciaccess.  Simplify OS PCI setup to reflect this.

The IOADDRESS type is kept around to help drivers through the API
transition and will be removed at some point in the future.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:46 -07:00
Adam Jackson
6d9efdce0d vgahw: Port to pciaccess IO space routines
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:45 -07:00
Adam Jackson
4bd6579188 vgahw: Don't default to standard (port space) access routines
In fact, don't default to anything; drivers must explicitly say which
kind they want, and they are strongly encouraged to do MMIO if possible.
This is an ABI change in that drivers that don't will crash, but drivers
that are explicit will work with both old and new servers.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:45 -07:00
Adam Jackson
30fb334d21 vgahw: Remove IO domain setup
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:45 -07:00
Adam Jackson
51a5558beb int10: Port to pciaccess' legacy IO API
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:45 -07:00
Adam Jackson
c0b63ff88a xfree86: Move xf86GetClocks to vgahw
This is really a vga-specific hack anyway.  The only modern driver that
uses it is trident, but it's already loaded vgahw by the time it would
call xf86GetClocks.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:45 -07:00
Peter Hutterer
8bebb4b489 Store desktop dimensions in screenInfo.
For Zaphod mode screen crossing handling we need to know the size of all
screens together (i.e. the whole desktop size). Store that in the screenInfo to
have it readily available in events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-13 11:26:09 +10:00
Peter Hutterer
9cbfa4739a xfree86: remove xf86XInputSetScreen
Keeping track of which screen the pointer within the input driver is
obsolete now. To bind to a screen, use the transformation matrix instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-13 11:07:50 +10:00
Jeremy Huddleston
09dbfcb0ad os: Remove Error()
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-11 21:23:46 -07:00
Jeremy Huddleston
db30615bcb Xephyr: Remove socket and its lock file on exit
https://bugs.freedesktop.org/show_bug.cgi?id=11484

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2011-10-10 20:40:44 -07:00
Jeremy Huddleston
c13a48e74e Xnest: Remove socket and its lock file on exit
https://bugs.freedesktop.org/show_bug.cgi?id=11484

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2011-10-10 20:40:44 -07:00
Jeremy Huddleston
8b29addc30 loader: when creating sdksyms.c only include shmint.h if MITSHM is enabled #29109
https://bugs.freedesktop.org/show_bug.cgi?id=29109

When configured with --disable-mitshm the symbols declared in shmint.h
do not exist. By guarding the include with '#ifdef MITSHM' these
symbols are skipped when generating sdksyms.c with --disable-mitshm.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-09 17:11:56 -07:00
Julien Cristau
eabd5532fb xfree86: fix build with xv disabled
https://bugs.freedesktop.org/show_bug.cgi?id=29111

Signed-off-by: Julien Cristau <jcristau@debian.org>
Tested-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
2011-10-09 17:08:34 -07:00
Ville Skyttä
c53380be80 Man page syntax and spelling fixes.
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-06 09:53:23 -07:00
Jeremy Huddleston
fae7ed62ad XQuartz: pbproxy: Add missing AM_OBJCFLAGS
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-04 21:40:41 -07:00
vdb@picaros.org
e4cddf509e Fix a rare memory leak
Signed-off-by: Servaas Vandenberghe <vdb@picaros.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-04 20:18:17 -07:00
Keith Packard
6378d0233d Merge remote-tracking branch 'herrb/master' 2011-10-03 13:56:06 -07:00
Keith Packard
6e965d8a18 Merge remote-tracking branch 'koba/reviewed' 2011-10-03 13:47:49 -07:00
Gaetan Nadon
ee3e26079e ddxDesign: drop the url in the coporate authors list
It was such an eyesore once rendered in html.
Now it looks like other authors.

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-10-03 12:18:37 -07:00
Gaetan Nadon
0ed71b48c0 ddxDesign: remove server version from the document title
Such version information is already written in the appropriate location

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 12:18:35 -07:00
Gaetan Nadon
83ec3bf1aa ddx-Design: add X Version and Release information
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 12:18:31 -07:00
Jamey Sharp
77743f877d kdrive: Fix build for opaque InputOption structure.
Commit 05284a03f9 missed fixing up
kdrive's use of the old non-opaque structure.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 11:51:00 -07:00
Keith Packard
cf11ca360c Merge remote-tracking branch 'jeremyhu/for-keith' 2011-10-03 11:44:59 -07:00
Pauli Nieminen
463dd87062 xf86/modes: Fix shadow rotation crashing when screen pixmap changes
Driver may change screen pixmaps after page flipping that would then
make damage lose track of the root pixmap.

Using root window for shadow damages fixes the problem because
SetWindowPixmap is implemented in shadow code.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 11:41:22 -07:00
Keith Packard
f5d50b46dd Merge remote-tracking branch 'whot/next' 2011-10-03 11:36:28 -07:00
Aaron Plattner
57cd32e934 xfree86/modes: Make cursor position transform a helper function
When the driver can handle the crtc transform in hardware, it sets
crtc->driverIsPerformingTransform, which turns off both the shadow
layer and the cursor's position-transforming code.  However, some
drivers actually do require the cursor position to still be
transformed in these cases.  Move the cursor position transform into a
helper function that can be called by such drivers.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2011-10-03 11:30:04 -07:00
Aaron Plattner
245cb8e94f xfree86/modes: Let the driver handle the transform
If a driver can use hardware to handle the crtc transform, then
there's no need for the server's shadow layer to do it.  Add a crtc
flag that lets the driver indicate that it is handling the transform.
If it's set, consider the transformed size of the screen but don't
actually enable the shadow layer.  Also stop adjusting the cursor
image and position.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2011-10-03 11:30:00 -07:00
Matthieu Herrb
98b230669f sdksyms.sh may not be executable.
Use $(SHELL) to run it. Someone may want to build out of a source tree
in a filesystem with the noexec mount flag set.

Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-01 17:35:19 +02:00
Matthieu Herrb
f54852edc3 Add a 'wscons' autoconf mechanism to configure input devices on BSD.
This does not really handle hotplug (it's handled inside the kernel,
by the 'mux' devices), but uses the wscons console driver
configuration to figure out the keyboard layout and the list of
pointing devices found by the kernel.

Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-30 10:10:32 +02:00
Alexandr Shadchin
ac5881d6d0 Remove unused vtSysreq
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-09-29 23:05:35 +06:00
Alexandr Shadchin
0be1640dbb bsd: ioctl KDENABIO/KDDISABIO do not matter for OpenBSD
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-09-29 23:05:35 +06:00
Alexandr Shadchin
91042b98af bsd: OpenBSD and NetBSD not need extra headers in PCVT_SUPPORT
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-09-29 23:05:35 +06:00
Alexandr Shadchin
86eaa9bbe4 bsd: Some clean up
OpenBSD and NetBSD does not support syscons

Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-09-29 23:05:35 +06:00
Alexandr Shadchin
dc864770d4 bsd: Remove dead code
Since OsInit closes stdin before the xfree86 DDX opens the
console, fstat on stdin will always fail, so it's safe to delete
code that attempts it.

Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-09-29 23:05:35 +06:00
Alexandr Shadchin
cbb842666f bsd: Variable devConsoleFd need only if defined PCCONS_SUPPORT
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-09-29 23:05:35 +06:00
Alexandr Shadchin
38bd1e123d bsd: Replacement screenFd on consoleFd because they are equivalent
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-09-29 23:05:35 +06:00
Alexandr Shadchin
f015351c73 bsd: Remove unused macros KBD_FD
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-09-29 23:05:35 +06:00
Peter Hutterer
8d1a414cca input: switch InitValuatorAxisStruct to return Bool
Return errors instead of silently ignoring them.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-09-29 12:26:43 +10:00
Daniel Stone
2b8f1d07bd Input: Widen pointer acceleration types to double
This widens almost all of the float-using code in ptrveloc.[ch] to
doubles, other than values coming from properties which are specified to
be floats by the property API.

Bumps input API to v14 as this changes the AccelScheme signature, as
used by xf86-input-synaptics.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2011-09-29 12:24:33 +10:00
Jeremy Huddleston
38e9e28ba2 XQuartz: Use set_front_process rather than X11ApplicationSetFrontProcess since we're already in the AppKit thread
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-28 13:31:48 -07:00
Keith Packard
afb1fe695d Merge remote-tracking branch 'whot/next' 2011-09-26 20:24:15 -07:00
vdb@picaros.org
c7163fdd30 xfree86: .BI style: monitor section in xorg.conf man page
The xorg.conf manual uses the following convention in most of its
sections:

bold = text to be copied literally to the config file,
italic = a symbolic name to be substituted by a true value.

Some configuration keywords seem to have been changed into generic
options.  Prepending Option to the manual entry swapped the
bold-italic logic.  This patch restores the convention in the monitor
section and consists of

-.BI "Option " "\*qPreferredMode\*q  " \*qstring\*q
+.BI "Option \*qPreferredMode\*q \*q" name \*q

modifications.

Plus a few minor changes (Modes → Mode) and a typo fix.

Signed-off-by: Servaas Vandenberghe
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-27 11:57:28 +10:00
Peter Hutterer
4b4caecb7d xfree86: expose Option "TransformationMatrix"
Recent changes to the server change the default absolute input device
behaviour on zaphods to span the whole desktop too. Since these setups
usually use an xorg.conf, allow the transformation matrix to be specified in
the config as well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-09-27 11:57:25 +10:00
Peter Hutterer
cf51424a34 xfree86: use subheader for Pointer Acceleration parts in xorg.conf(5)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-27 11:57:23 +10:00
Peter Hutterer
9125952b40 xfree86: fix comment typo
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-27 11:57:20 +10:00
Peter Hutterer
24823f1ab0 xfree86: switch options from pointer to XF86OptionPtr
In all cases, the pointer was simply type-cast anyway. Let's get some
compile-time type safety going, how about that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>

Squashed in:
xfree86: Move definition of xf86OptionPtr into separate header file

The pile of spaghettis that is the xfree86 include dependencies make it
rather hard to have a single typedef somewhere that's not interfering with
everything else or drags in a whole bunch of other includes.

Move the xf86OptionRec and GenericListRec declarations into a separate
header.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-27 11:43:36 +10:00
Keith Packard
7fb4bef039 Merge remote-tracking branch 'mattst88/for-keith' 2011-09-21 14:34:27 -07:00
Keith Packard
98f4940093 Merge remote-tracking branch 'alanc/master' 2011-09-21 14:30:19 -07:00
Keith Packard
b018b81533 Merge remote-tracking branch 'jamey/reviewed' 2011-09-21 14:17:14 -07:00
Matt Turner
9edcae78c4 Use correct swap{l,s} (or none at all for CARD8)
Swapping the wrong size was never caught because swap{l,s} are macros.

It's clear in the case of Xext/xres.c, that the author believed
client_major/minor to be CARD16 from looking at the code in the first
hunk.

v2: dmx.c fixes from Keith.

Reviewed-by: Peter Harris <pharris@opentext.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-21 17:14:16 -04:00
Matt Turner
2c7c520cfe Use internal temp variable for swap macros
Also, fix whitespace, mainly around
	swaps(&rep.sequenceNumber)

Reviewed-by: Peter Harris <pharris@opentext.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-21 17:12:04 -04:00
Matt Turner
c10bad3d3e Silence printf format warnings in helper_exec.c
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-21 17:12:04 -04:00
Matt Turner
40a47bd628 Remove unnecessary #undefs of [f]abs and old comments
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-21 17:12:04 -04:00
Pauli Nieminen
871d65790e DRI2: Allow DDX to validate swap_limit changes
DDX can now implement validation for swap_limit changes to prevent
configurations that are not support in driver.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
CC: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-09-21 14:04:37 -07:00
Pauli Nieminen
b435e2aac1 DRI2: Expose API to set drawable swap limit.
This allows ddx to set swap_limit if there is more than one back
buffer for drawable. Setting swap_limit has to also check if change
affects a client that is blocked.

This can be used to implement N-buffering in driver with minimal
logic in allocation and selecting next back.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-09-21 13:55:45 -07:00
Pauli Nieminen
86f8da0aa7 DRI2: Add ReuseBufferNotify hook
ReuseBufferNotify hook is called whenever old buffer is reused in DRI2
code.

Driver can use this hook to rewrite the buffer name if hardware requires
shared buffers. Shared buffer might be some hardware limited resources like
framebuffer that is preallocated in boot.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-09-21 13:54:55 -07:00
vdb@picaros.org
2f47433fef print DisplayMode type bits
Dear,

A patch I posted on xorg-devel was reviewed and is ready for
inclusion in xserver.  Would you be willing to apply the patch so that
it finds its way into the master branch ?

Thank you, Servaas Vandenberghe.

http://lists.x.org/archives/xorg-devel/2011-August/024769.html
http://lists.x.org/archives/xorg-devel/2011-August/024777.html

This patch adds printing of the DisplayMode type bits to
xf86PrintModeline().  It helps to trace the modeline origin and to
understand the initial configured modeline.

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
Signed-off-by: Servaas Vandenberghe
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-09-21 13:46:57 -07:00
Aaron Plattner
4ad271d06c xfree86: Bump extension ABI version to 6.0
The video driver ABI was bumped to 11.0 in commit
0de7cec907 because of a change to the
size of ATOM in commit 51f353d0a0.  This
also affects extension modules, so the extension ABI version should
have been bumped too.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-09-21 13:28:11 -07:00
Alan Coopersmith
c8eacae4f8 Space & style cleanup of hw/xfree86/i2c/fi1236.c
Fortunately, the massive decrease in the cost of whitespace in the past
decade has allowed us to be much more generous with it, and much more
consistent in its application, even for code like this that clearly no
one has ever tried to read.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-09-20 07:41:18 -07:00
Alan Coopersmith
c46215c100 Cross-reference cvt(1) & gtf(1) man pages
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2011-09-20 07:41:18 -07:00
Jamey Sharp
8f69c935f6 Eliminate MAXSCREENS-sized CursorScreenKey array.
Use new per-screen privates API instead.

Commit by Jamey Sharp and Josh Triplett.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-19 22:53:05 -07:00
Alan Coopersmith
78f946c297 sun_init.c: Implement novtswitch & sharevts for Solaris
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: John Martin <john.m.martin@oracle.com>
2011-09-19 15:34:54 -07:00
Jamey Sharp
87cc83474d Replace XmuSnprintf with snprintf.
Alan Coopersmith explains:

	XmuSnprintf() can be replaced by snprintf() now. (It was a
	implementation X provided for it's libraries to use in the days
	before all platforms we cared about had snprintf in libc.)

Reported-by: walter harms <wharms@bfs.de>
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-19 15:16:04 -07:00
Jamey Sharp
df4eeb1256 xnest: Delete unused nClipRects GC-private field.
This field was never read at any time in the git history.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-18 20:11:43 -05:00
Jamey Sharp
53a4744b69 XineramaInitData ignores its argument. Quit passing one.
Also fix up XineramaInitData's caller, XineramaReinitData.

Commit by Jamey Sharp and Josh Triplett.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-18 20:11:43 -05:00
Jamey Sharp
b85c10a35d dmx: Fix some "no previous prototype" warnings by making functions static.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2011-09-18 20:11:43 -05:00