[PATCH xserver 2/4 v5] xwayland: add a server sync before repeating keys

2016-05-24 Thread Olivier Fourdan
Key repeat is handled by the X server, but input events need to be processed and forwarded by the Wayland compositor first. Make sure the Wayland compositor is actually processing events, to avoid repeating keys in Xwayland while the Wayland compositor cannot deal with input events for whatever re

[PATCH xserver] glamor: Fix sampling outside of RGBx source/mask pictures

2016-05-24 Thread Michel Dänzer
From: Michel Dänzer RENDER requires that sampling outside of any source/mask picture results in alpha == 0.0. The OpenGL border colour cannot set alpha = 0.0 if the texture format doesn't have an alpha channel, so we have to use the RepeatFix handling in that case. Also, only force alpha = 1.0

[PATCH xserver v3] xwayland: Use the CLOCK_MONOTONIC clock

2016-05-24 Thread Jonas Ådahl
By default the X server will try CLOCK_MONOTONIC_COARSE before CLOCK_MONOTONIC, while A Wayland compositor may only support getting their timestamps from the CLOCK_MONOTONIC clock. This causes various issues since it may happen that a timestamp from CLOCK_MONOTONIC retrieved before a sending an X r

[PATCH xserver 11/25] Remove AddEnabledDevice and AddGeneralSocket APIs

2016-05-24 Thread Keith Packard
All uses of these interfaces should instead be using the NotifyFd API instead. Signed-off-by: Keith Packard --- include/os.h| 8 os/WaitFor.c| 4 +--- os/connection.c | 23 --- 3 files changed, 5 insertions(+), 30 deletions(-) diff --git a/include/os.h b/i

[PATCH xserver 12/25] dix: Use list for ready clients

2016-05-24 Thread Keith Packard
This converts the dispatch loop into using a list of ready clients instead of an array. For now, that list is constructed from the array returned by WaitForSomething. Signed-off-by: Keith Packard --- dix/dispatch.c | 86 ++--- include/dixstruc

[PATCH xserver 23/25] xfree86: Switch from select(2) to poll(2)

2016-05-24 Thread Keith Packard
xf86WaitForInput and the xf86 SIGIO handling code. Signed-off-by: Keith Packard --- hw/xfree86/common/xf86Events.c | 1 - hw/xfree86/os-support/shared/posix_tty.c | 33 ++--- hw/xfree86/os-support/shared/sigio.c | 63 +--- 3 files changed, 5

[PATCH xserver 09/25] dmx: Eliminate use of AddEnabledDevice

2016-05-24 Thread Keith Packard
Use SetNotifyFd instead, with the hope that someday someone will come fix this to be more efficient -- right now, the wakeup handler is doing the event reading, instead of the notify callback. Signed-off-by: Keith Packard --- hw/dmx/input/dmxcommon.c | 17 + hw/dmx/input/dmxsigio

[PATCH xserver 14/25] dix: Intermediate GrabServer state 'GrabKickout' not needed

2016-05-24 Thread Keith Packard
The intermediate grabState, "GrabKickout", was used to trigger dispatch into going back to WaitForSomething after doing a GrabServer so that the set of ready clients would be recomputed to match what the server should be processing. As we only process one client per WaitForSomething call, we will a

[PATCH xserver 03/25] hw/kdrive: Use passed-in fd for kdrive/linux APM monitoring [v2]

2016-05-24 Thread Keith Packard
This is a cleanup, proposed by Adam Jackson, but wasn't merged with the original NotifyFD changes. Signed-off-by: Keith Packard --- hw/kdrive/linux/linux.c | 64 - 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/hw/kdrive/linux/linu

[PATCH xserver 17/25] os: use poll(2) instead of select(2)

2016-05-24 Thread Keith Packard
This leaves all of the select file descriptor bashing in place, and just adds the necessary hooks to compute the poll data as well. Signed-off-by: Keith Packard --- os/WaitFor.c| 143 ++--- os/connection.c | 214

[PATCH xserver 06/25] Remove fd_set from Block/Wakeup handler API

2016-05-24 Thread Keith Packard
This removes the last uses of fd_set from the server interfaces outside of the OS layer itself. Signed-off-by: Keith Packard --- Xext/sleepuntil.c | 17 +++-- Xext/sync.c | 12 ++-- dix/dixfonts.c | 7 +++ dix/dixutils.c

[PATCH xserver 16/25] ephyr: Use screen block handler for flushing changes

2016-05-24 Thread Keith Packard
ephyr needs to make sure it calls glXSwapBuffers after glamor finishes its rendering. As the screen block handler is now called last, we have to use that instead of a registered block/wakeup handler to make sure the GL rendering is done before we copy it to the front buffer. Signed-off-by: Keith P

[PATCH xserver 01/25] hw/xfree86: Use NotifyFd for other input fd wakeups

2016-05-24 Thread Keith Packard
Remove code in xf86Wakeup for dealing with other input and switch to using the new NotifyFd interface. Signed-off-by: Keith Packard --- hw/xfree86/common/xf86Events.c | 76 -- 1 file changed, 22 insertions(+), 54 deletions(-) diff --git a/hw/xfree86/commo

[PATCH xserver 05/25] Remove readmask from screen block/wakeup handler

2016-05-24 Thread Keith Packard
With no users of the interface needing the readmask anymore, we can remove it from the argument passed to these functions. Signed-off-by: Keith Packard --- composite/compalloc.c | 4 +-- dix/dixutils.c | 14 doc/Xinput.xml

[PATCH xserver 02/25] dix: Switch to the libXfont2 API (v2)

2016-05-24 Thread Keith Packard
This new libXfont API eliminates exposing internal X server symbols to the font library, replacing those with a struct full of the entire API needed to use that library. v2: Use libXfont2 instead of libXfont_2 Signed-off-by: Keith Packard --- Xext/xf86bigfont.c | 4 +- configure.ac

[PATCH xserver 04/25] modesetting: Use passed-in fd for drm event monitoring NotifyFd callback

2016-05-24 Thread Keith Packard
This is a cleanup, proposed by Adam Jackson, but wasn't merged with the original NotifyFD changes. Signed-off-by: Keith Packard --- hw/xfree86/drivers/modesetting/vblank.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/drivers/modesetting/vblank.c b/hw/xfree86/dr

[PATCH xserver 10/25] xnest: Use SetNotifyFd to receive events

2016-05-24 Thread Keith Packard
Signed-off-by: Keith Packard --- hw/xnest/Init.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/xnest/Init.c b/hw/xnest/Init.c index bec2c51..e8a700e 100644 --- a/hw/xnest/Init.c +++ b/hw/xnest/Init.c @@ -35,6 +35,7 @@ is" without express or implied warranty. #inc

[PATCH xserver 08/25] kdrive/ephyr: Poll for events in block handler

2016-05-24 Thread Keith Packard
With the driver block handler guaranteed to be the last thing called before the server blocks, we can now reliably check for events there and never block with events read but not processed. Signed-off-by: Keith Packard --- hw/kdrive/ephyr/ephyr.c | 14 +- hw/kdrive/ephyr/ephyr.h

[PATCH xserver 00/25] Eliminiate fd_set and switch to poll(2)

2016-05-24 Thread Keith Packard
I've finished the migration from select(2) to poll(2) to get rid of any fd value dependencies in the server. This is all sitting in my 'eliminate_fd_set' branch and is built on top of my 'input-thread' branch, which is nearly ready to merge. Get rid of fd_set from block and wakeup handler interfa

[PATCH xserver 19/25] os: Use poll(2) instead of select(2) in ErrorConnMax

2016-05-24 Thread Keith Packard
This avoids problems if the file descriptor is too large for select(2) Signed-off-by: Keith Packard --- os/connection.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/os/connection.c b/os/connection.c index be82610..6b74c76 100644 --- a/os/connection.c +++ b/os/

[PATCH xserver 21/25] os: Use poll(2) for input thread

2016-05-24 Thread Keith Packard
Replace use of select(2) to avoid fd limits Signed-off-by: Keith Packard --- os/inputthread.c | 34 +++--- os/osdep.h | 3 +++ os/utils.c | 11 +++ 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/os/inputthread.c b/os/inputthread.

[PATCH xserver 13/25] dix/os: Merge priority computation into SmartScheduleClient

2016-05-24 Thread Keith Packard
Instead of having scheduling done in two places (one in WaitForSomething, and the other in SmartScheduleClient), just stick all of the scheduling in SmartScheduleClient. Signed-off-by: Keith Packard --- dix/dispatch.c | 17 ++--- os/WaitFor.c | 33 ++---

[PATCH xserver 15/25] Modify ready_client list directly from WaitForSomething

2016-05-24 Thread Keith Packard
This changes the WaitForSomething API so that it only notifies DIX when a client becomes ready to read. This avoids walking over all existing ready clients to compute the total set each time. Signed-off-by: Keith Packard --- dix/dispatch.c | 45 + inc

[PATCH xserver 18/25] os: Eliminate code managing fd_set masks for WaitForSomething

2016-05-24 Thread Keith Packard
This gets rid of all of the fd_set masks used while the server is running. Signed-off-by: Keith Packard --- dix/dispatch.c | 4 ++ include/dixstruct.h | 29 os/WaitFor.c| 1 - os/connection.c | 198 os/io.c

[PATCH xserver 24/25] dmx: Switch from select(2) to poll(2) for input

2016-05-24 Thread Keith Packard
Signed-off-by: Keith Packard --- hw/dmx/input/lnx-ms.c | 19 ++- hw/dmx/input/lnx-ps2.c | 12 +--- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/hw/dmx/input/lnx-ms.c b/hw/dmx/input/lnx-ms.c index 621f0fe..3d028be 100644 --- a/hw/dmx/input/lnx-ms.c +++

[PATCH xserver 22/25] kdrive: switch from select(2) to poll(2)

2016-05-24 Thread Keith Packard
This avoids fd limits Signed-off-by: Keith Packard --- hw/kdrive/fake/mouse.c | 1 - hw/kdrive/linux/evdev.c | 14 +- hw/kdrive/linux/mouse.c | 34 +- hw/kdrive/linux/ms.c| 13 + hw/kdrive/linux/ps2.c | 13 + hw/kdrive/l

[PATCH xserver 25/25] os: eliminate fd value limits for clients

2016-05-24 Thread Keith Packard
With no code depending on the range of file descriptors, checking for that can be eliminated. Signed-off-by: Keith Packard --- os/connection.c | 74 - os/osdep.h | 37 ++--- 2 files changed, 22 insertions(+), 89

[PATCH xserver 20/25] os: Generalize poll fd management code

2016-05-24 Thread Keith Packard
We want to use this in the input thread too Signed-off-by: Keith Packard --- os/WaitFor.c| 10 ++--- os/connection.c | 123 ++-- os/osdep.h | 29 +++-- os/utils.c | 89 4 files c

[PATCH xserver 07/25] dix: Call screen block/wakeup handlers closest to blocking [v2]

2016-05-24 Thread Keith Packard
The screen block and wakeup handlers are the only ones which provide a well known ordering between the wrapping layers; placing these as close as possible to the server blocking provides a way for the driver to control the flow of execution correctly. Switch the shadow code to run in the screen bl