<div dir="ltr">Could it be related somehow to my concerns in <a href="https://patchwork.freedesktop.org/patch/86328">https://patchwork.freedesktop.org/patch/86328</a> ?<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-05-18 18:51 GMT-03:00 Keith Packard <span dir="ltr"><<a href="mailto:keithp@keithp.com" target="_blank">keithp@keithp.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">With the driver block handler guaranteed to be the last thing called<br>
before the server blocks, we can now reliably check for events there<br>
and never block with events read but not processed.<br>
<br>
Signed-off-by: Keith Packard <<a href="mailto:keithp@keithp.com">keithp@keithp.com</a>><br>
---<br>
hw/kdrive/ephyr/ephyr.c | 14 +++++++++++++-<br>
hw/kdrive/ephyr/ephyr.h | 3 +++<br>
hw/kdrive/ephyr/ephyrinit.c | 1 +<br>
hw/kdrive/src/kdrive.h | 2 +-<br>
hw/kdrive/src/kinput.c | 9 ++++-----<br>
5 files changed, 22 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c<br>
index 1a410ca..6066b5d 100644<br>
--- a/hw/kdrive/ephyr/ephyr.c<br>
+++ b/hw/kdrive/ephyr/ephyr.c<br>
@@ -1106,7 +1106,7 @@ ephyrProcessConfigureNotify(xcb_generic_event_t *xev)<br>
}<br>
<br>
static void<br>
-ephyrXcbNotify(int fd, int ready, void *data)<br>
+ephyrXcbProcessEvents(void)<br>
{<br>
xcb_connection_t *conn = hostx_get_xcbconn();<br>
<br>
@@ -1166,6 +1166,18 @@ ephyrXcbNotify(int fd, int ready, void *data)<br>
}<br>
}<br>
<br>
+static void<br>
+ephyrXcbNotify(int fd, int ready, void *data)<br>
+{<br>
+ ephyrXcbProcessEvents();<br>
+}<br>
+<br>
+void<br>
+ephyrBlockHandler(ScreenPtr pScreen, void *timeo)<br>
+{<br>
+ ephyrXcbProcessEvents();<br>
+}<br>
+<br>
void<br>
ephyrCardFini(KdCardInfo * card)<br>
{<br>
diff --git a/hw/kdrive/ephyr/ephyr.h b/hw/kdrive/ephyr/ephyr.h<br>
index f5015f6..ef5736e 100644<br>
--- a/hw/kdrive/ephyr/ephyr.h<br>
+++ b/hw/kdrive/ephyr/ephyr.h<br>
@@ -138,6 +138,9 @@ void<br>
ephyrCloseScreen(ScreenPtr pScreen);<br>
<br>
void<br>
+ephyrBlockHandler(ScreenPtr pScreen, void *timeo);<br>
+<br>
+void<br>
ephyrCardFini(KdCardInfo * card);<br>
<br>
void<br>
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c<br>
index 149ea98..03d6289 100644<br>
--- a/hw/kdrive/ephyr/ephyrinit.c<br>
+++ b/hw/kdrive/ephyr/ephyrinit.c<br>
@@ -411,4 +411,5 @@ KdCardFuncs ephyrFuncs = {<br>
ephyrPutColors, /* putColors */<br>
<br>
ephyrCloseScreen, /* closeScreen */<br>
+ ephyrBlockHandler, /* blockHandler */<br>
};<br>
diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h<br>
index 3c7f2cd..6ef7337 100644<br>
--- a/hw/kdrive/src/kdrive.h<br>
+++ b/hw/kdrive/src/kdrive.h<br>
@@ -133,6 +133,7 @@ typedef struct _KdCardFuncs {<br>
void (*putColors) (ScreenPtr, int, xColorItem *);<br>
<br>
void (*closeScreen) (ScreenPtr); /* close ScreenRec */<br>
+ void (*blockHandler) (ScreenPtr, void *timeo);<br>
} KdCardFuncs;<br>
<br>
#define KD_MAX_PSEUDO_DEPTH 8<br>
@@ -296,7 +297,6 @@ typedef struct _KdOsFuncs {<br>
Bool (*SpecialKey) (KeySym);<br>
void (*Disable) (void);<br>
void (*Fini) (void);<br>
- void (*pollEvents) (void);<br>
void (*Bell) (int, int, int);<br>
} KdOsFuncs;<br>
<br>
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c<br>
index c0f1cf7..2234dfc 100644<br>
--- a/hw/kdrive/src/kinput.c<br>
+++ b/hw/kdrive/src/kinput.c<br>
@@ -1965,6 +1965,7 @@ KdBlockHandler(ScreenPtr pScreen, void *timeo)<br>
{<br>
KdPointerInfo *pi;<br>
int myTimeout = 0;<br>
+ KdScreenPriv(pScreen);<br>
<br>
for (pi = kdPointers; pi; pi = pi->next) {<br>
if (pi->timeoutPending) {<br>
@@ -1977,13 +1978,11 @@ KdBlockHandler(ScreenPtr pScreen, void *timeo)<br>
myTimeout = ms;<br>
}<br>
}<br>
- /* if we need to poll for events, do that */<br>
- if (kdOsFuncs->pollEvents) {<br>
- (*kdOsFuncs->pollEvents) ();<br>
- myTimeout = 20;<br>
- }<br>
if (myTimeout > 0)<br>
AdjustWaitForDelay(timeo, myTimeout);<br>
+<br>
+ if (pScreenPriv->card->cfuncs->blockHandler)<br>
+ (*pScreenPriv->card->cfuncs->blockHandler)(pScreen, timeo);<br>
}<br>
<br>
void<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.8.0.rc3<br>
<br>
_______________________________________________<br>
<a href="mailto:xorg-devel@lists.x.org">xorg-devel@lists.x.org</a>: X.Org development<br>
Archives: <a href="http://lists.x.org/archives/xorg-devel" rel="noreferrer" target="_blank">http://lists.x.org/archives/xorg-devel</a><br>
Info: <a href="https://lists.x.org/mailman/listinfo/xorg-devel" rel="noreferrer" target="_blank">https://lists.x.org/mailman/listinfo/xorg-devel</a></font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><b>Laércio de Sousa</b><br></div><div style="text-align:center"><div style="text-align:left"><i>Orientador de Informática</i></div><div style="text-align:left"><u>Escola Municipal "Professor Eulálio Gruppi"</u></div><div style="text-align:left"><i>Rua Ismael da Silva Mello, 559, Mogi Moderno</i></div><i><div style="text-align:left"><i>Mogi das Cruzes - SP</i></div><div style="text-align:left"><i>CEP 08717-390</i></div></i></div><div><span style="font-family:arial;font-size:small">Telefone: (11) 4726-8313</span></div></div></div>
</div>