Commit Graph

16366 Commits

Author SHA1 Message Date
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
Michel Dänzer
75408f53d4 xf86XvMCScreenInit: Clear pScreenPriv->dixinfo when freeing pAdapt
Fixes double-free later in xf86XvMCCloseScreen, which would generally
cause fireworks.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2018-01-24 11:21:08 -05:00
Michel Dänzer
76732f498f Revert "present: Only send PresentCompleteNotify events to the presenting client"
This reverts commit 5c00e69363.

It broke the Gallium nine state tracker, which makes PresentPixmap
requests on one display connection and processes the corresponding
events on another one.

The issue that motivated this change is prevented on the client side by
https://cgit.freedesktop.org/mesa/mesa/commit/?id=7b0e8264dd21ae05521d08d41fecd84139401fef

Bugzilla: https://bugs.freedesktop.org/104678
2018-01-24 11:40:50 +01:00
Adam Jackson
f704620e5d glx: Move provider setup interface to glx_extinit.h
Keeps us from needing to add glx/ to the include path everywhere, since
we can't add it to the dix include path because the header file names
conflict with glxproxy.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2018-01-22 17:29:45 -05:00
Adam Jackson
c2b2f06aa0 miinitext: General cleanup (v2)
This really just wants to be the list of disable booleans and
initialization functions, and nothing else. Stop including the protocol
headers from extinit.h, remove a stray mention of xgl, and move an
XInput declaration to a better place.

v2: A bunch of drivers assume they'll get the DPMS tokens implicitly,
so add it to globals.h.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2018-01-22 17:28:12 -05:00
Keith Packard
4d5aab66c0 xfree86: Disable cursor whenever turning off CRTC during modeset
This makes sure the CRTC's cursor is hidden before we hand the CRTC
over to some other application.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2018-01-22 17:22:21 -05:00
Keith Packard
29f79bedf2 randr: Declare incoming property values const
RRChangeOutputProperty and RRConfigureOutputProperty should not modify
their parameters, and callers may want to pass pointers to fixed data,
so declare the value pointers as const in both cases.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2018-01-22 17:22:21 -05:00
Keith Packard
a12485ed84 xf86-video-modesetting: Update property values at detect and uevent time
We were updating the link-status property when a uevent came in, but
we also want to update the non-desktop property, and potentially
others as well. We also want to check at detect time in case we don't
get a hotplug event.

This patch updates every property provided by the kernel, sending
changes to DIX so it can track things as well.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2018-01-22 17:22:21 -05:00
Keith Packard
44d5f2eb8a xf86-video-modesetting: Support new vblank kernel API [v2]
drmCrtcGetSequence returns the current vblank sequence and time.

drmCrtcQueueSequence queues an event for delivery at a specified
vblank sequence.

Use these (when available) in preference to drmWaitVBlank.

v2: Remove FIRST_PIXEL_OUT_FLAG. This has been removed from the kernel
    API.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2018-01-22 17:22:21 -05:00
Adam Jackson
627dfc2f83 automake: Fix 'make distcheck'
Add some missing meson.builds to the distball, and update the meson
build test to work when the distcheck srcdir != builddir. The test build
directory will be $(srcdir)/_distcheck_build so srcdir will need to be
writable; this shouldn't be too much to ask I hope.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-01-22 17:19:03 -05:00
Jon Turney
2d29daf4c6 meson.build: Fix hw/xwin build when dependencies are installed in a non-default location
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2018-01-22 13:50:20 -05:00
Jon Turney
514d2c243e meson: Use and prefer tirpc for Secure RPC authentication
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-01-22 13:15:10 -05:00
Pekka Paalanen
f72587ecc7 xwayland: reduce over-damage
If an X11 app draws a little here, some there, and a tiny bit in the
opposite corner, using RegionExtents for the damage to be sent to the
Wayland compositor will cause massive over-damaging.

However, we cannot blindly send an arbitrary number of damage
rectangles, because there is a risk of overflowing the Wayland
connection. If that happens, it triggers an abort in libwayland-client.

Try to be more accurate with the damage by sending up to 256 rectangles
per window, and fall back to extents otherwise. The number is completely
arbitrary.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-01-22 12:27:28 -05:00
Martin Wilck
a5e9bcad7a xfree86: add default modes for 16:9 and 16:10
Improve the user experience for users with wide screens by adding standard
16:9 and 16:10 modes to extramodes, as suggested previously
(https://lists.x.org/archives/xorg-devel/2016-February/048866.html).
Tested successfully on my laptop. Feedback welcome.

See also https://bugs.freedesktop.org/show_bug.cgi?id=37858.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-01-18 14:16:35 -05:00
David Weinehall
528cf6fcee sync: Fix diffgreater comparison
xsync: Fix diffgreater comparison

While transitioning from CARD64 to int64,
the GreaterThan call was mistakenly transformed into ">=".
Part of this was fixed already in
commit 8060196a3e

This patch fixes the remaining issue.

Signed-off-by: David Weinehall <david.weinehall@linux.intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2018-01-18 14:08:46 -05:00
Keith Packard
32b4262721 modesetting: Use seq instead of msc in ms_queue_vblank failure path
When the call to queue a vblank event fails, we need to clean up by
removing the user-space queue entry. That is indexed by the local
sequence number, not by the kernel vblank count. The call in this
case was just passing the wrong value.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2018-01-16 16:10:27 -05:00
Adam Jackson
15d91df474 x86emu: Teach the debug code about varargs
With -Wformat-nonliteral and a debug build you'd get yelled at here:

../hw/xfree86/x86emu/x86emu/debug.h:188:9: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]

To fix this, rewrite the printf code to actually use varargs and the
appropriate format attribute. All callers of DECODE_PRINTF() pass a
string with no % specifiers, so we pass that as the argument to
printf("%s"). For DECODE_PRINTF2() we just pass the args through.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2018-01-16 16:08:38 -05:00
Adam Jackson
1274015186 build: Remove <*dbm.h> checks
Formerly used by the rgb database code, which hasn't been a thing in
over a decade.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-01-16 16:08:28 -05:00