Revert "Remove unused server state change callbackery" for now.
The nvidia driver currently uses these callbacks to work around problems where
RAC will disable access to the hardware at unexpected times. This change
restores these hooks until we can come up with a better API for working around
RAC.
This reverts commit d7c0ba2e9e
.
Conflicts:
hw/xfree86/loader/xf86sym.c
This commit is contained in:
parent
94919480d8
commit
fe85ec34ec
|
@ -137,6 +137,8 @@ void xf86EnterServerState(xf86State state);
|
||||||
ScrnInfoPtr xf86FindScreenForEntity(int entityIndex);
|
ScrnInfoPtr xf86FindScreenForEntity(int entityIndex);
|
||||||
Bool xf86NoSharedResources(int screenIndex, resType res);
|
Bool xf86NoSharedResources(int screenIndex, resType res);
|
||||||
resPtr xf86FindIntersectOfLists(resPtr l1, resPtr l2);
|
resPtr xf86FindIntersectOfLists(resPtr l1, resPtr l2);
|
||||||
|
void xf86RegisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func, pointer arg);
|
||||||
|
Bool xf86DeregisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func);
|
||||||
|
|
||||||
int xf86GetLastScrnFlag(int entityIndex);
|
int xf86GetLastScrnFlag(int entityIndex);
|
||||||
void xf86SetLastScrnFlag(int entityIndex, int scrnIndex);
|
void xf86SetLastScrnFlag(int entityIndex, int scrnIndex);
|
||||||
|
|
|
@ -95,6 +95,10 @@ _X_EXPORT resRange res8514Shared[] = {_8514_SHARED, _END};
|
||||||
static Bool needRAC = FALSE;
|
static Bool needRAC = FALSE;
|
||||||
static Bool doFramebufferMode = FALSE;
|
static Bool doFramebufferMode = FALSE;
|
||||||
|
|
||||||
|
/* state change notification callback list */
|
||||||
|
static StateChangeNotificationPtr StateChangeNotificationList;
|
||||||
|
static void notifyStateChange(xf86NotifyState state);
|
||||||
|
|
||||||
#undef MIN
|
#undef MIN
|
||||||
#define MIN(x,y) ((x<y)?x:y)
|
#define MIN(x,y) ((x<y)?x:y)
|
||||||
|
|
||||||
|
@ -591,6 +595,7 @@ xf86AccessEnter(void)
|
||||||
PciStateEnter();
|
PciStateEnter();
|
||||||
disableAccess();
|
disableAccess();
|
||||||
EntityEnter();
|
EntityEnter();
|
||||||
|
notifyStateChange(NOTIFY_ENTER);
|
||||||
xf86EnterServerState(SETUP);
|
xf86EnterServerState(SETUP);
|
||||||
xf86ResAccessEnter = TRUE;
|
xf86ResAccessEnter = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -609,6 +614,7 @@ xf86AccessLeave(void)
|
||||||
{
|
{
|
||||||
if (!xf86ResAccessEnter)
|
if (!xf86ResAccessEnter)
|
||||||
return;
|
return;
|
||||||
|
notifyStateChange(NOTIFY_LEAVE);
|
||||||
disableAccess();
|
disableAccess();
|
||||||
DisablePciBusAccess();
|
DisablePciBusAccess();
|
||||||
EntityLeave();
|
EntityLeave();
|
||||||
|
@ -1751,9 +1757,15 @@ xf86EnterServerState(xf86State state)
|
||||||
*/
|
*/
|
||||||
if (!needRAC) {
|
if (!needRAC) {
|
||||||
xf86EnableAccess(xf86Screens[0]);
|
xf86EnableAccess(xf86Screens[0]);
|
||||||
|
notifyStateChange(NOTIFY_ENABLE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (state == SETUP)
|
||||||
|
notifyStateChange(NOTIFY_SETUP_TRANSITION);
|
||||||
|
else
|
||||||
|
notifyStateChange(NOTIFY_OPERATING_TRANSITION);
|
||||||
|
|
||||||
clearAccess();
|
clearAccess();
|
||||||
for (i=0; i<xf86NumScreens;i++) {
|
for (i=0; i<xf86NumScreens;i++) {
|
||||||
|
|
||||||
|
@ -1796,6 +1808,10 @@ xf86EnterServerState(xf86State state)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (state == SETUP)
|
||||||
|
notifyStateChange(NOTIFY_SETUP);
|
||||||
|
else
|
||||||
|
notifyStateChange(NOTIFY_OPERATING);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2045,6 +2061,7 @@ xf86PostProbe(void)
|
||||||
} else {
|
} else {
|
||||||
xf86Msg(X_INFO,"Running in FRAMEBUFFER Mode\n");
|
xf86Msg(X_INFO,"Running in FRAMEBUFFER Mode\n");
|
||||||
xf86AccessRestoreState();
|
xf86AccessRestoreState();
|
||||||
|
notifyStateChange(NOTIFY_ENABLE);
|
||||||
doFramebufferMode = TRUE;
|
doFramebufferMode = TRUE;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -2703,6 +2720,46 @@ xf86NoSharedResources(int screenIndex,resType res)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_X_EXPORT void
|
||||||
|
xf86RegisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func, pointer arg)
|
||||||
|
{
|
||||||
|
StateChangeNotificationPtr ptr =
|
||||||
|
(StateChangeNotificationPtr)xnfalloc(sizeof(StateChangeNotificationRec));
|
||||||
|
|
||||||
|
ptr->func = func;
|
||||||
|
ptr->arg = arg;
|
||||||
|
ptr->next = StateChangeNotificationList;
|
||||||
|
StateChangeNotificationList = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
_X_EXPORT Bool
|
||||||
|
xf86DeregisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func)
|
||||||
|
{
|
||||||
|
StateChangeNotificationPtr *ptr = &StateChangeNotificationList;
|
||||||
|
StateChangeNotificationPtr tmp;
|
||||||
|
|
||||||
|
while (*ptr) {
|
||||||
|
if ((*ptr)->func == func) {
|
||||||
|
tmp = (*ptr);
|
||||||
|
(*ptr) = (*ptr)->next;
|
||||||
|
xfree(tmp);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
ptr = &((*ptr)->next);
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
notifyStateChange(xf86NotifyState state)
|
||||||
|
{
|
||||||
|
StateChangeNotificationPtr ptr = StateChangeNotificationList;
|
||||||
|
while (ptr) {
|
||||||
|
ptr->func(state,ptr->arg);
|
||||||
|
ptr = ptr->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Multihead accel sharing accessor functions and entity Private handling */
|
/* Multihead accel sharing accessor functions and entity Private handling */
|
||||||
|
|
||||||
_X_EXPORT int
|
_X_EXPORT int
|
||||||
|
|
|
@ -119,6 +119,14 @@ typedef struct x_BusAccRec {
|
||||||
} busdep;
|
} busdep;
|
||||||
} BusAccRec, *BusAccPtr;
|
} BusAccRec, *BusAccPtr;
|
||||||
|
|
||||||
|
/* state change notification callback */
|
||||||
|
typedef struct _stateChange {
|
||||||
|
xf86StateChangeNotificationCallbackFunc func;
|
||||||
|
pointer arg;
|
||||||
|
struct _stateChange *next;
|
||||||
|
} StateChangeNotificationRec, *StateChangeNotificationPtr;
|
||||||
|
|
||||||
|
|
||||||
extern EntityPtr *xf86Entities;
|
extern EntityPtr *xf86Entities;
|
||||||
extern int xf86NumEntities;
|
extern int xf86NumEntities;
|
||||||
extern xf86AccessRec AccessNULL;
|
extern xf86AccessRec AccessNULL;
|
||||||
|
|
|
@ -778,6 +778,18 @@ typedef enum {
|
||||||
OPERATING
|
OPERATING
|
||||||
} xf86State;
|
} xf86State;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
NOTIFY_SETUP_TRANSITION,
|
||||||
|
NOTIFY_SETUP,
|
||||||
|
NOTIFY_OPERATING,
|
||||||
|
NOTIFY_OPERATING_TRANSITION,
|
||||||
|
NOTIFY_ENABLE,
|
||||||
|
NOTIFY_ENTER,
|
||||||
|
NOTIFY_LEAVE
|
||||||
|
} xf86NotifyState;
|
||||||
|
|
||||||
|
typedef void (*xf86StateChangeNotificationCallbackFunc)(xf86NotifyState state,pointer);
|
||||||
|
|
||||||
/* DGA */
|
/* DGA */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -321,6 +321,8 @@ _X_HIDDEN void *xfree86LookupTab[] = {
|
||||||
SYMFUNC(xf86IsEntityPrimary)
|
SYMFUNC(xf86IsEntityPrimary)
|
||||||
SYMFUNC(xf86SetOperatingState)
|
SYMFUNC(xf86SetOperatingState)
|
||||||
SYMFUNC(xf86FindScreenForEntity)
|
SYMFUNC(xf86FindScreenForEntity)
|
||||||
|
SYMFUNC(xf86RegisterStateChangeNotificationCallback)
|
||||||
|
SYMFUNC(xf86DeregisterStateChangeNotificationCallback)
|
||||||
/* Shared Accel Accessor Functions */
|
/* Shared Accel Accessor Functions */
|
||||||
SYMFUNC(xf86GetLastScrnFlag)
|
SYMFUNC(xf86GetLastScrnFlag)
|
||||||
SYMFUNC(xf86SetLastScrnFlag)
|
SYMFUNC(xf86SetLastScrnFlag)
|
||||||
|
|
Loading…
Reference in New Issue