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

Keith Packard keithp at keithp.com
Mon May 30 07:47:22 UTC 2016


Julien Cristau <jcristau at debian.org> writes:

>> #define X_NOTIFY_READ   POLLIN
>> #define X_NOTIFY_WRITE  POLLOUT
>> #define X_NOTIFY_OTHER  (!(POLLIN|POLLOUT))
>> 
> I guess you mean ~(POLLIN|POLLOUT).

Yes, thanks. I've actually reconsidered and decided to make an interface
which doesn't use the underlying OS values. It's simpler to describe,
and allows us to change the underlying implementation without impacting
the ABI. So, it uses the X_NOTIFY_ values, but I've add another one:

#define X_NOTIFY_NONE   0x0
#define X_NOTIFY_READ   0x1
#define X_NOTIFY_WRITE  0x2
#define X_NOTIFY_ERROR  0x4     /* don't need to select for, always reported */

Note that X_NOTIFY_WRITE is not the same as POLLOUT (2 vs 4). That
should get caught though as I carefully did *not* include <poll.h>
anywhere except for ospoll.c.

Results are looking promising; performance is improved and the code
looks simpler in a lot of places.

Full series of 29 patches is on my 'epoll' branch at

        git://people.freedesktop.org/~keithp/xserver.git

As one might expect, I keep finding minor issues and tweaking the
patches a bit, but I'm running my desktop on this branch and it seems
solid. Additional testing would be awesome.

One nice side benefit is that I'm leaving stdin, stdout and stderr alone
now, which makes it possible to get output from MESA_VERBOSE and
INTEL_DEBUG. I'm using that to try and debug a regression in drawing
zero-width dashed lines (without much success yet, alas).

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20160530/bfa6c9d6/attachment.sig>


More information about the xorg-devel mailing list