Commit Graph

16483 Commits

Author SHA1 Message Date
Laurent Carlier
82d9e99bf9 meson: Xephyr Requires xcb-shm version 1.9.3 or newer
Sync with commit 8510f542e5

Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
2018-02-19 13:14:42 -05:00
Jeffrey Smith
272fa18170 os: avoid uninitialized offsets in backtrace
When xorg_backtrace calls unw_get_proc_name and an error occurs, offset
might not be set for the current frame.

Initialize offset for each frame so that the offset from another frame
cannot be used inadvertently.

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-19 13:12:18 -05:00
Jon Turney
6f9d29040c hw/xwin: Update for glxvnd
- Link with libglxvnd in meson.build
- Call xorgGlxCreateVendor() like all other DDX

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2018-02-19 12:44:04 -05:00
Adam Jackson
500cc4a029 dmx: warning fix
/home/ajax/git/xserver/at/../hw/dmx/input/dmxinputinit.c: In function ‘dmxInputInit’:
/home/ajax/git/xserver/at/../hw/dmx/input/dmxinputinit.c:1019:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
         int found;

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-14 17:21:43 -05:00
Adam Jackson
9bcddaf961 dri2: warning fix
/home/ajax/git/xserver/at/../glx/glxdri2.c: In function ‘create_driver_context’:
/home/ajax/git/xserver/at/../glx/glxdri2.c:444:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     const __DRIconfig *driConfig = config ? config->driConfig : NULL;

I don't know why autotools has decided not to be C99 but at least it's
trivial to fix.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-14 17:20:16 -05:00
Adam Jackson
133bd4443b glx: Large commands are context state, not client state
There's no reason a multithreaded client shouldn't be allowed to
interleave other requests (for other contexts) with a RenderLarge. Move
the check into __glXForceCurrent, and store the state in the context not
the client.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-14 17:04:48 -05:00
Adam Jackson
5d87e4f713 miinitext: Remove separate extension toggle list
This was only separate because GLX was loadable. The frontend is now
linked statically, so we can use the static extension list directly.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-14 17:04:48 -05:00
Adam Jackson
67c303fff3 miinitext: Load GLX on the mi path
Add a stub for Xnest so it continues to link, but otherwise we support
GLX on every server so there's no need to make every DDX add it.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-14 17:04:48 -05:00
Adam Jackson
d8ec33fe05 glx: Use vnd layer for dispatch (v4)
The big change here is MakeCurrent and context tag tracking. We now
delegate context tags entirely to the vnd layer, and simply store a
pointer to the context state as the tag data. If a context is deleted
while it's current, we allocate a fake ID for the context and move the
context state there, so the tag data still points to a real context. As
a result we can stop trying so hard to detach the client from contexts
at disconnect time and just let resource destruction handle it.

Since vnd handles all the MakeCurrent protocol now, our request handlers
for it can just be return BadImplementation. We also remove a bunch of
LEGAL_NEW_RESOURCE, because now by the time we're called vnd has already
allocated its tracking resource on that XID.

v2: Update to match v2 of the vnd import, and remove more redundant work
like request length checks.

v3: Add/remove the XID map from the vendor private thunk, not the
backend. (Kyle Brenneman)

v4: Fix deletion of ghost contexts (Kyle Brenneman)

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-14 17:04:44 -05:00
Kyle Brenneman
8753218bea glx: Import glxvnd server module (v2)
This is based on an out-of-tree module written by Kyle:

https://github.com/kbrenneman/libglvnd/tree/server-libglx

I (ajax) did a bunch of cosmetic fixes, ported it off xfree86 API,
added request length checks, and fixed a minor bug or two.

v2: Use separate functions to set/get a context tag's private data, and
call the backend's MakeCurrent when a client disconnects to unbind the
context. (Kyle Brenneman)

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-14 17:04:35 -05:00
Laurent Carlier
d1fdddeb76 meson: Make Security extension optional
Just mimic autoconf file, Security extension needs X-ACE extension

Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-14 14:12:24 -05:00
Laurent Carlier
43ef94068e meson: Make more extensions optional
Just mimic autoconf file for xf86bigfont, screensaver,
xres, xace and xinerama extensions

Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-14 14:12:24 -05:00
Laurent Carlier
3203dd175b meson: Make DPMS extension optional
Just mimic autoconf file, DPMS is disabled with Xquartz

Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-14 14:12:24 -05:00
Adam Jackson
2c3e137b78 dmx: #if PANORAMIX → #ifdef PANORAMIX
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-14 14:12:24 -05:00
Adam Jackson
ceaf427744 xfixes: Restore monitoring of animated cursors
This was broken by:

    commit aa6651f83c
    Author: Adam Jackson <ajax@redhat.com>
    Date:   Thu Jun 8 16:23:12 2017 -0400

        xfixes: Remove the CursorCurrent array

As of that change we look up the current cursor dynamically instead of
trying to track every time it's set through ->DisplayCursor. That would
work, except the 'bits' of an animated cursor is a transparent 1x1
pixel. So now, look up whether there's an animated cursor, and use its
current frame if so.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-14 13:52:45 -05:00
Adam Jackson
0b7a5700ad animcur: Change which CursorPtr we save in external state
Formerly spriteInfo->anim.pCursor would point to the animated cursor (or
NULL if not animated). That value would also be available in
spriteInfo->sprite->current, so instead lets use anim.pCursor to point
to the current animation element.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-14 13:52:45 -05:00
Alexander Volkov
8510f542e5 Xephyr: Require xcb-shm version 1.9.3 or newer
It's needed for FD-passing.

Signed-off-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-14 13:19:21 -05:00
Roman Gilg
2ff6eaad85 Correct xorg_list_is_empty return value description
The helper xorg_list_is_empty returns True when the list is empty and not when
it contains one or more elements.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-02-12 08:09:53 +10:00
Mario Kleiner
bebcc8477c glx: Only assign 8 bpc fbconfigs for composite visuals.
Commit 91c42093b2 ("glx: Duplicate relevant fbconfigs for
compositing visuals") adds many new depth 32 fbconfigs as
composite visuals. On a X-Screen running at depth 24, this
also adds bgra 10-10-10-2 fbconigs, as they also have
config.rgbBits == 32, but these are not displayable on a
depth 24 screen, leading to visually corrupted desktops
under some compositors, e.g., fdo bug 104597 "Compton
weird colors" when running compton with
"compton --backend glx".

Be more conservative for now and only select fbconfigs with
8 bpc red, green, blue components for composite visuals.

Fixes: 91c42093b2 ("glx: Duplicate relevant fbconfigs for
                      compositing visuals")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104597
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-06 14:03:52 -05:00
Lyude Paul
98edb9a35e xwayland: Don't process cursor warping without an xwl_seat
Unfortunately, on my machine Xwayland immediately crashes when I try to
start it. gdb backtrace:

 #0  0x00007ffff74f0e79 in wl_proxy_marshal () from target:/lib64/libwayland-client.so.0
 #1  0x0000000000413172 in zwp_confined_pointer_v1_destroy (zwp_confined_pointer_v1=0x700000000)
     at hw/xwayland/Xwayland@exe/pointer-constraints-unstable-v1-client-protocol.h:612
 #2  0x0000000000418bc0 in xwl_seat_destroy_confined_pointer (xwl_seat=0x8ba2a0)
     at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-input.c:2839
 #3  0x0000000000418c09 in xwl_seat_unconfine_pointer (xwl_seat=0x8ba2a0)
     at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-input.c:2849
 #4  0x0000000000410d97 in xwl_cursor_confined_to (device=0xa5a000, screen=0x8b9d80, window=0x9bdb70)
     at /home/lyudess/Projects/xserver/hw/xwayland/xwayland.c:328
 #5  0x00000000004a8571 in ConfineCursorToWindow (pDev=0xa5a000, pWin=0x9bdb70, generateEvents=1,
     confineToScreen=0) at /home/lyudess/Projects/xserver/dix/events.c:900
 #6  0x00000000004a94b7 in ScreenRestructured (pScreen=0x8b9d80)
     at /home/lyudess/Projects/xserver/dix/events.c:1387
 #7  0x0000000000502386 in RRScreenSizeNotify (pScreen=0x8b9d80)
     at /home/lyudess/Projects/xserver/randr/rrscreen.c:160
 #8  0x000000000041a83c in update_screen_size (xwl_output=0x8e7670, width=3840, height=2160)
     at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-output.c:203
 #9  0x000000000041a9f0 in apply_output_change (xwl_output=0x8e7670)
     at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-output.c:252
 #10 0x000000000041aaeb in xdg_output_handle_done (data=0x8e7670, xdg_output=0x8e7580)
     at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-output.c:307
 #11 0x00007ffff50e9d1e in ffi_call_unix64 () at ../src/x86/unix64.S:76
 #12 0x00007ffff50e968f in ffi_call (cif=<optimized out>, fn=<optimized out>, rvalue=<optimized out>,
     avalue=<optimized out>) at ../src/x86/ffi64.c:525
 #13 0x00007ffff74f3d8b in wl_closure_invoke () from target:/lib64/libwayland-client.so.0
 #14 0x00007ffff74f0928 in dispatch_event.isra () from target:/lib64/libwayland-client.so.0
 #15 0x00007ffff74f1be4 in wl_display_dispatch_queue_pending () from target:/lib64/libwayland-client.so.0
 #16 0x00007ffff74f200b in wl_display_roundtrip_queue () from target:/lib64/libwayland-client.so.0
 #17 0x0000000000418cad in InitInput (argc=12, argv=0x7fffffffd9c8)
     at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-input.c:2867
 #18 0x00000000004a20e3 in dix_main (argc=12, argv=0x7fffffffd9c8, envp=0x7fffffffda30)
     at /home/lyudess/Projects/xserver/dix/main.c:250
 #19 0x0000000000420cb2 in main (argc=12, argv=0x7fffffffd9c8, envp=0x7fffffffda30)
    at /home/lyudess/Projects/xserver/dix/stubmain.c:34

This appears to be the result of xwl_cursor_confined_to() and
xwl_screen_get_default_seat(). While not against protocol, mutter ends
up sending xdg_output before wl_seat. xwl_screen_get_default_seat()
makes the naïve assumption that we always have a valid seat, we end up
returning a pointer to the empty list itself instead of an actual seat
and causing ourselves to segfault.

So, actually return NULL in xwl_screen_get_default_seat() if the seat
list is empty, and skip any pointer confinement processing in
xwl_cursor_confined_to() when we don't have a seat setup yet.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-06 13:47:25 -05:00
Jeff Smith
fd21b282dc xfree86: Only call PreInit handler if it exists for device
DoConfigure() attempts to call the PreInit handler on a device without
checking that the handler exists.

Check that the PreInit handler exists for a device before attempting to
call it.

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-05 15:40:20 -05:00
Jeff Smith
e81031f3fd xfree86: Allocate sufficienct space for dev2screen array
When the dev2screen is sized to xf86NumDrivers in DoConfigure(),
subsequent code may attempt to write past the end of the array.

Size the dev2screen array to nDevToConfig instead.

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-05 15:40:17 -05:00
Jeff Smith
1a24a0ae7b xfree86: Do not use uninitialized pointer during probe
Commits b5dffbb and d75ffcd introduce code in xf86platformProbe() that
references a member of xf86configptr.  However, when using the
"-configure" option, xf86configptr may not be initialized when
xf86platformProbe() is called.

Avoid referencing a member of xf86configptr if uninitialized.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100405
Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-05 15:40:13 -05:00
Jan Beich
1e23f03dd5 shm, xwayland: prefer atomic close-on-exec without O_TMPFILE
Signed-off-by: Jan Beich <jbeich@FreeBSD.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-02 15:28:46 -05:00
Michal Srb
3e3b8a40fe modesetting: Check for -1 before converting to unsigned int.
dri2.c:516:21: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
    if (front->name < 0)

Prevents a failure from being ignored.
2018-02-02 15:19:32 -05:00
Michal Srb
a9f68688f3 xfree86: Silence always true condition warning.
xf86pciBus.c:1464:21: warning: comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always true [-Wtautological-constant-out-of-range-compare]
    if (pVideo->bus < 256)

The code used to be in xf86FormatPciBusNumber and compared parameter which was int, but since b967bf2a it was inlined now it works with uint8_t.
2018-02-02 15:19:15 -05:00
Raimonds Cicans
b75835a435 Xdmx: fix input driver initialization code paths
Problem: Xdmx exit with error "(Fatal Error) dmx: Unknown input argument: "
if local input driver is specified (example: -input local,usb-kbd,usb-mou).

Cause: code block for remote input drivers is placed in code path common
for all drivers.

Fix: affected code block moved to remote input driver code path part.

Signed-off-by: Raimonds Cicans <ray@apollo.lv>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-02 15:09:13 -05:00
Adam Jackson
cbf09619f2 meson: Get more xkb configuration from xkbcomp.pc
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-02-02 15:07:25 -05:00
Alexander Volkov
93c16b0524 Xephyr: Call forgotten XShmDetach if can't mmap SHM segment
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-02 14:54:11 -05:00
Alex Goins
6b26a7bda9 randr: Fix rotation check in ProcRRSetScreenSize()
ProcRRSetScreenSize() does bounds checking to ensure that none of the CRTCs have
a viewport that extends beyond the new screen size. In doing so, it accounts for
if the CRTC is rotated 90 or 270 degrees, swapping width and height.

However, it does so by testing if crtc->rotation is equal to RR_Rotate_90 or
RR_Rotate_270. crtc->rotation is a bit mask, and it includes reflection as well
as rotation. If a CRTC is reflected as well as rotated, it will incorrectly fail
this test, resulting in incorrect dimensions being used to verify the validity
of the new screen size. In some cases, this can cause valid uses of
ProcRRSetScreenSize() to fail with BadMatch.

This patch fixes the issue by testing that the bits RR_Rotate_90 or
RR_Rotate_270 are set, rather than testing for equality.

Signed-off-by: Alex Goins <agoins@nvidia.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2018-02-01 16:36:59 -05:00
Alexander Volkov
90996f5909 Xephyr: Prefer using MIT-SHM FD-passing when possible
This makes the shared memory visible only for the Xephyr
and the X server to which it is connected.

Signed-off-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: Keith Packard <keithp@keithp.com>
2018-02-01 11:40:27 -05:00
Alexander Volkov
8a220bd83c Xephyr: Extract functions to create/delete shared memory segments
Signed-off-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: Keith Packard <keithp@keithp.com>
2018-02-01 11:40:26 -05:00
Jeff Smith
510e7d0d86 os: Always return microseconds from GetTimeInMicros()
When a monotonic clock is not available, GetTimeInMicros() returns the
time in nanoseconds.  Instead, return the time in microseconds, as the
name indicates.

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-01-31 16:02:39 -05:00
Giuseppe Bilotta
94e7ca6a56 rrmonitor: allocate using the correct type
Monitor outputs are of type RROutput, not RRCrtc.

(Which are both XID, so this makes no difference in practice, other than
being technically correct.)

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-01-31 14:43:56 -05:00
Jeff Smith
ff410c56bf glamor: tidy up some gradient color formulas
- Avoid some needlessly complex equations for calculating the color at a
  point in a gradient field.
- Avoid calculating certain values multiple times.
- Use similar variable names across the two versions of the get_color
  function where practical.

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-01-29 16:18:31 -05:00
Jeff Smith
3bd17dff1a glamor: remove unused variables in linear gradient shader
Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-01-29 16:18:28 -05:00
Jeff Smith
5815c7b595 glamor: fix no-reflect case for gradients
When compositing a no-reflect gradient, 'before' the gradient is empty,
but 'after' the gradient is padded with the final color.  Both sides are
supposed to be empty.

This is fixed by moving the virtual stops to match the first and last
client-supplied stops for no-reflect gradients, then causing everything
'before' the initial virtual stop and 'after' the final virtual stop to
emit rgba(0,0,0,0).  This does not impact gradients using the other
reflect modes.

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-01-29 16:18:07 -05:00
Jeff Smith
3e377e238f glamor: fix repeat-reflect case in linear gradient shader
If _pt_distance is negative, it causes the final distance to be negative
in the repeat-reflect case.  Moving the scaling by _pt_distance earlier
avoids this problem, and simplifies some equations as a bonus.

Bugzilla: https://bugs.freedesktop.org/98508
Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-01-29 16:18:04 -05:00
Jeff Smith
9b7b8720eb edid: use value returned from pruning duplicate modes
xf86PruneDuplicateModes is passed a linked list of modes, and after
pruning the duplicate nodes, the new head of the list is returned.  If
the first element is removed, the head of the list will change and the
returned value needs to be assigned.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103722
Thanks: John Lumby <johnlumby@hotmail.com>
Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-01-29 14:38:12 -05:00
Adam Jackson
dd00e5466a xfree86: Remove broken RANDR disabling logic (v4)
The only way to get at xf86Info.disableRandR from configuration is
Option "RANDR" "foo" in ServerFlags, which probably nobody is using
seeing as it's not documented. The other way it could be set is if a
screen supports RANDR 1.2, in which case we set it to avoid trying to
use the RANDR 1.1 compat code. If the second screen is not 1.2-aware
then this would mean we don't do RANDR setup on the second screen at
all, which would almost certainly crash the first time you try to do
RANDR operations on the second screen.

Fix that all by deletion, and just check whether the screen already has
RANDR initialized before installing the stub support. If you want to
disable RANDR, use the Extensions section of xorg.conf instead.

v2: Also remove a now entirely pointless log message, telling you to
ignore a line we will no longer print.

v3: Explain the fallback path in InitOutput. (Keith Packard)

v4: Check whether the RANDR private key is initialized before trying to
use it to look up the screen private.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2018-01-29 14:31:34 -05:00
Hawking Zhang
9a416a478c glamor: Add 30bit RGB color format support
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>

[ Michel Dänzer: Adapt to glamor changes since 1.19 ]

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
2018-01-25 12:21:49 -05:00
Olivier Fourdan
fc8b7d05e7 xwayland: place a manual redirect on windows
Place a manual redirect on windows on xwl_realize_window() and remove
it on xwl_unrealize_window() to avoid the X11 window manager removing
its redirect before Xwayland has unrealized the window (e.g. if the X11
window manager has terminated unexpectedly)

Suggested by Daniel Stone <daniel@fooishbar.org>

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2018-01-25 10:31:50 -05:00
Olivier Fourdan
3362422e84 xwayland: remove dirty window unconditionally on unrealize
This is a rare occurrence of a crash in Xwayland for which I don't have
the reproducing steps, just a core file.

The backtrace looks as follow:

  #0  raise () from /usr/lib64/libc.so.6
  #1  abort () from /usr/lib64/libc.so.6
  #2  OsAbort () at utils.c:1361
  #3  AbortServer () at log.c:877
  #4  FatalError () at log.c:1015
  #5  OsSigHandler () at osinit.c:154
  #6  <signal handler called>
  #7  xwl_glamor_pixmap_get_wl_buffer () at xwayland-glamor.c:162
  #8  xwl_screen_post_damage () at xwayland.c:514
  #9  block_handler () at xwayland.c:665
  #10 BlockHandler () at dixutils.c:388
  #11 WaitForSomething () at WaitFor.c:219
  #12 Dispatch () at dispatch.c:422
  #13 dix_main () at main.c:287

The crash is caused by dereferencing “xwl_pixmap->buffer” in
xwl_glamor_pixmap_get_wl_buffer() because “xwl_pixmap” is NULL.

Reason for this is because the corresponding pixmap is from the root
window and xwayland is rootless by default.

This can happen if the window was mapped, redirected, damaged and
unredirected immediately, before the damage is processed by Xwayland.

Make sure to remove the dirty window from the damage list on unrealize
to prevent this from happening.

Credit goes to Adam Jackson <ajax@nwnk.net> and Daniel Stone
<daniel@fooishbar.org> for finding the root cause the issue.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-01-25 10:31:45 -05:00
Jason Gerecke
29a5423abd xwayland: Support for BTN_STYLUS3 kernel events
BTN_STYLUS3 has been introduced by the Linux 4.15 kernel to report the
status of the third button present on Wacom's new "Pro Pen 3D" stylus.
Treat this button like xf86-input-wacom and send a button 8 event
("navigate back") when received from Wayland.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-01-25 18:26:09 +10:00
Michal Srb
71348e99a8 os/inputthread: Force unlock when stopping thread.
The inputthread is kept locked all the time while X server's VT is not active.
If the X server is terminated while not active, it will be stuck forever in
InputThreadFini waiting for the thread to join, but it wouldn't because it is
locked.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=103782
Signed-off-by: Michal Srb <msrb@suse.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-01-24 16:27:31 -05:00
Peter Harris
d5c23b2948 composite: Propagate damagedDescendants when reparented
If a window that is fully covered by an automatic-redirected descendant
(even implicitly, eg. via BackingStores) is reparented, the automatic
updates could be broken if the new parent is not marked as having
damaged descendants.

Fix this issue by propagating the damagedDescendants flag whenever a
window is reparented.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Harris <pharris@opentext.com>
2018-01-24 16:20:21 -05:00
Rinat Ibragimov
ac138f9b31 modesetting: setup colormap
Signed-off-by: Rinat Ibragimov <ibragimovrinat@mail.ru>
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
2018-01-24 16:17:22 -05:00
Adam Jackson
5cb330cd5d Revert "xfree86: Remove broken RANDR disabling logic (v3)"
Tsk. This broke vesa for me, the rrGetScrPriv in InitOutput will crash
if randr's screen private key hasn't been initialized yet. That seems
dumb, but let's not leave it broken.

This reverts commit c08d7c1cdd.
2018-01-24 15:24:00 -05:00
Adam Jackson
c08d7c1cdd xfree86: Remove broken RANDR disabling logic (v3)
The only way to get at xf86Info.disableRandR from configuration is
Option "RANDR" "foo" in ServerFlags, which probably nobody is using
seeing as it's not documented. The other way it could be set is if a
screen supports RANDR 1.2, in which case we set it to avoid trying to
use the RANDR 1.1 compat code. If the second screen is not 1.2-aware
then this would mean we don't do RANDR setup on the second screen at
all, which would almost certainly crash the first time you try to do
RANDR operations on the second screen.

Fix that all by deletion, and just check whether the screen already has
RANDR initialized before installing the stub support. If you want to
disable RANDR, use the Extensions section of xorg.conf instead.

v2: Also remove a now entirely pointless log message, telling you to
ignore a line we will no longer print.

v3: Explain the fallback path in InitOutput. (Keith Packard)

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2018-01-24 11:39:31 -05:00
Olivier Fourdan
da8de2a7f6 xwayland: Add optional xdg-output support
The xdg-output protocol aims at describing outputs in way which is
more in line with the concept of an output on desktop oriented systems.

For now it just features the position and logical size which describe
the output position and size in the global compositor space.

This is however much useful for Xwayland to advertise the output size
and position to X11 clients which need this to configure their surfaces
in the global compositor space as the compositor may apply a different
scale from what is advertised by the output scaling property (to achieve
fractional scaling, for example).

This was added in wayland-protocols 1.10.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2018-01-24 11:34:59 -05:00