Commit Graph

15393 Commits

Author SHA1 Message Date
Adam Jackson
137ac094e7 dix: Push UpdateCurrentTimeIf down out of the main loop
This was added in:

    commit 312910b4e3
    Author: Chase Douglas <chase.douglas@canonical.com>
    Date:   Wed Apr 18 11:15:40 2012 -0700

        Update currentTime in dispatch loop

Unfortunately this is equivalent to calling GetTimeInMillis() once per
request. In the absolute best case (as on Linux) you're only hitting the
vDSO; on other platforms that's a syscall. Either way it puts a pretty
hard ceiling on request throughput.

Instead, push the call down to the requests that need it; basically,
grab processing and event generation.

Cc: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-05-04 10:58:01 -04:00
Peter Hutterer
ac164e5887 xkb: after changing the keymap, force an indicator update
When NumLock is on and a new keymap is applied, the next modifier state
change will turn off that LED (but leave the state enabled). The cause
for this is a bit convoluted:

* the SLI explicitState is copied from the current state in
  ProcXkbGetKbdByName. Thus, if NumLock is on, that state is 0x2.
* on the next modifier key press (e.g. Shift), XkbApplyState() calls into
  XkbUpdateIndicators() -> XkbUpdateLedAutoState() to update SLIs (if any)
  for the currently changed modifier. But it does so with a mask only for
  the changed modifier (i.e. for Shift).
* XkbUpdateLedAutoState() calculates the state based on this mask and
  ends up with 0 because we don't have a Shift LED and we masked out the
  others.
* XkbUpdateLedAutoState() compares that state with the previous state
  (which is still 0x2) and then proceeds to turn the LED off

This doesn't happen in the normal case because either the mask
encompasses all modifiers or the state matches of the masked-out
modifiers matches the old state.

Avoid this issue by forcing an SLI update after changing the keymap.
This updates the sli->effectiveState and thus restores everything to
happy working order.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-05-04 10:55:09 -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
Jeremy Huddleston Sequoia
16d6733c63 XQuartz: Fix the help text for --with-bundle-id-prefix
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-05-03 23:29:48 -07:00
Jeremy Huddleston Sequoia
214a66b661 XQuartz: Remove --with-launchd-id-prefix
It's been deprecated for years.

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
Dave Airlie
aa4e757130 glamor: add glamor_finish API
Some drivers are calling glFinish, they really should be doing this.

This also is needed for some reverse prime scenarios.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-04-29 10:19:17 -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
Alexandre Courbot
4cc3288073 configure.ac: Keep environment CFLAGS when testing
DRI2 detection could fail if configure is invoked with a sysroot passed
as CFLAGS. Ideally configure should invoke gcc with the sysroot argument
passed to the configure script, but for some reason this is not done by
AC_COMPILE_IFELSE.

Fix this by ensuring CFLAGS are preserved when checking for stuff.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-04-25 15:14:30 -04:00
Simon Thum
16e4bce9e5 dix/ptraccel: Remove float literals
This was fine back when valuators were integer. Device
properties are float (not double), so some instances remain.

Signed-off-by: Simon Thum <simon.thum@gmx.de>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-04-22 14:32:30 +10:00
Simon Thum
c8e5fc3057 dix/ptraccel: Fix memory leak in InitPredictableAccelerationScheme
This was quite unlikely except in situations where a proper startup
would have been impossible anyway, but since automated checks don't
grade likelyhood just fix it.

Detected by Jeremy Huddleston's clang checks.

Signed-off-by: Simon Thum <simon.thum@gmx.de>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-04-22 14:32:24 +10:00
Peter Hutterer
f641ae4122 Xi: don't deliver emulated motion events for non-emulating touches
The touchpoint knows whether it should be emulating or not and we have a check
for that later. Check for this before we generate the event and try to deliver
it, lest we trigger a bug warning.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-04-19 07:30:06 +10: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
Emil Velikov
3981dcdd48 dri3: remove unused file dri3int.h
Copied during the prototyping stage and never used.

Cc: Keith Packard <keithp@keithp.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-04-18 11:26:36 -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
Adam Jackson
2c3a3afb51 dix: Add RootWindowFinalizeCallback
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
8437955515 glamor: fix wrong offset on composite rectangles
When using PictOpSrc, the destination is wrongly shifted back to (0, 0).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94568
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-04-15 16:31:36 -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
Peter Hutterer
f9b5bbaa3a xkb: fix SlowKeys release/reject beeps
Wrong use of the mask here caused a beep whenever a key was rejected but
also when it was released after being accepted. Fix the mask to check
for the correct enabled controls.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-04-15 16:20:04 -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
15af78fc56 glx: Enable GLX_SGI_make_current_read in the core
GLX 1.3 implies equivalent functionality, so this is safe to enable
unconditionally, and bindContext always takes both drawable and readable
arguments in any case. Mesa stopped exporting the __DRI_READ_DRAWABLE
extension in 8.0 (when the DRI1 drivers were removed) so this will
restore the extension string.

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:07:14 -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