Re: [PATCH v5 00/13] PRIME Synchronization

2016-05-26 Thread Dave Airlie
On 20 May 2016 at 08:36, Alex Goins wrote: > Hi Dave, > > Any update on this? Anything I can do to help? Hey, can you take a look at prime: clean up slave bo properly. (v3) I think with this rebased onto that, we should be pretty much good to merge. Dave.

Re: [PATCH RESEND xserver v3] xfree86: Immediately handle failure to set HW cursor

2016-05-26 Thread Alexandre Courbot
Friendly ping, as it would be very nice to see this merged! On Fri, May 13, 2016 at 7:36 PM, Alexandre Courbot wrote: > On 05/13/2016 01:04 AM, Adam Jackson wrote: >> >> On Thu, 2016-05-12 at 16:04 +0900, Alexandre Courbot wrote: >>> >>> There is currently no reliable way to

[PATCH xserver] randr: Adjust master's last set time with slaves

2016-05-26 Thread Nikhil Mahale
In prime configurations master's last set time may not be latest and greatest, adjust it with slaves last set time, pick up greatest one. Otherwise xserver may end with events which has lastSetTime < lastConfigTime even if that's not the case and confuse xrandr client. Signed-off-by: Nikhil

Re: [PATCH xserver] randr: Adjust master's last set time with slaves

2016-05-26 Thread Nikhil Mahale
On 05/27/2016 01:40 AM, Hans de Goede wrote: Hi, On 26-05-16 18:20, Nikhil Mahale wrote: In prime configurations master's last set time may not be latest and greatest, adjust it with slaves last set time, pick up greatest one. Otherwise xserver may end with events which has lastSetTime <

[PATCH xserver 20/23] os: Use poll(2) for input thread

2016-05-26 Thread Keith Packard
Replace use of select(2) to avoid fd limits Signed-off-by: Keith Packard --- os/inputthread.c | 85 1 file changed, 48 insertions(+), 37 deletions(-) diff --git a/os/inputthread.c b/os/inputthread.c index

[PATCH xserver 17/23] os: Add ospoll interface

2016-05-26 Thread Keith Packard
This provides a wrapper around poll, epoll or WSAPoll providing a callback-based interface for monitoring activity on a large set of file descriptors. Signed-off-by: Keith Packard --- configure.ac| 2 +- include/dix-config.h.in | 9 + os/Makefile.am |

[PATCH xserver 22/23] Allow 1024 and 2048 for LimitClients

2016-05-26 Thread Keith Packard
There's no reason not to offer ridiculous numbers of clients; only a few static data structures are arrays of this length. Signed-off-by: Keith Packard --- include/misc.h | 2 +- os/utils.c | 6 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git

[PATCH xserver 15/23] dix: Intermediate GrabServer state 'GrabKickout' not needed

2016-05-26 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

[PATCH xserver 10/23] dmx: Eliminate use of AddEnabledDevice

2016-05-26 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 +

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

2016-05-26 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 | 81 - os/osdep.h | 43 +- 2 files changed,

[PATCH xserver 19/23] os: Switch server to poll(2)

2016-05-26 Thread Keith Packard
Eliminates all of the fd_set mangling in the server main thread Signed-off-by: Keith Packard --- dix/dispatch.c | 4 + include/dixstruct.h | 25 os/WaitFor.c| 157 +++-- os/connection.c | 333

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

2016-05-26 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 +---

[PATCH xserver 06/23] hw/xfree86: Use NotifyFd for other input fd wakeups

2016-05-26 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

[PATCH xserver 16/23] os: Compute timeout in milliseconds instead of struct timeval

2016-05-26 Thread Keith Packard
The timeout resolution offered in the AdjustWaitForDelay call is only milliseconds, so passing around the timeout as a pointer to a struct timeval is not helpful. Doing everything in milliseconds up to the point of the select call simplifies the code without affecting functionality at all.

[PATCH xserver 18/23] dix: Use list for ready clients

2016-05-26 Thread Keith Packard
This converts the dispatch loop into using a list of ready clients instead of an array. This changes the WaitForSomething API so that it notifies DIX when a client becomes ready to read, instead of returning the set of ready clients. Signed-off-by: Keith Packard ---

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

2016-05-26 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

[PATCH xserver 14/23] dix/os: Merge priority computation into SmartScheduleClient

2016-05-26 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 | 22 -- os/WaitFor.c | 33

[PATCH xserver 11/23] Remove readmask from screen block/wakeup handler

2016-05-26 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 | 18 --

[PATCH xserver 01/23] dix: Switch to the libXfont2 API (v2)

2016-05-26 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 +-

[PATCH xserver 00/23] Switch server to poll/epoll

2016-05-26 Thread Keith Packard
Ok, I've reworked this patch series to try and have it make some semblance of sense. There's two scary patches, 18/23 and 19/23; everything else is pretty self contained. The first patch flips to the new font API: [PATCH xserver 01/23] dix: Switch to the libXfont2 API (v2) Then changes

[PATCH xserver 12/23] Remove fd_set from Block/Wakeup handler API

2016-05-26 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

[PATCH xserver 13/23] Remove AddEnabledDevice and AddGeneralSocket APIs

2016-05-26 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 | 43 --- 3 files changed, 9 insertions(+), 46

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

2016-05-26 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 ---

[PATCH xserver 23/23] os: Leave stdin and stdout open

2016-05-26 Thread Keith Packard
There's no reason to close these now that we don't care what file descriptors we use. Signed-off-by: Keith Packard --- os/osinit.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/os/osinit.c b/os/osinit.c index 6ec2f11..e269957 100644 --- a/os/osinit.c +++

[PATCH xserver 05/23] os: Switch from select(2) to poll(2) in ErrorConnMax

2016-05-26 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 4c1ba4b..488672c 100644 ---

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

2016-05-26 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

[PATCH xserver 02/23] kdrive: switch from select(2) to poll(2)

2016-05-26 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

[PATCH xserver] os: Increase default client buffer to 16kB

2016-05-26 Thread Keith Packard
This matches a change made in xcb and improves performance for a small increase in memory usage. Signed-off-by: Keith Packard --- os/io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/os/io.c b/os/io.c index 19a449a..d04ebd8 100644 --- a/os/io.c +++

[PATCH xserver] dix: Call screen block/wakeup handlers closest to blocking [v3]

2016-05-26 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

Re: [PATCH xserver] randr: Adjust master's last set time with slaves

2016-05-26 Thread Hans de Goede
Hi, On 26-05-16 18:20, Nikhil Mahale wrote: In prime configurations master's last set time may not be latest and greatest, adjust it with slaves last set time, pick up greatest one. Otherwise xserver may end with events which has lastSetTime < lastConfigTime even if that's not the case and

Re: API for using poll/epoll instead of select

2016-05-26 Thread Keith Packard
Adam Jackson writes: > Exposing edge/level in ospoll_add is a bit funky, you're silently > degrading edge to level if the OS backend can't do edge. kqueue could do > it if the code were written, and I suspect win32's WaitForMultipleObjects > could be made to do it if we got really

Re: API for using poll/epoll instead of select

2016-05-26 Thread Adam Jackson
On Wed, 2016-05-25 at 22:44 -0700, Keith Packard wrote: > It's similar to the NotifyFd interfaces added to the OS layer, but has > the ability to support both level-triggered and edge-triggered > notifications. Using edge-triggered notifications along with epoll > reduces the notifications

[PATCH xserver] randr: Adjust master's last set time with slaves

2016-05-26 Thread Nikhil Mahale
In prime configurations master's last set time may not be latest and greatest, adjust it with slaves last set time, pick up greatest one. Otherwise xserver may end with events which has lastSetTime < lastConfigTime even if that's not the case and confuse xrandr client. --- randr/randr.c | 9

Re: [PATCH xserver 1/3] glamor: Disable logic ops when doing compositing [v3]

2016-05-26 Thread Keith Packard
Michel Dänzer writes: > The glamor_set_composite_texture related change in this patch needs to > be moved to patch 3, or this patch fails to build. With that fixed, > patches 1 & 2 are That was also mentioned by Emil Velikov and was fixed in [v4] 1/3 and [v2] 3/3 >

Re: [PATCH xserver 1/9] xfree86: Set xf86CrtcConfigRec cursor pointer to NULL in HideCursor

2016-05-26 Thread Keith Packard
Peter Hutterer writes: >> Signed-off-by: Keith Packard > > Acked-by: Peter Hutterer Merged. b64108f..f5670b4 master -> master -- -keith signature.asc Description: PGP signature

Re: [xserver-xorg][PATCH V2 1/1] xwayland-shm: block signals during fallocate

2016-05-26 Thread Daniel Stone
On 25 May 2016 at 08:41, Ian Ray wrote: > posix_fallocate() does an explicit rollback if it gets EINTR, and > this is a problem on slow systems because when the allocation size > is sufficiently large posix_fallocate() will always be interrupted > by the smart scheduler's SIGALRM.

Re: [PATCH xserver] glamor: Cannot use copies when accessing outside of composite source

2016-05-26 Thread Hans de Goede
Hi, On 26-05-16 12:04, Michel Dänzer wrote: From: Michel Dänzer Commit b64108fa ("glamor: Check for composite operations which are equivalent to copies") failed to copy conditions from exaComposite which ensure that the composite operation doesn't access outside of the

Re: [PATCH xserver] randr: Adjust master's last set time with slaves

2016-05-26 Thread Hans de Goede
Hi, On 20-05-16 07:01, Nikhil Mahale wrote: In prime configurations master's last set time may not be latest and greatest, adjust it with slaves last set time, pick up greatest one. Otherwise xserver may end with events which has lastSetTime < lastConfigTime even if that's not the case and

Re: [PATCH xserver 1/3] glamor: Disable logic ops when doing compositing [v3]

2016-05-26 Thread Michel Dänzer
On 17.05.2016 06:05, Keith Packard wrote: > Michel Dänzer writes: > >> https://bugs.freedesktop.org/show_bug.cgi?id=63397#c24 > > Some day I'll think to look at bugzilla when I fix a bug :-) > > I've added a comment and copy of the patch to that bug. The

[PATCH xserver] glamor: Cannot use copies when accessing outside of composite source

2016-05-26 Thread Michel Dänzer
From: Michel Dänzer Commit b64108fa ("glamor: Check for composite operations which are equivalent to copies") failed to copy conditions from exaComposite which ensure that the composite operation doesn't access outside of the source picture. This fixes rendercheck

Re: [PATCH xserver] randr: Do not check the screen size bound for gpu screens

2016-05-26 Thread Timo Aaltonen
On 26.05.2016 11:21, Nikhil Mahale wrote: > On 05/26/2016 01:31 PM, Timo Aaltonen wrote: >> On 20.05.2016 08:00, Nikhil Mahale wrote: >>> For gpu screen, CrtcSet set/adjust the master screen size along >>> mode in following callstack - >>> >>> ProcRRSetCrtcConfig() >>> | >>> ->

Re: [PATCH xserver] randr: Do not check the screen size bound for gpu screens

2016-05-26 Thread Nikhil Mahale
On 05/26/2016 01:31 PM, Timo Aaltonen wrote: On 20.05.2016 08:00, Nikhil Mahale wrote: For gpu screen, CrtcSet set/adjust the master screen size along mode in following callstack - ProcRRSetCrtcConfig() | -> RRCrtcSet() | -> rrCheckPixmapBounding() |

Re: [PATCH xserver] randr: Do not check the screen size bound for gpu screens

2016-05-26 Thread Timo Aaltonen
On 20.05.2016 08:00, Nikhil Mahale wrote: > For gpu screen, CrtcSet set/adjust the master screen size along > mode in following callstack - > > ProcRRSetCrtcConfig() > | > -> RRCrtcSet() > | > -> rrCheckPixmapBounding() > | > ->

Performance benefit of epoll over poll

2016-05-26 Thread Keith Packard
epoll is designed to reduce the cost of having many file descriptors in a process which are mostly idle. The kernel only reports data about active descriptors. I changed MAXCLIENTS from 512 to 2048 so I could get some 'worst case' measurements. I figured x11perf -noop would be a nice test, and

Re: [PATCH xserver 3/4] dix: Convert ResourceClientBits to a variable

2016-05-26 Thread Keith Packard
Mark Kettenis writes: > Hmm. This is marked as _X_EXPORT, so presumably part of the driver > ABI. Exporting variables like this is generally a bad idea, at least > for ELF DSOs. Copy relocations and all that. even libc exposes a pile of data, including stdin, stderr