[PATCH xserver 15/24] kdrive/ephyr: Use NotifyFd for XCB connection input [v2]

Uli Schlachter psychon at znc.in
Mon Sep 21 11:42:16 PDT 2015


Hi,

Am 21.09.2015 um 11:32 schrieb Keith Packard:
> Daniel Martin <consume.noise at gmail.com> writes:
> 
> 
>> ephyrPoll() isn't used anywhere else. You could merge it into
>> kdrive_notify_conn().
> 
> Good call. I've renamed that to:
> 
> static void
> ephyrXcbNotify(int fd, int ready, void *data)
> 
> and eliminated the extra kdrive_notify_conn wrapper.

is this actually safe?

When you call any function reading from the XCB connection (e.g.
xcb_render_query_pict_formats_reply() in ephyrcursor.c, function
get_argb_format()), this can read an event from the underlying socket and buffer
this internally in XCB. So there would be an event available, but the FD is not
readable.

I guess you have to call ephyrXcbNotify() also before blocking.

Cheers,
Uli
-- 
Bruce Schneier can read and understand Perl programs.


More information about the xorg-devel mailing list