[PATCH xserver 9/9] xfree86: Remove xf86RegisterRootWindowProperty

Adam Jackson ajax at redhat.com
Wed Jan 6 06:30:37 PST 2016


All consumers have been ported to the root window callback, so this can
all be nuked.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 hw/xfree86/common/xf86.h        |  7 ----
 hw/xfree86/common/xf86Globals.c |  1 -
 hw/xfree86/common/xf86Helper.c  | 75 -----------------------------------------
 hw/xfree86/common/xf86Init.c    | 52 +---------------------------
 hw/xfree86/common/xf86Priv.h    |  2 --
 hw/xfree86/common/xf86Privstr.h | 10 ------
 6 files changed, 1 insertion(+), 146 deletions(-)

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 38b901f..adb5601 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -61,10 +61,6 @@ extern _X_EXPORT DevPrivateKeyRec xf86ScreenKeyRec;
 
 #define xf86ScreenKey (&xf86ScreenKeyRec)
 
-extern _X_EXPORT DevPrivateKeyRec xf86CreateRootWindowKeyRec;
-
-#define xf86CreateRootWindowKey (&xf86CreateRootWindowKeyRec)
-
 extern _X_EXPORT ScrnInfoPtr *xf86Screens;      /* List of pointers to ScrnInfoRecs */
 extern _X_EXPORT const unsigned char byte_reversed[256];
 extern _X_EXPORT Bool fbSlotClaimed;
@@ -351,9 +347,6 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag,
 
 extern _X_EXPORT Bool
 xf86IsScreenPrimary(ScrnInfoPtr pScrn);
-extern _X_EXPORT int
-xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
-                               int format, unsigned long len, void *value);
 extern _X_EXPORT Bool
 xf86IsUnblank(int mode);
 
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index 86bf15d..07cfabf 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -201,5 +201,4 @@ Bool xf86AllowMouseOpenFail = FALSE;
 Bool xf86VidModeDisabled = FALSE;
 Bool xf86VidModeAllowNonLocal = FALSE;
 #endif
-RootWinPropPtr *xf86RegisteredPropertiesTable = NULL;
 Bool xorgHWAccess = FALSE;
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index a0793b1..e3eeb13 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1817,81 +1817,6 @@ xf86IsScreenPrimary(ScrnInfoPtr pScrn)
     return FALSE;
 }
 
-int
-xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
-                               int format, unsigned long len, void *value)
-{
-    RootWinPropPtr pNewProp = NULL, pRegProp;
-    Bool existing = FALSE;
-
-    DebugF("xf86RegisterRootWindowProperty(%d, %ld, %ld, %d, %ld, %p)\n",
-           ScrnIndex, (long)property, (long)type, format, len, value);
-
-    if (ScrnIndex < 0 || ScrnIndex >= xf86NumScreens) {
-        return BadMatch;
-    }
-
-    if (xf86RegisteredPropertiesTable &&
-        xf86RegisteredPropertiesTable[ScrnIndex]) {
-        for (pNewProp = xf86RegisteredPropertiesTable[ScrnIndex];
-             pNewProp; pNewProp = pNewProp->next) {
-            if (strcmp(pNewProp->name, NameForAtom(property)) == 0)
-                break;
-        }
-    }
-
-    if (!pNewProp) {
-        if ((pNewProp = (RootWinPropPtr) malloc(sizeof(RootWinProp))) == NULL) {
-            return BadAlloc;
-        }
-        /*
-         * We will put this property at the end of the list so that
-         * the changes are made in the order they were requested.
-         */
-        pNewProp->next = NULL;
-    }
-    else {
-        free((void *) pNewProp->name);
-        existing = TRUE;
-    }
-
-    pNewProp->name = xnfstrdup(NameForAtom(property));
-    pNewProp->type = type;
-    pNewProp->format = format;
-    pNewProp->size = len;
-    pNewProp->data = value;
-
-    DebugF("new property filled\n");
-
-    if (xf86RegisteredPropertiesTable == NULL) {
-        DebugF("creating xf86RegisteredPropertiesTable[] size %d\n",
-               xf86NumScreens);
-        xf86RegisteredPropertiesTable =
-            xnfcalloc(sizeof(RootWinProp), xf86NumScreens);
-    }
-
-    DebugF("xf86RegisteredPropertiesTable %p\n",
-           (void *) xf86RegisteredPropertiesTable);
-    DebugF("xf86RegisteredPropertiesTable[%d] %p\n",
-           ScrnIndex, (void *) xf86RegisteredPropertiesTable[ScrnIndex]);
-
-    if (!existing) {
-        if (xf86RegisteredPropertiesTable[ScrnIndex] == NULL) {
-            xf86RegisteredPropertiesTable[ScrnIndex] = pNewProp;
-        }
-        else {
-            pRegProp = xf86RegisteredPropertiesTable[ScrnIndex];
-            while (pRegProp->next != NULL) {
-                DebugF("- next %p\n", (void *) pRegProp);
-                pRegProp = pRegProp->next;
-            }
-            pRegProp->next = pNewProp;
-        }
-    }
-    DebugF("xf86RegisterRootWindowProperty succeeded\n");
-    return Success;
-}
-
 Bool
 xf86IsUnblank(int mode)
 {
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 7923561..7a7203e 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -296,50 +296,6 @@ xf86PrivsElevated(void)
     return privsElevated;
 }
 
-static Bool
-xf86CreateRootWindow(WindowPtr pWin)
-{
-    int ret = TRUE;
-    int err = Success;
-    ScreenPtr pScreen = pWin->drawable.pScreen;
-    RootWinPropPtr pProp;
-    CreateWindowProcPtr create_window = (CreateWindowProcPtr)
-        dixLookupPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey);
-
-    DebugF("xf86CreateRootWindow(%p)\n", pWin);
-
-    /* Unhook this function ... */
-    pScreen->CreateWindow = create_window;
-    dixSetPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey, NULL);
-
-    /* ... and call the previous CreateWindow fuction, if any */
-    if (NULL != pScreen->CreateWindow) {
-        ret = (*pScreen->CreateWindow) (pWin);
-    }
-
-    /* Now do our stuff */
-    if (xf86RegisteredPropertiesTable != NULL) {
-        if (pWin->parent == NULL && xf86RegisteredPropertiesTable != NULL) {
-            for (pProp = xf86RegisteredPropertiesTable[pScreen->myNum];
-                 pProp != NULL && err == Success; pProp = pProp->next) {
-                Atom prop;
-
-                prop = MakeAtom(pProp->name, strlen(pProp->name), TRUE);
-                err = dixChangeWindowProperty(serverClient, pWin,
-                                              prop, pProp->type,
-                                              pProp->format, PropModeReplace,
-                                              pProp->size, pProp->data, FALSE);
-            }
-
-            /* Look at err */
-            ret &= (err == Success);
-
-        }
-    }
-
-    return ret;
-}
-
 static void
 InstallSignalHandlers(void)
 {
@@ -814,8 +770,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
         if (!xf86ColormapAllocatePrivates(xf86Screens[i]))
             FatalError("Cannot register DDX private keys");
 
-    if (!dixRegisterPrivateKey(&xf86ScreenKeyRec, PRIVATE_SCREEN, 0) ||
-        !dixRegisterPrivateKey(&xf86CreateRootWindowKeyRec, PRIVATE_SCREEN, 0))
+    if (!dixRegisterPrivateKey(&xf86ScreenKeyRec, PRIVATE_SCREEN, 0))
         FatalError("Cannot register DDX private keys");
 
     for (i = 0; i < xf86NumGPUScreens; i++) {
@@ -886,11 +841,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
         DebugF("xf86Screens[%d]->pScreen->CreateWindow = %p\n",
                i, xf86Screens[i]->pScreen->CreateWindow);
 
-        dixSetPrivate(&screenInfo.screens[scr_index]->devPrivates,
-                      xf86CreateRootWindowKey,
-                      xf86Screens[i]->pScreen->CreateWindow);
-        xf86Screens[i]->pScreen->CreateWindow = xf86CreateRootWindow;
-
         if (PictureGetSubpixelOrder(xf86Screens[i]->pScreen) == SubPixelUnknown) {
             xf86MonPtr DDC = (xf86MonPtr) (xf86Screens[i]->monitor->DDC);
 
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index ad3f2b9..81f7294 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -92,8 +92,6 @@ extern _X_EXPORT const char *xf86VisualNames[];
 extern _X_EXPORT int xf86Verbose;       /* verbosity level */
 extern _X_EXPORT int xf86LogVerbose;    /* log file verbosity level */
 
-extern _X_EXPORT RootWinPropPtr *xf86RegisteredPropertiesTable;
-
 extern ScrnInfoPtr *xf86GPUScreens;      /* List of pointers to ScrnInfoRecs */
 extern int xf86NumGPUScreens;
 #ifndef DEFAULT_VERBOSE
diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h
index 2eefeaf..aa55395 100644
--- a/hw/xfree86/common/xf86Privstr.h
+++ b/hw/xfree86/common/xf86Privstr.h
@@ -125,16 +125,6 @@ typedef struct {
 } VidModeRec, *VidModePtr;
 #endif
 
-/* Information for root window properties. */
-typedef struct _RootWinProp {
-    struct _RootWinProp *next;
-    const char *name;
-    Atom type;
-    short format;
-    long size;
-    void *data;
-} RootWinProp, *RootWinPropPtr;
-
 /* ISC's cc can't handle ~ of UL constants, so explicitly type cast them. */
 #define XLED1   ((unsigned long) 0x00000001)
 #define XLED2   ((unsigned long) 0x00000002)
-- 
2.5.0



More information about the xorg-devel mailing list