Commit 56d9c736 authored by Adam Jackson's avatar Adam Jackson 🎧
Browse files

xfree86: Convert some xf86BlockSIGIO to OsBlockSignals



The DDC1 and int10 code are blocking SIGIO to get some assurance that
their usleep() calls take as long as they expect.  That's a good start
but you really want to be blocking more than just SIGIO, SIGALRM too at
minimum.

At this point, except for SIGIO handler setup itself, BlockSIGIO really
means "block input events".
Reviewed-by: default avatarTiago Vignatti <tiago.vignatti@nokia.com>
Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
parent ce13a1db
...@@ -235,15 +235,12 @@ EDIDRead_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc DDCSpeed, ...@@ -235,15 +235,12 @@ EDIDRead_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc DDCSpeed,
* @return NULL if no monitor attached or failure to interpret the EDID. * @return NULL if no monitor attached or failure to interpret the EDID.
*/ */
xf86MonPtr xf86MonPtr
xf86DoEDID_DDC1( xf86DoEDID_DDC1(int scrnIndex, DDC1SetSpeedProc DDC1SetSpeed,
int scrnIndex, DDC1SetSpeedProc DDC1SetSpeed, unsigned int (*DDC1Read)(ScrnInfoPtr))
unsigned int (*DDC1Read)(ScrnInfoPtr)
)
{ {
ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
unsigned char *EDID_block = NULL; unsigned char *EDID_block = NULL;
xf86MonPtr tmp = NULL; xf86MonPtr tmp = NULL;
int sigio;
/* Default DDC and DDC1 to enabled. */ /* Default DDC and DDC1 to enabled. */
Bool noddc = FALSE, noddc1 = FALSE; Bool noddc = FALSE, noddc1 = FALSE;
OptionInfoPtr options; OptionInfoPtr options;
...@@ -259,9 +256,9 @@ xf86DoEDID_DDC1( ...@@ -259,9 +256,9 @@ xf86DoEDID_DDC1(
if (noddc || noddc1) if (noddc || noddc1)
return NULL; return NULL;
sigio = xf86BlockSIGIO(); OsBlockSignals();
EDID_block = EDIDRead_DDC1(pScrn,DDC1SetSpeed,DDC1Read); EDID_block = EDIDRead_DDC1(pScrn,DDC1SetSpeed,DDC1Read);
xf86UnblockSIGIO(sigio); OsReleaseSignals();
if (EDID_block){ if (EDID_block){
tmp = xf86InterpretEDID(scrnIndex,EDID_block); tmp = xf86InterpretEDID(scrnIndex,EDID_block);
......
...@@ -75,13 +75,14 @@ setup_int(xf86Int10InfoPtr pInt) ...@@ -75,13 +75,14 @@ setup_int(xf86Int10InfoPtr pInt)
if (pInt->Flags & SET_BIOS_SCRATCH) if (pInt->Flags & SET_BIOS_SCRATCH)
SetResetBIOSVars(pInt, TRUE); SetResetBIOSVars(pInt, TRUE);
#endif #endif
return xf86BlockSIGIO(); OsBlockSignals();
return 0;
} }
void void
finish_int(xf86Int10InfoPtr pInt, int sig) finish_int(xf86Int10InfoPtr pInt, int sig)
{ {
xf86UnblockSIGIO(sig); OsReleaseSignals();
pInt->ax = (CARD32) X86_EAX; pInt->ax = (CARD32) X86_EAX;
pInt->bx = (CARD32) X86_EBX; pInt->bx = (CARD32) X86_EBX;
pInt->cx = (CARD32) X86_ECX; pInt->cx = (CARD32) X86_ECX;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment