dix: Update some comments to reflect the new non-SIGIO input model

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Adam Jackson 2016-06-07 15:52:15 -04:00
parent 48a9b29b0a
commit 5bcdd1cc75
12 changed files with 17 additions and 23 deletions

View File

@ -944,14 +944,9 @@ are missing.
<title>devReadInput()</title> <title>devReadInput()</title>
<para>Each device will have some function that gets called to read its <para>Each device will have some function that gets called to read its
physical input. These may be called in a number of different ways. In physical input. This function should do at least two things: make sure that
the case of synchronous I/O, they will be called from a DDX input events get enqueued, and make sure that the cursor gets moved for motion
wakeup-handler that gets called after the server detects that new input is events (except if these are handled later by the driver's own event queue
available. In the case of asynchronous I/O, they will be called from a
(SIGIO) signal handler triggered when new input is available. This
function should do at least two things: make sure that input events get
enqueued, and make sure that the cursor gets moved for motion events
(except if these are handled later by the driver's own event queue
processing function, which cannot be done when using the MI event queue processing function, which cannot be done when using the MI event queue
handling). handling).
</para> </para>

View File

@ -585,7 +585,7 @@ dmxInvalidateGlobalPosition(void)
* \a DMX_ABSOLUTE_CONFINED (in the latter case, the pointer will not be * \a DMX_ABSOLUTE_CONFINED (in the latter case, the pointer will not be
* allowed to move outside the global boundaires). * allowed to move outside the global boundaires).
* *
* If \a block is set to \a DMX_BLOCK, then the SIGIO handler will be * If \a block is set to \a DMX_BLOCK, then the input thread will be
* blocked around calls to \a enqueueMotion(). */ * blocked around calls to \a enqueueMotion(). */
void void
dmxMotion(DevicePtr pDev, int *v, int firstAxes, int axesCount, dmxMotion(DevicePtr pDev, int *v, int firstAxes, int axesCount,
@ -689,7 +689,7 @@ dmxFixup(DevicePtr pDev, int detail, KeySym keySym)
* KeyRelease event, then the \a keySym is also specified. * KeyRelease event, then the \a keySym is also specified.
* *
* FIXME: make the code do what the comment says, or remove this comment. * FIXME: make the code do what the comment says, or remove this comment.
* If \a block is set to \a DMX_BLOCK, then the SIGIO handler will be * If \a block is set to \a DMX_BLOCK, then the input thread will be
* blocked around calls to dmxeqEnqueue(). */ * blocked around calls to dmxeqEnqueue(). */
void void

View File

@ -820,7 +820,7 @@ kbdLinuxConvert(DevicePtr pDev,
* event, enqueue it with the \a motion function. Otherwise, check for * event, enqueue it with the \a motion function. Otherwise, check for
* special keys with the \a checkspecial function and enqueue the event * special keys with the \a checkspecial function and enqueue the event
* with the \a enqueue function. The \a block type is passed to the * with the \a enqueue function. The \a block type is passed to the
* functions so that they may block SIGIO handling as appropriate to the * functions so that they may block the input thread as appropriate to the
* caller of this function. */ * caller of this function. */
void void
kbdLinuxRead(DevicePtr pDev, kbdLinuxRead(DevicePtr pDev,

View File

@ -191,7 +191,7 @@ msLinuxButton(DevicePtr pDev, ENQUEUEPROC enqueue, int buttons, BLOCK block)
* event, enqueue it with the \a motion function. Otherwise, check for * event, enqueue it with the \a motion function. Otherwise, check for
* special keys with the \a checkspecial function and enqueue the event * special keys with the \a checkspecial function and enqueue the event
* with the \a enqueue function. The \a block type is passed to the * with the \a enqueue function. The \a block type is passed to the
* functions so that they may block SIGIO handling as appropriate to the * functions so that they may block the input thread as appropriate to the
* caller of this function. */ * caller of this function. */
void void
msLinuxRead(DevicePtr pDev, msLinuxRead(DevicePtr pDev,

View File

@ -187,7 +187,7 @@ ps2LinuxButton(DevicePtr pDev, ENQUEUEPROC enqueue, int buttons, BLOCK block)
* event, enqueue it with the \a motion function. Otherwise, check for * event, enqueue it with the \a motion function. Otherwise, check for
* special keys with the \a checkspecial function and enqueue the event * special keys with the \a checkspecial function and enqueue the event
* with the \a enqueue function. The \a block type is passed to the * with the \a enqueue function. The \a block type is passed to the
* functions so that they may block SIGIO handling as appropriate to the * functions so that they may block the input thread as appropriate to the
* caller of this function. */ * caller of this function. */
void void
ps2LinuxRead(DevicePtr pDev, MOTIONPROC motion, ps2LinuxRead(DevicePtr pDev, MOTIONPROC motion,

View File

@ -77,7 +77,7 @@
/** Read an event from the \a pDev device. If the event is a motion /** Read an event from the \a pDev device. If the event is a motion
* event, enqueue it with the \a motion function. Otherwise, enqueue * event, enqueue it with the \a motion function. Otherwise, enqueue
* the event with the \a enqueue function. The \a block type is passed * the event with the \a enqueue function. The \a block type is passed
* to the functions so that they may block SIGIO handling as appropriate * to the functions so that they may block the input thread as appropriate
* to the caller of this function. * to the caller of this function.
* *
* Since USB devices return EV_KEY events for buttons and keys, \a * Since USB devices return EV_KEY events for buttons and keys, \a

View File

@ -379,7 +379,7 @@ kbdUSBConvert(DevicePtr pDev,
* event, enqueue it with the \a motion function. Otherwise, check for * event, enqueue it with the \a motion function. Otherwise, check for
* special keys with the \a checkspecial function and enqueue the event * special keys with the \a checkspecial function and enqueue the event
* with the \a enqueue function. The \a block type is passed to the * with the \a enqueue function. The \a block type is passed to the
* functions so that they may block SIGIO handling as appropriate to the * functions so that they may block the input thread as appropriate to the
* caller of this function. */ * caller of this function. */
void void
kbdUSBRead(DevicePtr pDev, kbdUSBRead(DevicePtr pDev,

View File

@ -80,8 +80,7 @@ typedef struct {
Bool miscModInDevEnabled; /* Allow input devices to be Bool miscModInDevEnabled; /* Allow input devices to be
* changed */ * changed */
Bool miscModInDevAllowNonLocal; Bool miscModInDevAllowNonLocal;
Bool useSIGIO; /* Use SIGIO for handling Bool useSIGIO; /* Use SIGIO for handling DRI1 swaps */
input device events */
Pix24Flags pixmap24; Pix24Flags pixmap24;
MessageType pix24From; MessageType pix24From;
Bool pmFlag; Bool pmFlag;

View File

@ -678,7 +678,7 @@ typedef struct _ScrnInfoRec {
/* Allow screens to be enabled/disabled individually */ /* Allow screens to be enabled/disabled individually */
Bool vtSema; Bool vtSema;
/* hw cursor moves at SIGIO time */ /* hw cursor moves from input thread */
Bool silkenMouse; Bool silkenMouse;
/* Storage for clockRanges and adjustFlags for use with the VidMode ext */ /* Storage for clockRanges and adjustFlags for use with the VidMode ext */

View File

@ -239,8 +239,7 @@ mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e)
else if (n_enqueued + 1 == miEventQueue.nevents) { else if (n_enqueued + 1 == miEventQueue.nevents) {
if (!mieqGrowQueue(&miEventQueue, miEventQueue.nevents << 1)) { if (!mieqGrowQueue(&miEventQueue, miEventQueue.nevents << 1)) {
/* Toss events which come in late. Usually this means your server's /* Toss events which come in late. Usually this means your server's
* stuck in an infinite loop somewhere, but SIGIO is still getting * stuck in an infinite loop in the main thread.
* handled.
*/ */
miEventQueue.dropped++; miEventQueue.dropped++;
if (miEventQueue.dropped == 1) { if (miEventQueue.dropped == 1) {

View File

@ -555,8 +555,9 @@ miPointerMoveNoEvent(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
pPointer = MIPOINTER(pDev); pPointer = MIPOINTER(pDev);
/* Hack: We mustn't call into ->MoveCursor for anything but the /* Hack: We mustn't call into ->MoveCursor for anything but the
* VCP, as this may cause a non-HW rendered cursor to be rendered during * VCP, as this may cause a non-HW rendered cursor to be rendered while
* SIGIO. This again leads to allocs during SIGIO which leads to SIGABRT. * not holding the input lock. This would race with building the command
* buffer for other rendering.
*/ */
if (GetMaster(pDev, MASTER_POINTER) == inputInfo.pointer if (GetMaster(pDev, MASTER_POINTER) == inputInfo.pointer
&&!pScreenPriv->waitForUpdate && pScreen == pPointer->pSpriteScreen) { &&!pScreenPriv->waitForUpdate && pScreen == pPointer->pSpriteScreen) {

View File

@ -38,7 +38,7 @@ typedef struct {
miPointerSpriteFuncPtr spriteFuncs; /* sprite-specific methods */ miPointerSpriteFuncPtr spriteFuncs; /* sprite-specific methods */
miPointerScreenFuncPtr screenFuncs; /* screen-specific methods */ miPointerScreenFuncPtr screenFuncs; /* screen-specific methods */
CloseScreenProcPtr CloseScreen; CloseScreenProcPtr CloseScreen;
Bool waitForUpdate; /* don't move cursor in SIGIO */ Bool waitForUpdate; /* don't move cursor from input thread */
Bool showTransparent; /* show empty cursors */ Bool showTransparent; /* show empty cursors */
} miPointerScreenRec, *miPointerScreenPtr; } miPointerScreenRec, *miPointerScreenPtr;
#endif /* MIPOINTRST_H */ #endif /* MIPOINTRST_H */