[PATCH] xfree86: remove bus state change notification callback

Tiago Vignatti tiago.vignatti at nokia.com
Wed Aug 19 09:16:55 PDT 2009


No one is using bus notifications now. We hope that the kernel take care of
this properly.

For other not-so-urgent-notifications (ACPI wakeups, etc) we can just register
a handler on server's scheduler (using xf86AddGeneralHandler). And for
external applications, the "trend" is to use HAL to kick notifications. So
we're already provided of enough notification schemes.

Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
---

Aaron, please certify that your driver are not using this anymore (in mention
of commit fe85ec34) 

Thanks,

 hw/xfree86/common/xf86.h    |    2 -
 hw/xfree86/common/xf86Bus.c |   48 -------------------------------------------
 hw/xfree86/common/xf86Bus.h |    7 ------
 hw/xfree86/common/xf86str.h |   12 ----------
 4 files changed, 0 insertions(+), 69 deletions(-)

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 51c91a2..c59d4b1 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -123,8 +123,6 @@ extern _X_EXPORT Bool xf86CheckPciMemBase(struct pci_device * pPci, memType base
 extern _X_EXPORT Bool xf86IsEntityPrimary(int entityIndex);
 extern _X_EXPORT void xf86EnterServerState(xf86State state);
 extern _X_EXPORT ScrnInfoPtr xf86FindScreenForEntity(int entityIndex);
-extern _X_EXPORT void xf86RegisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func, pointer arg);
-extern _X_EXPORT Bool xf86DeregisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func);
 
 extern _X_EXPORT int xf86GetLastScrnFlag(int entityIndex);
 extern _X_EXPORT void xf86SetLastScrnFlag(int entityIndex, int scrnIndex);
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index d7e8d0d..166f439 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -62,10 +62,6 @@ static Bool xf86ResAccessEnter = FALSE;
 
 static Bool doFramebufferMode = FALSE;
 
-/* state change notification callback list */
-static StateChangeNotificationPtr StateChangeNotificationList;
-static void notifyStateChange(xf86NotifyState state);
-
 /*
  * Call the bus probes relevant to the architecture.
  *
@@ -414,7 +410,6 @@ xf86AccessEnter(void)
      * to any bus and let the RAC code to "open" the right bridges.
      */
     EntityEnter();
-    notifyStateChange(NOTIFY_ENTER);
     xf86EnterServerState(SETUP);
     xf86ResAccessEnter = TRUE;
 }
@@ -433,7 +428,6 @@ xf86AccessLeave(void)
 {
     if (!xf86ResAccessEnter)
 	return;
-    notifyStateChange(NOTIFY_LEAVE);
     EntityLeave();
 }
 
@@ -505,7 +499,6 @@ xf86EnterServerState(xf86State state)
     /* When servicing a dumb framebuffer we don't need to do anything */
     if (doFramebufferMode) return;
 
-    notifyStateChange(NOTIFY_ENABLE);
     return;
 }
 
@@ -527,7 +520,6 @@ xf86PostProbe(void)
 	    return;
 	} else  {
 	    xf86Msg(X_INFO,"Running in FRAMEBUFFER Mode\n");
-	    notifyStateChange(NOTIFY_ENABLE);
 	    doFramebufferMode = TRUE;
 
 	    return;
@@ -587,46 +579,6 @@ xf86FindPrimaryDevice(void)
     }
 }
 
-void
-xf86RegisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func, pointer arg)
-{
-    StateChangeNotificationPtr ptr =
-	(StateChangeNotificationPtr)xnfalloc(sizeof(StateChangeNotificationRec));
-
-    ptr->func = func;
-    ptr->arg = arg;
-    ptr->next = StateChangeNotificationList;
-    StateChangeNotificationList = ptr;
-}
-
-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 */
 
 int
diff --git a/hw/xfree86/common/xf86Bus.h b/hw/xfree86/common/xf86Bus.h
index 844fd86..b22e2e7 100644
--- a/hw/xfree86/common/xf86Bus.h
+++ b/hw/xfree86/common/xf86Bus.h
@@ -62,13 +62,6 @@ typedef struct {
     IOADDRESS                   domainIO;
 } EntityRec, *EntityPtr;
 
-/* state change notification callback */
-typedef struct _stateChange {
-    xf86StateChangeNotificationCallbackFunc func;
-    pointer arg;
-    struct _stateChange *next;
-} StateChangeNotificationRec, *StateChangeNotificationPtr;
-
 #define ACCEL_IS_SHARABLE 0x100
 #define IS_SHARED_ACCEL 0x200
 #define SA_PRIM_INIT_DONE 0x400
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index 9cb66eb..3e96941 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -608,18 +608,6 @@ typedef enum {
     OPERATING
 } 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 */
 
 typedef struct {
-- 
1.5.6.3



More information about the xorg-devel mailing list