From 645063cd9384a26353775e92a79ed8710c6ca66c Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 4 Mar 2014 12:51:49 -0500 Subject: exa, kdrive: Remove redundant BitsPerPixel macros We already get this from servermd.h Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- hw/kdrive/src/kdrive.h | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'hw') diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h index 066a13419..e1d2b5927 100644 --- a/hw/kdrive/src/kdrive.h +++ b/hw/kdrive/src/kdrive.h @@ -330,19 +330,6 @@ typedef struct _KdPointerMatrix { int matrix[2][3]; } KdPointerMatrix; -/* - * This is the only completely portable way to - * compute this info. - */ - -#ifndef BitsPerPixel -#define BitsPerPixel(d) (\ - PixmapWidthPaddingInfo[d].notPower2 ? \ - (PixmapWidthPaddingInfo[d].bytesPerPixel * 8) : \ - ((1 << PixmapWidthPaddingInfo[d].padBytesLog2) * 8 / \ - (PixmapWidthPaddingInfo[d].padRoundUp+1))) -#endif - extern DevPrivateKeyRec kdScreenPrivateKeyRec; #define kdScreenPrivateKey (&kdScreenPrivateKeyRec) -- cgit v1.2.3 From 692676debbc2227054d67078c6442f1ab1811192 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 16 Jun 2014 12:35:28 -0400 Subject: loader: Remove some baklava code Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- hw/xfree86/loader/loadmod.c | 113 +++++++++++++++++++------------------------- 1 file changed, 48 insertions(+), 65 deletions(-) (limited to 'hw') diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c index 21ccb1bf9..7021bdd4c 100644 --- a/hw/xfree86/loader/loadmod.c +++ b/hw/xfree86/loader/loadmod.c @@ -77,12 +77,8 @@ typedef struct _pattern { static char *FindModule(const char *, const char *, const char **, PatternPtr); static Bool CheckVersion(const char *, XF86ModuleVersionInfo *, const XF86ModReqInfo *); -static void UnloadModuleOrDriver(ModuleDescPtr mod); static char *LoaderGetCanonicalName(const char *, PatternPtr); static void RemoveChild(ModuleDescPtr); -static ModuleDescPtr doLoadModule(const char *, const char *, const char **, - const char **, void *, - const XF86ModReqInfo *, int *, int *); const ModuleVersions LoaderVersionInfo = { XORG_VERSION_CURRENT, @@ -754,8 +750,8 @@ LoadSubModule(void *_parent, const char *module, return NULL; } - submod = doLoadModule(module, NULL, subdirlist, patternlist, options, - modreq, errmaj, errmin); + submod = LoadModule(module, NULL, subdirlist, patternlist, options, + modreq, errmaj, errmin); if (submod && submod != (ModuleDescPtr) 1) { parent->child = AddSibling(parent->child, submod); submod->parent = parent; @@ -818,10 +814,47 @@ static const char *compiled_in_modules[] = { NULL }; -static ModuleDescPtr -doLoadModule(const char *module, const char *path, const char **subdirlist, - const char **patternlist, void *options, - const XF86ModReqInfo * modreq, int *errmaj, int *errmin) +/* + * LoadModule: load a module + * + * module The module name. Normally this is not a filename but the + * module's "canonical name. A full pathname is, however, + * also accepted. + * path A comma separated list of module directories. + * subdirlist A NULL terminated list of subdirectories to search. When + * NULL, the default "stdSubdirs" list is used. The default + * list is also substituted for entries with value DEFAULT_LIST. + * patternlist A NULL terminated list of regular expressions used to find + * module filenames. Each regex should contain exactly one + * subexpression that corresponds to the canonical module name. + * When NULL, the default "stdPatterns" list is used. The + * default list is also substituted for entries with value + * DEFAULT_LIST. + * options A NULL terminated list of Options that are passed to the + * module's SetupProc function. + * modreq An optional XF86ModReqInfo* containing + * version/ABI/vendor-ABI requirements to check for when + * loading the module. The following fields of the + * XF86ModReqInfo struct are checked: + * majorversion - must match the module's majorversion exactly + * minorversion - the module's minorversion must be >= this + * patchlevel - the module's minorversion.patchlevel must be + * >= this. Patchlevel is ignored when + * minorversion is not set. + * abiclass - (string) must match the module's abiclass + * abiversion - must be consistent with the module's + * abiversion (major equal, minor no older) + * moduleclass - string must match the module's moduleclass + * string + * "don't care" values are ~0 for numbers, and NULL for strings + * errmaj Major error return. + * errmin Minor error return. + * + */ +ModuleDescPtr +LoadModule(const char *module, const char *path, const char **subdirlist, + const char **patternlist, void *options, + const XF86ModReqInfo * modreq, int *errmaj, int *errmin) { XF86ModuleData *initdata = NULL; char **pathlist = NULL; @@ -1009,61 +1042,11 @@ doLoadModule(const char *module, const char *path, const char **subdirlist, return ret; } -/* - * LoadModule: load a module - * - * module The module name. Normally this is not a filename but the - * module's "canonical name. A full pathname is, however, - * also accepted. - * path A comma separated list of module directories. - * subdirlist A NULL terminated list of subdirectories to search. When - * NULL, the default "stdSubdirs" list is used. The default - * list is also substituted for entries with value DEFAULT_LIST. - * patternlist A NULL terminated list of regular expressions used to find - * module filenames. Each regex should contain exactly one - * subexpression that corresponds to the canonical module name. - * When NULL, the default "stdPatterns" list is used. The - * default list is also substituted for entries with value - * DEFAULT_LIST. - * options A NULL terminated list of Options that are passed to the - * module's SetupProc function. - * modreq An optional XF86ModReqInfo* containing - * version/ABI/vendor-ABI requirements to check for when - * loading the module. The following fields of the - * XF86ModReqInfo struct are checked: - * majorversion - must match the module's majorversion exactly - * minorversion - the module's minorversion must be >= this - * patchlevel - the module's minorversion.patchlevel must be - * >= this. Patchlevel is ignored when - * minorversion is not set. - * abiclass - (string) must match the module's abiclass - * abiversion - must be consistent with the module's - * abiversion (major equal, minor no older) - * moduleclass - string must match the module's moduleclass - * string - * "don't care" values are ~0 for numbers, and NULL for strings - * errmaj Major error return. - * errmin Minor error return. - * - */ -ModuleDescPtr -LoadModule(const char *module, const char *path, const char **subdirlist, - const char **patternlist, void *options, - const XF86ModReqInfo * modreq, int *errmaj, int *errmin) -{ - return doLoadModule(module, path, subdirlist, patternlist, options, - modreq, errmaj, errmin); -} - void -UnloadModule(void *mod) +UnloadModule(void *_mod) { - UnloadModuleOrDriver((ModuleDescPtr) mod); -} + ModuleDescPtr mod = _mod; -static void -UnloadModuleOrDriver(ModuleDescPtr mod) -{ if (mod == (ModuleDescPtr) 1) return; @@ -1083,9 +1066,9 @@ UnloadModuleOrDriver(ModuleDescPtr mod) } if (mod->child) - UnloadModuleOrDriver(mod->child); + UnloadModule(mod->child); if (mod->sib) - UnloadModuleOrDriver(mod->sib); + UnloadModule(mod->sib); free(mod->path); free(mod->name); free(mod); @@ -1100,7 +1083,7 @@ UnloadSubModule(void *_mod) if (mod == (ModuleDescPtr) 1) return; RemoveChild(mod); - UnloadModuleOrDriver(mod); + UnloadModule(mod); } static void -- cgit v1.2.3 From 3689be96ac125c9bfca9d37de4878f05f4e2f584 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 10 Jun 2014 12:54:41 -0400 Subject: vfb: Don't reimplement micmap so much We know we're atop fb which is atop micmap, the only thing we need to hook is InstallColormap to handle the xwd colormap change. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- hw/vfb/InitOutput.c | 55 +++-------------------------------------------------- 1 file changed, 3 insertions(+), 52 deletions(-) (limited to 'hw') diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c index 9c4926462..bcaaa85e4 100644 --- a/hw/vfb/InitOutput.c +++ b/hw/vfb/InitOutput.c @@ -380,26 +380,10 @@ ddxProcessArgument(int argc, char *argv[], int i) return 0; } -static DevPrivateKeyRec cmapScrPrivateKeyRec; - -#define cmapScrPrivateKey (&cmapScrPrivateKeyRec) - -#define GetInstalledColormap(s) ((ColormapPtr) dixLookupPrivate(&(s)->devPrivates, cmapScrPrivateKey)) -#define SetInstalledColormap(s,c) (dixSetPrivate(&(s)->devPrivates, cmapScrPrivateKey, c)) - -static int -vfbListInstalledColormaps(ScreenPtr pScreen, Colormap * pmaps) -{ - /* By the time we are processing requests, we can guarantee that there - * is always a colormap installed */ - *pmaps = GetInstalledColormap(pScreen)->mid; - return 1; -} - static void vfbInstallColormap(ColormapPtr pmap) { - ColormapPtr oldpmap = GetInstalledColormap(pmap->pScreen); + ColormapPtr oldpmap = GetInstalledmiColormap(pmap->pScreen); if (pmap != oldpmap) { int entries; @@ -410,11 +394,7 @@ vfbInstallColormap(ColormapPtr pmap) xColorItem *defs; int i; - if (oldpmap != (ColormapPtr) None) - WalkTree(pmap->pScreen, TellLostMap, (char *) &oldpmap->mid); - /* Install pmap */ - SetInstalledColormap(pmap->pScreen, pmap); - WalkTree(pmap->pScreen, TellGainedMap, (char *) &pmap->mid); + miInstallColormap(pmap); entries = pmap->pVisual->ColormapEntries; pXWDHeader = vfbScreens[pmap->pScreen->myNum].pXWDHeader; @@ -451,29 +431,13 @@ vfbInstallColormap(ColormapPtr pmap) } } -static void -vfbUninstallColormap(ColormapPtr pmap) -{ - ColormapPtr curpmap = GetInstalledColormap(pmap->pScreen); - - if (pmap == curpmap) { - if (pmap->mid != pmap->pScreen->defColormap) { - dixLookupResourceByType((void **) &curpmap, - pmap->pScreen->defColormap, - RT_COLORMAP, serverClient, - DixInstallAccess); - (*pmap->pScreen->InstallColormap) (curpmap); - } - } -} - static void vfbStoreColors(ColormapPtr pmap, int ndef, xColorItem * pdefs) { XWDColor *pXWDCmap; int i; - if (pmap != GetInstalledColormap(pmap->pScreen)) { + if (pmap != GetInstalledmiColormap(pmap->pScreen)) { return; } @@ -761,17 +725,9 @@ static Bool vfbCloseScreen(ScreenPtr pScreen) { vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum]; - int i; pScreen->CloseScreen = pvfb->closeScreen; - /* - * XXX probably lots of stuff to clean. For now, - * clear installed colormaps so that server reset works correctly. - */ - for (i = 0; i < screenInfo.numScreens; i++) - SetInstalledColormap(screenInfo.screens[i], NULL); - /* * fb overwrites miCloseScreen, so do this here */ @@ -790,9 +746,6 @@ vfbScreenInit(ScreenPtr pScreen, int argc, char **argv) int ret; char *pbits; - if (!dixRegisterPrivateKey(&cmapScrPrivateKeyRec, PRIVATE_SCREEN, 0)) - return FALSE; - if (dpix == 0) dpix = 100; @@ -859,8 +812,6 @@ vfbScreenInit(ScreenPtr pScreen, int argc, char **argv) return FALSE; pScreen->InstallColormap = vfbInstallColormap; - pScreen->UninstallColormap = vfbUninstallColormap; - pScreen->ListInstalledColormaps = vfbListInstalledColormaps; pScreen->SaveScreen = vfbSaveScreen; pScreen->StoreColors = vfbStoreColors; -- cgit v1.2.3 From 7ebf480f5eb75e06271ec924769e51bdcbbdc69c Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 28 Feb 2014 12:34:49 -0500 Subject: xfree86: Remove some can't-happen printf from xf86CreateRootWindow Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- hw/xfree86/common/xf86Init.c | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'hw') diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 7686294c8..017dcb6bb 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -308,14 +308,6 @@ xf86CreateRootWindow(WindowPtr pWin) DebugF("xf86CreateRootWindow(%p)\n", pWin); - if (pScreen->CreateWindow != xf86CreateRootWindow) { - /* Can't find hook we are hung on */ - xf86DrvMsg(pScreen->myNum, X_WARNING /* X_ERROR */ , - "xf86CreateRootWindow %p called when not in pScreen->CreateWindow %p n", - (void *) xf86CreateRootWindow, - (void *) pScreen->CreateWindow); - } - /* Unhook this function ... */ pScreen->CreateWindow = create_window; dixSetPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey, NULL); @@ -343,15 +335,8 @@ xf86CreateRootWindow(WindowPtr pWin) ret &= (err == Success); } - else { - xf86Msg(X_ERROR, "xf86CreateRootWindow unexpectedly called with " - "non-root window %p (parent %p)\n", - (void *) pWin, (void *) pWin->parent); - ret = FALSE; - } } - DebugF("xf86CreateRootWindow() returns %d\n", ret); return ret; } -- cgit v1.2.3