diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c index 2296ee892..910c884a7 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/hw/xfree86/common/xf86Bus.c @@ -108,21 +108,6 @@ StringToBusType(const char* busID, const char **retID) return ret; } -/* - * Entity related code. - */ - -void -xf86EntityInit(void) -{ - int i; - - for (i = 0; i < xf86NumEntities; i++) - if (xf86Entities[i]->entityInit) { - xf86Entities[i]->entityInit(i,xf86Entities[i]->private); - } -} - int xf86AllocateEntity(void) { @@ -135,28 +120,6 @@ xf86AllocateEntity(void) return (xf86NumEntities - 1); } -static void -EntityEnter(void) -{ - int i; - - for (i = 0; i < xf86NumEntities; i++) - if (xf86Entities[i]->entityEnter) { - xf86Entities[i]->entityEnter(i,xf86Entities[i]->private); - } -} - -static void -EntityLeave(void) -{ - int i; - - for (i = 0; i < xf86NumEntities; i++) - if (xf86Entities[i]->entityLeave) { - xf86Entities[i]->entityLeave(i,xf86Entities[i]->private); - } -} - Bool xf86IsEntityPrimary(int entityIndex) { @@ -388,27 +351,23 @@ xf86GetDevFromEntity(int entityIndex, int instance) void xf86AccessEnter(void) { - /* - * on enter we simply disable routing of special resources - * to any bus and let the RAC code to "open" the right bridges. - */ - EntityEnter(); + int i; + + for (i = 0; i < xf86NumEntities; i++) + if (xf86Entities[i]->entityEnter) + xf86Entities[i]->entityEnter(i,xf86Entities[i]->private); + xf86EnterServerState(SETUP); } -/* - * xf86AccessLeave() -- prepares access for and calls the - * entityLeave() functions. - * xf86AccessLeaveState() --- gets called to restore the - * access to the VGA IO resources when switching VT or on - * server exit. - * This was split to call xf86AccessLeaveState() from - * ddxGiveUp(). - */ void xf86AccessLeave(void) { - EntityLeave(); + int i; + + for (i = 0; i < xf86NumEntities; i++) + if (xf86Entities[i]->entityLeave) + xf86Entities[i]->entityLeave(i,xf86Entities[i]->private); } /* @@ -480,6 +439,8 @@ xf86EnterServerState(xf86State state) void xf86PostProbe(void) { + int i; + if (fbSlotClaimed && (pciSlotClaimed #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) || sbusSlotClaimed @@ -487,6 +448,10 @@ xf86PostProbe(void) )) FatalError("Cannot run in framebuffer mode. Please specify busIDs " " for all framebuffer devices\n"); + + for (i = 0; i < xf86NumEntities; i++) + if (xf86Entities[i]->entityInit) + xf86Entities[i]->entityInit(i,xf86Entities[i]->private); } void diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c index ef61e4698..87d40e0b3 100644 --- a/hw/xfree86/common/xf86Configure.c +++ b/hw/xfree86/common/xf86Configure.c @@ -818,7 +818,6 @@ DoConfigure(void) } xf86PostProbe(); - xf86EntityInit(); for (j = 0; j < xf86NumScreens; j++) { xf86Screens[j]->scrnIndex = j; diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 80877e7f8..15b6bdc73 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -786,7 +786,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) } xf86PostProbe(); - xf86EntityInit(); /* * Sort the drivers to match the requested ording. Using a slow diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h index 6faf4d5bd..a8169e985 100644 --- a/hw/xfree86/common/xf86Priv.h +++ b/hw/xfree86/common/xf86Priv.h @@ -114,7 +114,6 @@ extern _X_EXPORT RootWinPropPtr *xf86RegisteredPropertiesTable; extern _X_EXPORT void xf86BusProbe(void); extern _X_EXPORT void xf86AccessEnter(void); extern _X_EXPORT void xf86AccessLeave(void); -extern _X_EXPORT void xf86EntityInit(void); extern _X_EXPORT void xf86FindPrimaryDevice(void); /* new RAC */