diff options
author | marha <marha@users.sourceforge.net> | 2010-12-23 07:51:31 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-12-23 07:51:31 +0000 |
commit | 71e1361d0fd4c2d1c6c31f9a28d474fceee7e12e (patch) | |
tree | 4e5cebc3ac6d1c0f5dd765697a7c2ad7be796136 /xorg-server/hw/xfree86/common/xf86PM.c | |
parent | 374f6889ce26ba0a914d07f4946cd113263a6e18 (diff) | |
parent | 8fd06c45853cb2300105db84e4b722f0e2dad8d2 (diff) | |
download | vcxsrv-71e1361d0fd4c2d1c6c31f9a28d474fceee7e12e.tar.gz vcxsrv-71e1361d0fd4c2d1c6c31f9a28d474fceee7e12e.tar.bz2 vcxsrv-71e1361d0fd4c2d1c6c31f9a28d474fceee7e12e.zip |
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/hw/xfree86/common/xf86PM.c')
-rw-r--r-- | xorg-server/hw/xfree86/common/xf86PM.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86PM.c b/xorg-server/hw/xfree86/common/xf86PM.c index 7af89b5b4..16b6bdc4a 100644 --- a/xorg-server/hw/xfree86/common/xf86PM.c +++ b/xorg-server/hw/xfree86/common/xf86PM.c @@ -33,6 +33,7 @@ #include "xf86.h" #include "xf86Priv.h" #include "xf86Xinput.h" +#include "xf86_OSproc.h" int (*xf86PMGetEventFromOs)(int fd,pmEvent *events,int num) = NULL; pmWait (*xf86PMConfirmEventToOs)(int fd,pmEvent event) = NULL; @@ -61,14 +62,14 @@ eventName(pmEvent event, char **str) } } +static int sigio_blocked_for_suspend; + static void suspend (pmEvent event, Bool undo) { int i; InputInfoPtr pInfo; - xf86inSuspend = TRUE; - for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->EnableDisableFBAccess) (*xf86Screens[i]->EnableDisableFBAccess) (i, FALSE); @@ -78,7 +79,7 @@ suspend (pmEvent event, Bool undo) DisableDevice(pInfo->dev, TRUE); pInfo = pInfo->next; } - xf86EnterServerState(SETUP); + sigio_blocked_for_suspend = xf86BlockSIGIO(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->PMEvent) xf86Screens[i]->PMEvent(i,event,undo); @@ -98,7 +99,6 @@ resume(pmEvent event, Bool undo) InputInfoPtr pInfo; xf86AccessEnter(); - xf86EnterServerState(SETUP); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->PMEvent) xf86Screens[i]->PMEvent(i,event,undo); @@ -107,7 +107,7 @@ resume(pmEvent event, Bool undo) xf86Screens[i]->EnterVT(i, 0); } } - xf86EnterServerState(OPERATING); + xf86UnblockSIGIO(sigio_blocked_for_suspend); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->EnableDisableFBAccess) (*xf86Screens[i]->EnableDisableFBAccess) (i, TRUE); @@ -118,18 +118,12 @@ resume(pmEvent event, Bool undo) EnableDevice(pInfo->dev, TRUE); pInfo = pInfo->next; } - xf86inSuspend = FALSE; } static void DoApmEvent(pmEvent event, Bool undo) { - /* - * we leave that as a global function for now. I don't know if - * this might cause problems in the future. It is a global server - * variable therefore it needs to be in a server info structure - */ - int i, setup = 0; + int i, was_blocked; switch(event) { #if 0 @@ -159,14 +153,13 @@ DoApmEvent(pmEvent event, Bool undo) } break; default: + was_blocked = xf86BlockSIGIO(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->PMEvent) { - if (!setup) xf86EnterServerState(SETUP); - setup = 1; xf86Screens[i]->PMEvent(i,event,undo); } } - if (setup) xf86EnterServerState(OPERATING); + xf86UnblockSIGIO(was_blocked); break; } } |