xfree86: Remove xf86RegisterRootWindowProperty
All consumers have been ported to the root window callback, so this can all be nuked. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
e89c7f1c2a
commit
a1b13cda61
|
@ -61,10 +61,6 @@ extern _X_EXPORT DevPrivateKeyRec xf86ScreenKeyRec;
|
||||||
|
|
||||||
#define xf86ScreenKey (&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 ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */
|
||||||
extern _X_EXPORT const unsigned char byte_reversed[256];
|
extern _X_EXPORT const unsigned char byte_reversed[256];
|
||||||
extern _X_EXPORT Bool fbSlotClaimed;
|
extern _X_EXPORT Bool fbSlotClaimed;
|
||||||
|
@ -351,9 +347,6 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag,
|
||||||
|
|
||||||
extern _X_EXPORT Bool
|
extern _X_EXPORT Bool
|
||||||
xf86IsScreenPrimary(ScrnInfoPtr pScrn);
|
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
|
extern _X_EXPORT Bool
|
||||||
xf86IsUnblank(int mode);
|
xf86IsUnblank(int mode);
|
||||||
|
|
||||||
|
|
|
@ -201,5 +201,4 @@ Bool xf86AllowMouseOpenFail = FALSE;
|
||||||
Bool xf86VidModeDisabled = FALSE;
|
Bool xf86VidModeDisabled = FALSE;
|
||||||
Bool xf86VidModeAllowNonLocal = FALSE;
|
Bool xf86VidModeAllowNonLocal = FALSE;
|
||||||
#endif
|
#endif
|
||||||
RootWinPropPtr *xf86RegisteredPropertiesTable = NULL;
|
|
||||||
Bool xorgHWAccess = FALSE;
|
Bool xorgHWAccess = FALSE;
|
||||||
|
|
|
@ -1817,81 +1817,6 @@ xf86IsScreenPrimary(ScrnInfoPtr pScrn)
|
||||||
return FALSE;
|
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
|
Bool
|
||||||
xf86IsUnblank(int mode)
|
xf86IsUnblank(int mode)
|
||||||
{
|
{
|
||||||
|
|
|
@ -297,50 +297,6 @@ xf86PrivsElevated(void)
|
||||||
return privsElevated;
|
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
|
static void
|
||||||
InstallSignalHandlers(void)
|
InstallSignalHandlers(void)
|
||||||
{
|
{
|
||||||
|
@ -815,8 +771,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
|
||||||
if (!xf86ColormapAllocatePrivates(xf86Screens[i]))
|
if (!xf86ColormapAllocatePrivates(xf86Screens[i]))
|
||||||
FatalError("Cannot register DDX private keys");
|
FatalError("Cannot register DDX private keys");
|
||||||
|
|
||||||
if (!dixRegisterPrivateKey(&xf86ScreenKeyRec, PRIVATE_SCREEN, 0) ||
|
if (!dixRegisterPrivateKey(&xf86ScreenKeyRec, PRIVATE_SCREEN, 0))
|
||||||
!dixRegisterPrivateKey(&xf86CreateRootWindowKeyRec, PRIVATE_SCREEN, 0))
|
|
||||||
FatalError("Cannot register DDX private keys");
|
FatalError("Cannot register DDX private keys");
|
||||||
|
|
||||||
for (i = 0; i < xf86NumGPUScreens; i++) {
|
for (i = 0; i < xf86NumGPUScreens; i++) {
|
||||||
|
@ -887,11 +842,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
|
||||||
DebugF("xf86Screens[%d]->pScreen->CreateWindow = %p\n",
|
DebugF("xf86Screens[%d]->pScreen->CreateWindow = %p\n",
|
||||||
i, xf86Screens[i]->pScreen->CreateWindow);
|
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) {
|
if (PictureGetSubpixelOrder(xf86Screens[i]->pScreen) == SubPixelUnknown) {
|
||||||
xf86MonPtr DDC = (xf86MonPtr) (xf86Screens[i]->monitor->DDC);
|
xf86MonPtr DDC = (xf86MonPtr) (xf86Screens[i]->monitor->DDC);
|
||||||
|
|
||||||
|
|
|
@ -92,8 +92,6 @@ extern _X_EXPORT const char *xf86VisualNames[];
|
||||||
extern _X_EXPORT int xf86Verbose; /* verbosity level */
|
extern _X_EXPORT int xf86Verbose; /* verbosity level */
|
||||||
extern _X_EXPORT int xf86LogVerbose; /* log file 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 ScrnInfoPtr *xf86GPUScreens; /* List of pointers to ScrnInfoRecs */
|
||||||
extern int xf86NumGPUScreens;
|
extern int xf86NumGPUScreens;
|
||||||
#ifndef DEFAULT_VERBOSE
|
#ifndef DEFAULT_VERBOSE
|
||||||
|
|
|
@ -115,16 +115,6 @@ typedef struct {
|
||||||
} DPMSRec, *DPMSPtr;
|
} DPMSRec, *DPMSPtr;
|
||||||
#endif
|
#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. */
|
/* ISC's cc can't handle ~ of UL constants, so explicitly type cast them. */
|
||||||
#define XLED1 ((unsigned long) 0x00000001)
|
#define XLED1 ((unsigned long) 0x00000001)
|
||||||
#define XLED2 ((unsigned long) 0x00000002)
|
#define XLED2 ((unsigned long) 0x00000002)
|
||||||
|
|
Loading…
Reference in New Issue