From d1c639c006526b8cab14dac582508f3f54848967 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 9 Jul 2012 16:29:04 -0700 Subject: [PATCH 1/4] Add 'install-headers' target in the top-level Makefile This target recursively locates directories with sdk headers and installs them all. Useful when you want to build a complete new X server and drivers without having to install the X server before the drivers are actually working. Signed-off-by: Keith Packard --- Makefile.am | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile.am b/Makefile.am index cea140bea..9a628537d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -95,3 +95,10 @@ DIST_SUBDIRS = \ # gross hack relink: all $(AM_V_at)$(MAKE) -C hw relink + +install-headers: Makefile + +find . -name Makefile | while read m; do \ + if grep -q install-sdkHEADERS $$m; then \ + (cd `dirname "$$m"` && make install-sdkHEADERS) \ + fi \ + done From ea8b04507e5464e4817791db516a20cfed2a6724 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 9 Jul 2012 16:30:24 -0700 Subject: [PATCH 2/4] privates: Resize GPU screen-specific privates too When allocating new global privates, make sure the gpu screens get their private offsets updated. This only affects GPU screens that enumerate before the non-GPU screens, which generally requires that the related device be present when the system boots so that it can get an earlier DRM filename. Signed-off-by: Keith Packard --- dix/privates.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dix/privates.c b/dix/privates.c index 740ead739..55b9345a7 100644 --- a/dix/privates.c +++ b/dix/privates.c @@ -315,6 +315,11 @@ grow_screen_specific_set(DevPrivateType type, unsigned bytes) for (s = 0; s < screenInfo.numScreens; s++) { ScreenPtr pScreen = screenInfo.screens[s]; + grow_private_set(&pScreen->screenSpecificPrivates[type], bytes); + } + for (s = 0; s < screenInfo.numGPUScreens; s++) { + ScreenPtr pScreen = screenInfo.gpuscreens[s]; + grow_private_set(&pScreen->screenSpecificPrivates[type], bytes); } } From d6756e0298e660a0aca58d75bcf79471ce07a634 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 9 Jul 2012 16:33:11 -0700 Subject: [PATCH 3/4] xfree86: In InitOutput, only call OsReleaseSIGIO if OsBlockSIGIO was called Otherwise, OsReleaseSIGIO will complain, or perhaps something worse will happen (if SIGIO actually needs to be blocked here). Signed-off-by: Keith Packard --- hw/xfree86/common/xf86Init.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 058d09f56..9c31d828d 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -401,6 +401,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) MessageType pix24From = X_DEFAULT; Bool pix24Fail = FALSE; Bool autoconfig = FALSE; + Bool sigio_blocked = FALSE; GDevPtr configured_device; xf86Initialising = TRUE; @@ -819,6 +820,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) #endif xf86AccessEnter(); OsBlockSIGIO(); + sigio_blocked = TRUE; } } @@ -924,7 +926,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen); xf86VGAarbiterWrapFunctions(); - OsReleaseSIGIO(); + if (sigio_blocked) + OsReleaseSIGIO(); xf86InitOrigins(); From 023127915e6922bc53e4c768de760d8a4f25c07c Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 9 Jul 2012 16:34:39 -0700 Subject: [PATCH 4/4] Reliably reset signals at server init time Each DDX currently calls OsReleaseSIGIO in case it was suspended when the server regen started. This causes a BUG to occur if SIGIO was *not* blocked at that time. Instead of relying on each DDX, make the OS layer reliably reset all signal state at server init time, ensuring that signals are suitably unblocked and that the various signal state counting variables are set back to zero. Signed-off-by: Keith Packard --- hw/xfree86/common/xf86Init.c | 1 - include/os.h | 3 +++ os/osinit.c | 1 + os/utils.c | 13 +++++++++++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 9c31d828d..0dedd7c5d 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -1012,7 +1012,6 @@ OsVendorInit(void) } #endif #endif - OsReleaseSIGIO(); beenHere = TRUE; } diff --git a/include/os.h b/include/os.h index 34ca1f557..7701c3977 100644 --- a/include/os.h +++ b/include/os.h @@ -340,6 +340,9 @@ OsBlockSIGIO(void); extern _X_EXPORT void OsReleaseSIGIO(void); +extern void +OsResetSignals(void); + extern _X_EXPORT void OsAbort(void) _X_NORETURN; diff --git a/os/osinit.c b/os/osinit.c index 6cc040178..2eb1f7a8f 100644 --- a/os/osinit.c +++ b/os/osinit.c @@ -288,6 +288,7 @@ OsInit(void) } TimerInit(); OsVendorInit(); + OsResetSignals(); /* * No log file by default. OsVendorInit() should call LogInit() with the * log file name if logging to a file is desired. diff --git a/os/utils.c b/os/utils.c index 253793467..82192e865 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1243,6 +1243,19 @@ OsReleaseSignals(void) #endif } +void +OsResetSignals(void) +{ +#ifdef SIG_BLOCK + while (BlockedSignalCount > 0) + OsReleaseSignals(); +#ifdef SIGIO + while (sigio_blocked > 0) + OsReleaseSIGIO(); +#endif +#endif +} + /* * Pending signals may interfere with core dumping. Provide a * mechanism to block signals when aborting.