Commit Graph

6519 Commits

Author SHA1 Message Date
Adam Jackson
d08966227e damage: Simplify DamageUnregister
You can only register one drawable on a given damage, so there's no
reason to require the caller to specify the drawable, the damage is
enough.  The implementation would do something fairly horrible if you
_did_ pass mismatched drawable and damage, so let's avoid the problem
entirely.

v2: Simplify xf86RotateDestroy even more [anholt]

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 14:28:35 -04:00
Adam Jackson
28708a045d damage: Implicitly unregister on destroy
There's no reason not to, and it simplifies quite a few callers.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 14:28:09 -04:00
Adam Jackson
e4b15125bb mipointer: Remove deprecated miPointerCurrentScreen
The only remaining use was in some debugging code in DMX.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 13:29:21 -04:00
Adam Jackson
b5d66b9513 xfree86: Remove deprecated unimplemented xf86MapReadSideEffects
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 13:28:24 -04:00
Adam Jackson
dff81687f5 vbe: Don't try to load the ddc submodule
DDC is built into the server now.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 13:28:24 -04:00
Adam Jackson
e674815e0a dmx: Remove ShadowFB support
This has been listed as deprecated ever since DMX was merged.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 13:28:23 -04:00
Adam Jackson
4dca026880 mipointer: Remove EnqueueEvent from miPointerScreenFuncRec
No DDX overrode this, and we never actually called through that slot
anyway.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 13:28:23 -04:00
Adam Jackson
ad076dc6e8 mipointer: Flatten calls to mieqSwitchScreen
No DDX was overriding this.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 13:28:23 -04:00
Radek Doulik
65fca55884 xnest: Ignore GetImage() error in xnestGetImage()
When an Xnest instance is not viewable it will crash when a client in
that instance calls GetImage. This is because the Xnest server will
itself receives a BadMatch error.
This patch ignores the error. The application which has requested the
image will receive garbage - this however is fully legal according
to the specs as obscured areas will always contain garbage if there
isn't some sort of backing store as discussed in
https://bugs.freedesktop.org/show_bug.cgi?id=9488
The applied patch is a version from Dadek Doulik.

v2: Call XSync() before changing error handlers as suggested by
    Daniel Stone <daniel@fooishbar.org>.

Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Egbert Eich <eich@freedesktop.org>
2013-09-10 13:26:26 -04:00
Michal Srb
b902c8abb6 Xnest: Implement xnestModifyPixmapHeader
Xnest variant of ModifyPixmapHeader that creates new Pixmap in parent X
server if it's size is modified from 0x0 to anything bigger.

xnestCreatePixmap doesn't create pixmap in parent X server if it has
dimensions 0x0. If it is later resized and accessed, Xnest will be
aborted with BadDrawable error from parent X server because it will
use XID 0. This happens with ScratchPixmap, for example as used from
XaceCensorImage. Applications using XACE crash Xnest.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-09-10 13:26:26 -04:00
Laurent Carlier
ceffb34774 ephyr: restore GLX support
It was removed since version 1.13

Signed-off-by: Sebastien Bacher <seb128@ubuntu.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
2013-09-10 13:26:25 -04:00
Keith Packard
47ff382d1f Merge remote-tracking branch 'jturney/master' 2013-09-09 15:13:42 -07:00
Chris Clayton
1110b71e36 kdrive: fix build error on gcc 4.8 for out-of-bounds array access
I'm getting a error building xorg-server-1.14.1.902 with thelatest snapshot
of gcc-4.8:

input.c:225:43: error: array subscript is above array bounds
[-Werror=array-bounds]

This is because kdNumInputFds can become equal to KD_MAX_INPUT_FDS in
KdRegisterFd(). This means that in KdUnregisterFd(), kdInputFds[j + 1] can
be beyond the end of the array.

Signed-off-by: Chris Clayton <chris2553@googlemail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-06 07:04:17 +10:00
Sebastien Bacher
abc2bfca16 kdrive: initialize GLX for xephyr
Like commit ac1a60e7b6, re-add
initialization of GLX after it was accidentally dropped from non-Xorg
servers in 5f5bbbe543.

Signed-off-by: Sebastien Bacher <seb128@ubuntu.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62346
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2013-09-03 14:35:39 -07:00
Eric Anholt
aa5534ec69 ephyr: Do grab/ungrab for ctrl+shift, not just shift+ctrl.
Given that the window title says "ctrl+shift", having pressing those
keys in that order not ungrab you is fairly mean.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:39 -07:00
Eric Anholt
5cc15e1c42 ephyr: Flush the X connection when updating the window title.
Otherwise when you're doing the ctrl-shift mouse grab thing, you
don't know what state you're in until the next rendering occurs.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:39 -07:00
Eric Anholt
ba387cf21f ephyr: Use host (HW) cursors by default.
Unless you're working on the sw cursor rendering code, you surely want
to have real hardware cursors.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:38 -07:00
Eric Anholt
0f5a2f13dc ephyr: Garbage collect some DOA host window clipping code.
Introduced in 7978272661 but never used.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:24 -07:00
Eric Anholt
090de17d36 ephyr: Garbage collect some dead XV clipping code.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:21 -07:00
Eric Anholt
347d0fa696 ephyr: Remove the helper libs for each of the optional components.
Note that EXTRA_DIST was always unnecessary, because automake notices
conditional compile of source files and includes them.

Copyright header is added because git noted that this was a 61%
rewrite.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:18 -07:00
Eric Anholt
74dff87790 ephyr: Remove the remaining bits of host/server XV split.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:14 -07:00
Eric Anholt
2f994dfe9d ephyr: Remove the host/server split of the actual XV video operations.
I suspect there's more cleanup possible in ephyrHostXVPutImage() by
sticking a bunch of the args in the port priv earlier.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:11 -07:00
Eric Anholt
0b7ce74315 ephyr: Remove another host/server split for XV image formats.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:09 -07:00
Eric Anholt
1dcc28bcb4 ephyr: Remove the host/server split for video encodings.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:06 -07:00
Eric Anholt
28a37757e1 ephyr: Remove the host/server split for XV formats.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:04 -07:00
Eric Anholt
41134d393a ephyr: Remove the host/server split for XV attributes.
v2: Fix leaks of xcb replies (caught by Julien)

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:01 -07:00
Eric Anholt
1342a93c49 ephyr: Remove the host/server split for XV adaptors.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:34:59 -07:00
Eric Anholt
fad79d2e3e ephyr: Refactor XV adaptor feature detection.
This obviously wanted a helper function beforehand, but even more so
now that we have XCB.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:34:56 -07:00
Eric Anholt
7a9c311add ephyr: Remove some pointless indirection in the XV code.
Now that we have XCB on the server side, we don't need to split these
functions out.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:34:53 -07:00
Eric Anholt
46cf6bf569 ephyr: Move event processing into ephyr.c.
No more extra event structure to translate between hostx.c and
ephyr.c!

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:34:51 -07:00
Eric Anholt
847c856eff ephyr: Move the host screen info into the kdrive screen private.
We can include xcb bits from the same place as server headers, so
there's no need to hide them any more.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:34:48 -07:00
Eric Anholt
8dadc78e23 ephyr: Rename and use the proper type for what was host_screen->info.
Now that we can include server headers in talking to host X, we don't
need to hide any more.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:34:46 -07:00
Eric Anholt
18d836f6dd ephyr: Expose a single function for detecting extensions.
v2: Fix trying to include xcb-dri in the non-dri-build case (Noted by
    Julien)

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:34:41 -07:00
Eric Anholt
3aacb22d64 ephyr: Drop dead ephyrHostAtomToLocal code.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:34:32 -07:00
Julien Cristau
4aaad0bfbc Xephyr: we're not using Xlib anymore, no need to undef _XSERVER64
Drop obsolete comments about interaction between Xlib code and that
macro, and stop undefining it.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-09-03 11:02:03 -07:00
Julien Cristau
0fc2f9f04a Xephyr: handle errors in event loop
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2013-09-03 11:02:03 -07:00
Julien Cristau
3309a73c82 Xephyr: drop remaining Xlib dependency
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:02:03 -07:00
Julien Cristau
7da2174cf9 Xephyr: move glx code to xcb
v2: Rebase on master, notably adding XCB for
    X_GLXvop_MakeCurrentReadSGI (anholt).
v3: Fix use-after-free (caught by Julien).

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2013-09-03 11:01:40 -07:00
Julien Cristau
19c2699b95 Xephyr: remove unused DRI1 code
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:01:00 -07:00
Julien Cristau
68b7db19e8 Xephyr: move ephyrdri over to xcb
Require new xcb-xf86dri to get fixed GetDrawableInfo.

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:01:00 -07:00
Julien Cristau
aea119cd05 Xephyr: use xcb-xv instead of libXv
v2: Massive, conflict-filled rebase.  I think I resolved everything
    right, but this host xv code makes my eyes bleed.  Touch-tested XV
    after the rebase (anholt).

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2013-09-03 11:00:59 -07:00
Julien Cristau
3ea75a59d5 Xephyr: use xcb for event handling
v2: Rebase on indentation changes, squash in a simpler variant of the
    later event compression patch, fix server hang or segfault on
    window close by reimplementing the x_io_error_handler in the new
    XCB event loop (anholt).

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2013-09-03 11:00:59 -07:00
Julien Cristau
ff26845252 Xephyr: some more hostx.c xcb-ification
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:00:59 -07:00
Julien Cristau
9b55f76a26 Xephyr: move HostX.visual to xcb
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:00:59 -07:00
Julien Cristau
126312fb4a Xephyr: replace XKeycodeToKeysym with xcb-keysyms
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:00:59 -07:00
Julien Cristau
8543d3fdfd Xephyr: delete unused hostx_get_extension_info function
v2: Also remove the prototype (anholt)

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2013-09-03 11:00:59 -07:00
Julien Cristau
d72c11b9df Xephyr: delete unused proxy code
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:00:59 -07:00
Julien Cristau
a71ea3f967 Xephyr: xcb-ify visual list construction
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:00:59 -07:00
Julien Cristau
ac2b0348c0 Xephyr: xcb-ify pointer/keyboard grab
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:00:59 -07:00
Julien Cristau
1f93e6b350 Xephyr: no need for XDisplayKeycodes
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:00:59 -07:00
Julien Cristau
73398e5bf6 Xephyr: use xcb-shape instead of XShape*
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:00:59 -07:00
Julien Cristau
a2b73da78d Xephyr: start converting hostx.c over to xcb
v2: Dropped the hostx_load_keymap changes, now that that function is
    gutted (anholt).

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2013-09-03 11:00:59 -07:00
Julien Cristau
762606b4cd Xephyr: stop loading the host's keymap
This isn't used anywhere.

v2: Rebase to the top of the patch series (anholt)

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2013-09-03 11:00:59 -07:00
Marc Haesen
3752a81580 hw/xwin: Remove unnecessary and incorrect HWND casts
Signed-off-by: Marc Haesen <marha@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-08-30 14:22:22 +01:00
Jon TURNEY
34932cef6c hw/xwin: Fix compilation of winauth.c with -Werror=implicit-function-declaration
/jhbuild/checkout/xorg/xserver/hw/xwin/winauth.c: In function ‘MitGenerateCookie’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winauth.c:87:5: error: implicit declaration of function ‘MitAddCookie’ [-Werror=implicit-function-declaration]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:59:08 +01:00
Jon TURNEY
2a08554a0b hw/xwin: Remove unused extern g_fUseUnicode from winclipboardwndproc.c
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:59:06 +01:00
Jon TURNEY
69401f38a6 hw/xwin: Remove unneeded forward declaration of winProcessXEventsTimeout()
Remove unneeded forward declaration of winProcessXEventsTimeout(), the actual
definition immediately follows.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:59:03 +01:00
Jon TURNEY
9c45a1ad44 hw/xwin: Remove prototype for non-existent winDeinitClipboard()
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:59:00 +01:00
Jon TURNEY
acc46fc217 hw/xwin: Remove unused externs from winclipboardwrappers.c
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:58:58 +01:00
Jon TURNEY
fcc7767f8c hw/xwin: Remove unused winProcQueryTreeOrig variable
Unused since 47c7b6d3e6 "Remove no-longer needed
tricks used to prevent the clipboard client from being killed"

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:58:56 +01:00
Jon TURNEY
8fa882a980 hw/xwin: Fix ARGB cursor conversion on x86_64
Fix erroneous use of unsigned long * for lpBits in winXCursorToHCURSOR() which
leads to ARGB cursors being vertically streched on x86_64 by interleaving blank
rows of pixels.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:58:54 +01:00
Jon TURNEY
4bfb2dce5e hw/xwin: Fix an issue in winSetSpansNativeGDI() identifed by -Warray-bounds
The BITMAPINFO local only has room for a single RBGQUAD in bmiColors, but we
access two (black and white for a mono-color DIB).  Fix by changing to a dynamic
allocation big enough for a BITMAPINFO and a RGBQUAD.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:58:51 +01:00
Jon TURNEY
784c006adb hw/xwin: Fix -Warray-bounds warning in winXCursorToHCURSOR()
Rewrite winXCursorToHCURSOR() so access to BITMAPINFO bmiColors member doesn't
trigger an -Warray-bounds warning.

Note that the underlying storage is allocated as a BITMAPV4HEADER, so has
sufficent room for the extra RGBQUADs bmiColors after the BITMAPINFO bmiHeader.

wincursor.c: In function 'winSetCursor':
wincursor.c:293:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:294:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:295:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:296:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:297:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:298:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:299:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:300:24: error: array subscript is above array bounds [-Werror=array-bounds]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:58:49 +01:00
Marc Haesen
41d03c9ccc hw/xwin: Correct size of _WINDOWSWM_NATIVE_HWND property on x86_64
Use the correct size of a HWND on x86_64 in XChangeProperty() and
XGetWindowProperty() calls for the _WINDOWSWM_NATIVE_HWND property.

Signed-off-by: Marc Haesen <marha@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-08-30 12:58:15 +01:00
Colin Harrison
390cfec10e hw/xwin: Correct winprefs.c function signatures for x64.
Correct SetupRootMenu(), SetupSysMenu(), HandleCustomWM_INITMENU() and
HandleCustomWM_COMMAND() function signatures which use unsigned long parameters,
where just a specific HWND or HMENU handle type should have been used.

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:56:35 +01:00
Jon TURNEY
e716baedc4 Move pseudoramiX code where it can be shared between Xwin and Xquartz
Move pseudoramiX code to a separate top-level directory.  Link Xwin and Xquartz
with libPseudoramiX

I'm not sure moving this to a top-level directory is appropriate, but I'm not
sure where else it fits.

Future work: pseudoramiX can probably be consolidated with the rrxinerama code
(which I think provides fake xinerama data when real XINERAMA is disabled and we
only have one screen)

v2: fix distcheck

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:52:30 +01:00
Jon TURNEY
ce0217b982 hw/xwin: Fix winglobals.h for MinGW64 build
Include pthread.h in winglobals.h to fix build with latest MinGW64 headers

In file included from
winmultiwindowicons.c:47:0:
winglobals.h:92:1: error: unknown type name ‘pthread_mutex_t’

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:52:27 +01:00
Jon TURNEY
b27756dbe6 hw/xwin: Fix inclusion of shlobj.h in MinGW64 build
Fix build with latest MinGW64 headers by wrapping Status type in shlobj.h as well

In file included from InitOutput.c:51:0:
/usr/i686-w64-mingw32/sys-root/mingw/include/shlobj.h:1231:44: error: expected identifier or ‘(’ before ‘int’
/usr/i686-w64-mingw32/sys-root/mingw/include/shlobj.h:1248:44: error: expected identifier or ‘(’ before ‘int’

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:52:24 +01:00
Eric Anholt
e01a3f65d3 ephyr: Fix warning about XID vs unsigned long * by changing function args
There's no reason to pass the data back out to the caller, since the
caller was dropping it on the floor.  The original data is a CARD32,
so no need to mess with weird unsigned longs.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-08-21 09:10:49 -07:00
Eric Anholt
f1cefe020b ephyr: Drop is_ok logging.
The only cases that lead to !is_ok are already EPHYR_LOG_ERROR, and it
fixes set-but-unused compiler warnings.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-08-21 09:10:48 -07:00
Eric Anholt
77c7a2014e kdrive: Fix const cast warnings in arguments processing.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-08-21 09:10:46 -07:00
Eric Anholt
7107937e47 kdrive: Fix const cast warnings in driver name handling.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-08-21 09:10:45 -07:00
Eric Anholt
56c405d46a kdrive: Fix a few easy cast warnings.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-08-21 09:10:44 -07:00
Eric Anholt
a9c48a07ee kdrive: Drop dead code.
This is unused as of the introduction of a helper in
e7150db535

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-08-21 09:10:41 -07:00
Eric Anholt
873ae962bd ephyr: Fix dead code warning.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-08-21 09:10:39 -07:00
Eric Anholt
34af2eebe1 ephyr: Fix const-cast warnings for setting window title.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-08-21 09:10:37 -07:00
Eric Anholt
7edf5066db ephyr: Fix const cast warnings in ephyrhostvideo.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-08-21 09:10:34 -07:00
Peter Hutterer
9680f6a12d xfree86: de-duplicate some AM_CPPFLAGS
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-06 13:14:56 +10:00
Peter Hutterer
bbef8e46f2 Replace INCLUDES with AM_CPPFLAGS
newer automake gets quite noisy about this.
hw/xfree86/ddc/Makefile.am:7: warning:
'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
and many more of these.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-06 13:08:13 +10:00
Julien Cristau
c218ba8423 xfree86: improve check for posix saved ids
Replace hardcoded SVR4 || linux || CSRG_BASED with an autoconf check and
the _POSIX_SAVED_IDS macro.

Suggested-by: Mark Kettenis <mark.kettenis@xs4all.nl>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-08-06 13:03:25 +10:00
Dave Airlie
e1ab8f239b xfree86/man: document AutoAddGPU
This at least mentions AutoAddGPU and hints at when you might
want to disable it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-08-01 14:45:56 +10:00
Aaron Plattner
bdd1e22cbd xfree86: detach scanout pixmaps when detaching output GPUs
Commit 8f4640bdb9 fixed a bit of a
chicken-and-egg problem by detaching GPU screens when their providers
are destroyed, which happens before CloseScreen is called.  However,
this created a new problem: the GPU screen tears down its RandR crtc
objects during CloseScreen and if one of them is active, it tries to
detach the scanout pixmap then.  This crashes because
RRCrtcDetachScanoutPixmap tries to get the master screen's screen
pixmap, but crtc->pScreen->current_master is already NULL at that
point.

It doesn't make sense for an unbound GPU screen to still be scanning
out its former master screen's pixmap, so detach them first when the
provider is destroyed.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-07-25 11:15:53 -07:00
Jon TURNEY
43ac0491e3 hw/xwin: Fix numerous 64-bit format/type cast issues with debug printing of pointers
Numerous pieces of debug output cast a pointer to an int and then use a "%08x"
printf format.

Use "%p" format for 64-bit portability.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:44 +01:00
Colin Harrison
e95bb97073 hw/xwin: Fix possible crash in winMultiWindowGetClassHint
Fix a possible crash in winMultiWindowGetClassHint() when an application doesn't
null terminate the WM_CLASS property class name (which is an ICCCM conformance
bug in the application)

(Reported for running the contiki cooja simulator in multiwindow mode, although
it seems that many Java clients may have this problem, see [1])

Based on a patch by Marc Haesen.

v2: Avoid using strnlen() which is missing on MinGW
v3: Align with Xming patch

[1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6961123

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2013-07-23 23:59:41 +01:00
Jon TURNEY
4bc375aa2f hw/xwin: Remove obsolete WIN_XEVENTS_SHUTDOWN
Remove obsolete WIN_XEVENTS_SHUTDOWN.  This event is never generated.

(I think the idea was to listen for WM_DELETE_WINDOW, but that's not a very
useful thing to do for a hidden window.)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:37 +01:00
Jon TURNEY
2663203cd6 configure.ac: Check for python at configure time when building XWin with AIGLX
Check for python at configure time when building XWin with AIGLX, it's used to
generate the wrapper code for native GL functions.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:34 +01:00
Jon TURNEY
9fe360bf2b hw/xwin: Avoid a null dereference if CreateDIBSection() fails in NetWMToWinIconAlpha()
Avoid a null dereference of DIB_pixels if CreateDIBSection() fails in
NetWMToWinIconAlpha()

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:31 +01:00
Jon TURNEY
71b5f56302 hw/xwin: Handle WM_MOUSEHWHEEL
Handle WM_MOUSEHWHEEL tilt wheel messages, similarly to WM_MOUSEWHEEL scroll
wheel messages, to generate X button 6 and 7 presses and releases.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:27 +01:00
Jon TURNEY
cf9c777ee0 hw/xwin: Map extra mouse buttons 1 and 2 to X buttons 8 and 9
Map extra mouse buttons 1 and 2 to X buttons 8 and 9, as conventional, leaving X
buttons 6 and 7 for tilt wheel.

Also add button labels for buttons 6, 7, 8 and 9 and change btn_labels in from a
dynamic allocation to a fixed one of the required size for all the labels we
use.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:24 +01:00
Jon TURNEY
c9d7b9516f hw/xwin: Remove unneeded WM_XBUTTON message defines
Remove unneeded WM_XBUTTON message defines, they have been provided by w32api
for a long time now.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:21 +01:00
Jon TURNEY
5dccfc63f9 hw/xwin: Change winTranslateKey() to return it's result as it's return value
Change winTranslateKey() to return it's result as it's return value, and change
it's uses as well.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:18 +01:00
Oliver Schmidt
9b4cec76f1 hw/xwin: Consider left and right modifier keys independently on gaining focus
Handle left and right ctrl and shift keys independently

Assume that all modifiers are cleared when all keys are released on focus lost,
as internalKeyState doesn't record which modifier key was pressed.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:14 +01:00
Jon TURNEY
235149d0b4 hw/xwin: Remove an extra '\n' from some log messages
Remove an extra '\n' from internal client IOError log messages

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:11 +01:00
Jon TURNEY
c7aa9f7578 hw/xwin: _NET_WM_STATE is ATOM[] not ATOM
_NET_WM_STATE is ATOM[] not ATOM, a list of window state hints, so check all of
the atoms, not just the first one

See EWMH specifcation, section "Application Window Properties"

v2: Actually use [] on the returned atom data

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:08 +01:00
Jon TURNEY
682ccac90b hw/xwin: Improve WM_ENDSESSION handling using separate messaging window thread
Currently, WM_ENDSESSION just calls GiveUp() to set the DE_TERMINATE flag. But
for the X server to exit cleanly, we also need the X server dispatch loop to be
unblocked so it can notice that DE_TERMINATE has been set and exit, removing
it's lock file and any unix domain socket.

It appears that the system will terminate the process when the last UI thread in
that process returns from processing WM_ENDSESSION for the last top-level
window.

Since WM_ENDSESSION appears to sent by the system via SendMessage()
(synchronously) and the wndproc is called to process it in the message thread
for that window (the X server thread), we can't easily terminate the X server
dispatch loop from inside the WM_ENDSESSION message processing.

So, create a messaging window, a hidden, top-level window, with a separate
thread to catch this message, and process it by calling GiveUp() and then
blocking on a mutex until the X server dispatch loop exits.

Also, notice when this is a shutdown cancel WM_ENDSESSION message and take no
action.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:58:50 +01:00
Jon TURNEY
15febb05d7 Allow DDX to provide a main()
XQuartz already conditionally renames main() as dix_main() so it can provide
it's own main().  This isn't the ideal way of doing this, as it prevents libdix
built this way from being useful with any other DDX.

So instead, always name that function dix_main(), and also provide a stub main()
which just calls dix_main(), which can be overriden in the DDX.

Add a main() to XWin (XQuartz already has one, of course).

It's no longer neccessary to link XWin and XQuartz with libmain.

v2: Remove unneeded stub main hw/xwin/InitOutput.c

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:56:58 +01:00
Keith Packard
d5ebe20f9b Merge remote-tracking branch 'alanc/master' 2013-07-22 20:34:41 -07:00
Peter Hutterer
21ea7ebb6a dix: scale y back instead of x up when pre-scaling coordinates
The peculiar way we handle coordinates results in relative coordinates on
absolute devices being added to the last value, then that value is mapped to
the screen (taking the device dimensions into account). From that mapped
value we get the final coordinates, both screen and device coordinates.

To avoid uneven scaling on relative coordinates, they are pre-scaled by
screen ratio:resolution:device ratio factor before being mapped. This
ensures that a circle drawn on the device is a circle on the screen.

Previously, we used the ratio to scale x up. Synaptics already does its own
scaling based on the resolution and that is done by scaling y down by the
ratio. So we can remove the code from the driver and get approximately the
same behaviour here.

Minor ABI bump, so we can remove this from synaptics.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Emmanuel Benisty <benisty.e@gmail.com>
2013-07-22 14:18:30 +10:00
Thomas Klausner
33f7e60785 Fix typo in header guard.
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-17 18:11:41 -07:00
Alan Coopersmith
ddc52b9cba Xephyr: Use _XEatDataWords (from Xlib 1.6) instead of _XEatData
Simplifies code and reduces risk of overflow from converting length
field in X replies from words to bytes.

One call to _XEatData is left in ephyrHostGLXGetStringFromServer where
it's already been checked for overflow, and other values have been
subtracted from it to reduce the size of data remaining to be eaten.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-17 18:10:41 -07:00
Alan Coopersmith
a3d43edf71 glxproxy: Use _XEatDataWords (from Xlib 1.6) instead of _XEatData
Reduces risk of overflow from converting length field in X replies
from words to bytes.   (Also seems to be what several calls were
already incorrectly passing to _XEatData.)

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-17 18:10:41 -07:00
Alan Coopersmith
87b0cabc14 glxproxy: Use _XReadPad instead of _XEatData to clean up the slop
Xlib already provides a function to eat padding bytes after the
data read, so use it instead of calculating it ourselves.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-17 18:10:41 -07:00
Alan Coopersmith
1cb182cbdc Xephyr: integer overflow in XF86DRIGetClientDriverName()
clientDriverNameLength is a CARD32 and needs to be bounds checked before
adding one to it to come up with the total size to allocate, to avoid
integer overflow leading to underallocation and writing data from the
network past the end of the allocated buffer.

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-07-17 18:10:40 -07:00
Alan Coopersmith
20644e53b3 Xephyr: integer overflow in XF86DRIOpenConnection()
busIdStringLength is a CARD32 and needs to be bounds checked before adding
one to it to come up with the total size to allocate, to avoid integer
overflow leading to underallocation and writing data from the network past
the end of the allocated buffer.

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-07-17 18:10:40 -07:00
Alan Coopersmith
c37ceda76b Xephyr: integer overflow in ephyrHostGLXGetStringFromServer()
reply.length & reply.size are CARD32s and need to be bounds checked before
multiplying or adding to come up with the total size to allocate, to avoid
integer overflow leading to underallocation and writing data from the
network past the end of the allocated buffer.

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-17 18:10:40 -07:00
Alan Coopersmith
5fbd8c45b4 Xdmx: integer overflow in GetGLXFBConfigs()
numFBConfigs & numAttribs are CARD32s and need to be bounds checked before
multiplying by structure sizes to come up with the total size to allocate,
to avoid integer overflow leading to underallocation and writing data from
the network past the end of the allocated buffer.

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-17 18:10:40 -07:00
Alan Coopersmith
c89bcd12f4 Xdmx: integer overflow in GetGLXVisualConfigs()
numVisuals & numProps are both CARD32 and need to be bounds checked before
multiplying by structure sizes to come up with the total size to allocate,
to avoid integer overflow leading to underallocation and writing data from
the network past the end of the allocated buffer.

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-17 18:10:40 -07:00
Peter Hutterer
74469895e3 dix: allow a ConstantDeceleration between 0 and 1 (#66134)
A constant deceleration of x simply means (delta * 1/x). We limited that to
values >= 1.0f for obvious reasons, but can also allow values from 0-1.
That means that ConstantDeceleration is actually a ConstantAcceleration, but
hey, if someone needs it...

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-07-17 14:27:26 +10:00
François Tigeot
791121e006 Fix mouse header include on DragonFly and FreeBSD
*  __FreeBSD_kernel_version doesn't exist anymore

* The removed check was for FreeBSD versions from before September 2000
  which are no longer supported anyway

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

Signed-off-by: François Tigeot <ftigeot@wolfpond.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-07-17 14:27:26 +10:00
Eric Anholt
77e51d5bbb Revert "DRI2: re-allocate DRI2 drawable if pixmap serial changes"
This reverts commit 3209b094a3.  After a
long debug session by Paul Berry, it appears that this was the commit
that has been producing sporadic failures in piglit front buffer
rendering tests for the last several years.

GetBuffers may return fresh buffers with invalid contents at a couple
reasonable times:

- When first asked for a non-fake-front buffer.
- When the drawable size is changed, an Invalidate has been sent, and
  obviously the app needs to redraw the whole buffer.
- After a glXSwapBuffers(), GL allows the backbuffer to be undefined,
  and an Invalidate was sent to tell the GL that it should grab these
  appropriate new buffers to avoid stalling.

But with the patch being reverted, GetBuffers would also return fresh
invalid buffers when the drawable serial number changed, which is
approximately "whenever, for any reason".  The app is not expecting
invalid buffer contents "whenever", nor is it valid.  Because the GL
usually only GetBuffers after an Invalidate is sent, and the new
buffer allocation only happened during a GetBuffers, most apps saw no
problems.  But apps that do (fake-)frontbuffer rendering do frequently
ask the server for the front buffer (since we drop the fake front
allocation when we're not doing front buffer rendering), and if the
drawable serial got bumped midway through a draw, the server would
pointlessly ditch the front *and* backbuffer full of important
drawing, resulting in bad rendering.

The patch was originally to fix bugzilla:
https://bugs.freedesktop.org/show_bug.cgi?id=28365
Specifically:

    To reproduce, start with a large-ish display (i.e. 1680x1050 on my
    laptop), use the patched glxgears from bug 28252 to add the
    -override option.  Then run glxgears -override -geometry 640x480
    to create a 640x480 window in the top left corner, which will work
    fine.  Next, run xrandr -s 640x480 and watch the fireworks.

I've tested with an override-redirect glxgears, both with vblank sync
enabled and disabled, both with gnome-shell and no window manager at
all, before and after this patch.  The only problem observed was that
before and after the revert, sometimes when alt-tabbing to kill my
gears after completing the test gnome-shell would get confused about
override-redirectness of the glxgears window (according to a log
message) and apparently not bother doing any further compositing.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-06-18 10:54:22 -07:00
Jon TURNEY
80054fcafb hw/xwin: Update manifest to target all architectures, not just x86
Update manifest to target all architectures, not just x86

Also: Write explicit dependencies for Xwin.rc.  XWin.exe.manifest and X.ico are
included the resource compiler output, so add a dependency on them to cause it
to be recompiled if they change.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-06-10 15:48:34 +01:00
Jon TURNEY
689e7ad9b0 hw/xwin: Win32 Windows properties are of pointer type HANDLE, not an integer type
Win32 Windows properties are of pointer type HANDLE, not an integer type, but we
use the Windows property WINDOW_WID_PROP to store the X window XID.

Add appropriate casts to show it doesn't matter that an XID is smaller than a
pointer on 64-bit build.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-06-10 15:48:31 +01:00
Jon TURNEY
e1a0945e8d hw/xwin: winMultiWindowGetTransientFor() returns an XID not a WindowPtr
winMultiWindowGetTransientFor() accesses the WM_TRANSIENT_FOR property, which is
an X window XID (which we compare with WINDOW_WID_PROP) and not a WindowPtr.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-06-10 15:48:08 +01:00
Jon TURNEY
be201ac257 hw/xwin: Change winIconIsOverride() to take a HICON parameter
Change winIconIsOverride() to take a HICON parameter, so some unneccessary
casts, which weren't portable to 64-bit Cygwin, can be removed.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-06-10 15:25:44 +01:00
Jon TURNEY
fc40f9a92c hw/xwin: Fix uses of CreateDialogParam() for 64-bit builds
Fix uses of CreateDialogParam() to be more strictly correct, for 64-bit builds

dwInitParam parameter is LPARAM, not int
Return type of DLGPROC is INT_PTR, not WINBOOL

Also: Reporting the value of g_hDlgDepthChange is completely uninteresting, we
are just interested in GetLastError() if it is NULL

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-06-10 15:21:14 +01:00
Jon TURNEY
b542976846 hw/xwin: deprecated interface cygwin_conv_to_win32_path() doesn't exist in 64-bit cygwin
The deprecated interface cygwin_conv_to_win32_path() doesn't exist in 64-bit
cygwin, but both the ID_ABOUT_CHANGELOG control and the referenced file who's
path we are converting haven't existed for a while, so just remove this unused,
cygwin-specific code.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-06-10 15:18:26 +01:00
Jon TURNEY
5a47c6420c hw/xwin: Fix a 64-bit portability issue with casting HINSTANCE result of ShellExecute() to an integer
Fix a 64-bit portability issue with casting HINSTANCE result of ShellExecute()
to an integer: Since HINSTANCE is a pointer type, use INT_PTR rather than int.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-06-10 15:15:44 +01:00
Keith Packard
c76a1b343d Merge remote-tracking branch 'whot/touch-grab-race-condition-56578-v3' 2013-05-23 19:58:36 -06:00
Peter Hutterer
9a5ad65330 Abstract cursor refcounting
Too many callers relied on the refcnt being handled correctly. Use a simple
wrapper to handle that case.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-05-15 19:17:57 +10:00
Peter Hutterer
49521edaf8 ephyr: add -resizeable to the man page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-05-15 09:36:00 +10:00
Peter Hutterer
7a4bbfd9f2 ephyr: fix typo in man page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-05-15 09:35:59 +10:00
Keith Packard
2746c68163 Merge remote-tracking branch 'alanc/master' 2013-05-06 10:52:40 -07:00
Keith Packard
1e6cf8ec20 Merge remote-tracking branch 'jturney/unused-but-set-variable-warning-fix' 2013-05-06 10:20:21 -07:00
Aaron Plattner
dbfeaf7062 xfree86: don't enable anything in xf86InitialConfiguration for GPU screens
There's no point in turning on outputs connected to GPU screens during initial
configuration.  Not only does this cause them to just display black, it also
confuses clients when these screens are attached to a master screen and RandR
reports that the outputs are already on.

Also, don't print the warning about no outputs being found on GPU screens,
since that's expected.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@gmail.com>
2013-05-06 09:34:27 +10:00
Jon TURNEY
5860408a19 hw/xwin: Fix unused-but-set-variable warning in ProcWindowsWMFrameGetRect()
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindowswm.c: In function ‘ProcWindowsWMFrameGetRect’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindowswm.c:322:12: error: variable ‘ir’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:29 +01:00
Jon TURNEY
bcfd523c15 hw/xwin: Fix unused-but-set-variable warning in winMWExtWMUpdateWindowDecoration()
/jhbuild/checkout/xorg/xserver/hw/xwin/winwin32rootlesswindow.c: In function ‘winMWExtWMUpdateWindowDecoration’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winwin32rootlesswindow.c:189:11: error: variable ‘dwStyle’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:27 +01:00
Jon TURNEY
fbf819c24d hw/xwin: Fix unused-but-set-variable warning in winHotKeyAltTabPrimaryDD()
/jhbuild/checkout/xorg/xserver/hw/xwin/winpfbdd.c: In function ‘winHotKeyAltTabPrimaryDD’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winpfbdd.c:518:20: error: variable ‘rcSrc’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:25 +01:00
Jon TURNEY
7dae1e59ce hw/xwin: Fix unused-but-set-variable warning in winMinimizeWindow() when built !XWIN_MULTIWINDOWEXTWM
/jhbuild/checkout/xorg/xserver/hw/xwin/winmultiwindowwindow.c: In function ‘winMinimizeWindow’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winmultiwindowwindow.c:813:20: error: variable ‘pScreenInfo’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:23 +01:00
Jon TURNEY
b284666f09 hw/xwin: Fix unused-but-set-variable warning in winClipboardProc()
/jhbuild/checkout/xorg/xserver/hw/xwin/winclipboardthread.c: In function ‘winClipboardProc’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winclipboardthread.c:88:25: error: variable ‘atomClipboardManager’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:22 +01:00
Jon TURNEY
d414a09bb7 hw/xwin: Fix unused-but-set-variable warning in winWindowProc()
/jhbuild/checkout/xorg/xserver/hw/xwin/winwndproc.c: In function ‘winWindowProc’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winwndproc.c:65:22: error: variable ‘s_hInstance’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:20 +01:00
Jon TURNEY
7726102671 hw/xwin: Fix unused-but-set-variable warning in winCopyWindowNativeGDI()
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindow.c: In function ‘winCopyWindowNativeGDI’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindow.c:131:15: error: variable ‘pwinRoot’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:18 +01:00
Jon TURNEY
b9a2566a6e hw/xwin: Fix unused-but-set-variable warning in winFinishScreenInitFB()
/jhbuild/checkout/xorg/xserver/hw/xwin/winscrinit.c:264:11: error: variable ‘pbits’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:16 +01:00
Jon TURNEY
c97fbd39ad hw/xwin: Fix unused-but-set-variable warning in winIsFakeCtrl_L()
/jhbuild/checkout/xorg/xserver/hw/xwin/winkeybd.c:331:17: error: variable ‘lastMessage’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:14 +01:00
Jon TURNEY
cdb74fe17d hw/xwin: Fix unused-but-set-variable warnings in windialog.c
/jhbuild/checkout/xorg/xserver/hw/xwin/windialogs.c: In function ‘winChangeDepthDlgProc’:
/jhbuild/checkout/xorg/xserver/hw/xwin/windialogs.c:432:22: error: variable ‘s_pScreen’ set but not used [-Werror=unused-but-set-variable]
/jhbuild/checkout/xorg/xserver/hw/xwin/windialogs.c: In function ‘winAboutDlgProc’:
/jhbuild/checkout/xorg/xserver/hw/xwin/windialogs.c:564:22: error: variable ‘s_pScreen’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:12 +01:00
Dave Airlie
f2fd8ec372 gpu: call CreateScreenResources for GPU screens
I didn't think we needed this before, but after doing some more
work with reverse optimus it seems like it should be called.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-04-30 10:10:51 +10:00
Dave Airlie
16077b81c5 xf86crtc: don't use scrn->display for gpu screens
scrn->display is a property of the main screen really, and we don't
want to have the GPU screens use it for anything when picking modes
or a front buffer size.

This fixes a bug where when you plugged a display link device, it
would try and allocate a screen the same size as the current running
one (3360x1050 in this case), which was too big for the device. Avoid
doing this and just pick sizes based on whats plugged into this device.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-04-30 10:10:23 +10:00
Dave Airlie
9d26e8eaf5 randr: report changes when we disconnect a GPU slave
When we disconnect an output/offload slave set the changed bits,
so a later TellChanged can do something.

Then when we remove a GPU slave device, sent change notification
to the protocol screen.

This allows hot unplugged USB devices to disappear in clients.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-04-30 10:08:43 +10:00
Chris Wilson
451ba4bd41 hw/xfree86: Only report SetDesiredModes() failed if at least one modeset fails
commit 6703a7c7cf
Author: Keith Packard <keithp@keithp.com>
Date:   Tue Jan 8 20:24:32 2013 -0800

    hw/xfree86: Require only one working CRTC to start the server.

changed the logic to try to set the mode on all connected outputs rather
than abort upon the first failure. The return error code was then
tweaked such that it reported success if it set a mode on any crtc.
However, this confuses the headless case where we never enable any crtcs
and also, importantly, never fail to set a crtc.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59190

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Also-written-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-04-29 09:10:06 -07:00
Alan Coopersmith
9878e097a7 Only call xf86platformVTProbe() when it's defined
Fixes build on non-udev systems, since XSERVER_PLATFORM_BUS is only
defined in configure.ac if $CONFIG_UDEV_KMS is true.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2013-04-25 21:44:09 -07:00
Alan Coopersmith
2b361fbda5 sparcPromPathname2Node: free name when returning error, instead of leaking it
Reported with other leaks found by cppcheck in bugzilla #50281
https://bugs.freedesktop.org/show_bug.cgi?id=50281

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-04-24 14:22:36 -07:00
Alan Coopersmith
174ccd8493 xf86SbusCmapLoadPalette: Delay malloc until needed, avoiding leak on error
Reported with other leaks found by cppcheck in bugzilla #50281
https://bugs.freedesktop.org/show_bug.cgi?id=50281

V2: check for malloc failure

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-04-24 14:22:36 -07:00
Alan Coopersmith
6bca0184d1 dmxVDLRead: if we opened a file, close it instead of leaking it
Reported with other leaks found by cppcheck in bugzilla #50281
https://bugs.freedesktop.org/show_bug.cgi?id=50281

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-04-24 14:22:36 -07:00
Keith Packard
7ab98bafc9 Merge remote-tracking branch 'geertu/master' 2013-04-24 14:14:45 -07:00
Keith Packard
53da26afb7 Merge remote-tracking branch 'whot/for-keith' 2013-04-24 10:27:19 -07:00
Keith Packard
5ece86e921 Merge remote-tracking branch 'airlied/for-keithp-gpu-vt-owner' 2013-04-24 10:23:51 -07:00
Jeremy White
ef0a726bc8 Eliminate the use of xf86Rename.h
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-04-24 10:22:20 -07:00
Geert Uytterhoeven
5ab260317a Xfbdev: Wire up Amiga afb4 and afb8 support
Add support for Amiga-style bitplanes, with 4 or 8 bits per pixel.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Keith Packard <keithp@keithp.com>
2013-04-18 13:10:26 +02:00
Geert Uytterhoeven
672bc5bb38 Xfbdev: Wire up Atari iplan2p4 and iplan2p8 support
Add support for Atari-style interleaved bitplanes, with 2 bytes interleave
and 4 or 8 bits per pixel.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-04-18 13:10:26 +02:00
Geert Uytterhoeven
95a3c7536c Xfbdev: Force shadowfb for frame buffers with non-packed pixels
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-04-18 13:10:26 +02:00
Geert Uytterhoeven
0e808110df Xfbdev: Reject unsupported frame buffer types
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-04-18 13:10:26 +02:00
Geert Uytterhoeven
4ee2566c3e Xfbdev: Treat 1 bpp pseudocolor as monochrome
miCreateDefColormap() only preallocates black and white pixels if
depth > 1.
Hence override the visual, so fbdevCreateColormap() takes care of it.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-04-18 13:10:25 +02:00
Geert Uytterhoeven
6dfb94a891 Xfbdev: Add support for monochrome visuals
Monochrome supports StaticGray, with hardcoded black and white pixels.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-04-18 13:10:25 +02:00
Geert Uytterhoeven
1049b32166 Xfbdev: Handle unset fix.line_length
Older frame buffer devices may not fill in fix.line_length, in which
case it must be calculated by the application.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2013-04-18 13:10:25 +02:00
Geert Uytterhoeven
5c509c360d Xfbdev: Make char *fbdevDevicePath const
This fixes:

hw/kdrive/fbdev/fbdev.c: In function 'fbdevInitialize':
hw/kdrive/fbdev/fbdev.c:41:25: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-04-18 13:10:25 +02:00
Geert Uytterhoeven
b08afbc53c KDrive: Bail out if screen initialization failed
Else we may get a segmentation fault later.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-04-18 13:10:25 +02:00
Dave Airlie
6ca03b9161 xf86: fix flush input to work with Linux evdev devices.
So when we VT switch back and attempt to flush the input devices,
we don't succeed because evdev won't return part of an event,
since we were only asking for 4 bytes, we'd only get -EINVAL back.

This could later cause events to be flushed that we shouldn't have
gotten.

This is a fix for CVE-2013-1940.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-04-17 14:56:00 +10:00
Bryce Harrington
d16284687d xfree86: Revert workaround for drm race condition.
Revert 70739e817b and mostly revert
c31eac647a.

Further investigation shows the encountered race condition is between
lightdm and plymouth-splash, as implemented in the Ubuntu distribution
within the limitations of upstart's job coordination logic, and can (and
should) be fixed within those limiations.  Not in xserver itself.

This leaves some of the diagnostic improvements from the recent patch
series, in case others run into a similar situation.

Signed-off-by: Bryce Harrington <bryce@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-04-12 10:03:29 +10:00
Peter Hutterer
131f883f85 xfree86: change a log message
This path is technically executed through config/udev, but having two
messages in the form "config/udev: Adding drm device" makes it appear as if
the udev filters are wrong and it's trying to add the same device twice. In
fact, it's only one device, only added once, but a duplicate log message.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2013-04-12 10:03:24 +10:00
Dave Airlie
22cab8a28a xf86: don't hotplug output devices while VT switched.
We don't want to hotplug output devices while we are VT switched,
as we get races between multiple X servers on the device open, and
drm device master status. This just queues device opens until we return
from VT switch.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-04-12 10:01:23 +10:00
Dave Airlie
5b359cf613 xf86: use new xf86VTOwner interface in a few places
This replaces some previous uses of direct xf86Screens[0] accesses.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-04-12 10:01:20 +10:00
Dave Airlie
d61ea1f64d xfree86: add VT owner interface
This is just a simple interface to avoid accessing x86Screens[0]
directly.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-04-12 09:58:34 +10:00
Jeremy White
ecf6275508 Define prototypes for hw/xfree86/modes/xf86Modes.c only in xf86Modes.h.
This removes a large number of redundant declaration warnings.

Signed-off-by: Jeremy White <jwhite@codeweavers.com>
Reviewed-by: Robert Morell <rmorell@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-04-08 09:19:34 -07:00
Bryce Harrington
e13f299842 xfree86: Be verbose if waiting on opening the drm device
Signed-off-by: Bryce Harrington <bryce@canonical.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-04-08 09:13:18 -07:00
Bryce Harrington
70739e817b xfree86: Fix race condition failure opening drm.
If other processes have had drm open previously, xserver may attempt to
open the device too early and fail, with xserver error exit "Cannot
run in framebuffer mode" or Xorg.0.log messages about "setversion 1.4
failed".

In this situation, we're receiving back -EACCES from libdrm.  To address
this we need to re-set ourselves as the drm master, and keep trying to
set the interface until it works (or until we give up).

See https://bugs.launchpad.net/ubuntu/+source/libdrm/+bug/982889

Signed-off-by: Bryce Harrington <bryce@canonical.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-04-08 09:13:12 -07:00
Bryce Harrington
c31eac647a xfree86: Keep trying to set interface on drm for 2 seconds.
And if we've had to delay booting due to not being able to set the
interface, fess up.

Signed-off-by: Bryce Harrington <bryce@canonical.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-04-08 09:13:05 -07:00
Bryce Harrington
d1cc210de8 xfree86: Provide more details on failure
Signed-off-by: Bryce Harrington <bryce@canonical.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-04-08 09:13:02 -07:00
Bryce Harrington
f059d0dabc xfree86: Track error code and add label for error handling.
Signed-off-by: Bryce Harrington <bryce@canonical.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-04-08 09:12:56 -07:00
Bryce Harrington
4d7052bd7b xfree86: (Cleanup) Close fd if drm interface 1.4 could not be set.
Signed-off-by: Bryce Harrington <bryce@canonical.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-04-08 09:12:53 -07:00
Geert Uytterhoeven
8928f8fa0b kdrive/fbdev: revive randr new screen size logic
hw/kdrive/fbdev/fbdev.c: In function 'fbdevRandRSetConfig':
hw/kdrive/fbdev/fbdev.c:470:19: warning: variable 'newheight' set but not used [-Wunused-but-set-variable]
hw/kdrive/fbdev/fbdev.c:470:9: warning: variable 'newwidth' set but not used [-Wunused-but-set-variable]

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-04-02 15:30:38 +10:00
Peter Hutterer
808c87bff7 Revert "kdrive: fix "set but not used" warnings"
Partial revert of commit 4149ee8ec0, better
fix coming up.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-04-02 15:30:37 +10:00
vdb@picaros.org
ac4c2abe98 xserver: add monitor Option "ZoomModes" [v2]
Section "Monitor"
  Identifier "a21inch"
  Option "PreferredMode" "1600x1200"
  Option "ZoomModes" "1600x1200 1280x1024 1280x1024 640x480"
EndSection

The option's effect is to search for and mark once each named mode in
the output modes list.  So the specification order is free and the zoom
modes sequence follows the order of the output modes list.  All marked
modes are available via the Ctrl+Alt+Keypad-{Plus,Minus} key
combination.

See also http://bugs.freedesktop.org/show_bug.cgi?id=17954.

This option has its use for combined monitor and television setups.
It allows for easy switching between 60 Hz and 50 Hz modes even when a
monitor refuses to display the input signal.

(Includes a few minor changes suggested by Aaron for v2)

Signed-off-by: Servaas Vandenberghe <vdb@picaros.org>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-03-26 13:53:06 -07:00
Keith Packard
116f020102 Merge remote-tracking branch 'whot/next' 2013-03-18 11:18:58 -07:00
Tomasz Lis
cf89aa5374 Full support of sRGB capable fbconfigs.
Changes to correctly initialize the sRGB capability attribute and
transfer it between XServer and the client. Modifications include
extension string, transferring visual config attribs and fbconfig
attribs. Also, attribute is initialized in the modules which do not
really use it (xquartz and xwin).
This version advertises both ARB and EXT strings, and initializes
the capability to default value of FALSE. It has corrected required
GLX version and does not influence swrast. The sRGB capable attribute
is attached only to those configs which do have this capability.
Both ARB and EXT versions share the same GLX extension enabling bit.

Signed-off-by: Tomasz Lis <tomasz.lis@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-03-18 10:02:00 -07:00
Peter Hutterer
eadda23109 xephyr: fix "set but not used warnings"
ephyrvideo.c: In function 'ephyrPutVideo':
ephyrvideo.c:1009:42: warning: variable 'drw_h' set but not used
ephyrvideo.c:1009:31: warning: variable 'drw_w' set but not used
ephyrvideo.c:1009:20: warning: variable 'drw_y' set but not used
ephyrvideo.c:1009:9: warning: variable 'drw_x' set but not used
ephyrvideo.c: In function 'ephyrGetVideo':
ephyrvideo.c:1058:42: warning: variable 'drw_h' set but not used
ephyrvideo.c:1058:31: warning: variable 'drw_w' set but not used
ephyrvideo.c:1058:20: warning: variable 'drw_y' set but not used
ephyrvideo.c:1058:9: warning: variable 'drw_x' set but not used
ephyrvideo.c: In function 'ephyrPutStill':
ephyrvideo.c:1107:42: warning: variable 'drw_h' set but not used
ephyrvideo.c:1107:31: warning: variable 'drw_w' set but not used
ephyrvideo.c:1107:20: warning: variable 'drw_y' set but not used
ephyrvideo.c:1107:9: warning: variable 'drw_x' set but not used
ephyrvideo.c: In function 'ephyrGetStill':
ephyrvideo.c:1156:42: warning: variable 'drw_h' set but not used
ephyrvideo.c:1156:31: warning: variable 'drw_w' set but not used
ephyrvideo.c:1156:20: warning: variable 'drw_y' set but not used
ephyrvideo.c:1156:9: warning: variable 'drw_x' set but not used

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Robert Morell <rmorell@nvidia.com>
2013-03-06 10:19:32 +10:00
Peter Hutterer
4149ee8ec0 kdrive: fix "set but not used" warnings
kinput.c: In function 'KdEnqueueKeyboardEvent':
kinput.c:1845:16: warning: variable 'ctrl' set but not used
kinput.c:1844:17: warning: variable 'keyc' set but not used

kinput.c: In function 'KdEnqueuePointerEvent':
kinput.c:1887:12: warning: variable 'ms' set but not used

kxv.c: In function 'KdXVDisable':
kxv.c:1181:19: warning: variable 'ScreenPriv' set but not used

mouse.c: In function 'ps2SkipInit':
mouse.c:444:9: warning: variable 'skipping' set but not used
mouse.c: In function 'ps2Init':
mouse.c:473:10: warning: variable 'waiting' set but not used
mouse.c:472:9: warning: variable 'skipping' set but not used

fbdev.c: In function 'fbdevRandRSetConfig':
fbdev.c:468:19: warning: variable 'newheight' set but not used
fbdev.c:468:9: warning: variable 'newwidth' set but not used

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Robert Morell <rmorell@nvidia.com>
2013-03-06 10:19:27 +10:00
Aaron Plattner
6238bd68bd DPMS: include GPU screens in DPMS code
Otherwise, displays driven by GPU screens remain on all the time.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-03-05 13:55:49 -08:00
Daniel Martin
bd58ebe4cf ephyr: Fix crash on 24bpp host framebuffer
Use bytes_per_line and bits_per_pixel from the created XImage to fix
    https://bugzilla.redhat.com/show_bug.cgi?id=518960

Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-03-04 10:01:08 +10:00
Dave Airlie
8f4640bdb9 randr: cleanup provider properly
So in the cold plug server shutdown case, we reap the resources
before we call CloseScreen handlers, so the config->randr_provider
is a dangling pointer when the xf86CrtcCloseScreen handler is called,

however in the hot screen unplug case, we can't rely on automatically
reaped resources, so we need to clean up the provider in the xf86CrtcCloseScreen
case.

This patch provides a cleanup callback from the randr provider removal
into the DDX so it can cleanup properly, this then gets called by the automatic
code for cold plug, or if hot unplug it gets called explicitly.

Fixes a number of random server crashes on shutdown
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58174
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=891140

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-03-01 18:14:28 +10:00
Dave Airlie
3ec35c45ca xf86: actually set the compat output in the failure case
The previous fix for the previous fix, didn't fully work,

If we don't set compat_output we end up doing derferences
of arrays with -1, leading to valgrind warnings.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-03-01 18:14:28 +10:00
Dave Airlie
da8ee26023 xfree86/hotplug: cleanup properly if the screen fails to initialise
Due to another bug, the modesetting/udl driver would fail to init properly
on hotplug, when it did the code didn't clean up properly, and on removing
the device the server could crash.

Found in F18 testing.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2013-03-01 18:14:27 +10:00
Daniel Martin
3aac7a59dc ephyr: Add -resizeable option
With this option passed, ephyr windows can be resized like normal
windows on the fly, without the need of an explicit parent window.

Signed-off-by: Daniel Martin <daniel.martin@secunet.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-02-18 16:26:15 +10:00
Peter Hutterer
88517ced1f Merge branch 'master' of git+ssh://people.freedesktop.org/~alanc/xserver into next 2013-02-15 11:58:52 +10:00
Peter Hutterer
82425c66e7 xfree86: remove redundant declaration of inputInfo
xf86Cursor.c:19:18: warning: redundant redeclaration of 'inputInfo'
[-Wredundant-decls]
In file included from xf86Cursor.c:18:0:
../../../include/inputstr.h:614:57: note: previous declaration of
'inputInfo' was here

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2013-02-15 11:58:45 +10:00
Peter Hutterer
858d8b19b3 xfree86: drop unused prevSIGIO
Unused as of 5d309af2ed

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2013-02-15 11:58:20 +10:00
Jeremy Huddleston Sequoia
67eaf4b46f XQuartz: Ensure <dix-config.h> is included in capabilities.c
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-02-14 09:20:46 -08:00
Aaron Plattner
da92690107 xf86: use nt_list_for_each_entry_safe to walk InputHandlers in xf86Wakeup
This is necessary when the input handler deletes itself from the
list. Bug found by Maarten Lankhorst, this patch uses the list macros
instead of open-coding the fix.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-02-11 20:25:32 -08:00
Bryce Harrington
d0a1487787 xfree86: Man page shouldn't say Device is mandatory anymore
man xorg.conf states that the 'Device' identifier is required in the
'Screen' section, yet current xserver defaults properly and boots up
fine without it.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=20742
Signed-off-by: Bryce Harrington <bryce@canonical.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-02-11 13:49:51 -08:00
Bryce Harrington
5e91054aa0 xfree86: Use fbdev/vesa driver on Oaktrail, Medfield, CDV rather than -intel
Instead of defaulting to -intel for Oaktrail, Medfield, and CDV chips,
default to -fbdev.  For Poulsbo (only), attempt to use -psb if it's
installed, and fallback to fbdev otherwise.  All other Intel chips
should use -intel.

This fixed an issue where -intel would load on these chips and cause a
boot failure.  Newer -intel drivers avoid the boot hang, but it's still
the wrong driver to load, so why take chances.

The patch was originally created by Stefan Dirsch for OpenSUSE.  We have
included it in our stable release (Ubuntu "quantal" 12.10) since
December.

ref:  https://bugzilla.novell.com/show_bug.cgi?id=772279
ref:  https://bugs.launchpad.net/ubuntu/+bug/1069031
Fixes:  https://bugs.freedesktop.org/show_bug.cgi?id=60514
Signed-off-by: Bryce Harrington <bryce@canonical.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-02-11 13:49:45 -08:00
Peter Hutterer
9f79e93b6b Short-cut the input device cleanup process during AbortServer()
If we're about to abort, we're already in the signal handler and cannot call
down to the default device cleanup routines (which reset, free, alloc, and
do a bunch of other things).

Add a new DEVICE_ABORT mode to signal a driver's DeviceProc that it must
reset the hardware if needed but do nothing else. An actual HW reset is only
required for some drivers dealing with the HW directly.

This is largely backwards-compatible, hence the input ABI minor bump only.

Drivers we care about either return BadValue on a mode that's not
DEVICE_{INIT|ON|OFF|CLOSE} or print an error and return BadValue. Exception
here is vmmouse, which currently ignores it and would not reset anything.
This should be fixed if the reset is required.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-02-08 09:06:14 -08:00
Ted Felix
3d35dfcf5b xfree86: bail on misformed acpi strings (#73227)
If acpid sends a string in a format that we can't parse, bail out instead of
potentially dereferencing a NULL-pointer.

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

Signed-off-by: Ted Felix <ted@tedfelix.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-02-08 13:47:23 +10:00
Peter Hutterer
1058fcf57f dmx: don't include dmx-config.h from xdmxconfig (#37502)
dmx-config.h is a server header which includes dix-config.h. That again
defines a bunch of server-specifics, including setting the size of XID to
32 bit.

libX11 uses unsigned long (8 bits on x86_64). XGCValues thus ends up being
16 bytes smaller in xdmxconfig than in the library, causing garbage to be
sent to the server.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-02-08 13:47:17 +10:00
Alan Coopersmith
73974dd7ea Avoid memory leak in ddc resort() if find_header() fails
Call find_header first, returning on failure before calling malloc.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-02-05 18:35:03 -08:00
Alan Coopersmith
b1129a1f17 xf86XvMCScreenInit: Avoid leak if dixRegisterPrivateKey fails
Found by parfait 1.1 memory analyser:
   Memory leak of pointer 'pAdapt' allocated with malloc((88 * num_adaptors))
        at line 162 of hw/xfree86/common/xf86xvmc.c in function 'xf86XvMCScreenInit'.
          'pAdapt' allocated at line 158 with malloc((88 * num_adaptors)).

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-02-05 18:34:57 -08:00
Alan Coopersmith
563db909bc Avoid memory leak on realloc failure in localRegisterFreeBoxCallback
Also avoids leaving invalid pointers in structures if realloc had to
move them elsewhere to make them larger.

Found by parfait 1.1 code analyzer:
   Memory leak of pointer 'newCallbacks' allocated with realloc(((char*)offman->FreeBoxesUpdateCallback), (8 * (offman->NumCallbacks + 1)))
        at line 328 of hw/xfree86/common/xf86fbman.c in function 'localRegisterFreeBoxCallback'.
          'newCallbacks' allocated at line 320 with realloc(((char*)offman->FreeBoxesUpdateCallback), (8 * (offman->NumCallbacks + 1))).
          newCallbacks leaks when newCallbacks != NULL at line 327.
   Memory leak of pointer 'newPrivates' allocated with realloc(((char*)offman->devPrivates), (8 * (offman->NumCallbacks + 1)))
        at line 328 of hw/xfree86/common/xf86fbman.c in function 'localRegisterFreeBoxCallback'.
          'newPrivates' allocated at line 324 with realloc(((char*)offman->devPrivates), (8 * (offman->NumCallbacks + 1))).
          newPrivates leaks when newCallbacks == NULL at line 327.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-02-05 18:34:49 -08:00
Alan Coopersmith
08f75d3a96 Avoid NULL pointer dereference in xf86TokenToOptinfo if token not found
Reported by parfait 1.1 code analyzer:

Error: Null pointer dereference (CWE 476)
   Read from null pointer 'p'
        at line 746 of hw/xfree86/common/xf86Option.c in function 'xf86TokenToOptName'.
          Function 'xf86TokenToOptinfo' may return constant 'NULL' at line 721, called at line 745.
          Null pointer introduced at line 721 in function 'xf86TokenToOptinfo'.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-02-05 18:34:26 -08:00
Alan Coopersmith
c1c01e3508 Make xf86ValidateModes actually copy clock range list to screen pointer
Our in-house parfait 1.1 code analysis tool complained that every exit
path from xf86ValidateModes() in hw/xfree86/common/xf86Mode.c leaks the
storeClockRanges allocation made at line 1501 with XNFalloc.

Investigating, it seems that this code to copy the clock range list to
the clockRanges list in the screen pointer is just plain insane, and
according to git, has been since we first imported it from XFree86.

We start at line 1495 by walking the linked list from scrp->clockRanges
until we find the end.  But that was just a diversion, since we've found
the end and immediately forgotten it, and thus at 1499 we know that
storeClockRanges is NULL, but that's not a problem since we're going to
immediately overwrite that value as the first thing in the loop.

So we move on through this loop at 1499, which takes us through the
linked list from the clockRanges variable, and for every entry in
that list allocates a new structure and copies cp to it.  If we've
not filled in the screen's clockRanges pointer yet, we set it to
the first storeClockRanges we copied from cp.   Otherwise, as best
I can tell, we just drop it into memory and let it leak away, as
parfait warned.

And then we hit the loop action, which if we haven't hit the end of
the cp list, advances cp to the next item in the list, and then just
for the fun of it, also sets storeClockRanges to the ->next pointer it
has just copied from cp as well, even though it's going to overwrite
it as the very first instruction in the loop body.

v2: rewritten using nt_list_* macros from Xorg's list.h header

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-02-05 18:30:37 -08:00
Alan Coopersmith
89badba082 Free keymap on error in Xephyr's hostx_load_keymap
Found by parfait 1.1 code analyser:
   Memory leak of pointer 'keymap' allocated with XGetKeyboardMapping(HostX.dpy, min_keycode, ((max_keycode - min_keycode) + 1), &host_width)
        at line 861 of hw/kdrive/ephyr/hostx.c in function 'hostx_load_keymap'.
          'keymap' allocated at line 845 with XGetKeyboardMapping(HostX.dpy, min_keycode, ((max_keycode - min_keycode) + 1), &host_width).

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-02-05 18:30:31 -08:00
Keith Packard
069d8ed3eb Merge remote-tracking branch 'jturney/xserver-next' 2013-01-20 15:58:38 -08:00
Keith Packard
591c06277b Merge remote-tracking branch 'whot/for-keith' 2013-01-20 15:52:26 -08:00
Jon TURNEY
d6dcde7a03 hw/xwin: Stop assuming WS_EX_APPWINDOW style in WM_SHOWWINDOW
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-16 16:50:39 +00:00
Jon TURNEY
56e94403f8 hw/xwin: Use ITaskBarList interface to ensure show-on-taskbar state is updated correctly
Use ITaskBarList interface to ensure that the taskbar notices if the window has
changed it's style in a way which affects if the taskbar shows it or not.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-16 16:50:26 +00:00
Jon TURNEY
c94d1cb0a4 hw/xwin: Ensure full styling is applied when the window is mapped
Move styling update code from WM_WM_HINTS_EVENT to a function UpdateStyle(),
which is also invoked from WM_WM_MAP3, so everything which needs to be done
to style the window happens when it is mapped

(Otherwise, the appearance of the window is sensitive to the timing of the
notification of the windows appearance hint properties being set relative to
window creation. e.g. see [1])

[1] http://sourceware.org/ml/cygwin-xfree/2012-06/msg00004.html

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-16 16:50:20 +00:00
Jon TURNEY
ef61f8cacc hw/xwin: Make sure that WM_WM_HINTS_EVENT does nothing for override-redirect windows
Future work: It looks like this code could be rationalized quite a lot: It might
make sense to pull the checking for override-redirect up out of UpdateIcon() and
UpdateName() and consolidate WM_WM_MAP2 and WM_WM_MAP3

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-16 16:49:56 +00:00
Jon TURNEY
3628559e59 hw/xwin: Add a new WM_WM_HINTS_EVENT event to update window style
Add a new WM_WM_HINTS_EVENT event to update window style if any of the
properties which affect window style change

Check PropertyNotify events for any of the window properties which we consider
to decide on the window style, and update the window style by sending a
WM_WM_HINTS_EVENT message to the WM.

This allows the styling of the window to change during it's lifetime.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-16 16:49:50 +00:00
Jon TURNEY
066ecbd11d hw/xwin: Move reshape code from winUpdateWindowPosition() to the map event handler
Move reshape code, which was only used when handling a map event, from
winUpdateWindowPosition(), to put it explicitly in the map event handler.

Remove 'reshape' parameter from winUpdatePosition().

(Note that there's no handling of the ShapeNotify event to notice when the
window shape changes, instead we hook the screen SetShape procedure and reshape
the native window then)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-16 16:49:15 +00:00
Ryan Pavlik
852d1fb042 hw/xwin: Add missing include xwin-config.h to winglobals.h
winglobals.h checks if RELOCATE_PROJECTROOT is defined to see if a declaration
of g_fLogFileChanged is needed, so must include xwin-config.h

Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-16 16:49:07 +00:00
Peter Hutterer
f4a58469a2 xfree86: don't access the old input handler after freeing it
Introduced in 323869f329

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2013-01-11 14:57:48 +10:00
Dave Airlie
205cfbd6d9 xf86: bump input ABI version to 19
The changes to miPointerSetPosition interface from int->double breaks
the SIS driver build, so time to bump this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-01-11 14:57:48 +10:00
Peter Hutterer
ad3bc57134 xfree86: update the device state for all DGA events (#59100)
DGA only handles master devices but it does intercept slave device events as
well (since the event handlers are per event type, not per device).

The DGA code must thus call into UpdateDeviceState to reset the button/key
state on the slave device before it discards the remainder of the event.

Test case:
- Passive GrabModeSync on VCP
- Press button
- Enable DGA after ButtonPress
- AllowEvents(SyncPointer)
- Release button

The button release is handled by DGAProcessPointerEvent but the device state
is never updated, so the slave ends up with the button permanently down.
And since the master's button state is the union of the slave states, the
master has the button permanently down.

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

Reported-by: Steven Elliott <selliott4@austin.rr.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2013-01-11 14:57:40 +10:00
Peter Hutterer
c5f2818edb xfree86: set event->detail for DGA pointer events
Reported-by: Steven Elliott <selliott4@austin.rr.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2013-01-11 14:57:33 +10:00
Peter Hutterer
519d183d78 Fix two typos "requires an string value"
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-01-11 14:57:32 +10:00
Jon TURNEY
a2037d7080 hw/xwin: Fix MinGW build of winSetAppModelID.c
Add missing #include <pthread.h>

In file included from /jhbuild/checkout/xorg/xserver/hw/xwin/winSetAppUserModelID.c:31:0:
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindow.h:140:11: error: expected declaration specifiers or ‘...’ before ‘pthread_t’
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindow.h:141:11: error: expected declaration specifiers or ‘...’ before ‘pthread_t’
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindow.h:142:11: error: expected declaration specifiers or ‘...’ before ‘pthread_mutex_t’

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-10 15:33:13 +00:00
Jon TURNEY
f57100bb36 hw/xwin: Process one Windows message per wakeup, rather than all of them.
De-queuing Windows messages and X events happens in the same thread of
execution.  Draining the windows message queue can lead to the X event queue
overflowing if lots of those windows messages cause X events (e.g. if a keyboard
macro program has just dumped thousands of keypresses into the Windows message
queue).  See the mailing list thread [1] for more details.

Processing one Windows message per wakeup, rather than all of them gives the X
server a chance to do stuff as well after each message.

[1] http://cygwin.com/ml/cygwin-xfree/2010-01/msg00056.html

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-10 15:33:12 +00:00
Jon TURNEY
e30e1ea987 hw/xwin: Fix some comments in winkeybd.c
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-10 15:33:10 +00:00
Jon TURNEY
6f4a48f8a5 hw/xwin: Bring the X screen window to the front on a single left-click on the tray icon
Bring the X screen window to the front on a single left click on the tray icon,
like the comment says we do

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-10 15:33:08 +00:00
Keith Packard
6703a7c7cf hw/xfree86: Require only one working CRTC to start the server.
Instead of requiring every mode set to complete successfully, start up
as long as at least one CRTC is working. This avoids failures when one
or more CRTCs can't start due to mode setting conflicts.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2013-01-08 20:24:32 -08:00
Keith Packard
2a0b544f5c Merge remote-tracking branch 'jeremyhu/master' 2012-12-19 12:26:00 -08:00
Keith Packard
0eb1559eb2 Merge remote-tracking branch 'yselkowitz/master'
I checked this patch with diff -w to check that it only affected
whitespace.
2012-12-19 12:22:03 -08:00
Jeremy Huddleston Sequoia
ba4bb3bc1b XQuartz: Don't add the 15bit visual any more
Mountain Lion only supports 32bit backing stores, so don't use 15bit visuals until libXplugin adapts

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-12-18 01:37:27 -08:00
Jeremy Huddleston Sequoia
c298f9c42e XQuartz: Revert some unfortunate auto-indenting mishaps with our super-nested for-loops
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-12-18 01:30:34 -08:00
Rob Clark
07a91fa6c6 hw/dmx: fix build without GLX
Fixes this compile break that showed up on arm recently:

dmxinit.c:746:26: error: 'glxSupported' undeclared (first use in this function)
dmxinit.c:746:26: note: each undeclared identifier is reported only once for each function it appears in

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-18 00:03:59 -08:00
Peter Hutterer
3420a7778c xfree86: print message to the log when zapping the server
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-12-17 13:49:47 -08:00
Dave Airlie
6b4aa8a359 Revert "xf86: Fix non-PCI configuration-less setups"
This reverts commit 76d9c62eb2.

This breaks multi-GPU setups here, so lets drop it for now.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-12 12:56:46 +10:00
Dave Airlie
785af88ab0 dri1: fix dri1 startup since 459c6da0f9
This commit regresses dri1 since it moves the drmSetServerInfo from being
called at module load time to extension init time. However DRIScreenInit
relies on this being called before it gets control.

This patches moves the call into DRIScreenInit and seems to work here.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-12 12:56:35 +10:00
Yaakov Selkowitz
ea1d76d1b6 Fix formatting of address operators
The formatter confused address operators preceded by casts with
bitwise-and expressions, placing spaces on either side of both.
That syntax isn't used by ordinary address operators, however,
so fix them for consistency.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-05 18:09:48 -06:00
Sybren van Elderen
6e18599d69 hw/dmx: add update_desktop_dimensions() call
The Xdmx server did not update the desktop dimensions when computing screen
origins.

Signed-off-by: Sybren van Elderen <sowmestno@msn.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-29 14:48:54 +10:00
Keith Packard
1712a45422 Merge remote-tracking branch 'jturney/mingw-patches' 2012-11-28 07:54:13 -08:00
Yaakov Selkowitz
338bec3005 hw/xwin: Fix for MinGW-w64 DirectDraw headers
mingw-w64 headers handle NONAMELESSUNION earlier than mingw.org's, so it must be
defined before including any headers.  It also provides a ddraw.h, so use it.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Keith Packard <keithp@keithp.com>
2012-11-28 14:44:14 +00:00
Yaakov Selkowitz
2c712d094a hw/xwin: use raise() instead of kill()
MinGW doesn't have kill(), so use raise() instead

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Keith Packard <keithp@keithp.com>
2012-11-28 14:44:09 +00:00
Chris Wilson
e54f71a2c7 xf86: select a fake output for headless servers
Following commit 37d956e3ac
Author: Keith Packard <keithp@keithp.com>
Date:   Mon Sep 10 11:14:20 2012 +1000

    xf86: fix compat output selection for no output GPUs

headless servers can no longer startup as we no longer select a compat
output for the fake framebuffer.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56343
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-11-27 16:30:53 -08:00
Thierry Reding
76d9c62eb2 xf86: Fix non-PCI configuration-less setups
For non-PCI video devices, such as those found on many ARM embedded
systems, the X server currently requires the BusID option to specify the
full path to the DRM device's sysfs node in order to properly match it
against the probed platform devices.

In order to allow X to start up properly if either the BusID option was
omitted or no configuration is present at all, the first video device is
used by default.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-11-27 16:23:36 -08:00
Keith Packard
d50a94568e Merge remote-tracking branch 'daniels/master' 2012-11-27 15:14:26 -08:00
Colin Harrison
87b60efb85 hw/xwin: Don't spam MotionNotify events when the mouse hasn't moved
Don't spam MotionNotify events when the mouse hasn't moved, when polling the
mouse position outside any X window

(Test with 'xev -root' after mouse polling has started.)

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-11-27 16:26:37 +00:00
Jon TURNEY
886f4c3892 hw/xwin: Don't log all fbConfigs and GL/WGL extensions
Don't log all fbConfigs and GL/WGL extensions, unless verbose logging
is requested
Log the number of pixelFormats which gave rise to the fbConfigs

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 16:26:36 +00:00
Jon TURNEY
9b10f20f47 hw/xwin: Use pre-computed extent of damage for creating GDI region
When -clipupdates option is specified, use the pre-computed extent of damage,
rather than computing a GDI region which combines all the individual boxes in
the damage.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 16:26:34 +00:00
Jon TURNEY
3ab95a2a5c hw/xwin: Ensure we own the clipboard before checking the format of it's contents
Ensure we own the clipboard before checking the format of it's contents, this
prevents the contents from changing underneath us.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 16:26:33 +00:00
Colin Harrison
a4f357c620 hw/xwin: Disable minimize button on window with skip-taskbar state
If a window has had its taskbar button removed, disable its minimize
button to prevent it becoming lost

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-11-27 16:26:32 +00:00
Jon TURNEY
a2983452ee hw/xwin: Process _NET_WM_STATE_SKIP_TASKBAR hint in multiwindow mode.
Set WS_EX_TOOLWINDOW style to hide window from Alt-Tab switcher

Use ITaskBarList interface to ensure that the taskbar notices if the window has
changed it's style in a way which affects if the taskbar shows it or not

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 16:26:30 +00:00
Jon TURNEY
de759cc38c hw/xwin: Add a simple interface to the ITaskbarList COM interface
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 16:09:12 +00:00
Jon TURNEY
19d875187a hw/xwin: Enable RANDR resize by default
Also fix erroneous use of '--resize' not '-resize', and document '-noresize' in man page

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 16:09:11 +00:00
Yaakov Selkowitz
4445806732 hw/xwin: Enable AIGLX by default
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-11-27 16:09:09 +00:00
Oliver Schmidt
11bb32e561 hw/xwin: Restore non-latching modifier key state when an X window gains focus
In multiwindow mode, the state of the modifier keys was lost when a window is
created (or raised) and focus moved to that window.

For example: In window A Ctrl + some key opens a window B, then in window B Ctrl
+ some other key triggers the next action. However after the opening of window B
the Ctrl key has to be released and pressed again. If the user keeps the Ctrl
key held down when the window B is opened, the next key press X will be
interpreted as X and not as Ctrl+X.

Extended the function winRestoreModeKeyStates in winkeybd.c to consider not only
the latching modifier keys but also the modifiers Ctrl, Shift, Alt/AltGr by
using the Windows function GetAsyncKeyState.

A combined Ctrl+AltGr modifier state cannot be restored correctly, as Windows
always fakes a Ctrl-L when AltGr is pressed.

Signed-off-by: Oliver Schmidt <oschmidt-mailinglists@gmx.de>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 16:09:08 +00:00
Jon TURNEY
47291d0b7d hw/xwin: Give our logical xor operator a more logical name
Also, rather than a comment about why we need a logical operator, let's have a
comment about what we are doing to the keyboard state...

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 16:09:06 +00:00
Tobias Häußler
8aa27ae821 hw/xwin: Add correct taskbar grouping of X windows on Windows 7
I created a small patch for XWin that adds correct grouping of taskbar icons
when 'Always combine, hide labels' is set in the taskbar properties. It uses the
new taskbar APIs introduced in Windows 7 to set an application id for each
window. The id is based on the X11 class hints.

v2: Add file to _SOURCES to fix distcheck

v3 : Fix compilation with mingw-w64 w32api headers
Include propkey.h, propsys.h rather than defining necessary stuff ourselves

v4: Fix up names taskbar->propertystore, AppID->AppUserModelID, etc.
Link directly with ole32 for PropVariantClear(), prototyping it if neccessary.

v5: Put winSetAppUserModelID()-related code in a separate file.
Drop a superfluous assign to hr of ignored HRESULT of SetValue()

Signed-off-by: Tobias Häußler <tobias.haeussler@gmx.de>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 16:08:22 +00:00
Jon TURNEY
f3aef7f956 hw/xwin: Fix function name in log message
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 14:37:16 +00:00
Jon TURNEY
127a7068b7 hw/xwin: Allow XScreenSaverSuspend() to effect Windows screen saver or monitor power off
Reset the idle timer in the block handler if screenSaverSuspended is set.

This isn't quite a complete solution.  We should also set the block timeout to
something less than the idle timer timeout to ensure we will reset the idle
timer before it times out if we are blocking.

The idle timer timeout is presumably the first one to expire of the screen saver
activation or monitor low power or power down timeout, depending on
configuration.

Unfortunately this is probably not straightforward to do. Whilst
SystemParametersInfo(SPI_GETSCREENSAVETIMEOUT) is portable, apparently
SPI_GETLOWPOWERTIMEOUT and SPI_GETPOWEROFFTIMEOUT are not supported by Windows
versions 6.0 or later, and the interface for discovering equivalent value is
complex.

This doesn't matter in the case where a media player or similar application is
the one making the XScreenSaverSuspend() requests, as it will be continuously
drawing, causing the X server to become unblocked often.

In the case where slide show presentation application or similar is the one
making the XScreenSaverSuspend() request, this might be a problem.

Since "Powerpoint is Evil" [1], I think we'll leave it like this till someone
complains :-)

[1] http://www.edwardtufte.com/tufte/books_pp

v2: conditionalize on SCREENSAVER

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 14:37:00 +00:00
Jon TURNEY
190f165317 hw/xwin: Avoid logging an extra blank line if BUILDERSTRING is empty
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 13:49:34 +00:00
Jon TURNEY
ef9dbea24f hw/xwin: Report which drawing engines are being enabled when checking for support
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 13:49:11 +00:00
Jon TURNEY
5824166256 hw/xwin: Show any fatal error message
Report the fatal error message in the dialog we pop up, rather than just
referring the user to the logfile.

v2: Do this a better way since the "Pass the FatalError message to
OsVendorFatalError" patch has landed, and OsVendorFatalError() now gets passed
the fatal error message

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 13:48:44 +00:00
Sjoerd Simons
cf05db8dde Ephyr: Find the right host screen when embedded
When Xephyr is embedded into another application (e.g. in xoo), the
input events may come from the parent Window instead of our own. So make
sure we find the host screen in that case as well instead of crashing.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2012-11-21 11:13:55 +11:00