xfree86: drop ddx-specific SIGIO blocking
The hooks are left for this cycle, we can drop it next cycle once the drivers that need it (e.g. wacom) have been updated. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
ff67135bec
commit
5d309af2ed
|
@ -199,7 +199,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
|
||||||
ScrnInfoPtr pScr = xf86ScreenToScrn(pScreen);
|
ScrnInfoPtr pScr = xf86ScreenToScrn(pScreen);
|
||||||
ScreenPtr pCursorScreen;
|
ScreenPtr pCursorScreen;
|
||||||
Bool Switched;
|
Bool Switched;
|
||||||
int px, py, was_blocked;
|
int px, py;
|
||||||
DeviceIntPtr dev, it;
|
DeviceIntPtr dev, it;
|
||||||
|
|
||||||
if (!pScr->vtSema || !mode || !pScr->SwitchMode)
|
if (!pScr->vtSema || !mode || !pScr->SwitchMode)
|
||||||
|
@ -228,7 +228,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
|
||||||
if (pScreen == pCursorScreen)
|
if (pScreen == pCursorScreen)
|
||||||
miPointerGetPosition(dev, &px, &py);
|
miPointerGetPosition(dev, &px, &py);
|
||||||
|
|
||||||
was_blocked = xf86BlockSIGIO();
|
OsBlockSIGIO();
|
||||||
Switched = (*pScr->SwitchMode) (pScr, mode);
|
Switched = (*pScr->SwitchMode) (pScr, mode);
|
||||||
if (Switched) {
|
if (Switched) {
|
||||||
pScr->currentMode = mode;
|
pScr->currentMode = mode;
|
||||||
|
@ -267,7 +267,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
|
||||||
pScr->frameY1 = pScr->virtualY - 1;
|
pScr->frameY1 = pScr->virtualY - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xf86UnblockSIGIO(was_blocked);
|
OsReleaseSIGIO();
|
||||||
|
|
||||||
if (pScr->AdjustFrame)
|
if (pScr->AdjustFrame)
|
||||||
(*pScr->AdjustFrame) (pScr, pScr->frameX0, pScr->frameY0);
|
(*pScr->AdjustFrame) (pScr, pScr->frameX0, pScr->frameY0);
|
||||||
|
@ -469,13 +469,11 @@ xf86CrossScreen(ScreenPtr pScreen, Bool entering)
|
||||||
static void
|
static void
|
||||||
xf86WarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
|
xf86WarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
|
||||||
{
|
{
|
||||||
int sigstate;
|
OsBlockSIGIO();
|
||||||
|
|
||||||
sigstate = xf86BlockSIGIO();
|
|
||||||
miPointerWarpCursor(pDev, pScreen, x, y);
|
miPointerWarpCursor(pDev, pScreen, x, y);
|
||||||
|
|
||||||
xf86Info.currentScreen = pScreen;
|
xf86Info.currentScreen = pScreen;
|
||||||
xf86UnblockSIGIO(sigstate);
|
OsReleaseSIGIO();
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
|
|
|
@ -254,7 +254,7 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
|
||||||
while (pInfo) {
|
while (pInfo) {
|
||||||
if (pInfo->read_input && pInfo->fd >= 0 &&
|
if (pInfo->read_input && pInfo->fd >= 0 &&
|
||||||
(FD_ISSET(pInfo->fd, &devicesWithInput) != 0)) {
|
(FD_ISSET(pInfo->fd, &devicesWithInput) != 0)) {
|
||||||
int sigstate = xf86BlockSIGIO();
|
OsBlockSIGIO();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Remove the descriptior from the set because more than one
|
* Remove the descriptior from the set because more than one
|
||||||
|
@ -263,7 +263,7 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
|
||||||
FD_CLR(pInfo->fd, &devicesWithInput);
|
FD_CLR(pInfo->fd, &devicesWithInput);
|
||||||
|
|
||||||
pInfo->read_input(pInfo);
|
pInfo->read_input(pInfo);
|
||||||
xf86UnblockSIGIO(sigstate);
|
OsReleaseSIGIO();
|
||||||
}
|
}
|
||||||
pInfo = pInfo->next;
|
pInfo = pInfo->next;
|
||||||
}
|
}
|
||||||
|
@ -397,9 +397,9 @@ xf86ReleaseKeys(DeviceIntPtr pDev)
|
||||||
for (i = keyc->xkbInfo->desc->min_key_code;
|
for (i = keyc->xkbInfo->desc->min_key_code;
|
||||||
i < keyc->xkbInfo->desc->max_key_code; i++) {
|
i < keyc->xkbInfo->desc->max_key_code; i++) {
|
||||||
if (key_is_down(pDev, i, KEY_POSTED)) {
|
if (key_is_down(pDev, i, KEY_POSTED)) {
|
||||||
sigstate = xf86BlockSIGIO();
|
OsBlockSIGIO();
|
||||||
QueueKeyboardEvents(pDev, KeyRelease, i, NULL);
|
QueueKeyboardEvents(pDev, KeyRelease, i, NULL);
|
||||||
xf86UnblockSIGIO(sigstate);
|
OsReleaseSIGIO();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -457,7 +457,7 @@ xf86VTSwitch(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
prevSIGIO = xf86BlockSIGIO();
|
OsBlockSIGIO();
|
||||||
for (i = 0; i < xf86NumScreens; i++)
|
for (i = 0; i < xf86NumScreens; i++)
|
||||||
xf86Screens[i]->LeaveVT(xf86Screens[i]);
|
xf86Screens[i]->LeaveVT(xf86Screens[i]);
|
||||||
|
|
||||||
|
@ -492,7 +492,7 @@ xf86VTSwitch(void)
|
||||||
for (ih = InputHandlers; ih; ih = ih->next)
|
for (ih = InputHandlers; ih; ih = ih->next)
|
||||||
xf86EnableInputHandler(ih);
|
xf86EnableInputHandler(ih);
|
||||||
|
|
||||||
xf86UnblockSIGIO(prevSIGIO);
|
OsReleaseSIGIO();
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -549,7 +549,7 @@ xf86VTSwitch(void)
|
||||||
for (ih = InputHandlers; ih; ih = ih->next)
|
for (ih = InputHandlers; ih; ih = ih->next)
|
||||||
xf86EnableInputHandler(ih);
|
xf86EnableInputHandler(ih);
|
||||||
|
|
||||||
xf86UnblockSIGIO(prevSIGIO);
|
OsReleaseSIGIO();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -394,7 +394,7 @@ InstallSignalHandlers(void)
|
||||||
void
|
void
|
||||||
InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
|
InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i, j, k, scr_index, was_blocked = 0;
|
int i, j, k, scr_index;
|
||||||
char **modulelist;
|
char **modulelist;
|
||||||
pointer *optionlist;
|
pointer *optionlist;
|
||||||
Pix24Flags screenpix24, pix24;
|
Pix24Flags screenpix24, pix24;
|
||||||
|
@ -806,7 +806,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
|
||||||
ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ);
|
ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ);
|
||||||
#endif
|
#endif
|
||||||
xf86AccessEnter();
|
xf86AccessEnter();
|
||||||
was_blocked = xf86BlockSIGIO();
|
OsBlockSIGIO();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -879,7 +879,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
xf86VGAarbiterWrapFunctions();
|
xf86VGAarbiterWrapFunctions();
|
||||||
xf86UnblockSIGIO(was_blocked);
|
OsReleaseSIGIO();
|
||||||
|
|
||||||
xf86InitOrigins();
|
xf86InitOrigins();
|
||||||
|
|
||||||
|
@ -964,7 +964,7 @@ OsVendorInit(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
xf86UnblockSIGIO(0);
|
OsReleaseSIGIO();
|
||||||
|
|
||||||
beenHere = TRUE;
|
beenHere = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1023,7 +1023,7 @@ AbortDDX(enum ExitCode error)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
xf86BlockSIGIO();
|
OsBlockSIGIO();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* try to restore the original video state
|
* try to restore the original video state
|
||||||
|
|
|
@ -92,8 +92,6 @@ eventName(pmEvent event, const char **str)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sigio_blocked_for_suspend;
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
suspend(pmEvent event, Bool undo)
|
suspend(pmEvent event, Bool undo)
|
||||||
{
|
{
|
||||||
|
@ -109,7 +107,7 @@ suspend(pmEvent event, Bool undo)
|
||||||
DisableDevice(pInfo->dev, TRUE);
|
DisableDevice(pInfo->dev, TRUE);
|
||||||
pInfo = pInfo->next;
|
pInfo = pInfo->next;
|
||||||
}
|
}
|
||||||
sigio_blocked_for_suspend = xf86BlockSIGIO();
|
OsBlockSIGIO();
|
||||||
for (i = 0; i < xf86NumScreens; i++) {
|
for (i = 0; i < xf86NumScreens; i++) {
|
||||||
if (xf86Screens[i]->PMEvent)
|
if (xf86Screens[i]->PMEvent)
|
||||||
xf86Screens[i]->PMEvent(xf86Screens[i], event, undo);
|
xf86Screens[i]->PMEvent(xf86Screens[i], event, undo);
|
||||||
|
@ -137,7 +135,7 @@ resume(pmEvent event, Bool undo)
|
||||||
xf86Screens[i]->EnterVT(xf86Screens[i]);
|
xf86Screens[i]->EnterVT(xf86Screens[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xf86UnblockSIGIO(sigio_blocked_for_suspend);
|
OsReleaseSIGIO();
|
||||||
for (i = 0; i < xf86NumScreens; i++) {
|
for (i = 0; i < xf86NumScreens; i++) {
|
||||||
if (xf86Screens[i]->EnableDisableFBAccess)
|
if (xf86Screens[i]->EnableDisableFBAccess)
|
||||||
(*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], TRUE);
|
(*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], TRUE);
|
||||||
|
@ -153,7 +151,7 @@ resume(pmEvent event, Bool undo)
|
||||||
static void
|
static void
|
||||||
DoApmEvent(pmEvent event, Bool undo)
|
DoApmEvent(pmEvent event, Bool undo)
|
||||||
{
|
{
|
||||||
int i, was_blocked;
|
int i;
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -184,13 +182,13 @@ DoApmEvent(pmEvent event, Bool undo)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
was_blocked = xf86BlockSIGIO();
|
OsBlockSIGIO();
|
||||||
for (i = 0; i < xf86NumScreens; i++) {
|
for (i = 0; i < xf86NumScreens; i++) {
|
||||||
if (xf86Screens[i]->PMEvent) {
|
if (xf86Screens[i]->PMEvent) {
|
||||||
xf86Screens[i]->PMEvent(xf86Screens[i], event, undo);
|
xf86Screens[i]->PMEvent(xf86Screens[i], event, undo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xf86UnblockSIGIO(was_blocked);
|
OsReleaseSIGIO();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,7 +132,6 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
|
||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
struct sigaction osa;
|
struct sigaction osa;
|
||||||
int i;
|
int i;
|
||||||
int blocked;
|
|
||||||
int installed = FALSE;
|
int installed = FALSE;
|
||||||
|
|
||||||
if (!xf86Info.useSIGIO)
|
if (!xf86Info.useSIGIO)
|
||||||
|
@ -142,7 +141,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
|
||||||
if (!xf86SigIOFuncs[i].f) {
|
if (!xf86SigIOFuncs[i].f) {
|
||||||
if (xf86IsPipe(fd))
|
if (xf86IsPipe(fd))
|
||||||
return 0;
|
return 0;
|
||||||
blocked = xf86BlockSIGIO();
|
OsBlockSIGIO();
|
||||||
#ifdef O_ASYNC
|
#ifdef O_ASYNC
|
||||||
if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_ASYNC) == -1) {
|
if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_ASYNC) == -1) {
|
||||||
xf86Msg(X_WARNING, "fcntl(%d, O_ASYNC): %s\n",
|
xf86Msg(X_WARNING, "fcntl(%d, O_ASYNC): %s\n",
|
||||||
|
@ -170,7 +169,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!installed) {
|
if (!installed) {
|
||||||
xf86UnblockSIGIO(blocked);
|
OsReleaseSIGIO();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
sigemptyset(&sa.sa_mask);
|
sigemptyset(&sa.sa_mask);
|
||||||
|
@ -186,7 +185,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
|
||||||
if (fd >= xf86SigIOMaxFd)
|
if (fd >= xf86SigIOMaxFd)
|
||||||
xf86SigIOMaxFd = fd + 1;
|
xf86SigIOMaxFd = fd + 1;
|
||||||
FD_SET(fd, &xf86SigIOMask);
|
FD_SET(fd, &xf86SigIOMask);
|
||||||
xf86UnblockSIGIO(blocked);
|
OsReleaseSIGIO();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
/* Allow overwriting of the closure and callback */
|
/* Allow overwriting of the closure and callback */
|
||||||
|
|
Loading…
Reference in New Issue