Commit Graph

7482 Commits

Author SHA1 Message Date
Keith Packard
6a5a4e6037 Remove SIGIO support for input [v5]
This removes all of the SIGIO handling support used for input
throughout the X server, preparing the way for using threads for input
handling instead.

Places calling OsBlockSIGIO and OsReleaseSIGIO are marked with calls
to stub functions input_lock/input_unlock so that we don't lose this
information.

xfree86 SIGIO support is reworked to use internal versions of
OsBlockSIGIO and OsReleaseSIGIO.

v2: Don't change locking order (Peter Hutterer)
v3: Comment weird && FALSE in xf86Helper.c
    Leave errno save/restore in xf86ReadInput
    Squash with stub adding patch (Peter Hutterer)
v4: Leave UseSIGIO config parameter so that
    existing config files don't break (Peter Hutterer)
v5: Split a couple of independent patch bits out
    of kinput.c (Peter Hutterer)

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-26 16:07:54 -07:00
Keith Packard
8cf832c288 kdrive: Remove unneeded AddEnabledDevice/RemoveEnabledDevice calls
kdrive uses the NotifyFd interface, which handles all of the necessary
fd configuration in the OS layer. Having it also use the old
EnableDevice interfaces is incorrect.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-26 16:07:54 -07:00
Adam Jackson
4fca18dc03 xfree86: Add IndirectGLX server flag (v2)
Not all display managers make it easy (or possible) to modify the
command line flags passed to the server, so add a way to get to it from
xorg.conf.

v2: Fix the FlagOptions list to not have IGLX after the terminator (Alan
Coopersmith)

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-05-26 14:00:11 -04:00
Keith Packard
f5670b4a7e xfree86: Set xf86CrtcConfigRec cursor pointer to NULL in HideCursor
This makes the cursor pointer held by xf86Cursors.c get reset to NULL
whenever the cursor isn't displayed, and means that the reference
count held in xf86Cursor.c is sufficient to cover the reference in
xf86Cursors.c.

As HideCursor may be called in the cursor loading path after
UseHWCursor or UseHWCursorARGB when HARDWARE_CURSOR_UPDATE_UNHIDDEN
isn't set in the Flags field, the setting of the cursor pointer had to
be moved to the LoadCursor paths.

LoadCursorARGBCheck gets the cursor pointer, but LoadCursorImageCheck
does not. For LoadCursorImageCheck, I added a new function,
xf86CurrentCursor, which returns the current cursor. With this new
function, we can eliminate the cursor pointer from the
xf86CrtcConfigRec, once drivers are converted over to use it.

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-26 09:13:20 -07:00
Keith Packard
3f9015b6dc xwayland: Move sprite invalidation logic into mipointer
This creates a function that invalidates the current sprite and forces
a sprite image reload the next time the sprite is checked, moving that
logic out of the xwayland sources and allowing the miPointerRec
structure to be removed from the server API.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-05-25 11:00:56 -04:00
Olivier Fourdan
984be789d5 xwayland: don't check events as early as InitInput
If data is received during XWayland startup, it will be read early in
InitInput() before the connection data is initialized, causing a crash.

Remove the wayland rountrips from InitInput() as this is done again in
xwl_screen_init() where it seems more appropriate.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95337
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-05-11 12:23:47 -04:00
Dave Airlie
7f0494671f modesetting: fix build with glamor disabled.
Fix build without --enable-glamor.

Caught by the arm tinderbox.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-06 08:59:45 +10:00
Emil Velikov
66fdeb880a xfree86: drop unneeded strdup for modulepath/logfile
The destination variable is never freed, thus we even plug some memory
leaks.

v2: Rebase against updated xf86CheckPrivs() helper.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-05-04 15:42:59 -04:00
Emil Velikov
032b1d79b7 xfree86: use the xf86CheckPrivs() helper for modulepath/logfile
v2: Rebase against updated xf86CheckPrivs() helper.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-05-04 15:42:58 -04:00
Emil Velikov
0fdd475604 xfree86: factor out the check priviliges and print a big warning
Current message was quite off "file specified must be a relative path"
and alike. Just factor it out and use "path/file" as needed.

v2: Rework error message, drop "Using default", print actual arg value.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-05-04 15:42:44 -04:00
Dave Airlie
2378adde67 modesetting: set capabilities up after glamor and enable offload caps.
This moves the capabilites setting to after glamor is initialised, and
enables the offload caps in cases where they work. This enables DRI2
PRIME support with modesetting.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-04 15:33:10 -04:00
Dave Airlie
258588224d xf86Crtc: don't set the root window property on slave GPUs.
Slave GPUs don't have a root window to set this on, so don't.

This fixes some crashes I saw just playing around.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-04 15:33:10 -04:00
Dave Airlie
a41a171bcb modesetting: set driverPrivate to NULL after closing fd.
Otherwise ms_ent_priv will return NULL and things will fall apart.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-04 15:33:10 -04:00
Alex Goins
2d0f151c61 modesetting: Consistent whitespace in driver.c
For some reason a couple of the dirty functions in driver.c used 8
spaces per tab instead of 4 like the rest of the file. Fix this to make
it more consistent and give me more room to work in ms_dirty_update in
subsequent commits.

v1: N/A
v2: N/A
v3: N/A
v4: Initial commit

Signed-off-by: Alex Goins <agoins@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-05-04 15:33:10 -04:00
Jeremy Huddleston Sequoia
059d5ef304 XQuartz: Update copyright years
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-05-04 00:08:34 -07:00
Jeremy Huddleston Sequoia
d6ba4f2c52 XQuartz: Add --with-bundle-version and --with-bundle-version-string configure options
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-05-04 00:08:34 -07:00
Jeremy Huddleston Sequoia
c1614928c1 XQuartz: Add --with-sparkle-feed-url configure option
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-05-03 23:29:48 -07:00
Jeremy Huddleston Sequoia
299b01eabf XQuartz: Update release feed URL to use new https URL
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-05-03 23:29:48 -07:00
Peter Hutterer
2285fe78c0 xfree86: add support for MatchIsTabletPad
The tablet pads have been separate kernel devices for a while now and
libwacom has labelled them with the udev ID_INPUT_TABLET_PAD for over a year
now. Add a new MatchIsTabletPad directive to apply configuration options
specifically to the Pad part of a tablet.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-05-03 16:15:51 +10:00
Dave Airlie
fa02b05645 modesetting: port clean start code from amdgpu. (v2)
Both radeon and amdgpu don't set the mode until the first blockhandler,
this means everything should be rendered on the screen correctly by
then.

This ports this code, it also removes the tail call of EnterVT from
ScreenInit, it really isn't necessary and causes us to set a dirty mode
with -modesetting always anyways.

v2: reorder set desired modes vs block handler as done for amdgpu.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-05-02 18:21:19 -04:00
Dave Airlie
caabc4e855 modesetting: add support for background none.
This adds support using glamor for background None.

loosely based off the amdgpu code. relies on the glamor_finish code.

Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-02 18:21:10 -04:00
Adam Jackson
c33250945b kdrive: Nuke a bunch of dead code
gcc6 says:

keyboard.c:46:21: warning: ‘linux_to_x’ defined but not used

Only referenced by a bunch of long if-0'd code, so chuck it all out.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-29 11:20:01 -04:00
Adam Jackson
a5dd7b890f dix: Squash some new gcc6 warnings
-Wlogical-op now tells us:

    devices.c:1685:23: warning: logical ‘and’ of equal expressions

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-29 11:19:58 -04:00
Andreas Schwab
23dfa01729 x86emu: Change include order to avoid conflict with system header
R_SP is also defined in <sys/ucontext.h> on m68k.  Also remove duplicate
definitions.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Andreas Schwab <schwab@suse.de>
2016-04-29 11:05:38 -04:00
Marek Chalupa
f48b0534f1 xwayland-shm: fortify fallocate against EINTR
If posix_fallocate or ftruncate is interrupted by signal while working,
we return -1 as fd and the allocation process returns BadAlloc error.
That causes xwayland clients to abort with 'BadAlloc (insufficient
resources for operation)' even when there's a lot of resources
available.

Fix it by trying again when we get EINTR.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-25 15:29:40 -04:00
Emil Velikov
577bebe206 xfree86/parser: simplify #ifdef ladder
Rather than 'hacking' around symbol names and providing macros such as
'Local' just fold things and make the code more readable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-04-18 11:36:46 -04:00
Emil Velikov
537276a5b8 xfree86/parser: reuse StringToToken() in xf86getToken()
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-04-18 11:36:43 -04:00
Emil Velikov
944ea03d5b xfree86/parser: move StringToToken() definition further up
... so that we can use it without the forward declaration. Plus we're
doing to reuse it in the next commit ;-)

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-04-18 11:36:41 -04:00
Emil Velikov
b93be14b7d xfree86/parser: annotate xf86ConfigSymTabRec as constant data
Add the const notation to all the static storage as well as the
functions that use it - xf86getToken(), xf86getSubTokenWithTab(),
StringToToken() and xf86getStringToken().

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-04-18 11:36:29 -04:00
Adam Jackson
a1b13cda61 xfree86: Remove xf86RegisterRootWindowProperty
All consumers have been ported to the root window callback, so this can
all be nuked.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-18 11:23:10 -04:00
Adam Jackson
e89c7f1c2a xfree86: Create EDID atom from the root window callback (v2)
v2: Fix swapped callback args

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-18 11:23:10 -04:00
Adam Jackson
8e3010d7d8 xfree86: Remove a never-hit diagnostic message
Practically speaking, the EDID major version is never not 1.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-18 11:23:10 -04:00
Adam Jackson
7961377567 xfree86: Make xf86SetDDCproperties work more than once (v2)
We can call this more than once via xf86OutputSetEDID since hotplug is
actually a thing in RANDR 1.2, but xf86RegisterRootWindowProperty merely
adds the data to a list to be applied to the root at CreateWindow time,
so calls past the first (for a given screen) would have no effect until
server regen.

Once we've initialised pScrn->pScreen is filled in, so we can just set
the property directly.

v2: Removed pointless version check, deobfuscate math (Walter Harms)

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-18 11:23:06 -04:00
Adam Jackson
8be83fff04 xfree86: Remove some leftovers from DisplayID support
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-18 11:22:58 -04:00
Adam Jackson
0cd2a24b61 xfree86: Unexport xf86Initialising, remove xf86ServerIsInitialising
Neither of these are used from outside the server.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-18 11:22:58 -04:00
Adam Jackson
e70ee11a39 xfree86: Create VT atoms from the root window callback (v2)
v2: Fix swapped callback args

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-18 11:22:58 -04:00
Adam Jackson
da9ee1eddd xfree86: Create seat atom from the root window callback (v2)
v2: Fix swapped callback args

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-18 11:22:58 -04:00
Olivier Fourdan
e8e5d83996 xwayland: Fix compiler warning in GLAMOR Xv
XvWindowMask is defined as 0x00020000 and cannot fit in the XvAdaptor
type which is defined as an unsigned char, thus causing a compiler
warning:

  xwayland-glamor-xv.c: In function ‘xwl_glamor_xv_add_adaptors’:
  xwayland-glamor-xv.c:339:16: warning: large integer implicitly
  truncated to unsigned type [-Woverflow]

This XvWindowMask value is actually not used for XvAdaptor itself but by
the server in its xf86xv implementation, so we don't even need that mask
in our xwayland-glamor-xv implementation.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-04-15 16:22:16 -04:00
Jon Turney
a6288f0954 hw/xwin: xcbify internal window manager
Convert the code for the multiwindow mode internal window manager to xcb

xcb conversion avoids xlib/xserver namespace collision and _XSERVER64 type
sizing issues

v2: Various fixes
v3: Don't include X11/extensions/windowswmstr.h, which uses the Display type
and thus depends on Xlib.h, just for _WINDOWSWM_NATIVE_HWND
v4: Fix indentation, add some error handling.
Fix a bug with ConfigureNotify handling
v5: Fix a bug which prevented WM_NORMAL_HINTS from being checked

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-04-07 10:31:39 +01:00
Jon Turney
8114b8127f hw/xwin: In multiwindow mode, do window minimization entirely in the WM
Remove winMinimizeWindow(), implement as UpdateState() in the WM instead,
which uses getHwnd() to map a Window XID to a HWND (like everything else in
the WM), rather than peering into the servers internal data structures.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-04-07 10:31:13 +01:00
Jon Turney
6a64b9d7af hw/xwin: xcbify code for converting X11 icon to Win32 icon
Convert the code for converting an X11 icon to Win32 icon from Xlib to xcb.

v2: some warning fixes in winXIconToHICON()
v3: declaration-after-statement warning fixes
v4: printf format fixes
v5: convert in place rather than in a library

This also avoids the xlib/xserver namespace collision issues, so
winmultiwindowicons.h can be included everywhere it should be, which fixes
compilation with -Werror=implicit-function-declaration

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-04-07 10:30:48 +01:00
Jon Turney
0a69c1e2fa xwin/glx: Build fix for warnings about missing WGL extensioons
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2016-03-30 13:51:19 -04:00
Adam Jackson
b08526eecf glx: Implement GLX_EXT_libglvnd (v2)
For the dri2 backend, we depend on xfree86 already, so we can walk the
options for the screen looking for a vendor string from xorg.conf.  For
the swrast backend we don't have that luxury, so just say mesa.  This
extension isn't really meaningful on Windows or OSX yet (since libglvnd
isn't really functional there yet), so on those platforms we don't say
anything and return BadValue for the token from QueryServerString.

v2: Use xnf* allocators when parsing options (Eric and Emil)

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 11:13:57 -04:00
Adam Jackson
2e8781ead3 glx: Compute the GLX extension string from __glXScreenInit
Now that the enable bits are in the screen base class we can compute
this in one place, rather than making every backend do it.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 11:13:57 -04:00
Adam Jackson
e21de4bf3c glx: Move glx_enable_bits up to the GLX screen base class
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 11:13:57 -04:00
Adam Jackson
23cce73221 xquartz/glx: Remove unused fields from the glx screen subclass
dmt:~/git/xserver% git grep -E '\<(index|num_vis)\>' hw/xquartz/GL
hw/xquartz/GL/indirect.c:    int index;
hw/xquartz/GL/indirect.c:    int num_vis;

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 11:13:57 -04:00
Adam Jackson
36bcbf76dc glx: Enable GLX 1.4 unconditionally
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 11:13:57 -04:00
Adam Jackson
2a72789ee8 xwin/glx: Drop GLWIN_NO_WGL_EXTENSIONS hack
This doesn't seem very useful, and we're about to implement 1.4 across
the board, so some WGL extensions will become required.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 11:13:57 -04:00
Adam Jackson
77bdaa1313 glx: Use __glXInitExtensionEnableBits in all backends (v2)
On xquartz this enables SGI_make_current_read, which is a mostly
harmless lie as CGL doesn't implement it, as well as SGIX_pbuffer, which
is fine because no pbuffer-enabled configs are created.

On xwin this enables SGIX_pbuffer and ARB_multisample in all cases.
Again this is harmless if the backend doesn't support the features,
since no fbconfigs will be created to expose them.

It also adds SGIX_visual_select_group to both xquartz and xwin.
Amusingly, both were filling in the appropriate field in the fbconfig
already.

v2: Warn about missing WGL extensions (Emil)

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 11:13:57 -04:00
Adam Jackson
9b2fc6d986 xwin/glx: Enable GLX_SGI_make_current_read unconditionally (v2)
This seems to be fairly universal these days, and if it doesn't exist
the only thing you break is separate drawable and readable, which is a
rare feature to use. So pretend it's always there and just throw an
error on MakeCurrent if it isn't, and don't consider it when computing
the GLX version number.

v2: Fix type-o for glxWinScreen (Jon Turney)

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 10:47:59 -04:00
Adam Jackson
b2ef7df476 xquartz/glx: Error out for MakeContextCurrent(draw != read)
CGL doesn't have a way to express this directly, unlike EGL WGL and GLX.
It might be implementable, but it's never actually worked, and it's a
fairly niche feature so we're better off throwing an error if someone
attempts it.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 10:47:56 -04:00
Adam Jackson
410aec8255 glx: Remove server-side mention of GLX_MESA_swap_control
This extension is direct-only and has no GLX protocol. We don't even
track an enable bit for it, trying to turn it on is pointless.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 10:47:52 -04:00
Adam Jackson
3a21da59e5 glx: Remove default server glx extension string
This existed only to be strdup'd and then immediately freed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 09:37:41 -04:00
Olivier Fourdan
44e1c97ca6 xwayland: Pretend we support viewport in vidmode
Some games (namely openttd) will raise an XError and fail with a
BadValue if their request to XF86VidModeSetViewPort fails.

Support only the default zoom and viewport, fail for everything else.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-03-28 14:10:59 -04:00
Olivier Fourdan
6e3a6e30a6 xwayland: do not include frequency in mode name
Some applications (e.g. using lwjgl) try to parse the output of the
xrandr command and get confused with the mode name returned by Xwayland,
because it contains "@[frequency]" (e.g. "1024x640@60.0Hz").

Remove the @[frequency] part of the mode name to match what is found in
usual mode names on regular X servers to please those applications.

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

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-03-28 14:09:09 -04:00
Michel Dänzer
418fe365b4 xfree86/modes: Make sure the HW cursor is hidden when it should be
When the HW cursor is hidden (e.g. because xf86CursorResetCursor
triggers a switch from HW cursor to SW cursor), the driver isn't
notified of this for disabled CRTCs. If the HW cursor was shown when the
CRTC was disabled, it may still be displayed when the CRTC is enabled
again.

Prevent this by explicitly hiding the HW cursor again after setting a
mode if it's currently supposed to be hidden.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94560
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2016-03-28 14:03:29 -04:00
Sonny Jiang
1c90797565 DRI2: add Polaris PCI IDs
Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (Polaris10)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (Polaris11)

(Ported from Mesa commit f00c840578a70e479ffb99f6b64c73dc420179fa)

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-28 12:32:25 -04:00
Adam Jackson
8ac0e05cc6 vfb: Re-add LD_EXPORT_SYMBOLS_FLAG to LDFLAGS
Accidentally removed, breaks Xvfb on cygwin.

Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-23 14:47:24 -04:00
Evgeny M. Zubok
b78897d0a0 xfree86: Change VBE version early-out to 1.2. (#22672)
Reporter has an S3 Trio with DDC and VESA 1.2.

Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2016-03-14 11:44:10 -04:00
Adam Jackson
184fbf7541 xfree86: Finish removing font modules
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-14 11:37:32 -04:00
Adam Jackson
69d1528bc3 xfree86: Font modules aren't a real thing
There are no longer any loadable font modules (not that they ever did
much in the first place), so stop pretending they're a defined ABI
surface.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2016-03-14 11:23:51 -04:00
Adam Jackson
744c292ae4 vidmode: Remove stray vidmodeproc.h from EXTRA_DIST
Was removed from the tree in:

    commit f175cf45ae
    Author: Olivier Fourdan <ofourdan@redhat.com>
    Date:   Wed Feb 10 09:34:34 2016 +0100

        vidmode: move to a separate library of its own

but not removed from the Makefile, which broke 'make dist'.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-11 13:50:32 -05:00
Eric Anholt
c01094c531 ephyr: Fix redisplay with glamor on GLES.
glamor_transfer.c is still totally broken, though.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2016-03-10 11:12:43 -05:00
Olivier Fourdan
da7724d3d2 xwayland: add glamor Xv adaptor
This adds an Xv adaptor using glamor.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-03-09 14:03:03 -05:00
Jon Turney
d11fdff50c hw/xwin: Tidy-up of winmsg.h
- winVMsg() has no uses, so remove
- winMsgVerb() has only one use, with default verbosity, so remove
- winMsg() is identical to LogMessage()
- Put winDrvMsg() and winDrvMsgVerb() under XWIN_XF86CONFIG
- Include what you use Xfuncproto.h for _X_ATTRIBUTE_PRINTF

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:54 +00:00
Jon Turney
519b98765f hw/xwin: Remove GC privates, unused since native GDI engine removal
Unused since native GDI engine removal in commit 8465ee78

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:47 +00:00
Jon Turney
9d28ff2a9b hw/xwin: Use NULL rather than NoopDDA for unimplemented engine functions
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:41 +00:00
Jon Turney
a309085a56 hw/xwin: Remove unused FinishCreateWindowsWindow engine function
This only ever had an (unused) implementation in the DDNL engine, which was
removed in commit 57bbf6e2.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:34 +00:00
Jon Turney
fa6f9d06a3 hw/xwin: Remove unused HotKeyAltTab engine function
This was only ever used by the primaryfb engine, removed in commit c79f824b

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:28 +00:00
Jon Turney
7bd25aa843 hw/xwin: Return FALSE to indicate failure in winSetEngine()
Return FALSE to indicate failure in winSetEngine(), if it couldn't find a
drawing engine to use

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:21 +00:00
Jon Turney
52e05b9282 hw/xwin: Remove WM_WM_MAP message, which is now unused
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:16 +00:00
Jon Turney
c42217aa3d hw/xwin: Remove WM_(UN|)MANAGE messages, which are now never sent
Remove fAnotherWMRunning which tracks this message (although since it was
never initialized, I doubt this worked reliably), and the only use of that,
which was to prevent winMWExtWMRestackWindows() from being used when the
internalwm is running

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:07 +00:00
Jon Turney
b6bdf36842 hw/xwin: Remove allowOtherWM, which is now always FALSE
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:01 +00:00
Jon Turney
8407d30962 hw/xwin: Remove winIsInternalWMRunning(), which now always returns FALSE
Also remove then unused variables and IsRaiseonClick()

v2:
Also remove unused pScreenInfo variable in winMWEXtWMRestackFrame()

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:12:51 +00:00
Jon Turney
2779a28a86 hw/xwin: Remove fInternalWM flag
Remove the fInternalWM flag as it is now always FALSE after removing the
-internalwm option

v2:
Also remove then unused pRLWinPriv local from pRLWinPriv()

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:12:40 +00:00
Jon Turney
98238ece57 hw/xwin: Ignore the obsolete, undocumented -internalwm option
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:12:33 +00:00
Jon Turney
cdeaebad98 hw/xwin: Remove the long-broken -silent-dup-error option
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:12:25 +00:00
Michel Dänzer
24042b4e36 modesetting: Allow CRTC transforms to actually take effect
Setting crtc->transformPresent to FALSE was preventing the transform
from actually taking effect and putting RandR into a confused state.

Now that the RandR 1.2 cursor code handles transforms correctly, we can
allow them to properly take effect.

Reviewed-by: Keith Packard <keithp@keithp.com>
2016-03-09 16:46:13 +09:00
Michel Dänzer
b04767c84d xfree86: Re-set current cursor after RandR 1.2 CRTC configuration change
Add xf86CursorResetCursor, which allows switching between HW and SW
cursor depending on the current state.

Call it from xf86DisableUnusedFunctions, which is called after any CRTC
configuration change such as setting a mode or disabling a CRTC. This
makes sure that SW cursor is used e.g. while a transform is in use on
any CRTC or while there are active PRIME output slaves, and enables HW
cursor again once none of those conditions are true anymore.

Reviewed-by: Keith Packard <keithp@keithp.com>
2016-03-09 15:59:10 +09:00
Michel Dänzer
a4ffa8721d xfree86/modes: Check for CRTC transforms in xf86_use_hw_cursor(_argb) (v2)
We currently don't handle transforms for the HW cursor image, so return
FALSE to signal a software cursor must be used if a transform is in use
on any CRTC.

v2: Check crtc->transformPresent instead of crtc->transform_in_use. The
    latter is TRUE for rotation as well, which we handle correctly.

Reviewed-by: Keith Packard <keithp@keithp.com>
2016-03-09 15:58:43 +09:00
Michel Dänzer
c3e4e9fc5d xfree86/modes: Refactor xf86_use_hw_cursor_argb to use xf86_use_hw_cursor (v2)
This reduces code duplication.

v2: No functional change this time.

Reviewed-by: Keith Packard <keithp@keithp.com>
2016-03-09 15:58:19 +09:00
Julien Cristau
d0c1a5bc61 xwin: no need to free auth data if AddResource fails
This is taken care of by SecurityDeleteAuthorization

Reviewed-by: Rémi Cardona <remi@gentoo.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2016-03-08 10:20:00 -05:00
Julien Cristau
acf263df81 modesetting: avoid double free if AddResource fails
ms_dri2_frame_event_client_gone or ms_dri2_frame_event_drawable_gone
already free the resource.

Reviewed-by: Rémi Cardona <remi@gentoo.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2016-03-08 10:19:55 -05:00
Julien Cristau
164753f158 dmx/glxProxy: don't free the glx pixmap twice if AddResource fails
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2016-03-08 10:19:51 -05:00
Jonas Ådahl
a2c3c34b44 xwayland: Correctly detect whether posix_fallocate exists
We had HAVE_POSIX_FALLOCATE checks, but no such macros were ever
defined anywhere. This commit makes it so that this macro is defined if
the posix_fallocate is detected during configure.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2016-03-08 10:05:44 -05:00
Adam Jackson
05e1bcf56e dri1: Fix unchecked AddResource
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2016-03-02 10:03:27 -05:00
Laércio de Sousa
9c88cb9b05 kdrive/ephyr: map host X server's keymap into Xephyr, if supported
Currently Xephyr doesn't inherit host X server's keymap, which
may lead to keymap mismatches when using a non-US keyboard in a
window inside Xephyr. This patch makes Xephyr change its keymap
to match host X server's one (unless XKB support is disabled),
using xcb-xkb to retrieve the needed XKB controls.
This implementation is analogous to Xnest one at commit 83fef4235.

Supersedes: https://patchwork.freedesktop.org/patch/67504

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2016-03-01 11:00:34 -05:00
Laércio de Sousa
daa6d2d58f config/udev: distinguish between real keyboards and other key devices
This patch introduces a new flag ATTR_KEY for hotplugged input devices,
so we can better distinguish between real keyboards (i.e. devices with
udev property ID_INPUT_KEYBOARD="1") and other key input devices like
lid switches, power buttons, etc.

All supported hotplug backends (udev, hal, and wscons) will set both
flags ATTR_KEY and ATTR_KEYBOARD for real keyboards, but udev backend
will set ATTR_KEY, but not ATTR_KEYBOARD, for non-keyboard key input
devices (hal and wscons will set both flags in any case). With this
distinction, kdrive input hotplugging mechanism will be allowed to only
grab real keyboards, as other key input devices are currently not
supported.

In order to don't break current behaviour, this patch will replace all
ATTR_KEYBOARD occurrences with ATTR_KEY in hw/xfree86/common/xf86Xinput.c.

[ajax: Just add ATTR_KEY, don't re-number the other attributes]

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2016-03-01 10:46:48 -05:00
Laércio de Sousa
851ff9ec04 ephyr: enable option -sw-cursor by default in multi-seat mode
Option -seat passed to Xephyr requires -sw-cursor to be passed as well,
otherwise the mouse cursor will remain invisible for the given seat.
This patch takes care of enabling -sw-cursor if -seat is passed.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2016-03-01 10:46:43 -05:00
Laércio de Sousa
40e32e9fc9 kdrive: add options to set default XKB properties
This patch introduces convenient command-line options -xkb-rules,
-xkb-model, -xkb-layout, -xkb-variant, and -xkb-options, to set default
values for these properties.

These options can be handful for cases in which compile-time default
values don't match user locale, since kdrive doesn't support InputClass
matching rules yet and not all Linux distros provide default rules to
store these values in udev properties (which by the way is a discouraged
practice).

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2016-03-01 10:46:31 -05:00
Laércio de Sousa
0cf3d72be6 kdrive: introduce input hot-plugging support for udev and hal backends (#33140)
This patch introduces input hot-plugging support for kdrive-based
applications in multi-seat context. This feature is enabled by passing
-seat option with desired seat name. All keyboard/mouse devices assigned
to that seat will be automatically grabbed by kdrive.

It supports udev and hal backends for input hot-plugging support.
Another patches may be required for wscons backend.

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

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2016-03-01 10:46:13 -05:00
Olivier Fourdan
2116f03be0 xwayland: fix a crash on output removal
On output removal, the CRTC that was added in xwl_output_create()
is not removed in xwl_output_destroy() and would cause a segmentation
fault later on in ProcRRGetMonitors():

  (EE) Segmentation fault at address 0x100000001
  (EE)
  (EE) 10: ? (?+0x29) [0x29]
  (EE) 9: /usr/bin/Xwayland (_start+0x29) [0x423299]
  (EE) 8: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x7fdd80e7f580]
  (EE) 7: /usr/bin/Xwayland (dix_main+0x3b3) [0x544ef3]
  (EE) 6: /usr/bin/Xwayland (Dispatch+0x31e) [0x54109e]
  (EE) 5: /usr/bin/Xwayland (ProcRRGetMonitors+0x9b) [0x4ca18b]
  (EE) 4: /usr/bin/Xwayland (RRMonitorMakeList+0x269) [0x4c9ba9]
  (EE) 3: /usr/bin/Xwayland (RRMonitorSetFromServer+0x118) [0x4c9198]
  (EE) 2: /usr/bin/Xwayland (MakeAtom+0x30) [0x530710]
  (EE) 1: /lib64/libc.so.6 (__restore_rt+0x0) [0x7fdd80e93b1f]
  (EE) 0: /usr/bin/Xwayland (OsSigHandler+0x29) [0x5792d9]

Remove the output CRTC in xwl_output_destroy() to avoid the crash.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-03-01 09:56:31 -05:00
Olivier Fourdan
6070a749d9 xwayland: add partial xvidmode extension support
Older games (mostly those based on SDL 1.x) rely on the XVidMode
extension and would refuse to run without.

Add a simple, limited and read-only xvidmode support that reports the
current mode used so that games that rely on xvidmode extension can run
on XWayland.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87806
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29 16:29:17 -05:00
Olivier Fourdan
b430f53bb7 vidmode: remove redundant DIX function
The API signature of the DIX xf86VidModeGetGammaRampSize() is now
identical to the xf86cmap's xf86GetGammaRampSize() and all it does is
actually call xf86GetGammaRampSize() so we can save one vfunc.

Remove uneeded xf86VidModeGetGammaRampSize() function.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29 16:29:14 -05:00
Olivier Fourdan
48fccde2bf vidmode: remove redundant check
The DIX already checks for VidModePrivateKey to get the vfunc, so
checking for this again in the DDX is redundant.

Remove the redundant function xf86VidModeAvailable() from the DDX.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29 16:29:06 -05:00
Olivier Fourdan
f175cf45ae vidmode: move to a separate library of its own
XVidMode extension might be useful to non hardware servers as well (e.g.
Xwayand) so that applications that rely on it (e.g. lot of older games)
can at least have read access to XVidMode.

But the implementation is very XFree86 centric, so the idea is to add
a bunch of vfunc that other non-XFree86 servers can hook up into to
provide a similar functionality.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87806
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29 16:29:01 -05:00
Olivier Fourdan
17097e083b vidmode: rename DDX functions
To avoid confusion as to what belongs on the DDX and what not.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29 16:28:59 -05:00
Olivier Fourdan
ddfb8c009a vidmode: move display mode definitions
To be able to reuse the VidMode extension in a non-hardware server, the
display mode definitions need to be accessible from DIX.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29 16:28:57 -05:00
Olivier Fourdan
e29a64de66 vidmode: remove mode access from public API
The mode access functions (namely VidModeCreateMode(),
VidModeCopyMode(), VidModeGetModeValue() and VidModeSetModeValue()) are
used only in xf86VidMode code and do not need to be available anywhere
else.

Remove these functions from the public VidMode API and move them as
static where they are used.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29 16:28:55 -05:00
Olivier Fourdan
b7962ade52 vidmode: use appropriate DisplayModePtr type
The API uses an untyped pointer (void *) where a DisplayModePtr is
expected.

Clean up the API to use the appropriate type, as DisplayModePtr is
really all that will be passed there.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29 16:28:54 -05:00
Olivier Fourdan
12f714fd95 vidmode: remove VidModeGetMonitor()
VidModeGetMonitor() is used solely in ProcXF86VidModeGetMonitor() to
get a untyped monitor pointer that is passed back straight again to
VidModeGetMonitorValue().

This is actually useless as VidModeGetMonitorValue() could as well get
the monitor from the ScreenPtr just like VidModeGetMonitor() does.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29 16:28:52 -05:00
Olivier Fourdan
f6f7e21133 vidmode: use ScreenPtr instead of screen index
New code passes ScreenPtr instead of the screen index.

Change the VidMode functions to take a ScreenPtr.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29 16:28:50 -05:00
Olivier Fourdan
6e898ef080 vidmode: get rid of the CloseScreen wrapper
As we rely on dixRegisterPrivateKey() to allocate the memory for us that
will be free automatically, we do not need the CloseScreen wrapper
anymore.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29 16:28:47 -05:00
Olivier Fourdan
341f3bccaf vidmode: use appropriate API
dixRegisterPrivateKey() can allocate memory that will be freed when the
screen is teared down.

No need to calloc() and free the memory ourself using a broken ref
counting method.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29 16:28:37 -05:00
Chris Wilson
d888295457 dri2: Allow many blocked clients per-drawable
This patch was motivated by the need to fix the use-after-free in
dri2ClientWake, but in doing so removes an arbitrary restriction that
limits DRI2 to only blocking the first client on each drawable. In order
to fix the use-after-free, we need to avoid touching our privates in the
ClientSleep callback and so we want to only use that external list as
our means of controlling sleeps and wakeups. We thus have a list of
sleeping clients at our disposal and can manage multiple events and
sources.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-29 14:33:20 -05:00
Jon Turney
9fecc4cd57 xwin: Remove unhelpful debug about WM message queue size
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:05:33 -05:00
Jon Turney
f7d1e5acdf xwin: Add SKIPTASKBAR hint to _NET_WM_WINDOW_TYPE_DOCK type windows
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:05:33 -05:00
Jon Turney
e7f87f8f76 xwin: In multiwindow mode, look up the HWND for the parent window
Rather than only looking at the foreground window to see if it matches
the WM_TRANSIENT_FOR window XID, lookup that XID and fetch the HWND from
the window privates.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:05:33 -05:00
Jon Turney
856a28f637 xwin: Factor out MessageName() debug helper
Factor out the MessageName() debug helper for message id -> text, and
use it on message queue and dequeue.

Reorder in numerical order to match winwindow.h

Add missing WM_WM_ICON_EVENT

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:05:33 -05:00
Jon Turney
8c2006ddc5 xwin: Keyboard layout updates
layout zh_TW doesn't exist (anymore), try something else for that.

layout it variant mac doesn't seem to exist anymore, try to handle
Macintosh keyboards (running under Parallels on Mac) and other oddities
in a more generic way, by falling back to matching only on the language
identifer part of the input locale identifer.

v2:
Fix typo of 0xa0000 for 0xa000

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:05:30 -05:00
Colin Harrison
8c97a0078e xwin: Add a tentative entry for the Korean keyboard to the list of known keyboard layouts
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2016-02-29 14:04:54 -05:00
Jon Turney
a4d8a64c4b xwin: Update to XRANDR 1.2 internal interface to ensure an output is reported by XRANDR
If using the X server internal XRANDR 1.0 interface, it seems we must
register a display size with RRRegisterSize() in order to make
RRGetInfo() call RRScanOldConfig() to generate an output and crtc for
us.

Without this, the following GDM bug means that an XDMCP session to GDM
cannot be started.

https://bugzilla.gnome.org/show_bug.cgi?id=736054

Instead, use the more recent XRANDR 1.2 internal interface to explicitly
create the output and crtc, and maintain a single mode which represents
the current display size.

Also don't emit a RRScreenSizeNotify when a RRScreenSizeSize is done
which has no effect, this seems to throw the GDM greeter into a loop...

v2: Maintain reference count for the mode we maintain more correctly, to
avoid double free causing a crash on shutdown

Connect crtc to output, so a subsequent RRSetCrtcConfig request doesn't
change anything, so we don't fail due to our lack of rrSetConfig or
rrCrtcSet hooks.

See https://cygwin.com/ml/cygwin-xfree/2015-02/msg00032.html

v3:
Raise limit on X display size from 4Kx4K to 32Kx32K

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:04:36 -05:00
Jon Turney
008efebda8 xwin: Use WM_CLIPBOARDUPDATE clipboard API
Windows Vista and later have a saner clipboard API where the clipboard
viewer linked list is no longer maintained by applications.  Use it
where available.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:04:31 -05:00
Jon Turney
de7f1fd6f8 xwin: Check that window position is visible on non-rectangular virtual desktops
Improve the check that window position is visible to work correctly for
non-rectangular virtual desktops

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:04:24 -05:00
Jon Turney
a9e73131b6 xwin: Correctly interpret WM_HINTS, WM_NORMAL_HINTS properties on x86_64
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:04:19 -05:00
Jon Turney
d7cef6fbe2 xwin: Improve handling of no-decoration motif hint
When motif decoration hint asks for no decoration, don't add sysmenu,
mimimize or maximimize controls.

(This fixes a problem with e.g. fbpanel having a minimize control, but
gtk's panel_configure_event() doesn't like the state we put the window
into when we minimize it, causing it to spin)

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:04:12 -05:00
Jon Turney
f75404be3a xwin: XGetWMNormalHints() returns non-zero on success
XGetWMNormalHints() doesn't actually return a Status value.  On success
it returns a non-zero value, not Success.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:04:06 -05:00
Jon Turney
9dc32746f2 xwin: Fix format warnings when ./configured --enable-debug --enable-windowswm
Fix format warnings (mainly pointer format fixes) which show up when
./configured --enable-debug --enable-windowswm

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:03:42 -05:00
Laércio de Sousa
0461bca0cb kdrive/evdev: update keyboard LEDs (#22302)
Implement missing parts in kdrive evdev driver for
correct update of evdev keyboard LEDs.

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

[ajax: Fixed deref-before-null-check bug]

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2016-02-22 16:34:44 -05:00
Jonas Ådahl
544b414926 xwayland: Prefix shm tmp file names with xwayland
Prefix the temporary file names used for allocating pixmaps with
"xwayland-" instead of "weston-". This makes it less confusing while
looking at the file names of the currently open fds of the Xwayland
process.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2016-02-22 14:00:18 -05:00
Marc-Andre Lureau
5627708e5f dri2: add virtio-gpu pci ids
Add virtio-gpu legacy + 1.0 pci ids, allowing them to use
modesetting + glamor with dri2.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-02-22 13:48:49 -05:00
Daniel Stone
e957a2e5dd dix: Add hybrid full-size/empty-clip mode to SetRootClip
216bdbc735 removed the SetRootClip call in the XWayland output-hotplug
handler when running rootless (e.g. as a part of Weston/Mutter), since
the root window has no storage, so generating exposures will result in
writes to invalid memory.

Unfortunately, preventing the segfault also breaks sprite confinement.
SetRootClip updates winSize and borderSize for the root window, which
when combined with RRScreenSizeChanged calling ScreenRestructured,
generates a new sprite-confinment area to update it to the whole screen.

Removing this call results in the window geometry being reported
correctly, but winSize/borderSize never changing from their values at
startup, i.e. out of sync with the root window geometry / screen
information in the connection info / XRandR.

This patch introduces a hybrid mode, where we update winSize and
borderSize for the root window, enabling sprite confinement to work
correctly, but keep the clip emptied so exposures are never generated.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Tested-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-02-22 13:26:31 -05:00
Adam Jackson
eddf848c44 dri2: Use the work queue to manage client sleeps
In  commit e43abdce96
    Author: Chris Wilson <chris@chris-wilson.co.uk>
    Date:   Wed Feb 3 09:54:46 2016 +0000

        dri2: Unblock Clients on Drawable release

we try to wake up any blocked clients at drawable destruction. But by
the time we get there, CloseDownConnection has already torn down state
that AttendClient wants to modify.

Using ClientSleep instead of IgnoreClient puts a wakeup function on a
workqueue, and the queue will be cleared for us in CloseDownClient
before (non-neverretain) resource teardown.

Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-02-11 13:58:13 -05:00
Chris Wilson
e43abdce96 dri2: Unblock Clients on Drawable release
If the Window is destroyed by another client, such as the window
manager, the original client may be blocked by DRI2 awaiting a vblank
event. When this happens, DRI2DrawableGone forgets to unblock that
client and so the wait never completes.

Note Present/xshmfence is also suspectible to this race.

Testcase: dri2-race/manager
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-02-08 21:47:18 -05:00
Rui Matos
87d5534f70 xwayland: Clear pending cursor frame callbacks on pointer enter
The last cursor frame we commited before the pointer left one of our
surfaces might not have been shown. In that case we'll have a cursor
surface frame callback pending which we need to clear so that we can
continue submitting new cursor frames.

Signed-off-by: Rui Matos <tiagomatos@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2016-02-08 17:09:40 -05:00
Chris Wilson
b7d392931a dri2: Only invalidate the immediate Window upon SetWindowPixmap
All callers of SetWindowPixmap will themselves be traversing the Window
heirarchy updating the backing Pixmap of each child and so we can forgo
doing the identical traversal inside the DRI2SetWindowPixmap handler.

Reported-by: Loïc Yhuel <loic.yhuel@gmail.com>
Link: http://lists.x.org/archives/xorg-devel/2015-February/045638.html
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-02-08 17:07:32 -05:00
Laércio de Sousa
da69f2f15a ephyr: don't load ephyr input driver if -seat option is passed
When used for single-GPU multi-seat purposes, there's no need to enable
ephyr virtual input devices, since Xephyr is supposed to handle its own
hardware devices.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2016-02-08 15:04:20 -05:00
Laércio de Sousa
7213e99cbc ephyr: ignore Xorg multiseat command line options
Multi-seat-capable display managers commonly pass command-line options
like "-novtswitch", "-sharevts", or "-layout seatXXXX" to Xorg server,
but Xephyr currently refuses to start if these options are passed to it,
which may break Xephyr-based single-GPU multiseat setups.

[ajax: shortened summary]

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2016-02-08 15:04:20 -05:00
Laércio de Sousa
edd443f69e kdrive: don't let evdev driver overwrite existing device names
KDrive evdev driver deliberately name grabbed devices as "Evdev mouse"
or "Evdev keyboard". This patch will make it skip this step if grabbed
devices are already named (i.e. from udev).

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2016-02-08 15:04:20 -05:00
Laércio de Sousa
0b80da0d18 kdrive: set "evdev" driver for input devices automatically, if available.
If kdrive input driver "evdev" is available, no other driver was
explicitly set for a given input device, and its kernel device node is
/dev/input/event*, this patch will make kdrive set "evdev" driver
automatically for such device.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2016-02-08 15:04:20 -05:00
Laércio de Sousa
6d6fd688ec kdrive: fix up NewInputDeviceRequest() implementation
This patch simplifies NewInputDeviceRequest() implementation in
kinput.c, making use of improved KdParseKbdOptions() /
KdParsePointerOptions() and merging several "if (ki)"/"if (pi)" clauses.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2016-02-08 15:04:07 -05:00
Eric Anholt
68f236ebd4 ephyr: Make sure we have GLX_ARB_create_context before calling it.
This should fix aborts()s from epoxy on old software stacks.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-01-29 18:12:28 -08:00
Adam Jackson
623ff251dd xephyr: Remove DRI1
This only worked if the backend server supported DRI1, which is
stunningly unlikely these days.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-01-28 09:01:12 -05:00
Adam Jackson
953b71270c xfree86: Build parser for DRI config file subsection unconditionally
This applies regardless of which DRI you're asking for. Worse, leaving
it out means breaking the config file syntax in a pointless way, since
non-DRI servers can safely just parse it and ignore it.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-01-28 09:01:08 -05:00
Adam Jackson
1a48a5863e xfree86: Remove ancient DRI build instructions
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-01-28 09:01:03 -05:00
Dave Airlie
d8ecbe5639 ephyr: catch X errors if we try to create a core context and fail.
This stops Xephyr failing on GLXBadFBConfig.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-01-27 16:47:46 -08:00
Timo Aaltonen
50ca286d79 dri2: Sync i915_pci_ids.h and i965_pci_ids.h from mesa
Adds Skylake, Kabylake and Broxton allowing them to use
modesetting + glamor with dri2.

Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2016-01-27 14:03:34 -05:00
Dave Airlie
6978c8ee66 xwayland: add support for use core profile for glamor. (v2)
This adds support to Xwayland to try and use OpenGL core
profile for glamor first.

v1.1: use version defines.
v2: let glamor work out core profile itself.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-01-26 12:04:23 -08:00
Keith Packard
98c3504dcf ephyr: Create 3.1 core profile context if possible (v3)
On desktop GL, ask for a 3.1 core profile context if that's available,
otherwise create a generic context.

v2: tell glamor the profile is a core one.
v2.1: add/use GL version defines
v3: let glamor work out core itself

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-01-26 12:04:10 -08:00
Keith Packard
49aa5e3ea4 glamor: Use vertex array objects
Core contexts require the use of vertex array objects, so switch both glamor
and ephyr/glamor over.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-01-21 06:49:40 +10:00
Thomas Klausner
862cbf4c87 Fix build when XSERVER_PLATFORM_BUS is not defined.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
2016-01-06 10:10:14 -05:00
Alan Coopersmith
fe8562f531 modesetting should not reference gbm when it's not defined
Fixes build errors of:
present.c: In function 'ms_do_pageflip':
present.c:410:17: error: 'drmmode_bo' has no member named 'gbm'
     new_front_bo.gbm = glamor_gbm_bo_from_pixmap(screen, new_front);
                 ^
present.c:412:22: error: 'drmmode_bo' has no member named 'gbm'
     if (!new_front_bo.gbm) {
                      ^
present.c: In function 'ms_present_check_flip':
present.c:536:36: error: 'drmmode_bo' has no member named 'gbm'
         if (drmmode_crtc->rotate_bo.gbm)
                                    ^
Introduced by commit 13c7d53d

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2016-01-05 13:23:56 -05:00
Peter Hutterer
f3593918a0 xfree86: move check for driver->PreInit up
No real change, but if the driver is broken and doesn't provide a PreInit
function, then we don't need to worry about logind.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-12-21 07:15:30 +10:00
Peter Hutterer
fc4fbe8224 xfree86: add NoMatchFoo directives for InputClass sections
InputClass sections use various MatchFoo directives to decide which device to
apply to. This usually works fine for specific snippets but has drawbacks for
snippets that apply more generally to a multitude of devices.

This patch adds a NoMatchFoo directive to negate a match, thus allowing
snippets that only apply if a given condition is not set. Specifically, this
allows for more flexible fallback driver matching, it is now possible to use a
snippet that says "assign driver foo, but only if driver bar wasn't already
assigned to it". For example:

Section "InputClass"
   Identifier "libinput for tablets"
   MatchIsTablet "true"
   NoMatchDriver "wacom"
   Driver "libinput"
EndSection

The above only assigns libinput to tablet devices if wacom isn't already
assigned to this device, making it possible to select a specific driver by
installing/uninstalling it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-12-18 11:56:46 +10:00
Peter Hutterer
eb671b804e xfree86: whitespace fix
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-12-18 11:56:46 +10:00
Siim Põder
3d68d1f267 vfb: add randr support (v2)
The motivation for getting this is chrome remote desktop that runs under
Xvfb and wants to use RANDR to adjust screen size according to the
remote desktop client screen size. Apparently there are other use cases
as well, the bug mentions gnome-settings-daemon testing.

[ajax: massaged commit message]

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=26391
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Lambros Lambrou <lambroslambrou@google.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michal Srb <msrb@suse.com>
Signed-off-by: Siim Põder <siim@p6drad-teel.net>
2015-12-09 10:09:21 -05:00
Adam Jackson
b5f04a79df glxproxy: Silence shadowed-variable warnings
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-12-08 18:20:18 -05:00
Adam Jackson
18729a211a glxproxy: Silence set-but-unused-variable warnings
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-12-08 18:20:16 -05:00
Adam Jackson
bc996fa4e3 dmx: Run 'doxygen -u' to upgrade the doxygen config file
Also change the dot font setting back to the default of Helvetica as
doxygen no longer ships FreeSans.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-12-08 18:20:14 -05:00
Adam Jackson
a55e0bc56f dmx: Silence unused variable warning in dmxcompat
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-12-08 18:20:13 -05:00
Adam Jackson
2730ccb803 dmx: Silence lex/yacc-related config parser warnings
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-12-08 18:20:00 -05:00
Laércio de Sousa
718223d274 systemd-logind.c: don't parse VT settings for non-seat0 X servers
Since non-seat0 X servers no longer touch VTs, I believe these settings
are unnecessary.

Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-12-08 11:54:11 -05:00
Adam Jackson
2a52c06e23 x86emu: Squash a warning
Apologies, should have caught this one when applying the previous x86emu
patch.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-12-07 17:05:39 -05:00
Julian Pidancet
59b618227e x86emu: Correctly handle 0x66 prefix for some instructions
(Sorry for double posting)

I repost this patch because I havn't got any replies from maintainers
since I posted the initial patch back in March.

Some instructions are not emulated correctly by x86emu when they
are prefixed by the 0x66 opcode.
I've identified problems in the emulation of these intructions: ret,
enter, leave, iret and some forms of call.

Most of the time, the problem is that these instructions should push or
pop 32-bit values to/from the stack, instead of 16bit, when they are
prefixed by the 0x66 special opcode.

The SeaBIOS project aims to produce a complete legacy BIOS
implementation as well as a VGA option ROM, entirely written in C and
using the GCC compiler.

In 16bit code produced by the GCC compiler, the 0x66 prefix is used
almost everywhere. This patch is necessary to allow the SeaBIOS VGA
option ROM to function with Xorg when using the vesa driver.

SeaBIOS currently use postprocessing on the ROM assembly output to
replace the affected instruction with alternative unaffected instructions.
This is obviously not very elegant, and this fix in x86emu would be
more appropriate.

v2: - Decrement BP instead of EBP in accordance with the Intel Manual
    - Assign EIP instead of IP when poping the return address from the
    stack in 32-bit operand size mode in ret_far_IMM, ret_far, and iret
    - When poping EFLAGS from the stack in iret in 32-bit operand size
    mode, apply some mask to preserve Read-only flags.

v3: - Rebase

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
2015-12-07 14:49:36 -05:00
Dave Airlie
548a3d5fd6 modesetting: create entities for pci and old probe. (v2)
This moves the code from the platform case into
a common function, and calls that from the
other two.

v2: Emil convinced me we don't need to lookup pEnt
here, so let's not bother.

Reported-by: Mark Kettenis <mark.kettenis@xs4all.nl>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-12-07 11:20:26 +10:00
Dave Airlie
771016f070 modesetting: drop platform_dev pointer.
This isn't used anywhere, so no point storing it until we need it.

Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-12-07 11:20:26 +10:00
Arkadiusz Miśkiewicz
19b0249a5e Xorg.wrap: activate libdrm based detection for KMS drivers
Xorg.wrap includes code guarded with WITH_LIBDRM for detecting KMS drivers.
Unfortunately it is never activated since code missed to include file
which defines WITH_LIBDRM.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92894
Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-12-03 11:05:37 -05:00
Adam Jackson
2e3d9623ae Revert "hw/xfree86: Use NotifyFd for device and other input fd wakeups"
Reported to break libinput:

http://lists.freedesktop.org/archives/xorg-devel/2015-December/048091.html

This reverts commit 1df07dc36c.
2015-12-02 10:42:36 -05:00
Keith Packard
1df07dc36c hw/xfree86: Use NotifyFd for device and other input fd wakeups
Remove code in xf86Wakeup for dealing with device and other input and
switch to using the new NotifyFd interface.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:56:13 -05:00
Keith Packard
f933a1b38e hw/xwayland: Use NotifyFd handler to monitor wayland socket
Replace the block/wakeup handler with a NotifyFd callback instead.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:55:28 -05:00
Keith Packard
8543d4d8bc modesetting: Use NotifyFd for drm event monitoring
Replace the block/wakeup handlers with a NotifyFd callback.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:55:25 -05:00
Keith Packard
58354fcf47 kdrive/ephyr: Use NotifyFd for XCB connection input [v2]
Eliminates polling every 20ms for device input.

v2: rename ephyrPoll to ephyrXcbNotify and fix the API so it can be
    used directly for SetNotifyFd. Thanks to Daniel Martin
    <consume.noise@gmail.com>

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Cc: Daniel Martin <consume.noise@gmail.com>
2015-12-01 13:55:20 -05:00
Keith Packard
483c2a1adf hw/kdrive: Use NotifyFd for kdrive input devices
This switches the kdrive code to use FD notification for input
devices, rather than the block and wakeup handlers.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:55:18 -05:00
Keith Packard
21c1680e83 hw/kdrive: Use NotifyFd interface for kdrive/linux APM monitoring
Replace the block/wakeup handlers with a NotifyFd callback

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:55:16 -05:00
agoins
8d3f0e964e xf86: Bump ABI version to 21
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Alex Goins <agoins@nvidia.com>
2015-12-01 13:15:03 -05:00
Olivier Fourdan
ab9837cc6a xwayland: Update screen size on output removal
When unplugging an output, it's still listed in xrandr and the size
of the root window still includes the removed output.

The RR output should be destroyed when its Wayland counterpart is
destroyed and the screen dimensions must be updated in both the done
and the destroy handlers.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92914
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
2015-12-01 12:26:19 -05:00
Jonas Ådahl
07941a50a5 xwayland: Always update the wl_pointer cursor on pointer focus
In Wayland, a client (in this case XWayland) should set the cursor
surface when it receives pointer focus. Not doing this will leave the
curser at whatever it was previously.

When running on XWayland, the X server will not be the entity that
controls what actual pointer cursor is displayed, and it wont be notified
about the pointer cursor changes done by the Wayland compositor. This
causes X11 clients running via XWayland to end up with incorrect pointer
cursors because the X server believes that, if the cursor was previously
set to the cursor C, if we receive Wayland pointer focus over window W
which also has the pointer cursor C, we do not need to update it. This
will cause us to end up with the wrong cursor if cursor C was not the
same one that was already set by the Wayland compositor.

This patch works around this by, when receiving pointer focus, getting
the private mipointer struct changing the "current sprite" pointer to
an invalid cursor in order to trigger the update path next time a cursor
is displayed by dix.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2015-12-01 12:14:03 -05:00
Olivier Fourdan
51a4399b94 xwayland: Do not set root clip when rootless
Otherwise the server may try to draw onto the root window when closing
down, but when running rootless the root window has no storage thus
causing a memory corruption.

Thanks to Adam Jackson <ajax@redhat.com> for helping tracking this down!

Reviewed-by: Adam Jackson <ajax@redhat.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93045
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Tested-by: Marek Chalupa <mchqwerty@gmail.com>
2015-11-30 12:03:57 -05:00
Marek Chalupa
5b2ca34132 xwayland: check if creating xwl_output succeeded
check return values of RR.*Create calls

v2. do not bail out if we don't have any output

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2015-11-30 11:56:28 -05:00
Marek Chalupa
646ebea456 xwayland: fix memory leaks on error paths in xwl_realize_window
don't leak memory when realizing window fails

v2. take care of all memory allocation and return values,
    not just one leak

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2015-11-30 11:56:28 -05:00
Richard PALO
e6b106715f Replace 'sun' with '__sun'
Globally replace #ifdef and #if defined usage of 'sun' with '__sun'
such that strict ISO compiler modes such as -ansi or -std=c99 can be used.

Signed-off-by: Richard PALO <richard@NetBSD.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-11-30 11:51:22 -05:00
Egbert Eich
44d0fd435a kdrive/UnregisterFd: Fix off by one
The number of FDs has been decremented already, therefore the
number contained the index of the top one that is to me moved down.

This problem was introduced by:
  commit 1110b71e36
  Author: Chris Clayton <chris2553@googlemail.com>

    kdrive: fix build error on gcc 4.8 for out-of-bounds array access

The reason for the warning was likely a confused compiler.
Hoping to reduce the confusion by moving the decrement behind the end
if the copy loop.

Signed-off-by: Egbert Eich <eich@suse.de>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-11-30 11:48:08 -05:00
Adam Jackson
eb36924ead dix: Remove redundant ChangeWindowProperty
Use dixChangeWindowProperty(serverClient, ...) instead.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-11-30 10:24:53 -05:00
Adam Jackson
4affa75a90 xnest: Fix needless build dependency on xcb-util-keysyms
This was added in:

    commit 4301479508
    Author: Olivier Fourdan <ofourdan@redhat.com>
    Date:   Mon Jan 5 16:44:22 2015 +0100

        Synchronize capslock in Xnest and Xephyr

Which is fine if you're building both, but if you don't happen to have
xcb-util-keysyms' headers installed Xnest will configure as enabled but
fail to build.

Fortunately <X11/X.h> has a corresponding #define, so use that instead.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2015-11-24 10:41:14 -05:00
Daniel Stone
fee0827a9a XWayland: Use FocusIn events for keyboard enter
wl_keyboard::enter is the equivalent of FocusIn + KeymapNotify: it
notifies us that the surface/window has now received the focus, and
provides us a set of keys which are currently down.

We should use these keys to update the current state, but not to send
any events to clients.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-11-24 11:36:36 +10:00
Peter Hutterer
71ba826901 xfree86: fix minor memory leak
xf86*StrOption returns a strdup

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-24 07:53:20 +10:00
Eric Anholt
51984dddfc glamor: Delay making pixmaps shareable until we need to.
If a pixmap isn't getting exported as a dmabuf, then we don't need to
make an EGLImage/GBM bo for it.  This should reduce normal pixmap
allocation overhead, and also lets the driver choose non-scanout
formats which may be much higher performance.

On Raspberry Pi, where scanout isn't usable as a texture source, this
improves x11perf -copypixwin100 from about 4300/sec to 5780/sec under
xcompmgr -a, because we no longer need to upload our x11perf window to
a tiled temporary in order to render it to the screen.

v2: Just use pixmap->usage_hint instead of a new field.  Drop the
    changes that started storing gbm_bos in the pixmap priv due to
    lifetime issues.
v3: Fix a missing gbm_bo_destroy() on the pixmap-from-fd success path.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-11-18 10:04:44 -08:00
Eric Anholt
ff2850424c glamor: Hook up EGL DestroyPixmap through the normal wrap chain.
One less layering violation (EGL should call glamor, if anything, not
the other way around).

v2: Move glamor.c's DestroyPixmap wrapping up above the
    glamor_egl_screen_init() call, since glamor.c's DestroyPixmap
    needs to be the bottom of the stack (it calls fb directly and
    doesn't wrap).  Caught by Michel.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-11-18 10:02:15 -08:00
Eric Anholt
9d2b76652f modesetting: No need to free the EGLImage just before freeing the pixmap.
DestroyPixmap handles that just fine.  This also lets us drop our use
of the manual image destruction function (Note that the radeon driver
still uses it in a similar fashion, though).

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-11-18 10:02:15 -08:00
Michael Stapelberg
a6cddb8c04 Also dump passive grabs on XF86LogGrabInfo
Signed-off-by: Michael Stapelberg <stapelberg@google.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-11-10 15:12:21 +10:00
Daniel Martin
7d1e478385 modesetting: Remove XF86_CRTC_VERSION checks
The ifdef checks for XF86_CRTC_VERSION >= 3/5 are remnants from the
out-of-tree driver. Within the tree, we can rely on:
    xf86Crtc.h:#define XF86_CRTC_VERSION 6

Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-10-30 10:22:29 -04:00
Daniel Martin
45c83a266d modesetting: Free output_ids in drmmode_set_mode_major()
We calloc() output_ids. Let's free() it, too.

Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-10-30 10:22:29 -04:00
Daniel Martin
2674d42402 modesetting: Handle failures in setting a CRTC to a DRM mode properly
This fixes a bug where running the card out of PPLL's when hotplugging
another monitor would result in all of the displays going blank and
failing to work properly until X was restarted or the user switched to
another VT.

[Michel Dänzer: Pass errno instead of -ret to strerror()]
[Daniel Martin: Add \n to log message]

Picked from xf86-video-ati
    7186a87 Handle failures in setting a CRTC to a DRM mode properly

Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-10-30 10:22:25 -04:00
Adam Jackson
250666586e vidmode: Drop the unused event code
As the code says, this is "far from complete".  So far, in fact, that
it's been basically untouched for twenty years (XFree86 3.1!).  As far
as I can tell it was never enabled in any XFree86 build, and certainly
has never been enabled since Xorg 7.0.

Also, K&R.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-10-30 10:07:53 -04:00
Alan Coopersmith
8fc295bde9 Xorg.man: update to reflect -nolisten tcp becoming default
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2015-10-28 14:16:20 -04:00
Alan Coopersmith
75157b7dbf Xorg.man: move XLOCAL details to X(7) man page instead
These settings affect clients, not server, so belong there, next to
the information about how to set $DISPLAY.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2015-10-28 14:16:06 -04:00
Adam Jackson
bb78c464f0 build: Remove stale miext/cw include paths
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-10-27 13:46:13 -04:00
Michel Dänzer
ac2f27f1a9 DRI2: Sync radeonsi_pci_ids.h from Mesa
Fixes DRI2 client driver name mapping for newer AMD GPUs with the
modesetting driver, allowing the DRI2 extension to initialize.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-10-27 10:47:25 -04:00
Adam Jackson
47b00fa4bf xfree86: Use same inb/outb asm code for i386 amd64 and ia64
This matches the GCCUSESGAS path from the old monolith build (where that
macro was actually set), and fixes the build on modern OSX.

Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-10-26 11:24:22 -04:00
Dave Airlie
c99fb550e0 xf86: don't add gpus from udev if autoAddGPU is set
At startup the server wasn't adding devices, but nothing
was blocking hotplug devices by the look of it.

bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91388
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-10-21 15:13:41 -04:00
Hans de Goede
2092f12a24 linux: Do not call FatalError from xf86CloseConsole
FatalError ends up calling xf86CloseConsole itself, so calling FatalError
from within xf86CloseConsole is not a good idea.

Make switch_to log errors using xf86Msg(X_WARNING, ...) and return success
(or failure).

This makes switch_to match the other error checking done in xf86CloseConsole
which all logs warnings and continues.

Add checking of the return value in xf86OpenConsole and call
FatalError there when switch_to fails, to preserve the error-handling
behavior of xf86OpenConsole.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1269210
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-10-21 10:35:51 -04:00
Samuel Thibault
113c0bb4fd hurd: fix xorg-wrapper build
hurd does not have any PATH_MAX limitation. misc.h provides a default value
which is fine here.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2015-10-19 17:17:15 -04:00
Adam Jackson
5b582a4a03 Merge remote-tracking branch 'jeremyhu/master' 2015-10-19 12:23:22 -04:00
Julien Cristau
1d4aa67242 xorg-wrapper: when starting the server as root, reset its environment
When the server is privileged, we shouldn't be passing the user's
environment directly.

Clearing the environment is recommended by the libdbus maintainers, see
https://bugs.freedesktop.org/show_bug.cgi?id=52202

v2: rename envp to empty_envp (Jeremy)
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83849
Signed-off-by: Julien Cristau <jcristau@debian.org>
2015-10-19 12:18:17 -04:00
Samuel Thibault
08c4912406 xorg-wrapper: fix build without libdrm
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-10-19 12:11:54 -04:00
Jeremy Huddleston Sequoia
27ad21254f XQuartz: Cleanup formatting of DarwinEQInit that was butchered by automation a few years ago
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2015-10-19 09:06:22 -07:00
Jeremy Huddleston Sequoia
3db7e332d3 XQuartz: Make sure that darwin_all_modifier_mask_additions is 0-terminated
Found by ASan

X.Org X Server 1.17.99.901 Build Date: 20151018
================================================================
==40471==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000101fed7a4 at pc 0x000101584030 bp 0x70000029f920 sp 0x70000029f918
READ of size 4 at 0x000101fed7a4 thread T7
    #0 0x10158402f in DarwinEQInit darwinEvents.c:377
    #1 0x10157f3bc in InitInput darwin.c:566
    #2 0x101be87ad in dix_main main.c:268
    #3 0x10159131b in server_thread quartzStartup.c:66
    #4 0x7fff8a535c12 in _pthread_body (/usr/lib/system/libsystem_pthread.dylib+0x3c12)
    #5 0x7fff8a535b8f in _pthread_start (/usr/lib/system/libsystem_pthread.dylib+0x3b8f)
    #6 0x7fff8a533374 in thread_start (/usr/lib/system/libsystem_pthread.dylib+0x1374)

0x000101fed7a4 is located 0 bytes to the right of global variable 'darwin_all_modifier_mask_additions' defined in 'darwinEvents.c:181:12'
(0x101fed7a0) of size 4
SUMMARY: AddressSanitizer: global-buffer-overflow darwinEvents.c:377 DarwinEQInit
Shadow bytes around the buggy address:
  0x1000203fdaa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1000203fdab0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1000203fdac0: f9 f9 f9 f9 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9
  0x1000203fdad0: 00 00 00 00 00 00 00 00 f9 f9 f9 f9 00 00 00 00
  0x1000203fdae0: 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00 00 f9 f9 f9
=>0x1000203fdaf0: f9 f9 f9 f9[04]f9 f9 f9 f9 f9 f9 f9 00 00 00 00
  0x1000203fdb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1000203fdb10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1000203fdb20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1000203fdb30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1000203fdb40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
Thread T7 created by T0 here:
    #0 0x10242ee99 in wrap_pthread_create
(/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/7.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib+0x37e99)
    #1 0x101591089 in create_thread quartzStartup.c:78
    #2 0x101590ed9 in QuartzInitServer quartzStartup.c:95
    #3 0x1015697eb in X11ApplicationMain X11Application.m:1277
    #4 0x101575dc0 in X11ControllerMain X11Controller.m:984
    #5 0x10159171a in server_main quartzStartup.c:127
    #6 0x101540fc0 in do_start_x11_server bundle-main.c:436
    #7 0x101544869 in _Xstart_x11_server mach_startupServer.c:189
    #8 0x101545c96 in mach_startup_server mach_startupServer.c:398
    #9 0x7fff8d1b70f3 in mach_msg_server (/usr/lib/system/libsystem_kernel.dylib+0x110f3)
    #10 0x1015416e7 in main bundle-main.c:774
    #11 0x7fff8bd975ac in start (/usr/lib/system/libdyld.dylib+0x35ac)
    #12 0x0  (<unknown module>)

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2015-10-19 09:05:54 -07:00
Ken Thomases
4513f924a7 XQuartz: Fix how we calculate the height of the OSX menu bar
+[NSScreen mainScreen] does not mean the primary display.  It used to mean the
one with the key window.  When "Displays have separate spaces" is enabled, it
means the active screen, the one whose menu bar is mostly opaque.  As such, it
may not be the screen whose lower-left corner is located at (0, 0).  That's
why its max-Y is not necessarily comparable to its height.  That only works
for the primary display.

This code could use [[NSScreen screens] firstObject].  This is always the
primary display, the one whose lower-left corner is at (0, 0).

Once that's done, the above change should be reverted.  The height of the
visible frame would be the full height of the screen minus the menu bar _and
the Dock_ if the Dock is along the bottom of the screen.

Actually, there's a theoretically-simpler approach: use
-[NSMenu menuBarHeight].  That replaces a long-deprecated method
+[NSMenuView menuBarHeight].  However, there was a bug in Tiger that led to
the former not working while the latter still worked. I haven't actually
checked recently.

CrossOver's still-kicking X server code uses this code, which tries all of
the above:

       NSScreen* primaryScreen = [[NSScreen screens] objectAtIndex:0];
       aquaMenuBarHeight = [[NSApp mainMenu] menuBarHeight];
       if (!aquaMenuBarHeight) aquaMenuBarHeight = [NSMenuView menuBarHeight];
       if (!aquaMenuBarHeight) aquaMenuBarHeight =
           NSHeight([primaryScreen frame]) - NSMaxY([primaryScreen visibleFrame]);

Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Signed-off-by: Ken Thomases <ken@codeweavers.com>
2015-10-13 14:19:05 -07:00
Jeremy Huddleston Sequoia
6e6827aac3 XQuartz: Remove InfoPlist.strings
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2015-10-13 14:19:05 -07:00
Jeremy Huddleston Sequoia
df80e2649a XQuartz: Relax App Transport Security for communicating with the update server
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2015-10-12 02:06:41 -07:00