diff options
author | Dave Airlie <airlied@redhat.com> | 2009-07-28 14:47:42 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-07-28 15:14:28 +1000 |
commit | 4b42448a2388d40f257774fbffdccaea87bd0347 (patch) | |
tree | 6580ef2926df762a4eb2d102244b7f692bd35830 | |
parent | 0a168401c401727e49a12cae43a6a387b1f2928d (diff) |
xserver: remove RAC/resource handling code.
This changes the ABI, but since the video ABI is at 6 already
it should be fine.
driver changes are in the pipeline after this.
Signed-off-by: Dave Airlie <airlied@redhat.com>
27 files changed, 62 insertions, 4081 deletions
diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am index fbd052c6c..f3e201b57 100644 --- a/hw/xfree86/common/Makefile.am +++ b/hw/xfree86/common/Makefile.am @@ -37,20 +37,20 @@ libcommon_la_SOURCES = xf86Configure.c xf86ShowOpts.c xf86Bus.c xf86Config.c \ xf86Events.c xf86Globals.c xf86AutoConfig.c \ xf86Option.c xf86Init.c \ xf86VidMode.c xf86fbman.c xf86cmap.c \ - xf86Helper.c xf86PM.c xf86RAC.c xf86Xinput.c xisb.c \ + xf86Helper.c xf86PM.c xf86Xinput.c xisb.c \ xf86Mode.c xorgHelper.c \ $(XVSOURCES) $(BUSSOURCES) $(RANDRSOURCES) nodist_libcommon_la_SOURCES = xf86DefModeSet.c xf86Build.h INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \ - -I$(srcdir)/../loader -I$(srcdir)/../rac -I$(srcdir)/../parser \ + -I$(srcdir)/../loader -I$(srcdir)/../parser \ -I$(srcdir)/../vbe -I$(srcdir)/../int10 \ -I$(srcdir)/../vgahw -I$(srcdir)/../dixmods/extmod \ -I$(srcdir)/../modes -I$(srcdir)/../ramdac sdk_HEADERS = compiler.h fourcc.h xf86.h xf86Module.h xf86Opt.h \ - xf86PciInfo.h xf86Priv.h xf86Privstr.h xf86Resources.h \ - xf86cmap.h xf86fbman.h xf86str.h xf86RAC.h xf86Xinput.h xisb.h \ + xf86PciInfo.h xf86Priv.h xf86Privstr.h \ + xf86cmap.h xf86fbman.h xf86str.h xf86Xinput.h xisb.h \ $(XVSDKINCS) $(XF86VMODE_SDK) xorgVersion.h \ xf86sbusBus.h @@ -71,7 +71,6 @@ EXTRA_DIST = \ xf86PciInfo.h \ xf86Priv.h \ xf86Privstr.h \ - xf86Resources.h \ xf86Xinput.h \ xf86cmap.h \ xf86fbman.h \ diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h index f8638403b..a17e0b163 100644 --- a/hw/xfree86/common/xf86.h +++ b/hw/xfree86/common/xf86.h @@ -102,7 +102,6 @@ extern _X_EXPORT Bool xf86ParsePciBusString(const char *busID, int *bus, int *de int *func); extern _X_EXPORT Bool xf86ComparePciBusString(const char *busID, int bus, int device, int func); extern _X_EXPORT void xf86FormatPciBusNumber(int busnum, char *buffer); -extern _X_EXPORT resPtr xf86AddRangesToList(resPtr list, resRange *pRange, int entityIndex); extern _X_EXPORT int xf86GetFbInfoForScreen(int scrnIndex); extern _X_EXPORT int xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active); extern _X_EXPORT int xf86ClaimNoSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active); @@ -110,9 +109,6 @@ extern _X_EXPORT void xf86EnableAccess(ScrnInfoPtr pScrn); extern _X_EXPORT void xf86SetCurrentAccess(Bool Enable, ScrnInfoPtr pScrn); extern _X_EXPORT Bool xf86IsPrimaryPci(struct pci_device * pPci); /* new RAC */ -extern _X_EXPORT resPtr xf86AddResToList(resPtr rlist, resRange *Range, int entityIndex); -extern _X_EXPORT void xf86FreeResList(resPtr rlist); -extern _X_EXPORT void xf86ClaimFixedResources(resList list, int entityIndex); extern _X_EXPORT Bool xf86DriverHasEntities(DriverPtr drvp); extern _X_EXPORT void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex); extern _X_EXPORT void xf86SetEntityInstanceForScreen(ScrnInfoPtr pScrn, int entityIndex, @@ -124,18 +120,10 @@ extern _X_EXPORT EntityInfoPtr xf86GetEntityInfo(int entityIndex); extern _X_EXPORT struct pci_device * xf86GetPciInfoForEntity(int entityIndex); extern _X_EXPORT Bool xf86SetEntityFuncs(int entityIndex, EntityProc init, EntityProc enter, EntityProc leave, pointer); -extern _X_EXPORT void xf86DeallocateResourcesForEntity(int entityIndex, unsigned long type); -extern _X_EXPORT resPtr xf86RegisterResources(int entityIndex, resList list, - unsigned long Access); extern _X_EXPORT Bool xf86CheckPciMemBase(struct pci_device * pPci, memType base); -extern _X_EXPORT void xf86SetAccessFuncs(EntityInfoPtr pEnt, xf86SetAccessFuncPtr funcs, - xf86SetAccessFuncPtr oldFuncs); extern _X_EXPORT Bool xf86IsEntityPrimary(int entityIndex); -extern _X_EXPORT resPtr xf86SetOperatingState(resList list, int entityIndex, int mask); extern _X_EXPORT void xf86EnterServerState(xf86State state); extern _X_EXPORT ScrnInfoPtr xf86FindScreenForEntity(int entityIndex); -extern _X_EXPORT Bool xf86NoSharedResources(int screenIndex, resType res); -extern _X_EXPORT resPtr xf86FindIntersectOfLists(resPtr l1, resPtr l2); extern _X_EXPORT void xf86RegisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func, pointer arg); extern _X_EXPORT Bool xf86DeregisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func); @@ -285,27 +273,21 @@ extern _X_EXPORT pointer xf86FindXvOptions(int scrnIndex, int adapt_index, char extern _X_EXPORT void xf86GetOS(const char **name, int *major, int *minor, int *teeny); extern _X_EXPORT ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,PciChipsets *p_chip, - resList res, EntityProc init, + void *dummy, EntityProc init, EntityProc enter, EntityProc leave, pointer private); extern _X_EXPORT ScrnInfoPtr xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, EntityProc init, EntityProc enter, EntityProc leave, pointer private); + /* Obsolete! don't use */ extern _X_EXPORT Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, - int entityIndex,PciChipsets *p_chip, - resList res, EntityProc init, - EntityProc enter, EntityProc leave, - pointer private); -/* Obsolete! don't use */ -extern _X_EXPORT void xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets *p_chip, - resList res, EntityProc init, - EntityProc enter, EntityProc leave, - pointer private); -extern _X_EXPORT void xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init, - EntityProc enter, EntityProc leave, - pointer private); + int entityIndex,PciChipsets *p_chip, + void *dummy, EntityProc init, + EntityProc enter, EntityProc leave, + pointer private); + extern _X_EXPORT Bool xf86IsScreenPrimary(int scrnIndex); extern _X_EXPORT int xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type, int format, unsigned long len, diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c index 0d732d0b1..01716ed35 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/hw/xfree86/common/xf86Bus.c @@ -40,7 +40,6 @@ #include "os.h" #include "xf86.h" #include "xf86Priv.h" -#include "xf86Resources.h" /* Bus-specific headers */ @@ -50,7 +49,6 @@ #define NEED_OS_RAC_PROTOS #include "xf86_OSproc.h" -#include "xf86RAC.h" #include "Pci.h" /* Entity data */ @@ -59,34 +57,10 @@ int xf86NumEntities = 0; static int xf86EntityPrivateCount = 0; BusAccPtr xf86BusAccInfo = NULL; -static void -noopEnableDisable(void *arg) { } - -xf86AccessRec AccessNULL = { noopEnableDisable, noopEnableDisable, NULL }; - -xf86CurrentAccessRec xf86CurrentAccess = {NULL,NULL}; - BusRec primaryBus = { BUS_NONE, { 0 } }; static Bool xf86ResAccessEnter = FALSE; -/* resource lists */ -static resPtr Acc = NULL; - -/* predefined special resources */ -resRange resVgaExclusive[] = {_VGA_EXCLUSIVE, _END}; -resRange resVgaShared[] = {_VGA_SHARED, _END}; -resRange resVgaMemShared[] = {_VGA_SHARED_MEM,_END}; -resRange resVgaIoShared[] = {_VGA_SHARED_IO,_END}; -resRange resVgaUnusedExclusive[] = {_VGA_EXCLUSIVE_UNUSED, _END}; -resRange resVgaUnusedShared[] = {_VGA_SHARED_UNUSED, _END}; -resRange resVgaSparseExclusive[] = {_VGA_EXCLUSIVE_SPARSE, _END}; -resRange resVgaSparseShared[] = {_VGA_SHARED_SPARSE, _END}; -resRange res8514Exclusive[] = {_8514_EXCLUSIVE, _END}; -resRange res8514Shared[] = {_8514_SHARED, _END}; - -/* Flag: do we need RAC ? */ -static Bool needRAC = FALSE; static Bool doFramebufferMode = FALSE; /* state change notification callback list */ @@ -151,17 +125,10 @@ void xf86EntityInit(void) { int i; - xf86AccessPtr pacc; for (i = 0; i < xf86NumEntities; i++) if (xf86Entities[i]->entityInit) { - if (xf86Entities[i]->access->busAcc) - ((BusAccPtr)xf86Entities[i]->access->busAcc)->set_f - (xf86Entities[i]->access->busAcc); - pacc = xf86Entities[i]->access->fallback; - pacc->AccessEnable(pacc->arg); xf86Entities[i]->entityInit(i,xf86Entities[i]->private); - pacc->AccessDisable(pacc->arg); } } @@ -181,17 +148,10 @@ static void EntityEnter(void) { int i; - xf86AccessPtr pacc; for (i = 0; i < xf86NumEntities; i++) if (xf86Entities[i]->entityEnter) { - if (xf86Entities[i]->access->busAcc) - ((BusAccPtr)xf86Entities[i]->access->busAcc)->set_f - (xf86Entities[i]->access->busAcc); - pacc = xf86Entities[i]->access->fallback; - pacc->AccessEnable(pacc->arg); xf86Entities[i]->entityEnter(i,xf86Entities[i]->private); - pacc->AccessDisable(pacc->arg); } } @@ -199,17 +159,10 @@ static void EntityLeave(void) { int i; - xf86AccessPtr pacc; for (i = 0; i < xf86NumEntities; i++) if (xf86Entities[i]->entityLeave) { - if (xf86Entities[i]->access->busAcc) - ((BusAccPtr)xf86Entities[i]->access->busAcc)->set_f - (xf86Entities[i]->access->busAcc); - pacc = xf86Entities[i]->access->fallback; - pacc->AccessEnable(pacc->arg); xf86Entities[i]->entityLeave(i,xf86Entities[i]->private); - pacc->AccessDisable(pacc->arg); } } @@ -269,8 +222,6 @@ xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex) pScrn->entityList = xnfrealloc(pScrn->entityList, pScrn->numEntities * sizeof(int)); pScrn->entityList[pScrn->numEntities - 1] = entityIndex; - xf86Entities[entityIndex]->access->next = pScrn->access; - pScrn->access = xf86Entities[entityIndex]->access; xf86Entities[entityIndex]->inUse = TRUE; pScrn->entityInstanceList = xnfrealloc(pScrn->entityInstanceList, pScrn->numEntities * sizeof(int)); @@ -320,26 +271,15 @@ void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex) { int i; - EntityAccessPtr *ptr = (EntityAccessPtr *)&pScrn->access; - EntityAccessPtr peacc; for (i = 0; i < pScrn->numEntities; i++) { if (pScrn->entityList[i] == entityIndex) { - peacc = xf86Entities[pScrn->entityList[i]]->access; - (*ptr) = peacc->next; - /* disable entity: call disable func */ - if (peacc->pAccess) - peacc->pAccess->AccessDisable(peacc->pAccess->arg); - /* also disable fallback - just in case */ - if (peacc->fallback) - peacc->fallback->AccessDisable(peacc->fallback->arg); for (i++; i < pScrn->numEntities; i++) pScrn->entityList[i-1] = pScrn->entityList[i]; pScrn->numEntities--; xf86Entities[entityIndex]->inUse = FALSE; break; } - ptr = &(xf86Entities[pScrn->entityList[i]]->access->next); } } @@ -351,7 +291,6 @@ void xf86ClearEntityListForScreen(int scrnIndex) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - EntityAccessPtr peacc; int i, entityIndex; if (pScrn->entityList == NULL || pScrn->numEntities == 0) return; @@ -360,43 +299,13 @@ xf86ClearEntityListForScreen(int scrnIndex) entityIndex = pScrn->entityList[i]; xf86Entities[entityIndex]->inUse = FALSE; /* disable resource: call the disable function */ - peacc = xf86Entities[entityIndex]->access; - if (peacc->pAccess) - peacc->pAccess->AccessDisable(peacc->pAccess->arg); - /* and the fallback function */ - if (peacc->fallback) - peacc->fallback->AccessDisable(peacc->fallback->arg); - /* shared resources are only needed when entity is active: remove */ - xf86DeallocateResourcesForEntity(entityIndex, ResShared); } xfree(pScrn->entityList); xfree(pScrn->entityInstanceList); - if (pScrn->CurrentAccess->pIoAccess == (EntityAccessPtr)pScrn->access) - pScrn->CurrentAccess->pIoAccess = NULL; - if (pScrn->CurrentAccess->pMemAccess == (EntityAccessPtr)pScrn->access) - pScrn->CurrentAccess->pMemAccess = NULL; pScrn->entityList = NULL; pScrn->entityInstanceList = NULL; } -void -xf86DeallocateResourcesForEntity(int entityIndex, unsigned long type) -{ - resPtr *pprev_next = &Acc; - resPtr res = Acc; - - while (res) { - if (res->entityIndex == entityIndex && - (type & ResAccMask & res->res_type)) - { - (*pprev_next) = res->next; - xfree(res); - } else - pprev_next = &(res->next); - res = (*pprev_next); - } -} - /* * Add an extra device section (GDevPtr) to an entity. */ @@ -439,7 +348,6 @@ xf86GetEntityInfo(int entityIndex) pEnt->location = xf86Entities[entityIndex]->bus; pEnt->active = xf86Entities[entityIndex]->active; pEnt->chipset = xf86Entities[entityIndex]->chipset; - pEnt->resources = xf86Entities[entityIndex]->resources; pEnt->driver = xf86Entities[entityIndex]->driver; if ( (xf86Entities[entityIndex]->devices) && (xf86Entities[entityIndex]->devices[0]) ) { @@ -483,72 +391,12 @@ xf86GetDevFromEntity(int entityIndex, int instance) } /* - * general generic disable function. - */ -static void -disableAccess(void) -{ - int i; - xf86AccessPtr pacc; - EntityAccessPtr peacc; - - /* call disable funcs and reset current access pointer */ - /* the entity specific access funcs are in an enabled */ - /* state - driver must restore their state explicitely */ - for (i = 0; i < xf86NumScreens; i++) { - peacc = xf86Screens[i]->CurrentAccess->pIoAccess; - while (peacc) { - if (peacc->pAccess) - peacc->pAccess->AccessDisable(peacc->pAccess->arg); - peacc = peacc->next; - } - xf86Screens[i]->CurrentAccess->pIoAccess = NULL; - peacc = xf86Screens[i]->CurrentAccess->pMemAccess; - while (peacc) { - if (peacc->pAccess) - peacc->pAccess->AccessDisable(peacc->pAccess->arg); - peacc = peacc->next; - } - xf86Screens[i]->CurrentAccess->pMemAccess = NULL; - } - /* then call the generic entity disable funcs */ - for (i = 0; i < xf86NumEntities; i++) { - pacc = xf86Entities[i]->access->fallback; - pacc->AccessDisable(pacc->arg); - } -} - -static void -clearAccess(void) -{ - int i; - - /* call disable funcs and reset current access pointer */ - /* the entity specific access funcs are in an enabled */ - /* state - driver must restore their state explicitely */ - for (i = 0; i < xf86NumScreens; i++) { - xf86Screens[i]->CurrentAccess->pIoAccess = NULL; - xf86Screens[i]->CurrentAccess->pMemAccess = NULL; - } - -} - -/* - * Generic interface to bus specific code - add other buses here - */ - -/* * xf86AccessInit() - set up everything needed for access control * called only once on first server generation. */ void xf86AccessInit(void) { - initPciState(); - initPciBusState(); - DisablePciBusAccess(); - DisablePciAccess(); - xf86ResAccessEnter = TRUE; } @@ -566,10 +414,6 @@ xf86AccessEnter(void) * on enter we simply disable routing of special resources * to any bus and let the RAC code to "open" the right bridges. */ - PciBusStateEnter(); - DisablePciBusAccess(); - PciStateEnter(); - disableAccess(); EntityEnter(); notifyStateChange(NOTIFY_ENTER); xf86EnterServerState(SETUP); @@ -591,34 +435,9 @@ xf86AccessLeave(void) if (!xf86ResAccessEnter) return; notifyStateChange(NOTIFY_LEAVE); - disableAccess(); - DisablePciBusAccess(); EntityLeave(); } -void -xf86AccessLeaveState(void) -{ - if (!xf86ResAccessEnter) - return; - xf86ResAccessEnter = FALSE; - PciStateLeave(); - PciBusStateLeave(); -} - -/* - * xf86AccessRestoreState() - Restore the access registers to the - * state before X was started. This is handy for framebuffers. - */ -static void -xf86AccessRestoreState(void) -{ - if (!xf86ResAccessEnter) - return; - PciStateLeave(); - PciBusStateLeave(); -} - /* * xf86EnableAccess() -- enable access to controlled resources. * To reduce latency when switching access the ScrnInfoRec has @@ -637,879 +456,17 @@ xf86AccessRestoreState(void) void xf86EnableAccess(ScrnInfoPtr pScrn) { - register EntityAccessPtr peAcc = (EntityAccessPtr) pScrn->access; - register EntityAccessPtr pceAcc; - register xf86AccessPtr pAcc; - EntityAccessPtr tmp; - DebugF("Enable access %i\n",pScrn->scrnIndex); - /* Entity is not under access control or currently enabled */ - if (!pScrn->access) { - if (pScrn->busAccess) { - ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess); - } - return; - } - - switch (pScrn->resourceType) { - case IO: - pceAcc = pScrn->CurrentAccess->pIoAccess; - if (peAcc == pceAcc) { - return; - } - if (pScrn->CurrentAccess->pMemAccess == pceAcc) - pScrn->CurrentAccess->pMemAccess = NULL; - while (pceAcc) { - pAcc = pceAcc->pAccess; - if (pAcc) - pAcc->AccessDisable(pAcc->arg); - pceAcc = pceAcc->next; - } - if (pScrn->busAccess) - ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess); - while (peAcc) { - pAcc = peAcc->pAccess; - if (pAcc) - pAcc->AccessEnable(pAcc->arg); - peAcc = peAcc->next; - } - pScrn->CurrentAccess->pIoAccess = (EntityAccessPtr) pScrn->access; - return; - - case MEM_IO: - pceAcc = pScrn->CurrentAccess->pIoAccess; - if (peAcc != pceAcc) { /* current Io != pAccess */ - tmp = pceAcc; - while (pceAcc) { - pAcc = pceAcc->pAccess; - if (pAcc) - pAcc->AccessDisable(pAcc->arg); - pceAcc = pceAcc->next; - } - pceAcc = pScrn->CurrentAccess->pMemAccess; - if (peAcc != pceAcc /* current Mem != pAccess */ - && tmp !=pceAcc) { - while (pceAcc) { - pAcc = pceAcc->pAccess; - if (pAcc) - pAcc->AccessDisable(pAcc->arg); - pceAcc = pceAcc->next; - } - } - } else { /* current Io == pAccess */ - pceAcc = pScrn->CurrentAccess->pMemAccess; - if (pceAcc == peAcc) { /* current Mem == pAccess */ - return; - } - while (pceAcc) { /* current Mem != pAccess */ - pAcc = pceAcc->pAccess; - if (pAcc) - pAcc->AccessDisable(pAcc->arg); - pceAcc = pceAcc->next; - } - } - if (pScrn->busAccess) - ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess); - while (peAcc) { - pAcc = peAcc->pAccess; - if (pAcc) - pAcc->AccessEnable(pAcc->arg); - peAcc = peAcc->next; - } - pScrn->CurrentAccess->pMemAccess = - pScrn->CurrentAccess->pIoAccess = (EntityAccessPtr) pScrn->access; - return; - - case MEM: - pceAcc = pScrn->CurrentAccess->pMemAccess; - if (peAcc == pceAcc) { - return; - } - if (pScrn->CurrentAccess->pIoAccess == pceAcc) - pScrn->CurrentAccess->pIoAccess = NULL; - while (pceAcc) { - pAcc = pceAcc->pAccess; - if (pAcc) - pAcc->AccessDisable(pAcc->arg); - pceAcc = pceAcc->next; - } - if (pScrn->busAccess) - ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess); - while (peAcc) { - pAcc = peAcc->pAccess; - if (pAcc) - pAcc->AccessEnable(pAcc->arg); - peAcc = peAcc->next; - } - pScrn->CurrentAccess->pMemAccess = (EntityAccessPtr) pScrn->access; - return; - - case NONE: - if (pScrn->busAccess) { - ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess); - } - return; - } + return; } void xf86SetCurrentAccess(Bool Enable, ScrnInfoPtr pScrn) { - EntityAccessPtr pceAcc2 = NULL; - register EntityAccessPtr pceAcc = NULL; - register xf86AccessPtr pAcc; - - - switch(pScrn->resourceType) { - case IO: - pceAcc = pScrn->CurrentAccess->pIoAccess; - break; - case MEM: - pceAcc = pScrn->CurrentAccess->pMemAccess; - break; - case MEM_IO: - pceAcc = pScrn->CurrentAccess->pMemAccess; - pceAcc2 = pScrn->CurrentAccess->pIoAccess; - break; - default: - break; - } - - while (pceAcc) { - pAcc = pceAcc->pAccess; - if (pAcc) { - if (Enable) { - pAcc->AccessEnable(pAcc->arg); - } else { - pAcc->AccessDisable(pAcc->arg); - } - } - pceAcc = pceAcc->next; - if (!pceAcc) { - pceAcc = pceAcc2; - pceAcc2 = NULL; - } - } -} - -void -xf86SetAccessFuncs(EntityInfoPtr pEnt, xf86SetAccessFuncPtr funcs, - xf86SetAccessFuncPtr oldFuncs) -{ - AccessFuncPtr rac; - - if (!xf86Entities[pEnt->index]->rac) - xf86Entities[pEnt->index]->rac = xnfcalloc(1,sizeof(AccessFuncRec)); - - rac = xf86Entities[pEnt->index]->rac; - - rac->mem_new = funcs->mem; - rac->io_new = funcs->io; - rac->io_mem_new = funcs->io_mem; - - rac->old = oldFuncs; -} - -/* - * Conflict checking - */ - -static memType -getMask(memType val) -{ - memType mask = 0; - memType tmp = 0; - - mask=~mask; - tmp = ~((~tmp) >> 1); - - while (!(val & tmp)) { - mask = mask >> 1; - val = val << 1; - } - return mask; -} - -/* - * checkConflictBlock() -- check for conflicts of a block resource range. - * If conflict is found return end of conflicting range. Else return 0. - */ -static memType -checkConflictBlock(resRange *range, resPtr pRes) -{ - memType val,tmp,prev; - int i; - - switch (pRes->res_type & ResExtMask) { - case ResBlock: - if (range->rBegin < pRes->block_end && - range->rEnd > pRes->block_begin) { - DebugF("b-b conflict w: %lx %lx\n", - pRes->block_begin,pRes->block_end); - return pRes->block_end < range->rEnd ? - pRes->block_end : range->rEnd; - } - return 0; - case ResSparse: - if (pRes->sparse_base > range->rEnd) return 0; - - val = (~pRes->sparse_mask | pRes->sparse_base) & getMask(range->rEnd); - DebugF("base = 0x%lx, mask = 0x%lx, begin = 0x%lx, end = 0x%lx ," - "val = 0x%lx\n", - pRes->sparse_base, pRes->sparse_mask, range->rBegin, - range->rEnd, val); - i = sizeof(memType) * 8; - tmp = prev = pRes->sparse_base; - - while (i) { - tmp |= 1<< (--i) & val; - if (tmp > range->rEnd) - tmp = prev; - else - prev = tmp; - } - if (tmp >= range->rBegin) { - DebugF("conflict found at: 0x%lx\n",tmp); - DebugF("b-d conflict w: %lx %lx\n", - pRes->sparse_base,pRes->sparse_mask); - return tmp; - } - else - return 0; - } - return 0; -} - -/* - * checkConflictSparse() -- check for conflicts of a sparse resource range. - * If conflict is found return base of conflicting region. Else return 0. - */ -#define mt_max ~(memType)0 -#define length sizeof(memType) * 8 -static memType -checkConflictSparse(resRange *range, resPtr pRes) -{ - memType val, tmp, prev; - int i; - - switch (pRes->res_type & ResExtMask) { - case ResSparse: - tmp = pRes->sparse_mask & range->rMask; - if ((tmp & pRes->sparse_base) == (tmp & range->rBase)) { - DebugF("s-b conflict w: %lx %lx\n", - pRes->sparse_base,pRes->sparse_mask); - return pRes->sparse_mask; - } - return 0; - - case ResBlock: - if (pRes->block_end < range->rBase) return 0; - - val = (~range->rMask | range->rBase) & getMask(pRes->block_end); - i = length; - tmp = prev = range->rBase; - - while (i) { - DebugF("tmp = 0x%lx\n",tmp); - tmp |= 1<< (--i) & val; - if (tmp > pRes->block_end) - tmp = prev; - else - prev = tmp; - } - if (tmp < pRes->block_begin) - return 0; - else { - /* - * now we subdivide the block region in sparse regions - * with base values = 2^n and find the smallest mask. - * This might be done in a simpler way.... - */ - memType mask, m_mask = 0, base = pRes->block_begin; - int i; - while (base < pRes->block_end) { - for (i = 1; i < length; i++) - if ( base != (base & (mt_max << i))) break; - mask = mt_max >> (length - i); - do mask >>= 1; - while ((mask + base + 1) > pRes->block_end); - /* m_mask and are _inverted_ sparse masks */ - m_mask = mask > m_mask ? mask : m_mask; - base = base + mask + 1; - } - DebugF("conflict found at: 0x%lx\n",tmp); - DebugF("b-b conflict w: %lx %lx\n", - pRes->block_begin,pRes->block_end); - return ~m_mask; - } - } - return 0; -} -#undef mt_max -#undef length - -/* - * needCheck() -- this function decides whether to check for conflicts - * depending on the types of the resource ranges and their locations - */ -static Bool -needCheck(resPtr pRes, unsigned long type, int entityIndex, xf86State state) -{ - /* the same entity shouldn't conflict with itself */ - ScrnInfoPtr pScrn; - int i; - BusType loc = BUS_NONE; - BusType r_loc = BUS_NONE; - - if ((pRes->res_type & ResTypeMask) != (type & ResTypeMask)) - return FALSE; - - /* - * Resources set by BIOS (ResBios) are allowed to conflict - * with resources marked (ResBios). - */ - if (pRes->res_type & type & ResBios) - return FALSE; - - if (type & pRes->res_type & ResUnused) - return FALSE; - - if (state == OPERATING) { - if (type & ResDisableOpr || pRes->res_type & ResDisableOpr) - return FALSE; - if (type & pRes->res_type & ResUnusedOpr) return FALSE; - /* - * Maybe we should have ResUnused set The resUnusedOpr - * bit, too. This way we could avoid this confusion - */ - if ((type & ResUnusedOpr && pRes->res_type & ResUnused) || - (type & ResUnused && pRes->res_type & ResUnusedOpr)) - return FALSE; - } - - if (entityIndex > -1) - loc = xf86Entities[entityIndex]->bus.type; - if (pRes->entityIndex > -1) - r_loc = xf86Entities[pRes->entityIndex]->bus.type; - - if ((type & ResAccMask) == ResShared && - (pRes->res_type & ResAccMask) == ResShared) - return FALSE; - - if (pRes->entityIndex == entityIndex) return FALSE; - - if (pRes->entityIndex > -1 && - (pScrn = xf86FindScreenForEntity(entityIndex))) { - for (i = 0; i < pScrn->numEntities; i++) - if (pScrn->entityList[i] == pRes->entityIndex) return FALSE; - } - return TRUE; -} - -/* - * checkConflict() - main conflict checking function which all other - * function call. - */ -static memType -checkConflict(resRange *rgp, resPtr pRes, int entityIndex, - xf86State state, Bool ignoreIdentical) -{ - memType ret; - - while(pRes) { - if (!needCheck(pRes,rgp->type, entityIndex ,state)) { - pRes = pRes->next; - continue; - } - switch (rgp->type & ResExtMask) { - case ResBlock: - if (rgp->rEnd < rgp->rBegin) { - xf86Msg(X_ERROR,"end of block range 0x%lx < begin 0x%lx\n", - (long)rgp->rEnd, (long)rgp->rBegin); - return 0; - } - if ((ret = checkConflictBlock(rgp, pRes))) { - if (!ignoreIdentical || (rgp->rBegin != pRes->block_begin) - || (rgp->rEnd != pRes->block_end)) - return ret; - } - break; - case ResSparse: - if ((rgp->rBase & rgp->rMask) != rgp->rBase) { - xf86Msg(X_ERROR,"sparse io range (base: 0x%lx mask: 0x%lx)" - "doesn't satisfy (base & mask = mask)\n", - (long)rgp->rBase, (long)rgp->rMask); - return 0; - } - if ((ret = checkConflictSparse(rgp, pRes))) { - if (!ignoreIdentical || (rgp->rBase != pRes->sparse_base) - || (rgp->rMask != pRes->sparse_mask)) - return ret; - } - break; - } - pRes = pRes->next; - } - return 0; -} - -/* - * xf86ChkConflict() - This function is the low level interface to - * the resource broker that gets exported. Tests all resources ie. - * performs test with SETUP flag. - */ -static memType -xf86ChkConflict(resRange *rgp, int entityIndex) -{ - return checkConflict(rgp, Acc, entityIndex, SETUP, FALSE); -} - -/* - * Resources List handling - */ - -static resPtr -xf86JoinResLists(resPtr rlist1, resPtr rlist2) -{ - resPtr pRes; - - if (!rlist1) - return rlist2; - - if (!rlist2) - return rlist1; - - for (pRes = rlist1; pRes->next; pRes = pRes->next) - ; - pRes->next = rlist2; - return rlist1; -} - -resPtr -xf86AddResToList(resPtr rlist, resRange *range, int entityIndex) -{ - resPtr new; - - switch (range->type & ResExtMask) { - case ResBlock: - if (range->rEnd < range->rBegin) { - xf86Msg(X_ERROR,"end of block range 0x%lx < begin 0x%lx\n", - (long)range->rEnd, (long)range->rBegin); - return rlist; - } - break; - case ResSparse: - if ((range->rBase & range->rMask) != range->rBase) { - xf86Msg(X_ERROR,"sparse io range (base: 0x%lx mask: 0x%lx)" - "doesn't satisfy (base & mask = mask)\n", - (long)range->rBase, (long)range->rMask); - return rlist; - } - break; - } - - new = xnfalloc(sizeof(resRec)); - /* - * Only background resources may be registered with ResBios - * and ResEstimated set. Other resources only set it for - * testing. - */ - if (entityIndex != (-1)) - range->type &= ~(ResBios | ResEstimated); - new->val = *range; - new->entityIndex = entityIndex; - new->next = rlist; - return new; -} - -void -xf86FreeResList(resPtr rlist) -{ - resPtr pRes; - - if (!rlist) - return; - - for (pRes = rlist->next; pRes; rlist = pRes, pRes = pRes->next) - xfree(rlist); - xfree(rlist); -} - -static resPtr -xf86DupResList(const resPtr rlist) -{ - resPtr pRes, ret, prev, new; - - if (!rlist) - return NULL; - - ret = xnfalloc(sizeof(resRec)); - *ret = *rlist; - prev = ret; - for (pRes = rlist->next; pRes; pRes = pRes->next) { - new = xnfalloc(sizeof(resRec)); - *new = *pRes; - prev->next = new; - prev = new; - } - return ret; -} - -static void -xf86PrintResList(int verb, resPtr list) -{ - int i = 0; - const char *s, *r; - resPtr tmp = list; - unsigned long type; - - if (!list) - return; - - type = ResMem; - r = "M"; - while (1) { - while (list) { - if ((list->res_type & ResPhysMask) == type) { - switch (list->res_type & ResExtMask) { - case ResBlock: - xf86ErrorFVerb(verb, - "\t[%d] %d\t%ld\t0x%08lx - 0x%08lx (0x%lx)", - i, list->entityIndex, - (list->res_type & ResDomain) >> 24, - (long)list->block_begin, - (long)list->block_end, - (long)(list->block_end - - list->block_begin + 1)); - break; - case ResSparse: - xf86ErrorFVerb(verb, "\t[%d] %d\t%ld\t0x%08lx - 0x%08lx ", - i, list->entityIndex, - (list->res_type & ResDomain) >> 24, - (long)list->sparse_base, - (long)list->sparse_mask); - break; - default: - list = list->next; - continue; - } - xf86ErrorFVerb(verb, " %s", r); - switch (list->res_type & ResAccMask) { - case ResExclusive: - if (list->res_type & ResUnused) - s = "x"; - else - s = "X"; - break; - case ResShared: - if (list->res_type & ResUnused) - s = "s"; - else - s = "S"; - break; - default: - s = "?"; - } - xf86ErrorFVerb(verb, "%s", s); - switch (list->res_type & ResExtMask) { - case ResBlock: - s = "[B]"; - break; - case ResSparse: - s = "[S]"; - break; - default: - s = "[?]"; - } - xf86ErrorFVerb(verb, "%s", s); - if (list->res_type & ResInit) - xf86ErrorFVerb(verb, "t"); - if (list->res_type & ResBios) - xf86ErrorFVerb(verb, "(B)"); - if (list->res_type & ResBus) - xf86ErrorFVerb(verb, "(b)"); - if (list->res_type & ResOprMask) { - switch (list->res_type & ResOprMask) { - case ResUnusedOpr: - s = "(OprU)"; - break; - case ResDisableOpr: - s = "(OprD)"; - break; - default: - s = "(Opr?)"; - break; - } - xf86ErrorFVerb(verb, "%s", s); - } - xf86ErrorFVerb(verb, "\n"); - i++; - } - list = list->next; - } - if (type == ResIo) break; - type = ResIo; - r = "I"; - list = tmp; - } -} - -resPtr -xf86AddRangesToList(resPtr list, resRange *pRange, int entityIndex) -{ - while(pRange && pRange->type != ResEnd) { - list = xf86AddResToList(list,pRange,entityIndex); - pRange++; - } - return list; -} - -void -xf86ResourceBrokerInit(void) -{ - Acc = NULL; - - /* Get the ranges used exclusively by the system */ - Acc = xf86AccResFromOS(Acc); - xf86MsgVerb(X_INFO, 3, "System resource ranges:\n"); - xf86PrintResList(3, Acc); -} - -/* - * Resource registration - */ - -static void -convertRange2Host(int entityIndex, resRange *pRange) -{ - if (pRange->type & ResBus) { - switch (xf86Entities[entityIndex]->bus.type) { - case BUS_PCI: - pciConvertRange2Host(entityIndex,pRange); - break; - default: - break; - } - - pRange->type &= ~ResBus; - } -} - -static void -xf86ConvertListToHost(int entityIndex, resPtr list) -{ - while (list) { - convertRange2Host(entityIndex, &list->val); - list = list->next; - } -} - -/* - * xf86RegisterResources() -- attempts to register listed resources. - * Returns a resPtr listing all resources not successfully registered, by - * which we mean, NULL. - */ - -resPtr -xf86RegisterResources(int entityIndex, resList list, unsigned long access) -{ - resRange range; - resList list_f = NULL; - - if (!list) - return NULL; - - while(list->type != ResEnd) { - range = *list; - - convertRange2Host(entityIndex,&range); - - if ((access != ResNone) && (access & ResAccMask)) { - range.type = (range.type & ~ResAccMask) | (access & ResAccMask); - } - range.type &= ~ResEstimated; /* Not allowed for drivers */ - Acc = xf86AddResToList(Acc,&range,entityIndex); - list++; - } - if (list_f) - xfree(list_f); - -#ifdef DEBUG - xf86MsgVerb(X_INFO, 3,"Resources after driver initialization\n"); - xf86PrintResList(3, Acc); -#endif - return NULL; - -} - -static void -busTypeSpecific(EntityPtr pEnt, xf86AccessPtr *acc_mem, - xf86AccessPtr *acc_io, xf86AccessPtr *acc_mem_io) -{ - switch (pEnt->bus.type) { - case BUS_SBUS: - *acc_mem = *acc_io = *acc_mem_io = &AccessNULL; - break; - case BUS_PCI: { - struct pci_device *const dev = pEnt->bus.id.pci; - - if ((dev != NULL) && ((void *)dev->user_data != NULL)) { - pciAccPtr const paccp = (pciAccPtr) dev->user_data; - - *acc_io = & paccp->ioAccess; - *acc_mem = & paccp->memAccess; - *acc_mem_io = & paccp->io_memAccess; - } - else { - /* FIXME: This is an error path. We should probably have an - * FIXME: assertion here or something. - */ - *acc_io = NULL; - *acc_mem = NULL; - *acc_mem_io = NULL; - } - break; - } - default: - *acc_mem = *acc_io = *acc_mem_io = NULL; - break; - } - return; + return; } -static void -setAccess(EntityPtr pEnt, xf86State state) -{ - - xf86AccessPtr acc_mem, acc_io, acc_mem_io; - xf86AccessPtr org_mem = NULL, org_io = NULL, org_mem_io = NULL; - int prop; - - busTypeSpecific(pEnt, &acc_mem, &acc_io, &acc_mem_io); - - /* The replacement function needs to handle _all_ shared resources */ - /* unless they are handeled locally and disabled otherwise */ - if (pEnt->rac) { - if (pEnt->rac->io_new) { - org_io = acc_io; - acc_io = pEnt->rac->io_new; - } - if (pEnt->rac->mem_new) { - org_mem = acc_mem; - acc_mem = pEnt->rac->mem_new; - } - if (pEnt->rac->io_mem_new) { - org_mem_io = acc_mem_io; - acc_mem_io = pEnt->rac->io_mem_new; - } - } - - if (state == OPERATING) { - prop = pEnt->entityProp; - switch(pEnt->entityProp & NEED_SHARED) { - case NEED_SHARED: - pEnt->access->rt = MEM_IO; - break; - case NEED_IO_SHARED: - pEnt->access->rt = IO; - break; - case NEED_MEM_SHARED: - pEnt->access->rt = MEM; - break; - default: - pEnt->access->rt = NONE; - } - } else { - prop = NEED_SHARED | NEED_MEM | NEED_IO; - pEnt->access->rt = MEM_IO; - } - - switch(pEnt->access->rt) { - case IO: - pEnt->access->pAccess = acc_io; - break; - case MEM: - pEnt->access->pAccess = acc_mem; - break; - case MEM_IO: - pEnt->access->pAccess = acc_mem_io; - break; - default: /* no conflicts at all */ - pEnt->access->pAccess = NULL; /* remove from RAC */ - break; - } - - if (org_io) { - /* does the driver want the old access func? */ - if (pEnt->rac->old) { - /* give it to the driver, leave state disabled */ - pEnt->rac->old->io = org_io; - } else { - /* driver doesn't want it - enable generic access */ - org_io->AccessEnable(org_io->arg); - } - } - - if (org_mem_io) { - /* does the driver want the old access func? */ - if (pEnt->rac->old) { - /* give it to the driver, leave state disabled */ - pEnt->rac->old->io_mem = org_mem_io; - } else { - /* driver doesn't want it - enable generic access */ - org_mem_io->AccessEnable(org_mem_io->arg); - } - } - - if (org_mem) { - /* does the driver want the old access func? */ - if (pEnt->rac->old) { - /* give it to the driver, leave state disabled */ - pEnt->rac->old->mem = org_mem; - } else { - /* driver doesn't want it - enable generic access */ - org_mem->AccessEnable(org_mem->arg); - } - } - - if (!(prop & NEED_MEM_SHARED)){ - if (prop & NEED_MEM) { - if (acc_mem) - acc_mem->AccessEnable(acc_mem->arg); - } else { - if (acc_mem) - acc_mem->AccessDisable(acc_mem->arg); - } - } - - if (!(prop & NEED_IO_SHARED)) { - if (prop & NEED_IO) { - if (acc_io) - acc_io->AccessEnable(acc_io->arg); - } else { - if (acc_io) - acc_io->AccessDisable(acc_io->arg); - } - } - - /* disable shared resources */ - if (pEnt->access->pAccess) - pEnt->access->pAccess->AccessDisable(pEnt->access->pAccess->arg); - - /* - * If device is not under access control it is enabled. - * If it needs bus routing do it here as it isn't bus - * type specific. Any conflicts should be checked at this - * stage - */ - if (!pEnt->access->pAccess - && (pEnt->entityProp & (state == SETUP ? NEED_VGA_ROUTED_SETUP : - NEED_VGA_ROUTED))) - ((BusAccPtr)pEnt->busAcc)->set_f(pEnt->busAcc); -} - - /* * xf86EnterServerState() -- set state the server is in. */ @@ -1534,11 +491,6 @@ SetSIGIOForState(xf86State state) void xf86EnterServerState(xf86State state) { - EntityPtr pEnt; - ScrnInfoPtr pScrn; - int i,j; - int needVGA = 0; - resType rt; /* * This is a good place to block SIGIO during SETUP state. * SIGIO should be blocked in SETUP state otherwise (u)sleep() @@ -1554,250 +506,8 @@ xf86EnterServerState(xf86State state) /* When servicing a dumb framebuffer we don't need to do anything */ if (doFramebufferMode) return; - for (i=0; i<xf86NumScreens; i++) { - pScrn = xf86Screens[i]; - j = pScrn->entityList[pScrn->numEntities - 1]; - pScrn->access = xf86Entities[j]->access; - - for (j = 0; j<xf86Screens[i]->numEntities; j++) { - pEnt = xf86Entities[xf86Screens[i]->entityList[j]]; - if (pEnt->entityProp & (state == SETUP ? NEED_VGA_ROUTED_SETUP - : NEED_VGA_ROUTED)) - xf86Screens[i]->busAccess = pEnt->busAcc; - } - if (xf86Screens[i]->busAccess) - needVGA ++; - } - - /* - * if we just have one screen we don't have RAC. - * Therefore just enable the screen and return. - */ - if (!needRAC) { - xf86EnableAccess(xf86Screens[0]); - notifyStateChange(NOTIFY_ENABLE); - return; - } - - if (state == SETUP) - notifyStateChange(NOTIFY_SETUP_TRANSITION); - else - notifyStateChange(NOTIFY_OPERATING_TRANSITION); - - clearAccess(); - for (i=0; i<xf86NumScreens;i++) { - - rt = NONE; - - for (j = 0; j<xf86Screens[i]->numEntities; j++) { - pEnt = xf86Entities[xf86Screens[i]->entityList[j]]; - setAccess(pEnt,state); - - if (pEnt->access->rt != NONE) { - if (rt != NONE && rt != pEnt->access->rt) - rt = MEM_IO; - else - rt = pEnt->access->rt; - } - } - xf86Screens[i]->resourceType = rt; - if (rt == NONE) { - xf86Screens[i]->access = NULL; - if (needVGA < 2) - xf86Screens[i]->busAccess = NULL; - } - - if (xf86Screens[i]->busAccess) - DebugF("Screen %i setting vga route\n",i); - switch (rt) { - case MEM_IO: - xf86MsgVerb(X_INFO, 3, "Screen %i shares mem & io resources\n",i); - break; - case IO: - xf86MsgVerb(X_INFO, 3, "Screen %i shares io resources\n",i); - break; - case MEM: - xf86MsgVerb(X_INFO, 3, "Screen %i shares mem resources\n",i); - break; - default: - xf86MsgVerb(X_INFO, 3, "Entity %i shares no resources\n",i); - break; - } - } - if (state == SETUP) - notifyStateChange(NOTIFY_SETUP); - else - notifyStateChange(NOTIFY_OPERATING); -} - -/* - * xf86SetOperatingState() -- Set ResOperMask for resources listed. - */ -resPtr -xf86SetOperatingState(resList list, int entityIndex, int mask) -{ - resPtr acc; - resPtr r_fail = NULL; - resRange range; - - while (list->type != ResEnd) { - range = *list; - convertRange2Host(entityIndex,&range); - - acc = Acc; - while (acc) { -#define MASK (ResTypeMask | ResExtMask) - if ((acc->entityIndex == entityIndex) - && (acc->val.a == range.a) && (acc->val.b == range.b) - && ((acc->val.type & MASK) == (range.type & MASK))) - break; -#undef MASK - acc = acc->next; - } - if (acc) - acc->val.type = (acc->val.type & ~ResOprMask) - | (mask & ResOprMask); - else { - r_fail = xf86AddResToList(r_fail,&range,entityIndex); - } - list ++; - } - - return r_fail; -} - -/* - * Stage specific code - */ - -/* - * xf86ClaimFixedResources() is used to allocate non-relocatable resources. - * This should only be done by a driver's Probe() function. - */ -void -xf86ClaimFixedResources(resList list, int entityIndex) -{ - resPtr ptr = NULL; - resRange range; - - if (!list) return; - - while (list->type !=ResEnd) { - range = *list; - - convertRange2Host(entityIndex,&range); - - range.type &= ~ResEstimated; /* Not allowed for drivers */ - switch (range.type & ResAccMask) { - case ResExclusive: - if (!xf86ChkConflict(&range, entityIndex)) { - Acc = xf86AddResToList(Acc, &range, entityIndex); - } else FatalError("xf86ClaimFixedResources conflict\n"); - break; - case ResShared: - /* at this stage the resources are just added to the - * EntityRec. After the Probe() phase this list is checked by - * xf86PostProbe(). All resources which don't - * conflict with already allocated ones are allocated - * and removed from the EntityRec. Thus a non-empty resource - * list in the EntityRec indicates resource conflicts the - * driver should either handle or fail. - */ - if (xf86Entities[entityIndex]->active) - ptr = xf86AddResToList(ptr,&range,entityIndex); - break; - } - list++; - } - xf86Entities[entityIndex]->resources = - xf86JoinResLists(xf86Entities[entityIndex]->resources,ptr); - xf86MsgVerb(X_INFO, 3, - "resource ranges after xf86ClaimFixedResources() call:\n"); - xf86PrintResList(3,Acc); -#ifdef DEBUG - if (ptr) { - xf86MsgVerb(X_INFO, 3, "to be registered later:\n"); - xf86PrintResList(3,ptr); - } -#endif -} - -static void -checkRoutingForScreens(xf86State state) -{ - resList list = resVgaUnusedExclusive; - resPtr pResVGA = NULL; - resPtr pResVGAHost; - pointer vga = NULL; - int i,j; - int entityIndex; - EntityPtr pEnt; - resPtr pAcc; - resRange range; - - /* - * find devices that need VGA routed: ie the ones that have - * registered VGA resources without ResUnused. ResUnused - * doesn't conflict with itself therefore use it here. - */ - while (list->type != ResEnd) { /* create resPtr from resList for VGA */ - range = *list; - range.type &= ~(ResBios | ResEstimated); /* if set remove them */ - pResVGA = xf86AddResToList(pResVGA, &range, -1); - list++; - } - - for (i = 0; i < xf86NumScreens; i++) { - for (j = 0; j < xf86Screens[i]->numEntities; j++) { - entityIndex = xf86Screens[i]->entityList[j]; - pEnt = xf86Entities[entityIndex]; - pAcc = Acc; - vga = NULL; - pResVGAHost = xf86DupResList(pResVGA); - xf86ConvertListToHost(entityIndex,pResVGAHost); - while (pAcc) { - if (pAcc->entityIndex == entityIndex) - if (checkConflict(&pAcc->val, pResVGAHost, - entityIndex, state, FALSE)) { - if (vga && vga != pEnt->busAcc) { - xf86Msg(X_ERROR, "Screen %i needs vga routed to" - "different buses - deleting\n",i); - xf86DeleteScreen(i--,0); - } -#ifdef DEBUG - { - resPtr rlist = xf86AddResToList(NULL,&pAcc->val, - pAcc->entityIndex); - xf86MsgVerb(X_INFO,3,"====== %s\n", - state == OPERATING ? "OPERATING" - : "SETUP"); - xf86MsgVerb(X_INFO,3,"%s Resource:\n", - (pAcc->val.type) & ResMem ? "Mem" :"Io"); - xf86PrintResList(3,rlist); - xf86FreeResList(rlist); - xf86MsgVerb(X_INFO,3,"Conflicts with:\n"); - xf86PrintResList(3,pResVGAHost); - xf86MsgVerb(X_INFO,3,"=====\n"); - } -#endif - vga = pEnt->busAcc; - pEnt->entityProp |= (state == SETUP - ? NEED_VGA_ROUTED_SETUP : NEED_VGA_ROUTED); - if (state == OPERATING) { - if (pAcc->val.type & ResMem) - pEnt->entityProp |= NEED_VGA_MEM; - else - pEnt->entityProp |= NEED_VGA_IO; - } - } - pAcc = pAcc->next; - } - if (vga) - xf86MsgVerb(X_INFO, 3,"Setting vga for screen %i.\n",i); - xf86FreeResList(pResVGAHost); - } - } - xf86FreeResList(pResVGA); + notifyStateChange(NOTIFY_ENABLE); + return; } /* @@ -1807,10 +517,6 @@ checkRoutingForScreens(xf86State state) void xf86PostProbe(void) { - memType val; - int i,j; - resPtr resp, acc, tmp, resp_x; - if (fbSlotClaimed) { if (pciSlotClaimed #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) @@ -1822,519 +528,34 @@ xf86PostProbe(void) return; } else { xf86Msg(X_INFO,"Running in FRAMEBUFFER Mode\n"); - xf86AccessRestoreState(); notifyStateChange(NOTIFY_ENABLE); doFramebufferMode = TRUE; return; } } - acc = tmp = xf86DupResList(Acc); - - for (i=0; i<xf86NumEntities; i++) { - resp = xf86Entities[i]->resources; - xf86Entities[i]->resources = NULL; - resp_x = NULL; - while (resp) { - if (! (val = checkConflict(&resp->val,acc,i,SETUP,FALSE))) { - resp->res_type &= ~(ResBios); /* just used for chkConflict() */ - tmp = resp_x; - resp_x = resp; - resp = resp->next; - resp_x->next = tmp; - } else { - xf86MsgVerb(X_INFO, 3, "Found conflict at: 0x%lx\n", - (long)val); - resp->res_type &= ~ResEstimated; - tmp = xf86Entities[i]->resources; - xf86Entities[i]->resources = resp; - resp = resp->next; - xf86Entities[i]->resources->next = tmp; - } - } - xf86JoinResLists(Acc,resp_x); - } - xf86FreeResList(acc); - - xf86MsgVerb(X_INFO, 3, "resource ranges after probing:\n"); - xf86PrintResList(3, Acc); - checkRoutingForScreens(SETUP); - - for (i = 0; i < xf86NumScreens; i++) { - for (j = 0; j<xf86Screens[i]->numEntities; j++) { - EntityPtr pEnt = xf86Entities[xf86Screens[i]->entityList[j]]; - if ((pEnt->entityProp & NEED_VGA_ROUTED_SETUP) && - ((xf86Screens[i]->busAccess = pEnt->busAcc))) - break; - } - } -} - -static void -checkRequiredResources(int entityIndex) -{ - resRange range; - resPtr pAcc = Acc; - const EntityPtr pEnt = xf86Entities[entityIndex]; - while (pAcc) { - if (pAcc->entityIndex == entityIndex) { - range = pAcc->val; - /* ResAny to find conflicts with anything. */ - range.type = (range.type & ~ResAccMask) | ResAny | ResBios; - if (checkConflict(&range,Acc,entityIndex,OPERATING,FALSE)) - switch (pAcc->res_type & ResPhysMask) { - case ResMem: - pEnt->entityProp |= NEED_MEM_SHARED; - break; - case ResIo: - pEnt->entityProp |= NEED_IO_SHARED; - break; - } - if (!(pAcc->res_type & ResOprMask)) { - switch (pAcc->res_type & ResPhysMask) { - case ResMem: - pEnt->entityProp |= NEED_MEM; - break; - case ResIo: - pEnt->entityProp |= NEED_IO; - break; - } - } - } - pAcc = pAcc->next; - } - - /* - * After we have checked all resources of an entity agains any - * other resource we know if the entity need this resource type - * (ie. mem/io) at all. if not we can disable this type completely, - * so no need to share it either. - */ - if ((pEnt->entityProp & NEED_MEM_SHARED) - && (!(pEnt->entityProp & NEED_MEM))) - pEnt->entityProp &= ~(unsigned long)NEED_MEM_SHARED; - - if ((pEnt->entityProp & NEED_IO_SHARED) - && (!(pEnt->entityProp & NEED_IO))) - pEnt->entityProp &= ~(unsigned long)NEED_IO_SHARED; } void xf86PostPreInit(void) { if (doFramebufferMode) return; - - if (xf86NumScreens > 1) - needRAC = TRUE; - - xf86MsgVerb(X_INFO, 3, "do I need RAC?"); - - if (needRAC) { - xf86ErrorFVerb(3, " Yes, I do.\n"); - } else { - xf86ErrorFVerb(3, " No, I don't.\n"); - } - - xf86MsgVerb(X_INFO, 3, "resource ranges after preInit:\n"); - xf86PrintResList(3, Acc); } void xf86PostScreenInit(void) { - int i,j; - ScreenPtr pScreen; - unsigned int flags; - int nummem = 0, numio = 0; - if (doFramebufferMode) { SetSIGIOForState(OPERATING); return; } DebugF("PostScreenInit generation: %i\n",serverGeneration); - if (serverGeneration == 1) { - checkRoutingForScreens(OPERATING); - for (i=0; i<xf86NumEntities; i++) { - checkRequiredResources(i); - } - - /* - * after removing NEED_XXX_SHARED from entities that - * don't need need XXX resources at all we might have - * a single entity left that has NEED_XXX_SHARED set. - * In this case we can delete that, too. - */ - for (i = 0; i < xf86NumEntities; i++) { - if (xf86Entities[i]->entityProp & NEED_MEM_SHARED) - nummem++; - if (xf86Entities[i]->entityProp & NEED_IO_SHARED) - numio++; - } - for (i = 0; i < xf86NumEntities; i++) { - if (nummem < 2) - xf86Entities[i]->entityProp &= ~NEED_MEM_SHARED; - if (numio < 2) - xf86Entities[i]->entityProp &= ~NEED_IO_SHARED; - } - } - - if (xf86Screens && needRAC) { - int needRACforVga = 0; - - for (i = 0; i < xf86NumScreens; i++) { - for (j = 0; j < xf86Screens[i]->numEntities; j++) { - if (xf86Entities[xf86Screens[i]->entityList[j]]->entityProp - & NEED_VGA_ROUTED) { - needRACforVga ++; - break; /* only count each screen once */ - } - } - } - - for (i = 0; i < xf86NumScreens; i++) { - Bool needRACforMem = FALSE, needRACforIo = FALSE; - - for (j = 0; j < xf86Screens[i]->numEntities; j++) { - if (xf86Entities[xf86Screens[i]->entityList[j]]->entityProp - & NEED_MEM_SHARED) - needRACforMem = TRUE; - if (xf86Entities[xf86Screens[i]->entityList[j]]->entityProp - & NEED_IO_SHARED) - needRACforIo = TRUE; - /* - * We may need RAC although we don't share any resources - * as we need to route VGA to the correct bus. This can - * only be done simultaniously for MEM and IO. - */ - if (needRACforVga > 1) { - if (xf86Entities[xf86Screens[i]->entityList[j]]->entityProp - & NEED_VGA_MEM) - needRACforMem = TRUE; - if (xf86Entities[xf86Screens[i]->entityList[j]]->entityProp - & NEED_VGA_IO) - needRACforIo = TRUE; - } - } - - pScreen = xf86Screens[i]->pScreen; - flags = 0; - if (needRACforMem) { - flags |= xf86Screens[i]->racMemFlags; - xf86ErrorFVerb(3, "Screen %d is using RAC for mem\n", i); - } - if (needRACforIo) { - flags |= xf86Screens[i]->racIoFlags; - xf86ErrorFVerb(3, "Screen %d is using RAC for io\n", i); - } - - xf86RACInit(pScreen,flags); - } - } - xf86EnterServerState(OPERATING); } /* - * Sets - */ - - -static resPtr -decomposeSparse(resRange range) -{ - resRange new; - resPtr ret = NULL; - memType val = range.rBegin; - int i = 0; - - new.type = (range.type & ~ResExtMask) | ResSparse; - - while (1) { - if (val & 0x01) { - new.rBase = (val << i); - new.rMask = ~((1 << i) - 1); - ret = xf86AddResToList(ret,&new,-1); - val ++; - } - i++; - val >>= 1; - if ((((val + 1) << i) - 1) > range.rEnd) - break; - } - i--; - val <<= 1; - - while (1) { - if((((val + 1) << i) - 1)> range.rEnd) { - if (--i < 0) break; - val <<= 1; - } else { - new.rBase = (val << i); - new.rMask = ~((1 << i) - 1); - val++; - ret = xf86AddResToList(ret,&new,-1); - } - } - return ret; -} - -static Bool -x_isSubsetOf(resRange range, resPtr list1, resPtr list2) -{ - resRange range1, range2; - memType m1_A_m2; - Bool ret; - resPtr list; - - if (list1) { - list = list1; - if ((range.type & ResTypeMask) == (list->res_type & ResTypeMask)) { - switch (range.type & ResExtMask) { - case ResBlock: - if ((list->res_type & ResExtMask) == ResBlock) { - if (range.rBegin >= list->block_begin - && range.rEnd <= list->block_end) - return TRUE; - else if (range.rBegin < list->block_begin - && range.rEnd > list->block_end) { - RANGE(range1, range.rBegin, list->block_begin - 1, - range.type); - RANGE(range2, list->block_end + 1, range.rEnd, - range.type); - return (x_isSubsetOf(range1,list->next,list2) && - x_isSubsetOf(range2,list->next,list2)); - } - else if (range.rBegin >= list->block_begin - && range.rBegin <= list->block_end) { - RANGE(range1, list->block_end + 1, range.rEnd, - range.type); - return (x_isSubsetOf(range1,list->next,list2)); - } else if (range.rEnd >= list->block_begin - && range.rEnd <= list->block_end) { - RANGE(range1,range.rBegin, list->block_begin - 1, - range.type); - return (x_isSubsetOf(range1,list->next,list2)); - } - } - break; - case ResSparse: - if ((list->res_type & ResExtMask) == ResSparse) { - memType test; - int i; - - m1_A_m2 = range.rMask & list->sparse_mask; - if ((range.rBase ^ list->sparse_base) & m1_A_m2) - break; - /* - * We use the following system: - * let 0 ^= mask:1 base:0, 1 ^= mask:1 base:1, - * X mask:0 ; S: set TSS: test set for subset - * NTSS: new test set after test - * S: 1 0 1 0 X X 0 1 X - * TSS: 1 0 0 1 1 0 X X X - * T: 0 0 1 1 0 0 0 0 0 - * NTSS: 1 0 0/X 1/X 1 0 1 0 X - * R: 0 0 0 0 0 0 1 1 0 - * If R != 0 TSS and S are disjunct - * If R == 0 TSS is subset of S - * If R != 0 NTSS contains elements from TSS - * which are not also members of S. - * If a T is set one of the correspondig bits - * in NTSS must be set to the specified value - * all other are X - */ - test = list->sparse_mask & ~range.rMask; - if (test == 0) - return TRUE; - for (i = 0; i < sizeof(memType); i++) { - if ((test >> i) & 0x1) { - RANGE(range1, ((range.rBase & list->sparse_base) - | (range.rBase & ~list->sparse_mask) - | ((~list->sparse_base & list->sparse_mask) - & ~range.rMask)) & range1.rMask, - ((range.rMask | list->sparse_mask) & ~test) - | (1 << i), range.type); - return (x_isSubsetOf(range1,list->next,list2)); - } - } - } - break; - } - } - return (x_isSubsetOf(range,list->next,list2)); - } else if (list2) { - resPtr tmpList = NULL; - switch (range.type & ResExtMask) { - case ResBlock: - tmpList = decomposeSparse(range); - while (tmpList) { - if (!x_isSubsetOf(tmpList->val,list2,NULL)) { - xf86FreeResList(tmpList); - return FALSE; - } - tmpList = tmpList->next; - } - xf86FreeResList(tmpList); - return TRUE; - break; - case ResSparse: - while (list2) { - tmpList = xf86JoinResLists(tmpList,decomposeSparse(list2->val)); - list2 = list2->next; - } - ret = x_isSubsetOf(range,tmpList,NULL); - xf86FreeResList(tmpList); - return ret; - break; - } - } else - return FALSE; - - return FALSE; -} - -Bool -xf86IsSubsetOf(resRange range, resPtr list) -{ - resPtr dup = xf86DupResList(list); - resPtr r_sp = NULL, r = NULL, tmp = NULL; - Bool ret = FALSE; - - while (dup) { - tmp = dup; - dup = dup->next; - switch (tmp->res_type & ResExtMask) { - case ResBlock: - tmp->next = r; - r = tmp; - break; - case ResSparse: - tmp->next = r_sp; - r_sp = tmp; - break; - } - } - - switch (range.type & ResExtMask) { - case ResBlock: - ret = x_isSubsetOf(range,r,r_sp); - break; - case ResSparse: - ret = x_isSubsetOf(range,r_sp,r); - break; - } - xf86FreeResList(r); - xf86FreeResList(r_sp); - - return ret; -} - -static resPtr -findIntersect(resRange Range, resPtr list) -{ - resRange range; - resPtr new = NULL; - - while (list) { - if ((Range.type & ResTypeMask) == (list->res_type & ResTypeMask)) { - switch (Range.type & ResExtMask) { - case ResBlock: - switch (list->res_type & ResExtMask) { - case ResBlock: - if (Range.rBegin >= list->block_begin) - range.rBegin = Range.rBegin; - else - range.rBegin = list->block_begin; - if (Range.rEnd <= list->block_end) - range.rEnd = Range.rEnd; - else - range.rEnd = list->block_end; - if (range.rEnd > range.rBegin) { - range.type = Range.type; - new = xf86AddResToList(new,&range,-1); - } - break; - case ResSparse: - new = xf86JoinResLists(new,xf86FindIntersectOfLists(new,decomposeSparse(list->val))); - break; - } - break; - case ResSparse: - switch (list->res_type & ResExtMask) { - case ResSparse: - if (!((~(range.rBase ^ list->sparse_base) - & (range.rMask & list->sparse_mask)))) { - RANGE(range, (range.rBase & list->sparse_base) - | (~range.rMask & list->sparse_base) - | (~list->sparse_mask & range.rBase), - range.rMask | list->sparse_mask, - Range.type); - new = xf86AddResToList(new,&range,-1); - } - break; - case ResBlock: - new = xf86JoinResLists(new,xf86FindIntersectOfLists( - decomposeSparse(range),list)); - break; - } - } - } - list = list->next; - } - return new; -} - -resPtr -xf86FindIntersectOfLists(resPtr l1, resPtr l2) -{ - resPtr ret = NULL; - - while (l1) { - ret = xf86JoinResLists(ret,findIntersect(l1->val,l2)); - l1 = l1->next; - } - return ret; -} - -#if 0 /* Not used */ -static resPtr -xf86FindComplement(resRange Range) -{ - resRange range; - memType tmp; - resPtr new = NULL; - int i; - - switch (Range.type & ResExtMask) { - case ResBlock: - if (Range.rBegin > 0) { - RANGE(range, 0, Range.rBegin - 1, Range.type); - new = xf86AddResToList(new,&range,-1); - } - if (Range.rEnd < (memType)~0) { - RANGE(range,Range.rEnd + 1, (memType)~0, Range.type); - new = xf86AddResToList(new,&range,-1); - } - break; - case ResSparse: - tmp = Range.rMask; - for (i = 0; i < sizeof(memType); i++) { - if (tmp & 0x1) { - RANGE(range,(~Range.rMask & range.rMask),(1 << i), Range.type); - new = xf86AddResToList(new,&range,-1); - } - } - break; - default: - break; - } - return new; -} -#endif - -/* * xf86FindPrimaryDevice() - Find the display device which * was active when the server was started. */ @@ -2367,38 +588,6 @@ xf86FindPrimaryDevice(void) } } -Bool -xf86NoSharedResources(int screenIndex,resType res) -{ - int j; - - if (screenIndex > xf86NumScreens) - return TRUE; - - for (j = 0; j < xf86Screens[screenIndex]->numEntities; j++) { - switch (res) { - case IO: - if ( xf86Entities[xf86Screens[screenIndex]->entityList[j]]->entityProp - & NEED_IO_SHARED) - return FALSE; - break; - case MEM: - if ( xf86Entities[xf86Screens[screenIndex]->entityList[j]]->entityProp - & NEED_MEM_SHARED) - return FALSE; - break; - case MEM_IO: - if ( xf86Entities[xf86Screens[screenIndex]->entityList[j]]->entityProp - & NEED_SHARED) - return FALSE; - break; - case NONE: - break; - } - } - return TRUE; -} - void xf86RegisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func, pointer arg) { diff --git a/hw/xfree86/common/xf86Bus.h b/hw/xfree86/common/xf86Bus.h index 83ba83c85..95da8a5cd 100644 --- a/hw/xfree86/common/xf86Bus.h +++ b/hw/xfree86/common/xf86Bus.h @@ -43,14 +43,6 @@ #include "xf86sbusBus.h" #endif -typedef struct racInfo { - xf86AccessPtr mem_new; - xf86AccessPtr io_new; - xf86AccessPtr io_mem_new; - xf86SetAccessFuncPtr old; -} AccessFuncRec, *AccessFuncPtr; - - typedef struct { DriverPtr driver; int chipset; @@ -59,12 +51,9 @@ typedef struct { EntityProc entityEnter; EntityProc entityLeave; pointer private; - resPtr resources; Bool active; Bool inUse; BusRec bus; - EntityAccessPtr access; - AccessFuncPtr rac; pointer busAcc; int lastScrnFlag; DevUnion * entityPrivates; @@ -73,31 +62,7 @@ typedef struct { IOADDRESS domainIO; } EntityRec, *EntityPtr; -#define NO_SEPARATE_IO_FROM_MEM 0x0001 -#define NO_SEPARATE_MEM_FROM_IO 0x0002 -#define NEED_VGA_ROUTED 0x0004 -#define NEED_VGA_ROUTED_SETUP 0x0008 -#define NEED_MEM 0x0010 -#define NEED_IO 0x0020 -#define NEED_MEM_SHARED 0x0040 -#define NEED_IO_SHARED 0x0080 -#define ACCEL_IS_SHARABLE 0x0100 -#define IS_SHARED_ACCEL 0x0200 -#define SA_PRIM_INIT_DONE 0x0400 -#define NEED_VGA_MEM 0x1000 -#define NEED_VGA_IO 0x2000 - -#define NEED_SHARED (NEED_MEM_SHARED | NEED_IO_SHARED) - -struct x_BusAccRec; -typedef void (*BusAccProcPtr)(struct x_BusAccRec *ptr); - typedef struct x_BusAccRec { - BusAccProcPtr set_f; - BusAccProcPtr enable_f; - BusAccProcPtr disable_f; - BusAccProcPtr save_f; - BusAccProcPtr restore_f; struct x_BusAccRec *current; /* pointer to bridge open on this bus */ struct x_BusAccRec *primary; /* pointer to the bus connecting to this */ struct x_BusAccRec *next; /* this links the different buses together */ @@ -121,15 +86,15 @@ typedef struct _stateChange { struct _stateChange *next; } StateChangeNotificationRec, *StateChangeNotificationPtr; +#define ACCEL_IS_SHARABLE 0x100 +#define IS_SHARED_ACCEL 0x200 +#define SA_PRIM_INIT_DONE 0x400 extern EntityPtr *xf86Entities; extern int xf86NumEntities; -extern xf86AccessRec AccessNULL; extern BusRec primaryBus; -extern BusAccPtr xf86BusAccInfo; int xf86AllocateEntity(void); BusType StringToBusType(const char* busID, const char **retID); -Bool xf86IsSubsetOf(resRange range, resPtr list); #endif /* _XF86_BUS_H */ diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c index 307e0c42d..7d738d575 100644 --- a/hw/xfree86/common/xf86Configure.c +++ b/hw/xfree86/common/xf86Configure.c @@ -659,8 +659,6 @@ DoConfigure(void) } /* Disable PCI devices */ - xf86ResourceBrokerInit(); - xf86AccessInit(); xf86FindPrimaryDevice(); /* Create XF86Config file structure */ diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c index 25aa4f51d..5716989f6 100644 --- a/hw/xfree86/common/xf86DGA.c +++ b/hw/xfree86/common/xf86DGA.c @@ -528,11 +528,6 @@ DGAAvailable(int index) if(DGAScreenKey == NULL) return FALSE; - if (!xf86NoSharedResources(((ScrnInfoPtr)dixLookupPrivate( - &screenInfo.screens[index]->devPrivates, - xf86ScreenKey))->scrnIndex, MEM)) - return FALSE; - if(DGA_GET_SCREEN_PRIV(screenInfo.screens[index])) return TRUE; diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 72e1c7580..3c607854c 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -469,7 +469,6 @@ xf86VTSwitch(void) xf86Screens[i]->LeaveVT(i, 0); xf86AccessLeave(); /* We need this here, otherwise */ - xf86AccessLeaveState(); /* console won't be restored */ if (!xf86VTSwitchAway()) { /* @@ -517,8 +516,6 @@ xf86VTSwitch(void) * trap calls when switched away. */ xf86Screens[i]->vtSema = FALSE; - xf86Screens[i]->access = NULL; - xf86Screens[i]->busAccess = NULL; } if (xorgHWAccess) xf86DisableIO(); diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index d6775488c..965bd5eab 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -58,7 +58,6 @@ #include "xf86Xinput.h" #include "xf86InPriv.h" #include "mivalidate.h" -#include "xf86RAC.h" #include "xf86Bus.h" #include "xf86Crtc.h" @@ -194,12 +193,6 @@ xf86AllocateScreen(DriverPtr drv, int flags) xf86Screens[i]->drv = drv; drv->refCount++; xf86Screens[i]->module = DuplicateModule(drv->module, NULL); - /* - * set the initial access state. This will be modified after PreInit. - * XXX Or should we do it some other place? - */ - xf86Screens[i]->CurrentAccess = &xf86CurrentAccess; - xf86Screens[i]->resourceType = MEM_IO; xf86Screens[i]->DriverFunc = drv->driverFunc; @@ -2317,13 +2310,8 @@ xf86SetSilkenMouse (ScreenPtr pScreen) /* check for commandline option here */ /* disable if screen shares resources */ - if (((pScrn->racMemFlags & RAC_CURSOR) && - !xf86NoSharedResources(pScrn->scrnIndex,MEM)) || - ((pScrn->racIoFlags & RAC_CURSOR) && - !xf86NoSharedResources(pScrn->scrnIndex,IO))) { - useSM = FALSE; - from = X_PROBED; - } else if (xf86silkenMouseDisableFlag) { + /* TODO VGA arb disable silken mouse */ + if (xf86silkenMouseDisableFlag) { from = X_CMDLINE; useSM = FALSE; } else { @@ -2374,13 +2362,43 @@ xf86FindXvOptions(int scrnIndex, int adaptor_index, char *port_name, #include "loader/os.c" /* new RAC */ +/* + * xf86ConfigPciEntityInactive() -- This function can be used + * to configure an inactive entity as well as to reconfigure an + * previously active entity inactive. If the entity has been + * assigned to a screen before it will be removed. If p_chip is + * non-NULL all static resources listed there will be registered. + */ +static void +xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets *p_chip, + EntityProc init, EntityProc enter, + EntityProc leave, pointer private) +{ + ScrnInfoPtr pScrn; + + if ((pScrn = xf86FindScreenForEntity(pEnt->index))) + xf86RemoveEntityFromScreen(pScrn,pEnt->index); + + /* shared resources are only needed when entity is active: remove */ + xf86SetEntityFuncs(pEnt->index,init,enter,leave,private); +} + +static void +xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init, + EntityProc enter, EntityProc leave, pointer private) +{ + ScrnInfoPtr pScrn; + + if ((pScrn = xf86FindScreenForEntity(pEnt->index))) + xf86RemoveEntityFromScreen(pScrn,pEnt->index); + xf86SetEntityFuncs(pEnt->index,init,enter,leave,private); +} ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, - PciChipsets *p_chip, resList res, EntityProc init, + PciChipsets *p_chip, void *dummy, EntityProc init, EntityProc enter, EntityProc leave, pointer private) { - PciChipsets *p_id; EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); if (!pEnt) return pScrn; @@ -2390,7 +2408,7 @@ xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, return pScrn; } if (!pEnt->active) { - xf86ConfigPciEntityInactive(pEnt, p_chip, res, init, enter, + xf86ConfigPciEntityInactive(pEnt, p_chip, init, enter, leave, private); xfree(pEnt); return pScrn; @@ -2405,15 +2423,8 @@ xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, if (xf86IsEntityShared(entityIndex)) { return pScrn; } - if (p_chip) { - for (p_id = p_chip; p_id->numChipset != -1; p_id++) { - if (pEnt->chipset == p_id->numChipset) break; - } - xf86ClaimFixedResources(p_id->resList,entityIndex); - } xfree(pEnt); - xf86ClaimFixedResources(res,entityIndex); xf86SetEntityFuncs(entityIndex,init,enter,leave,private); return pScrn; @@ -2455,10 +2466,9 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex, - PciChipsets *p_chip, resList res, EntityProc init, + PciChipsets *p_chip, void *dummy, EntityProc init, EntityProc enter, EntityProc leave, pointer private) { - PciChipsets *p_id; EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); if (!pEnt) return FALSE; @@ -2468,61 +2478,13 @@ xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex, } xf86AddEntityToScreen(pScrn,entityIndex); - if (p_chip) { - for (p_id = p_chip; p_id->numChipset != -1; p_id++) { - if (pEnt->chipset == p_id->numChipset) break; - } - xf86ClaimFixedResources(p_id->resList,entityIndex); - } xfree(pEnt); - - xf86ClaimFixedResources(res,entityIndex); if (!xf86SetEntityFuncs(entityIndex,init,enter,leave,private)) return FALSE; return TRUE; } -/* - * xf86ConfigPciEntityInactive() -- This function can be used - * to configure an inactive entity as well as to reconfigure an - * previously active entity inactive. If the entity has been - * assigned to a screen before it will be removed. If p_chip is - * non-NULL all static resources listed there will be registered. - */ -void -xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets *p_chip, - resList res, EntityProc init, EntityProc enter, - EntityProc leave, pointer private) -{ - PciChipsets *p_id; - ScrnInfoPtr pScrn; - - if ((pScrn = xf86FindScreenForEntity(pEnt->index))) - xf86RemoveEntityFromScreen(pScrn,pEnt->index); - else if (p_chip) { - for (p_id = p_chip; p_id->numChipset != -1; p_id++) { - if (pEnt->chipset == p_id->numChipset) break; - } - xf86ClaimFixedResources(p_id->resList,pEnt->index); - } - xf86ClaimFixedResources(res,pEnt->index); - /* shared resources are only needed when entity is active: remove */ - xf86DeallocateResourcesForEntity(pEnt->index, ResShared); - xf86SetEntityFuncs(pEnt->index,init,enter,leave,private); -} - -void -xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init, - EntityProc enter, EntityProc leave, pointer private) -{ - ScrnInfoPtr pScrn; - - if ((pScrn = xf86FindScreenForEntity(pEnt->index))) - xf86RemoveEntityFromScreen(pScrn,pEnt->index); - xf86SetEntityFuncs(pEnt->index,init,enter,leave,private); -} - Bool xf86IsScreenPrimary(int scrnIndex) { diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 4cab20c72..cea17ee92 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -792,9 +792,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) xf86OSPMClose = xf86OSPMOpen(); #endif - /* Initialise the resource broker */ - xf86ResourceBrokerInit(); - /* Load all modules specified explicitly in the config file */ if ((modulelist = xf86ModulelistFromConfig(&optionlist))) { xf86LoadModules(modulelist, optionlist); @@ -1371,16 +1368,12 @@ ddxGiveUp(void) xf86OSPMClose = NULL; #endif - xf86AccessLeaveState(); - for (i = 0; i < xf86NumScreens; i++) { /* * zero all access functions to * trap calls when switched away. */ xf86Screens[i]->vtSema = FALSE; - xf86Screens[i]->access = NULL; - xf86Screens[i]->busAccess = NULL; } #ifdef XFreeXDGA diff --git a/hw/xfree86/common/xf86PM.c b/hw/xfree86/common/xf86PM.c index c51960e81..f6138c3a2 100644 --- a/hw/xfree86/common/xf86PM.c +++ b/hw/xfree86/common/xf86PM.c @@ -70,7 +70,6 @@ suspend (pmEvent event, Bool undo) xf86inSuspend = TRUE; for (i = 0; i < xf86NumScreens; i++) { - xf86EnableAccess(xf86Screens[i]); if (xf86Screens[i]->EnableDisableFBAccess) (*xf86Screens[i]->EnableDisableFBAccess) (i, FALSE); } @@ -81,7 +80,6 @@ suspend (pmEvent event, Bool undo) } xf86EnterServerState(SETUP); for (i = 0; i < xf86NumScreens; i++) { - xf86EnableAccess(xf86Screens[i]); if (xf86Screens[i]->PMEvent) xf86Screens[i]->PMEvent(i,event,undo); else { @@ -90,7 +88,7 @@ suspend (pmEvent event, Bool undo) } } xf86AccessLeave(); - xf86AccessLeaveState(); + } static void diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h index f4ed8c085..dc35c7c62 100644 --- a/hw/xfree86/common/xf86Priv.h +++ b/hw/xfree86/common/xf86Priv.h @@ -88,7 +88,6 @@ extern _X_EXPORT int xf86NumDrivers; extern _X_EXPORT Bool xf86Resetting; extern _X_EXPORT Bool xf86Initialising; extern _X_EXPORT int xf86NumScreens; -extern _X_EXPORT xf86CurrentAccessRec xf86CurrentAccess; extern _X_EXPORT const char *xf86VisualNames[]; extern _X_EXPORT int xf86Verbose; /* verbosity level */ extern _X_EXPORT int xf86LogVerbose; /* log file verbosity level */ @@ -118,11 +117,9 @@ extern _X_EXPORT void xf86AccessInit(void); extern _X_EXPORT void xf86AccessEnter(void); extern _X_EXPORT void xf86AccessLeave(void); extern _X_EXPORT void xf86EntityInit(void); -extern _X_EXPORT void xf86AccessLeaveState(void); extern _X_EXPORT void xf86FindPrimaryDevice(void); /* new RAC */ -extern _X_EXPORT void xf86ResourceBrokerInit(void); extern _X_EXPORT void xf86PostProbe(void); extern _X_EXPORT void xf86ClearEntityListForScreen(int scrnIndex); extern _X_EXPORT void xf86AddDevToEntity(int entityIndex, GDevPtr dev); diff --git a/hw/xfree86/common/xf86RAC.c b/hw/xfree86/common/xf86RAC.c deleted file mode 100644 index 2eed8c7f5..000000000 --- a/hw/xfree86/common/xf86RAC.c +++ /dev/null @@ -1,1171 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include <X11/X.h> -#include "colormapst.h" -#include "scrnintstr.h" -#include "screenint.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "pixmap.h" -#include "windowstr.h" -#include "window.h" -#include "xf86str.h" -#include "xf86RAC.h" -#include "mipointer.h" -#include "mipointrst.h" -#ifdef RENDER -# include "picturestr.h" -#endif - -#ifdef DEBUG -#define DPRINT_S(x,y) ErrorF(x ": %i\n",y); -#define DPRINT(x) ErrorF(x "\n"); -#else -#define DPRINT_S(x,y) -#define DPRINT(x) -#endif - -#define WRAP_SCREEN(x,y) {pScreenPriv->x = pScreen->x;\ - pScreen->x = y;} -#define WRAP_SCREEN_COND(x,y,cond) \ - {pScreenPriv->x = pScreen->x;\ - if (flag & (cond))\ - pScreen->x = y;} -#define UNWRAP_SCREEN(x) pScreen->x = pScreenPriv->x - -#define SCREEN_PROLOG(x) pScreen->x = ((RACScreenPtr) \ - dixLookupPrivate(&(pScreen)->devPrivates, RACScreenKey))->x -#define SCREEN_EPILOG(x,y) pScreen->x = y; - -#define WRAP_PICT_COND(x,y,cond) if (ps)\ - {pScreenPriv->x = ps->x;\ - if (flag & (cond))\ - ps->x = y;} -#define UNWRAP_PICT(x) if (ps) {ps->x = pScreenPriv->x;} - -#define PICTURE_PROLOGUE(field) ps->field = \ - ((RACScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, RACScreenKey))->field -#define PICTURE_EPILOGUE(field, wrap) \ - ps->field = wrap - -#define WRAP_SCREEN_INFO(x,y) {pScreenPriv->x = pScrn->x;\ - pScrn->x = y;} -#define WRAP_SCREEN_INFO_COND(x,y,cond) \ - {pScreenPriv->x = pScrn->x;\ - if (flag & (cond))\ - pScrn->x = y;} -#define UNWRAP_SCREEN_INFO(x) pScrn->x = pScreenPriv->x - -#define SPRITE_PROLOG miPointerScreenPtr PointPriv = \ - (miPointerScreenPtr)dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey); \ - RACScreenPtr pScreenPriv = \ - ((RACScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, RACScreenKey));\ - PointPriv->spriteFuncs = pScreenPriv->miSprite; -#define SPRITE_EPILOG pScreenPriv->miSprite = PointPriv->spriteFuncs;\ - PointPriv->spriteFuncs = &RACSpriteFuncs; -#define WRAP_SPRITE_COND(cond){pScreenPriv->miSprite = PointPriv->spriteFuncs;\ - if(flag & (cond))\ - PointPriv->spriteFuncs = &RACSpriteFuncs;} -#define UNWRAP_SPRITE PointPriv->spriteFuncs = pScreenPriv->miSprite - - -#define GC_WRAP(x) pGCPriv->wrapOps = (x)->ops;\ - pGCPriv->wrapFuncs = (x)->funcs;\ - (x)->ops = &RACGCOps;\ - (x)->funcs = &RACGCFuncs; -#define GC_UNWRAP(x)\ - RACGCPtr pGCPriv = (RACGCPtr)dixLookupPrivate(&(x)->devPrivates, RACGCKey);\ - (x)->ops = pGCPriv->wrapOps;\ - (x)->funcs = pGCPriv->wrapFuncs; - -#define GC_SCREEN register ScrnInfoPtr pScrn \ - = xf86Screens[pGC->pScreen->myNum] - -#define ENABLE xf86EnableAccess(xf86Screens[pScreen->myNum]) -#define ENABLE_GC xf86EnableAccess(xf86Screens[pGC->pScreen->myNum]) - -typedef struct _RACScreen { - CreateGCProcPtr CreateGC; - CloseScreenProcPtr CloseScreen; - GetImageProcPtr GetImage; - GetSpansProcPtr GetSpans; - SourceValidateProcPtr SourceValidate; - CopyWindowProcPtr CopyWindow; - ClearToBackgroundProcPtr ClearToBackground; - CreatePixmapProcPtr CreatePixmap; - SaveScreenProcPtr SaveScreen; - /* Colormap */ - StoreColorsProcPtr StoreColors; - /* Cursor */ - DisplayCursorProcPtr DisplayCursor; - RealizeCursorProcPtr RealizeCursor; - UnrealizeCursorProcPtr UnrealizeCursor; - RecolorCursorProcPtr RecolorCursor; - SetCursorPositionProcPtr SetCursorPosition; - void (*AdjustFrame)(int,int,int,int); - Bool (*SwitchMode)(int, DisplayModePtr,int); - Bool (*EnterVT)(int, int); - void (*LeaveVT)(int, int); - void (*FreeScreen)(int, int); - miPointerSpriteFuncPtr miSprite; -#ifdef RENDER - CompositeProcPtr Composite; - GlyphsProcPtr Glyphs; - CompositeRectsProcPtr CompositeRects; -#endif -} RACScreenRec, *RACScreenPtr; - -typedef struct _RACGC { - GCOps *wrapOps; - GCFuncs *wrapFuncs; -} RACGCRec, *RACGCPtr; - -/* Screen funcs */ -static Bool RACCloseScreen (int i, ScreenPtr pScreen); -static void RACGetImage (DrawablePtr pDrawable, int sx, int sy, - int w, int h, unsigned int format, - unsigned long planemask, char *pdstLine); -static void RACGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, - int *pwidth, int nspans, char *pdstStart); -static void RACSourceValidate (DrawablePtr pDrawable, - int x, int y, int width, int height ); -static void RACCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, - RegionPtr prgnSrc ); -static void RACClearToBackground (WindowPtr pWin, int x, int y, - int w, int h, Bool generateExposures ); -static PixmapPtr RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, - unsigned usage_hint); -static Bool RACCreateGC(GCPtr pGC); -static Bool RACSaveScreen(ScreenPtr pScreen, Bool unblank); -static void RACStoreColors (ColormapPtr pmap, int ndef, xColorItem *pdefs); -static void RACRecolorCursor (DeviceIntPtr pDev, ScreenPtr pScreen, - CursorPtr pCurs, Bool displayed); -static Bool RACRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, - CursorPtr pCursor); -static Bool RACUnrealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, - CursorPtr pCursor); -static Bool RACDisplayCursor (DeviceIntPtr pDev, ScreenPtr pScreen, - CursorPtr pCursor); -static Bool RACSetCursorPosition (DeviceIntPtr pDev, ScreenPtr pScreen, - int x, int y, Bool generateEvent); -static void RACAdjustFrame(int index, int x, int y, int flags); -static Bool RACSwitchMode(int index, DisplayModePtr mode, int flags); -static Bool RACEnterVT(int index, int flags); -static void RACLeaveVT(int index, int flags); -static void RACFreeScreen(int index, int flags); -/* GC funcs */ -static void RACValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw); -static void RACChangeGC(GCPtr pGC, unsigned long mask); -static void RACCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); -static void RACDestroyGC(GCPtr pGC); -static void RACChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects); -static void RACDestroyClip(GCPtr pGC); -static void RACCopyClip(GCPtr pgcDst, GCPtr pgcSrc); -/* GC ops */ -static void RACFillSpans( DrawablePtr pDraw, GC *pGC, int nInit, - DDXPointPtr pptInit, int *pwidthInit, int fSorted ); -static void RACSetSpans(DrawablePtr pDraw, GCPtr pGC, char *pcharsrc, - register DDXPointPtr ppt, int *pwidth, int nspans, - int fSorted ); -static void RACPutImage(DrawablePtr pDraw, GCPtr pGC, int depth, - int x, int y, int w, int h, int leftPad, - int format, char *pImage ); -static RegionPtr RACCopyArea(DrawablePtr pSrc, DrawablePtr pDst, - GC *pGC, int srcx, int srcy, - int width, int height, - int dstx, int dsty ); -static RegionPtr RACCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, - GCPtr pGC, int srcx, int srcy, - int width, int height, int dstx, int dsty, - unsigned long bitPlane ); -static void RACPolyPoint(DrawablePtr pDraw, GCPtr pGC, int mode, - int npt, xPoint *pptInit ); -static void RACPolylines(DrawablePtr pDraw, GCPtr pGC, int mode, - int npt, DDXPointPtr pptInit ); -static void RACPolySegment(DrawablePtr pDraw, GCPtr pGC, int nseg, - xSegment *pSeg ); -static void RACPolyRectangle(DrawablePtr pDraw, GCPtr pGC, int nRectsInit, - xRectangle *pRectsInit ); -static void RACPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, - xArc *parcs ); -static void RACFillPolygon(DrawablePtr pDraw, GCPtr pGC, int shape, int mode, - int count, DDXPointPtr ptsIn ); -static void RACPolyFillRect( DrawablePtr pDraw, GCPtr pGC, int nrectFill, - xRectangle *prectInit ); -static void RACPolyFillArc(DrawablePtr pDraw, GCPtr pGC, int narcs, - xArc *parcs ); -static int RACPolyText8(DrawablePtr pDraw, GCPtr pGC, int x, int y, - int count, char *chars ); -static int RACPolyText16(DrawablePtr pDraw, GCPtr pGC, int x, int y, - int count, unsigned short *chars ); -static void RACImageText8(DrawablePtr pDraw, GCPtr pGC, int x, int y, - int count, char *chars ); -static void RACImageText16(DrawablePtr pDraw, GCPtr pGC, int x, int y, - int count, unsigned short *chars ); -static void RACImageGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit, - int yInit, unsigned int nglyph, - CharInfoPtr *ppci, pointer pglyphBase ); -static void RACPolyGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit, - int yInit, unsigned int nglyph, - CharInfoPtr *ppci, pointer pglyphBase ); -static void RACPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDraw, - int dx, int dy, int xOrg, int yOrg ); -/* miSpriteFuncs */ -static Bool RACSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, - CursorPtr pCur); -static Bool RACSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, - CursorPtr pCur); -static void RACSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, - CursorPtr pCur, int x, int y); -static void RACSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, - int x, int y); -#ifdef RENDER -static void RACComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, - PicturePtr pDst, INT16 xSrc, INT16 ySrc, - INT16 xMask, INT16 yMask, INT16 xDst, - INT16 yDst, CARD16 width, CARD16 height); -static void RACGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, - PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, - int nlist, GlyphListPtr list, GlyphPtr *glyphs); -static void RACCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color, - int nRect, xRectangle *rects); -#endif - -static GCFuncs RACGCFuncs = { - RACValidateGC, RACChangeGC, RACCopyGC, RACDestroyGC, - RACChangeClip, RACDestroyClip, RACCopyClip -}; - -static GCOps RACGCOps = { - RACFillSpans, RACSetSpans, RACPutImage, RACCopyArea, - RACCopyPlane, RACPolyPoint, RACPolylines, RACPolySegment, - RACPolyRectangle, RACPolyArc, RACFillPolygon, RACPolyFillRect, - RACPolyFillArc, RACPolyText8, RACPolyText16, RACImageText8, - RACImageText16, RACImageGlyphBlt, RACPolyGlyphBlt, RACPushPixels, - {NULL} /* devPrivate */ -}; - -static miPointerSpriteFuncRec RACSpriteFuncs = { - RACSpriteRealizeCursor, RACSpriteUnrealizeCursor, RACSpriteSetCursor, - RACSpriteMoveCursor -}; - -static int RACScreenKeyIndex; -static DevPrivateKey RACScreenKey = &RACScreenKeyIndex; -static int RACGCKeyIndex; -static DevPrivateKey RACGCKey = &RACGCKeyIndex; - - -Bool -xf86RACInit(ScreenPtr pScreen, unsigned int flag) -{ - ScrnInfoPtr pScrn; - RACScreenPtr pScreenPriv; - miPointerScreenPtr PointPriv; -#ifdef RENDER - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); -#endif - - pScrn = xf86Screens[pScreen->myNum]; - PointPriv = (miPointerScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miPointerScreenKey); - DPRINT_S("RACInit",pScreen->myNum); - - if (!dixRequestPrivate(RACGCKey, sizeof(RACGCRec))) - return FALSE; - - if (!(pScreenPriv = xalloc(sizeof(RACScreenRec)))) - return FALSE; - - dixSetPrivate(&pScreen->devPrivates, RACScreenKey, pScreenPriv); - - WRAP_SCREEN(CloseScreen, RACCloseScreen); - WRAP_SCREEN(SaveScreen, RACSaveScreen); - WRAP_SCREEN_COND(CreateGC, RACCreateGC, RAC_FB); - WRAP_SCREEN_COND(GetImage, RACGetImage, RAC_FB); - WRAP_SCREEN_COND(GetSpans, RACGetSpans, RAC_FB); - WRAP_SCREEN_COND(SourceValidate, RACSourceValidate, RAC_FB); - WRAP_SCREEN_COND(CopyWindow, RACCopyWindow, RAC_FB); - WRAP_SCREEN_COND(ClearToBackground, RACClearToBackground, RAC_FB); - WRAP_SCREEN_COND(CreatePixmap, RACCreatePixmap, RAC_FB); - WRAP_SCREEN_COND(StoreColors, RACStoreColors, RAC_COLORMAP); - WRAP_SCREEN_COND(DisplayCursor, RACDisplayCursor, RAC_CURSOR); - WRAP_SCREEN_COND(RealizeCursor, RACRealizeCursor, RAC_CURSOR); - WRAP_SCREEN_COND(UnrealizeCursor, RACUnrealizeCursor, RAC_CURSOR); - WRAP_SCREEN_COND(RecolorCursor, RACRecolorCursor, RAC_CURSOR); - WRAP_SCREEN_COND(SetCursorPosition, RACSetCursorPosition, RAC_CURSOR); -#ifdef RENDER - WRAP_PICT_COND(Composite,RACComposite,RAC_FB); - WRAP_PICT_COND(Glyphs,RACGlyphs,RAC_FB); - WRAP_PICT_COND(CompositeRects,RACCompositeRects,RAC_FB); -#endif - WRAP_SCREEN_INFO_COND(AdjustFrame, RACAdjustFrame, RAC_VIEWPORT); - WRAP_SCREEN_INFO(SwitchMode, RACSwitchMode); - WRAP_SCREEN_INFO(EnterVT, RACEnterVT); - WRAP_SCREEN_INFO(LeaveVT, RACLeaveVT); - WRAP_SCREEN_INFO(FreeScreen, RACFreeScreen); - WRAP_SPRITE_COND(RAC_CURSOR); - - return TRUE; -} - -/* Screen funcs */ -static Bool -RACCloseScreen (int i, ScreenPtr pScreen) -{ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - RACScreenPtr pScreenPriv = (RACScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, RACScreenKey); - miPointerScreenPtr PointPriv = (miPointerScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, miPointerScreenKey); -#ifdef RENDER - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); -#endif - - DPRINT_S("RACCloseScreen",pScreen->myNum); - UNWRAP_SCREEN(CreateGC); - UNWRAP_SCREEN(CloseScreen); - UNWRAP_SCREEN(GetImage); - UNWRAP_SCREEN(GetSpans); - UNWRAP_SCREEN(SourceValidate); - UNWRAP_SCREEN(CopyWindow); - UNWRAP_SCREEN(ClearToBackground); - UNWRAP_SCREEN(SaveScreen); - UNWRAP_SCREEN(StoreColors); - UNWRAP_SCREEN(DisplayCursor); - UNWRAP_SCREEN(RealizeCursor); - UNWRAP_SCREEN(UnrealizeCursor); - UNWRAP_SCREEN(RecolorCursor); - UNWRAP_SCREEN(SetCursorPosition); -#ifdef RENDER - UNWRAP_PICT(Composite); - UNWRAP_PICT(Glyphs); - UNWRAP_PICT(CompositeRects); -#endif - UNWRAP_SCREEN_INFO(AdjustFrame); - UNWRAP_SCREEN_INFO(SwitchMode); - UNWRAP_SCREEN_INFO(EnterVT); - UNWRAP_SCREEN_INFO(LeaveVT); - UNWRAP_SCREEN_INFO(FreeScreen); - UNWRAP_SPRITE; - - xfree ((pointer) pScreenPriv); - - if (xf86Screens[pScreen->myNum]->vtSema) { - xf86EnterServerState(SETUP); - ENABLE; - } - return (*pScreen->CloseScreen) (i, pScreen); -} - -static void -RACGetImage ( - DrawablePtr pDrawable, - int sx, int sy, int w, int h, - unsigned int format, - unsigned long planemask, - char *pdstLine - ) -{ - ScreenPtr pScreen = pDrawable->pScreen; - DPRINT_S("RACGetImage",pScreen->myNum); - SCREEN_PROLOG(GetImage); - if (xf86Screens[pScreen->myNum]->vtSema) { - ENABLE; - } - (*pScreen->GetImage) (pDrawable, sx, sy, w, h, - format, planemask, pdstLine); - SCREEN_EPILOG (GetImage, RACGetImage); -} - -static void -RACGetSpans ( - DrawablePtr pDrawable, - int wMax, - DDXPointPtr ppt, - int *pwidth, - int nspans, - char *pdstStart - ) -{ - ScreenPtr pScreen = pDrawable->pScreen; - - DPRINT_S("RACGetSpans",pScreen->myNum); - SCREEN_PROLOG (GetSpans); - ENABLE; - (*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart); - SCREEN_EPILOG (GetSpans, RACGetSpans); -} - -static void -RACSourceValidate ( - DrawablePtr pDrawable, - int x, int y, int width, int height ) -{ - ScreenPtr pScreen = pDrawable->pScreen; - DPRINT_S("RACSourceValidate",pScreen->myNum); - SCREEN_PROLOG (SourceValidate); - ENABLE; - if (pScreen->SourceValidate) - (*pScreen->SourceValidate) (pDrawable, x, y, width, height); - SCREEN_EPILOG (SourceValidate, RACSourceValidate); -} - -static void -RACCopyWindow( - WindowPtr pWin, - DDXPointRec ptOldOrg, - RegionPtr prgnSrc ) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - DPRINT_S("RACCopyWindow",pScreen->myNum); - SCREEN_PROLOG (CopyWindow); - ENABLE; - (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc); - SCREEN_EPILOG (CopyWindow, RACCopyWindow); -} - -static void -RACClearToBackground ( - WindowPtr pWin, - int x, int y, - int w, int h, - Bool generateExposures ) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - DPRINT_S("RACClearToBackground",pScreen->myNum); - SCREEN_PROLOG ( ClearToBackground); - ENABLE; - (*pScreen->ClearToBackground) (pWin, x, y, w, h, generateExposures); - SCREEN_EPILOG (ClearToBackground, RACClearToBackground); -} - -static PixmapPtr -RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint) -{ - PixmapPtr pPix; - - DPRINT_S("RACCreatePixmap",pScreen->myNum); - SCREEN_PROLOG ( CreatePixmap); - ENABLE; - pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint); - SCREEN_EPILOG (CreatePixmap, RACCreatePixmap); - - return pPix; -} - -static Bool -RACSaveScreen(ScreenPtr pScreen, Bool unblank) -{ - Bool val; - - DPRINT_S("RACSaveScreen",pScreen->myNum); - SCREEN_PROLOG (SaveScreen); - ENABLE; - val = (*pScreen->SaveScreen) (pScreen, unblank); - SCREEN_EPILOG (SaveScreen, RACSaveScreen); - - return val; -} - -static void -RACStoreColors ( - ColormapPtr pmap, - int ndef, - xColorItem *pdefs) -{ - ScreenPtr pScreen = pmap->pScreen; - - DPRINT_S("RACStoreColors",pScreen->myNum); - SCREEN_PROLOG (StoreColors); - ENABLE; - (*pScreen->StoreColors) (pmap,ndef,pdefs); - - SCREEN_EPILOG ( StoreColors, RACStoreColors); -} - -static void -RACRecolorCursor ( - DeviceIntPtr pDev, - ScreenPtr pScreen, - CursorPtr pCurs, - Bool displayed - ) -{ - DPRINT_S("RACRecolorCursor",pScreen->myNum); - SCREEN_PROLOG (RecolorCursor); - ENABLE; - (*pScreen->RecolorCursor) (pDev, pScreen,pCurs,displayed); - - SCREEN_EPILOG ( RecolorCursor, RACRecolorCursor); -} - -static Bool -RACRealizeCursor ( - DeviceIntPtr pDev, - ScreenPtr pScreen, - CursorPtr pCursor - ) -{ - Bool val; - - DPRINT_S("RACRealizeCursor",pScreen->myNum); - SCREEN_PROLOG (RealizeCursor); - ENABLE; - val = (*pScreen->RealizeCursor) (pDev, pScreen,pCursor); - - SCREEN_EPILOG ( RealizeCursor, RACRealizeCursor); - return val; -} - -static Bool -RACUnrealizeCursor ( - DeviceIntPtr pDev, - ScreenPtr pScreen, - CursorPtr pCursor - ) -{ - Bool val; - - DPRINT_S("RACUnrealizeCursor",pScreen->myNum); - SCREEN_PROLOG (UnrealizeCursor); - ENABLE; - val = (*pScreen->UnrealizeCursor) (pDev, pScreen,pCursor); - - SCREEN_EPILOG ( UnrealizeCursor, RACUnrealizeCursor); - return val; -} - -static Bool -RACDisplayCursor ( - DeviceIntPtr pDev, - ScreenPtr pScreen, - CursorPtr pCursor - ) -{ - Bool val; - - DPRINT_S("RACDisplayCursor",pScreen->myNum); - SCREEN_PROLOG (DisplayCursor); - ENABLE; - val = (*pScreen->DisplayCursor) (pDev, pScreen,pCursor); - - SCREEN_EPILOG ( DisplayCursor, RACDisplayCursor); - return val; -} - -static Bool -RACSetCursorPosition ( - DeviceIntPtr pDev, - ScreenPtr pScreen, - int x, int y, - Bool generateEvent) -{ - Bool val; - - DPRINT_S("RACSetCursorPosition",pScreen->myNum); - SCREEN_PROLOG (SetCursorPosition); - ENABLE; - val = (*pScreen->SetCursorPosition) (pDev, pScreen,x,y,generateEvent); - - SCREEN_EPILOG ( SetCursorPosition, RACSetCursorPosition); - return val; -} - -static void -RACAdjustFrame(int index, int x, int y, int flags) -{ - ScreenPtr pScreen = screenInfo.screens[index]; - RACScreenPtr pScreenPriv = (RACScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, RACScreenKey); - - DPRINT_S("RACAdjustFrame",index); - xf86EnableAccess(xf86Screens[index]); - - (*pScreenPriv->AdjustFrame)(index, x, y, flags); -} - -static Bool -RACSwitchMode(int index, DisplayModePtr mode, int flags) -{ - ScreenPtr pScreen = screenInfo.screens[index]; - RACScreenPtr pScreenPriv = (RACScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, RACScreenKey); - - DPRINT_S("RACSwitchMode",index); - xf86EnableAccess(xf86Screens[index]); - - return (*pScreenPriv->SwitchMode)(index, mode, flags); -} - -static Bool -RACEnterVT(int index, int flags) -{ - ScreenPtr pScreen = screenInfo.screens[index]; - RACScreenPtr pScreenPriv = (RACScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, RACScreenKey); - - DPRINT_S("RACEnterVT",index); - xf86EnableAccess(xf86Screens[index]); - - return (*pScreenPriv->EnterVT)(index, flags); -} - -static void -RACLeaveVT(int index, int flags) -{ - ScreenPtr pScreen = screenInfo.screens[index]; - RACScreenPtr pScreenPriv = (RACScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, RACScreenKey); - - DPRINT_S("RACLeaveVT",index); - xf86EnableAccess(xf86Screens[index]); - - (*pScreenPriv->LeaveVT)(index, flags); -} - -static void -RACFreeScreen(int index, int flags) -{ - ScreenPtr pScreen = screenInfo.screens[index]; - RACScreenPtr pScreenPriv = (RACScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, RACScreenKey); - - DPRINT_S("RACFreeScreen",index); - xf86EnableAccess(xf86Screens[index]); - - (*pScreenPriv->FreeScreen)(index, flags); -} - -static Bool -RACCreateGC(GCPtr pGC) -{ - ScreenPtr pScreen = pGC->pScreen; - RACGCPtr pGCPriv = (RACGCPtr)dixLookupPrivate(&pGC->devPrivates, RACGCKey); - Bool ret; - - DPRINT_S("RACCreateGC",pScreen->myNum); - SCREEN_PROLOG(CreateGC); - - ret = (*pScreen->CreateGC)(pGC); - - GC_WRAP(pGC); - SCREEN_EPILOG(CreateGC,RACCreateGC); - - return ret; -} - -/* GC funcs */ -static void -RACValidateGC( - GCPtr pGC, - unsigned long changes, - DrawablePtr pDraw ) -{ - GC_UNWRAP(pGC); - DPRINT("RACValidateGC"); - (*pGC->funcs->ValidateGC)(pGC, changes, pDraw); - GC_WRAP(pGC); -} - - -static void -RACDestroyGC(GCPtr pGC) -{ - GC_UNWRAP (pGC); - DPRINT("RACDestroyGC"); - (*pGC->funcs->DestroyGC)(pGC); - GC_WRAP (pGC); -} - -static void -RACChangeGC ( - GCPtr pGC, - unsigned long mask) -{ - GC_UNWRAP (pGC); - DPRINT("RACChangeGC"); - (*pGC->funcs->ChangeGC) (pGC, mask); - GC_WRAP (pGC); -} - -static void -RACCopyGC ( - GCPtr pGCSrc, - unsigned long mask, - GCPtr pGCDst) -{ - GC_UNWRAP (pGCDst); - DPRINT("RACCopyGC"); - (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst); - GC_WRAP (pGCDst); -} - -static void -RACChangeClip ( - GCPtr pGC, - int type, - pointer pvalue, - int nrects ) -{ - GC_UNWRAP (pGC); - DPRINT("RACChangeClip"); - (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects); - GC_WRAP (pGC); -} - -static void -RACCopyClip(GCPtr pgcDst, GCPtr pgcSrc) -{ - GC_UNWRAP (pgcDst); - DPRINT("RACCopyClip"); - (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc); - GC_WRAP (pgcDst); -} - -static void -RACDestroyClip(GCPtr pGC) -{ - GC_UNWRAP (pGC); - DPRINT("RACDestroyClip"); - (* pGC->funcs->DestroyClip)(pGC); - GC_WRAP (pGC); -} - -/* GC Ops */ -static void -RACFillSpans( - DrawablePtr pDraw, - GC *pGC, - int nInit, - DDXPointPtr pptInit, - int *pwidthInit, - int fSorted ) -{ - GC_UNWRAP(pGC); - DPRINT("RACFillSpans"); - ENABLE_GC; - (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted); - GC_WRAP(pGC); -} - -static void -RACSetSpans( - DrawablePtr pDraw, - GCPtr pGC, - char *pcharsrc, - register DDXPointPtr ppt, - int *pwidth, - int nspans, - int fSorted ) -{ - GC_UNWRAP(pGC); - DPRINT("RACSetSpans"); - ENABLE_GC; - (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted); - GC_WRAP(pGC); -} - -static void -RACPutImage( - DrawablePtr pDraw, - GCPtr pGC, - int depth, - int x, int y, int w, int h, - int leftPad, - int format, - char *pImage ) -{ - GC_UNWRAP(pGC); - DPRINT("RACPutImage"); - ENABLE_GC; - (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h, - leftPad, format, pImage); - GC_WRAP(pGC); -} - -static RegionPtr -RACCopyArea( - DrawablePtr pSrc, - DrawablePtr pDst, - GC *pGC, - int srcx, int srcy, - int width, int height, - int dstx, int dsty ) -{ - RegionPtr ret; - - GC_UNWRAP(pGC); - DPRINT("RACCopyArea"); - ENABLE_GC; - ret = (*pGC->ops->CopyArea)(pSrc, pDst, - pGC, srcx, srcy, width, height, dstx, dsty); - GC_WRAP(pGC); - return ret; -} - -static RegionPtr -RACCopyPlane( - DrawablePtr pSrc, - DrawablePtr pDst, - GCPtr pGC, - int srcx, int srcy, - int width, int height, - int dstx, int dsty, - unsigned long bitPlane ) -{ - RegionPtr ret; - - GC_UNWRAP(pGC); - DPRINT("RACCopyPlane"); - ENABLE_GC; - ret = (*pGC->ops->CopyPlane)(pSrc, pDst, pGC, srcx, srcy, - width, height, dstx, dsty, bitPlane); - GC_WRAP(pGC); - return ret; -} - -static void -RACPolyPoint( - DrawablePtr pDraw, - GCPtr pGC, - int mode, - int npt, - xPoint *pptInit ) -{ - GC_UNWRAP(pGC); - DPRINT("RACPolyPoint"); - ENABLE_GC; - (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit); - GC_WRAP(pGC); -} - - -static void -RACPolylines( - DrawablePtr pDraw, - GCPtr pGC, - int mode, - int npt, - DDXPointPtr pptInit ) -{ - GC_UNWRAP(pGC); - DPRINT("RACPolylines"); - ENABLE_GC; - (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit); - GC_WRAP(pGC); -} - -static void -RACPolySegment( - DrawablePtr pDraw, - GCPtr pGC, - int nseg, - xSegment *pSeg ) -{ - GC_UNWRAP(pGC); - DPRINT("RACPolySegment"); - ENABLE_GC; - (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg); - GC_WRAP(pGC); -} - -static void -RACPolyRectangle( - DrawablePtr pDraw, - GCPtr pGC, - int nRectsInit, - xRectangle *pRectsInit ) -{ - GC_UNWRAP(pGC); - DPRINT("RACPolyRectangle"); - ENABLE_GC; - (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit); - GC_WRAP(pGC); -} - -static void -RACPolyArc( - DrawablePtr pDraw, - GCPtr pGC, - int narcs, - xArc *parcs ) -{ - GC_UNWRAP(pGC); - DPRINT("RACPolyArc"); - ENABLE_GC; - (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs); - GC_WRAP(pGC); -} - -static void -RACFillPolygon( - DrawablePtr pDraw, - GCPtr pGC, - int shape, - int mode, - int count, - DDXPointPtr ptsIn ) -{ - GC_UNWRAP(pGC); - DPRINT("RACFillPolygon"); - ENABLE_GC; - (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn); - GC_WRAP(pGC); -} - - -static void -RACPolyFillRect( - DrawablePtr pDraw, - GCPtr pGC, - int nrectFill, - xRectangle *prectInit ) -{ - GC_UNWRAP(pGC); - DPRINT("RACPolyFillRect"); - ENABLE_GC; - (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit); - GC_WRAP(pGC); -} - - -static void -RACPolyFillArc( - DrawablePtr pDraw, - GCPtr pGC, - int narcs, - xArc *parcs ) -{ - GC_UNWRAP(pGC); - DPRINT("RACPolyFillArc"); - ENABLE_GC; - (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs); - GC_WRAP(pGC); -} - -static int -RACPolyText8( - DrawablePtr pDraw, - GCPtr pGC, - int x, - int y, - int count, - char *chars ) -{ - int ret; - - GC_UNWRAP(pGC); - DPRINT("RACPolyText8"); - ENABLE_GC; - ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars); - GC_WRAP(pGC); - return ret; -} - -static int -RACPolyText16( - DrawablePtr pDraw, - GCPtr pGC, - int x, - int y, - int count, - unsigned short *chars ) -{ - int ret; - - GC_UNWRAP(pGC); - DPRINT("RACPolyText16"); - ENABLE_GC; - ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars); - GC_WRAP(pGC); - return ret; -} - -static void -RACImageText8( - DrawablePtr pDraw, - GCPtr pGC, - int x, - int y, - int count, - char *chars ) -{ - GC_UNWRAP(pGC); - DPRINT("RACImageText8"); - ENABLE_GC; - (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars); - GC_WRAP(pGC); -} - -static void -RACImageText16( - DrawablePtr pDraw, - GCPtr pGC, - int x, - int y, - int count, - unsigned short *chars ) -{ - GC_UNWRAP(pGC); - DPRINT("RACImageText16"); - ENABLE_GC; - (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars); - GC_WRAP(pGC); -} - - -static void -RACImageGlyphBlt( - DrawablePtr pDraw, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr *ppci, - pointer pglyphBase ) -{ - GC_UNWRAP(pGC); - DPRINT("RACImageGlyphBlt"); - ENABLE_GC; - (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit, - nglyph, ppci, pglyphBase); - GC_WRAP(pGC); -} - -static void -RACPolyGlyphBlt( - DrawablePtr pDraw, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr *ppci, - pointer pglyphBase ) -{ - GC_UNWRAP(pGC); - DPRINT("RACPolyGlyphBlt"); - ENABLE_GC; - (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit, - nglyph, ppci, pglyphBase); - GC_WRAP(pGC); -} - -static void -RACPushPixels( - GCPtr pGC, - PixmapPtr pBitMap, - DrawablePtr pDraw, - int dx, int dy, int xOrg, int yOrg ) -{ - GC_UNWRAP(pGC); - DPRINT("RACPushPixels"); - ENABLE_GC; - (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg); - GC_WRAP(pGC); -} - - -/* miSpriteFuncs */ -static Bool -RACSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur) -{ - Bool val; - SPRITE_PROLOG; - DPRINT_S("RACSpriteRealizeCursor",pScreen->myNum); - ENABLE; - val = PointPriv->spriteFuncs->RealizeCursor(pDev, pScreen, pCur); - SPRITE_EPILOG; - return val; -} - -static Bool -RACSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur) -{ - Bool val; - SPRITE_PROLOG; - DPRINT_S("RACSpriteUnrealizeCursor",pScreen->myNum); - ENABLE; - val = PointPriv->spriteFuncs->UnrealizeCursor(pDev, pScreen, pCur); - SPRITE_EPILOG; - return val; -} - -static void -RACSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, - CursorPtr pCur, int x, int y) -{ - SPRITE_PROLOG; - DPRINT_S("RACSpriteSetCursor",pScreen->myNum); - ENABLE; - PointPriv->spriteFuncs->SetCursor(pDev, pScreen, pCur, x, y); - SPRITE_EPILOG; -} - -static void -RACSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) -{ - SPRITE_PROLOG; - DPRINT_S("RACSpriteMoveCursor",pScreen->myNum); - ENABLE; - PointPriv->spriteFuncs->MoveCursor(pDev, pScreen, x, y); - SPRITE_EPILOG; -} - -#ifdef RENDER -static void -RACComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, - PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, - INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, - CARD16 height) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - - PICTURE_PROLOGUE(Composite); - - ENABLE; - (*ps->Composite) (op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, - yDst, width, height); - - PICTURE_EPILOGUE(Composite, RACComposite); -} - -static void -RACGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, - PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, - GlyphListPtr list, GlyphPtr *glyphs) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - - PICTURE_PROLOGUE(Glyphs); - - ENABLE; - (*ps->Glyphs)(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs); - - PICTURE_EPILOGUE (Glyphs, RACGlyphs); -} - -static void -RACCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color, int nRect, - xRectangle *rects) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - - PICTURE_PROLOGUE(CompositeRects); - - ENABLE; - (*ps->CompositeRects)(op, pDst, color, nRect, rects); - - PICTURE_EPILOGUE (CompositeRects, RACCompositeRects); -} -#endif - diff --git a/hw/xfree86/common/xf86RAC.h b/hw/xfree86/common/xf86RAC.h deleted file mode 100644 index 881d0042f..000000000 --- a/hw/xfree86/common/xf86RAC.h +++ /dev/null @@ -1,17 +0,0 @@ - -#ifndef __XF86RAC_H -#define __XF86RAC_H 1 - -#include "screenint.h" -#include "misc.h" -#include "xf86.h" - -extern _X_EXPORT Bool xf86RACInit(ScreenPtr pScreen, unsigned int flag); - -/* flags */ -#define RAC_FB 0x01 -#define RAC_CURSOR 0x02 -#define RAC_COLORMAP 0x04 -#define RAC_VIEWPORT 0x08 - -#endif /* __XF86RAC_H */ diff --git a/hw/xfree86/common/xf86Resources.h b/hw/xfree86/common/xf86Resources.h deleted file mode 100644 index 012fa699e..000000000 --- a/hw/xfree86/common/xf86Resources.h +++ /dev/null @@ -1,137 +0,0 @@ - -/* - * Copyright (c) 1999-2002 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -#ifndef _XF86_RESOURCES_H - -#define _XF86_RESOURCES_H - -#include "xf86str.h" - -#define _END {ResEnd,0,0} - -#define _VGA_EXCLUSIVE \ - {ResExcMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\ - {ResExcMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\ - {ResExcMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\ - {ResExcIoBlock | ResBios | ResBus, 0x03B0, 0x03BB},\ - {ResExcIoBlock | ResBios | ResBus, 0x03C0, 0x03DF} - -#define _VGA_SHARED \ - {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\ - {ResShrMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\ - {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\ - {ResShrIoBlock | ResBios | ResBus, 0x03B0, 0x03BB},\ - {ResShrIoBlock | ResBios | ResBus, 0x03C0, 0x03DF} - -#define _VGA_SHARED_MEM \ - {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\ - {ResShrMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\ - {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF} - -#define _VGA_SHARED_IO \ - {ResShrIoBlock | ResBios | ResBus, 0x03B0, 0x03BB},\ - {ResShrIoBlock | ResBios | ResBus, 0x03C0, 0x03DF} - -/* - * Exclusive unused VGA: resources unneeded but cannot be disabled. - * Like old Millennium. - */ -#define _VGA_EXCLUSIVE_UNUSED \ - {ResExcUusdMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\ - {ResExcUusdMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\ - {ResExcUusdMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\ - {ResExcUusdIoBlock | ResBios | ResBus, 0x03B0, 0x03BB},\ - {ResExcUusdIoBlock | ResBios | ResBus, 0x03C0, 0x03DF} - -/* - * Shared unused VGA: resources unneeded but cannot be disabled - * independently. This is used to determine if a device needs RAC. - */ -#define _VGA_SHARED_UNUSED \ - {ResShrUusdMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\ - {ResShrUusdMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\ - {ResShrUusdMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\ - {ResShrUusdIoBlock | ResBios | ResBus, 0x03B0, 0x03BB},\ - {ResShrUusdIoBlock | ResBios | ResBus, 0x03C0, 0x03DF} - -/* - * Sparse versions of the above for those adapters that respond to all ISA - * aliases of VGA ports. - */ -#define _VGA_EXCLUSIVE_SPARSE \ - {ResExcMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\ - {ResExcMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\ - {ResExcMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\ - {ResExcIoSparse | ResBios | ResBus, 0x03B0, 0x03F8},\ - {ResExcIoSparse | ResBios | ResBus, 0x03B8, 0x03FC},\ - {ResExcIoSparse | ResBios | ResBus, 0x03C0, 0x03E0} - -#define _VGA_SHARED_SPARSE \ - {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\ - {ResShrMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\ - {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\ - {ResShrIoSparse | ResBios | ResBus, 0x03B0, 0x03F8},\ - {ResShrIoSparse | ResBios | ResBus, 0x03B8, 0x03FC},\ - {ResShrIoSparse | ResBios | ResBus, 0x03C0, 0x03E0} - -#define _8514_EXCLUSIVE \ - {ResExcIoSparse | ResBios | ResBus, 0x02E8, 0x03F8} - -#define _8514_SHARED \ - {ResShrIoSparse | ResBios | ResBus, 0x02E8, 0x03F8} - -/* Predefined resources */ -extern _X_EXPORT resRange resVgaExclusive[]; -extern _X_EXPORT resRange resVgaShared[]; -extern _X_EXPORT resRange resVgaIoShared[]; -extern _X_EXPORT resRange resVgaMemShared[]; -extern _X_EXPORT resRange resVgaUnusedExclusive[]; -extern _X_EXPORT resRange resVgaUnusedShared[]; -extern _X_EXPORT resRange resVgaSparseExclusive[]; -extern _X_EXPORT resRange resVgaSparseShared[]; -extern _X_EXPORT resRange res8514Exclusive[]; -extern _X_EXPORT resRange res8514Shared[]; - -/* Less misleading aliases for xf86SetOperatingState() */ -#define resVgaMem resVgaMemShared -#define resVgaIo resVgaIoShared -#define resVga resVgaShared - -/* Old style names */ -#define RES_EXCLUSIVE_VGA resVgaExclusive -#define RES_SHARED_VGA resVgaShared -#define RES_EXCLUSIVE_8514 res8514Exclusive -#define RES_SHARED_8514 res8514Shared - -#define _PCI_AVOID_PC_STYLE \ - {ResExcIoSparse | ResBus, 0x0100, 0x0300},\ - {ResExcIoSparse | ResBus, 0x0200, 0x0200},\ - {ResExcMemBlock | ResBus, 0xA0000,0xFFFFF} - -#define RES_UNDEFINED NULL -#endif diff --git a/hw/xfree86/common/xf86fbBus.c b/hw/xfree86/common/xf86fbBus.c index 90e6eb0b6..059e378e3 100644 --- a/hw/xfree86/common/xf86fbBus.c +++ b/hw/xfree86/common/xf86fbBus.c @@ -40,16 +40,12 @@ #include "os.h" #include "xf86.h" #include "xf86Priv.h" -#include "xf86Resources.h" #include "xf86Bus.h" #define XF86_OS_PRIVS -#define NEED_OS_RAC_PROTOS #include "xf86_OSproc.h" -#include "xf86RAC.h" - Bool fbSlotClaimed = FALSE; int @@ -73,10 +69,6 @@ xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active) p->active = active; p->inUse = FALSE; xf86AddDevToEntity(num, dev); - p->access = xnfcalloc(1,sizeof(EntityAccessRec)); - p->access->fallback = &AccessNULL; - p->access->pAccess = &AccessNULL; - p->busAcc = NULL; fbSlotClaimed = TRUE; return num; diff --git a/hw/xfree86/common/xf86noBus.c b/hw/xfree86/common/xf86noBus.c index e7d4442cf..0b9634918 100644 --- a/hw/xfree86/common/xf86noBus.c +++ b/hw/xfree86/common/xf86noBus.c @@ -40,16 +40,12 @@ #include "os.h" #include "xf86.h" #include "xf86Priv.h" -#include "xf86Resources.h" #include "xf86Bus.h" #define XF86_OS_PRIVS -#define NEED_OS_RAC_PROTOS #include "xf86_OSproc.h" -#include "xf86RAC.h" - int xf86ClaimNoSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active) { @@ -64,10 +60,6 @@ xf86ClaimNoSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active) p->active = active; p->inUse = FALSE; xf86AddDevToEntity(num, dev); - p->access = xnfcalloc(1,sizeof(EntityAccessRec)); - p->access->fallback = &AccessNULL; - p->access->pAccess = &AccessNULL; - p->busAcc = NULL; return num; } diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c index 27e238a4d..3935c5cd5 100644 --- a/hw/xfree86/common/xf86pciBus.c +++ b/hw/xfree86/common/xf86pciBus.c @@ -41,16 +41,13 @@ #include "Pci.h" #include "xf86.h" #include "xf86Priv.h" -#include "xf86Resources.h" /* Bus-specific headers */ #include "xf86Bus.h" #define XF86_OS_PRIVS -#define NEED_OS_RAC_PROTOS #include "xf86_OSproc.h" -#include "xf86RAC.h" /* Bus-specific globals */ Bool pciSlotClaimed = FALSE; @@ -108,241 +105,6 @@ xf86FormatPciBusNumber(int busnum, char *buffer) } /* - * IO enable/disable related routines for PCI - */ -#define pArg ((pciArg*)arg) -#define SETBITS PCI_CMD_IO_ENABLE -static void -pciIoAccessEnable(void* arg) -{ -#if 0 -#ifdef DEBUG - ErrorF("pciIoAccessEnable: 0x%05lx\n", *(PCITAG *)arg); -#endif - pArg->ctrl |= SETBITS | PCI_CMD_MASTER_ENABLE; - pci_device_cfg_write_u32(pArg->dev, pArg->ctrl, PCI_CMD_STAT_REG); -#endif -} - -static void -pciIoAccessDisable(void* arg) -{ -#if 0 -#ifdef DEBUG - ErrorF("pciIoAccessDisable: 0x%05lx\n", *(PCITAG *)arg); -#endif - pArg->ctrl &= ~SETBITS; - pci_device_cfg_write_u32(pArg->dev, pArg->ctrl, PCI_CMD_STAT_REG); -#endif -} - -#undef SETBITS -#define SETBITS (PCI_CMD_IO_ENABLE | PCI_CMD_MEM_ENABLE) -static void -pciIo_MemAccessEnable(void* arg) -{ -#if 0 -#ifdef DEBUG - ErrorF("pciIo_MemAccessEnable: 0x%05lx\n", *(PCITAG *)arg); -#endif - pArg->ctrl |= SETBITS | PCI_CMD_MASTER_ENABLE; - pci_device_cfg_write_u32(pArg->dev, pArg->ctrl, PCI_CMD_STAT_REG); -#endif -} - -static void -pciIo_MemAccessDisable(void* arg) -{ -#if 0 -#ifdef DEBUG - ErrorF("pciIo_MemAccessDisable: 0x%05lx\n", *(PCITAG *)arg); -#endif - pArg->ctrl &= ~SETBITS; - pci_device_cfg_write_u32(pArg->dev, pArg->ctrl, PCI_CMD_STAT_REG); -#endif -} - -#undef SETBITS -#define SETBITS (PCI_CMD_MEM_ENABLE) -static void -pciMemAccessEnable(void* arg) -{ -#if 0 -#ifdef DEBUG - ErrorF("pciMemAccessEnable: 0x%05lx\n", *(PCITAG *)arg); -#endif - pArg->ctrl |= SETBITS | PCI_CMD_MASTER_ENABLE; - pci_device_cfg_write_u32(pArg->dev, pArg->ctrl, PCI_CMD_STAT_REG); -#endif -} - -static void -pciMemAccessDisable(void* arg) -{ -#if 0 -#ifdef DEBUG - ErrorF("pciMemAccessDisable: 0x%05lx\n", *(PCITAG *)arg); -#endif - pArg->ctrl &= ~SETBITS; - pci_device_cfg_write_u32(pArg->dev, pArg->ctrl, PCI_CMD_STAT_REG); -#endif -} -#undef SETBITS -#undef pArg - - -/* move to OS layer */ -#define MASKBITS (PCI_PCI_BRIDGE_VGA_EN | PCI_PCI_BRIDGE_MASTER_ABORT_EN) -static void -pciBusAccessEnable(BusAccPtr ptr) -{ -#if 0 - struct pci_device * const dev = ptr->busdep.pci.dev; - uint16_t ctrl; - -#ifdef DEBUG - ErrorF("pciBusAccessEnable: bus=%d\n", ptr->busdep.pci.bus); -#endif - pci_device_cfg_read_u16( dev, & ctrl, PCI_PCI_BRIDGE_CONTROL_REG ); - if ((ctrl & MASKBITS) != PCI_PCI_BRIDGE_VGA_EN) { - ctrl = (ctrl | PCI_PCI_BRIDGE_VGA_EN) & - ~(PCI_PCI_BRIDGE_MASTER_ABORT_EN | PCI_PCI_BRIDGE_SECONDARY_RESET); - pci_device_cfg_write_u16(dev, ctrl, PCI_PCI_BRIDGE_CONTROL_REG); - } -#endif -} - -/* move to OS layer */ -static void -pciBusAccessDisable(BusAccPtr ptr) -{ -#if 0 - struct pci_device * const dev = ptr->busdep.pci.dev; - uint16_t ctrl; - -#ifdef DEBUG - ErrorF("pciBusAccessDisable: bus=%d\n", ptr->busdep.pci.bus); -#endif - pci_device_cfg_read_u16( dev, & ctrl, PCI_PCI_BRIDGE_CONTROL_REG ); - if (ctrl & MASKBITS) { - ctrl &= ~(MASKBITS | PCI_PCI_BRIDGE_SECONDARY_RESET); - pci_device_cfg_write_u16(dev, ctrl, PCI_PCI_BRIDGE_CONTROL_REG); - } -#endif -} -#undef MASKBITS - -static void -pciSetBusAccess(BusAccPtr ptr) -{ -#if 0 -#ifdef DEBUG - ErrorF("pciSetBusAccess: route VGA to bus %d\n", ptr->busdep.pci.bus); -#endif - - if (!ptr->primary && !ptr->current) - return; - - if (ptr->current && ptr->current->disable_f) - (*ptr->current->disable_f)(ptr->current); - ptr->current = NULL; - - /* walk down */ - while (ptr->primary) { /* No enable for root bus */ - if (ptr != ptr->primary->current) { - if (ptr->primary->current && ptr->primary->current->disable_f) - (*ptr->primary->current->disable_f)(ptr->primary->current); - if (ptr->enable_f) - (*ptr->enable_f)(ptr); - ptr->primary->current = ptr; - } - ptr = ptr->primary; - } -#endif -} - -/* move to OS layer */ -static void -savePciState( struct pci_device * dev, pciSavePtr ptr ) -{ -#if 0 - int i; - - pci_device_cfg_read_u32( dev, & ptr->command, PCI_CMD_STAT_REG ); - - for ( i = 0; i < 6; i++ ) { - pci_device_cfg_read_u32( dev, & ptr->base[i], - PCI_CMD_BASE_REG + (i * 4) ); - } - - pci_device_cfg_read_u32( dev, & ptr->biosBase, PCI_CMD_BIOS_REG ); -#endif -} - -/* move to OS layer */ -#if 0 -static void -restorePciState( struct pci_device * dev, pciSavePtr ptr) -{ - int i; - - /* disable card before setting anything */ - pci_device_cfg_write_bits(dev, PCI_CMD_MEM_ENABLE | PCI_CMD_IO_ENABLE, 0, - PCI_CMD_STAT_REG); - - pci_device_cfg_write_u32(dev, ptr->biosBase, PCI_CMD_BIOS_REG); - - for ( i = 0; i < 6; i++ ) { - pci_device_cfg_write_u32(dev, ptr->base[i], - PCI_CMD_BASE_REG + (i * 4)); - } - - pci_device_cfg_write_u32(dev, ptr->command, PCI_CMD_STAT_REG); -} -#endif - -/* move to OS layer */ -static void -savePciBusState(BusAccPtr ptr) -{ -#if 0 - struct pci_device * const dev = ptr->busdep.pci.dev; - uint16_t temp; - - pci_device_cfg_read_u16( dev, & temp, PCI_PCI_BRIDGE_CONTROL_REG ); - ptr->busdep.pci.save.control = temp & ~PCI_PCI_BRIDGE_SECONDARY_RESET; - - /* Allow master aborts to complete normally on non-root buses */ - if ( ptr->busdep.pci.save.control & PCI_PCI_BRIDGE_MASTER_ABORT_EN ) { - temp = ptr->busdep.pci.save.control & ~PCI_PCI_BRIDGE_MASTER_ABORT_EN; - pci_device_cfg_read_u16( dev, & temp, PCI_PCI_BRIDGE_CONTROL_REG ); - } -#endif -} - -/* move to OS layer */ -#define MASKBITS (PCI_PCI_BRIDGE_VGA_EN | PCI_PCI_BRIDGE_MASTER_ABORT_EN) -static void -restorePciBusState(BusAccPtr ptr) -{ -#if 0 - struct pci_device * const dev = ptr->busdep.pci.dev; - uint16_t ctrl; - - /* Only restore the bits we've changed (and don't cause resets) */ - pci_device_cfg_read_u16( dev, & ctrl, PCI_PCI_BRIDGE_CONTROL_REG ); - - if ((ctrl ^ ptr->busdep.pci.save.control) & MASKBITS) { - ctrl &= ~(MASKBITS | PCI_PCI_BRIDGE_SECONDARY_RESET); - ctrl |= ptr->busdep.pci.save.control & MASKBITS; - pci_device_cfg_write_u16(dev, ctrl, PCI_PCI_BRIDGE_CONTROL_REG); - } -#endif -} -#undef MASKBITS - - -/* * xf86Bus.c interface */ @@ -488,19 +250,8 @@ initPciState(void) pvp->user_data = (intptr_t) pcaccp; pcaccp->arg.dev = pvp; - pcaccp->ioAccess.AccessDisable = pciIoAccessDisable; - pcaccp->ioAccess.AccessEnable = pciIoAccessEnable; - pcaccp->ioAccess.arg = &pcaccp->arg; - pcaccp->io_memAccess.AccessDisable = pciIo_MemAccessDisable; - pcaccp->io_memAccess.AccessEnable = pciIo_MemAccessEnable; - pcaccp->io_memAccess.arg = &pcaccp->arg; - pcaccp->memAccess.AccessDisable = pciMemAccessDisable; - pcaccp->memAccess.AccessEnable = pciMemAccessEnable; - pcaccp->memAccess.arg = &pcaccp->arg; - pcaccp->ctrl = PCISHAREDIOCLASSES(pvp->device_class); - savePciState(pvp, &pcaccp->save); pcaccp->arg.ctrl = pcaccp->save.command; } } @@ -535,7 +286,7 @@ initPciBusState(void) }; struct pci_device *dev; struct pci_device_iterator *iter; - BusAccPtr pbap, pbap_tmp; + BusAccPtr pbap; iter = pci_id_match_iterator_create(& bridge_match); while((dev = pci_device_next(iter)) != NULL) { @@ -544,7 +295,6 @@ initPciBusState(void) int secondary; int subordinate; - pci_device_get_bridge_buses(dev, &primary, &secondary, &subordinate); pbap = xnfcalloc(1,sizeof(BusAccRec)); @@ -553,8 +303,6 @@ initPciBusState(void) pbap->busdep_type = BUS_PCI; pbap->busdep.pci.dev = dev; - pbap->set_f = pciSetBusAccess; - switch (subclass) { case PCI_SUBCLASS_BRIDGE_HOST: pbap->type = BUS_PCI; @@ -562,142 +310,12 @@ initPciBusState(void) case PCI_SUBCLASS_BRIDGE_PCI: case PCI_SUBCLASS_BRIDGE_CARDBUS: pbap->type = BUS_PCI; - pbap->save_f = savePciBusState; - pbap->restore_f = restorePciBusState; - pbap->enable_f = pciBusAccessEnable; - pbap->disable_f = pciBusAccessDisable; - savePciBusState(pbap); break; } - pbap->next = xf86BusAccInfo; - xf86BusAccInfo = pbap; } pci_iterator_destroy(iter); - for (pbap = xf86BusAccInfo; pbap; pbap = pbap->next) { - pbap->primary = NULL; - - if (pbap->busdep_type == BUS_PCI - && pbap->busdep.pci.primary_bus > -1) { - pbap_tmp = xf86BusAccInfo; - while (pbap_tmp) { - if (pbap_tmp->busdep_type == BUS_PCI && - pbap_tmp->busdep.pci.bus == pbap->busdep.pci.primary_bus) { - /* Don't create loops */ - if (pbap == pbap_tmp) - break; - pbap->primary = pbap_tmp; - break; - } - pbap_tmp = pbap_tmp->next; - } - } - } -} - -void -PciStateEnter(void) -{ -#if 0 - unsigned i; - - if (xf86PciVideoInfo == NULL) - return; - - for ( i = 0 ; xf86PciVideoInfo[i] != NULL ; i++ ) { - pciAccPtr paccp = (pciAccPtr) xf86PciVideoInfo[i]->user_data; - - if ( (paccp != NULL) && paccp->ctrl ) { - savePciState(paccp->arg.dev, &paccp->save); - restorePciState(paccp->arg.dev, &paccp->restore); - paccp->arg.ctrl = paccp->restore.command; - } - } -#endif -} - -void -PciBusStateEnter(void) -{ -#if 0 - BusAccPtr pbap = xf86BusAccInfo; - - while (pbap) { - if (pbap->save_f) - pbap->save_f(pbap); - pbap = pbap->next; - } -#endif -} - -void -PciStateLeave(void) -{ -#if 0 - unsigned i; - - if (xf86PciVideoInfo == NULL) - return; - - for ( i = 0 ; xf86PciVideoInfo[i] != NULL ; i++ ) { - pciAccPtr paccp = (pciAccPtr) xf86PciVideoInfo[i]->user_data; - - if ( (paccp != NULL) && paccp->ctrl ) { - savePciState(paccp->arg.dev, &paccp->restore); - restorePciState(paccp->arg.dev, &paccp->save); - } - } -#endif -} - -void -PciBusStateLeave(void) -{ -#if 0 - BusAccPtr pbap = xf86BusAccInfo; - - while (pbap) { - if (pbap->restore_f) - pbap->restore_f(pbap); - pbap = pbap->next; - } -#endif -} - -void -DisablePciAccess(void) -{ -#if 0 - unsigned i; - - if (xf86PciVideoInfo == NULL) - return; - - for ( i = 0 ; xf86PciVideoInfo[i] != NULL ; i++ ) { - pciAccPtr paccp = (pciAccPtr) xf86PciVideoInfo[i]->user_data; - - if ( (paccp != NULL) && paccp->ctrl ) { - pciIo_MemAccessDisable(paccp->io_memAccess.arg); - } - } -#endif -} - -void -DisablePciBusAccess(void) -{ -#if 0 - BusAccPtr pbap = xf86BusAccInfo; - - while (pbap) { - if (pbap->disable_f) - pbap->disable_f(pbap); - if (pbap->primary) - pbap->primary->current = NULL; - pbap = pbap->next; - } -#endif } /* @@ -710,10 +328,6 @@ xf86ClaimPciSlot(struct pci_device * d, DriverPtr drvp, int chipset, GDevPtr dev, Bool active) { EntityPtr p = NULL; - pciAccPtr paccp = (pciAccPtr) d->user_data; - BusAccPtr pbap = xf86BusAccInfo; - const unsigned bus = PCI_MAKE_BUS(d->domain, d->bus); - int num; if (xf86CheckPciSlot(d)) { @@ -727,25 +341,6 @@ xf86ClaimPciSlot(struct pci_device * d, DriverPtr drvp, p->inUse = FALSE; if (dev) xf86AddDevToEntity(num, dev); - /* Here we initialize the access structure */ - p->access = xnfcalloc(1,sizeof(EntityAccessRec)); - if (paccp != NULL) { - p->access->fallback = & paccp->io_memAccess; - p->access->pAccess = & paccp->io_memAccess; - paccp->ctrl = TRUE; /* mark control if not already */ - } - else { - p->access->fallback = &AccessNULL; - p->access->pAccess = &AccessNULL; - } - - p->busAcc = NULL; - while (pbap) { - if (pbap->type == BUS_PCI && pbap->busdep.pci.bus == bus) - p->busAcc = pbap; - pbap = pbap->next; - } - pciSlotClaimed = TRUE; if (active) { @@ -929,21 +524,3 @@ xf86CheckPciSlot(const struct pci_device *d) } -void -pciConvertRange2Host(int entityIndex, resRange *pRange) -{ - struct pci_device *const pvp = xf86GetPciInfoForEntity(entityIndex); - const PCITAG tag = PCI_MAKE_TAG(PCI_MAKE_BUS(pvp->domain, pvp->bus), - pvp->dev, pvp->func); - - if (pvp == NULL) { - return; - } - - if (!(pRange->type & ResBus)) - return; - - /* Set domain number */ - pRange->type &= ~(ResDomain | ResBus); - pRange->type |= pvp->domain << 24; -} diff --git a/hw/xfree86/common/xf86pciBus.h b/hw/xfree86/common/xf86pciBus.h index 1cbfa38ea..ec9a1648d 100644 --- a/hw/xfree86/common/xf86pciBus.h +++ b/hw/xfree86/common/xf86pciBus.h @@ -48,9 +48,6 @@ typedef struct { typedef struct { pciArg arg; - xf86AccessRec ioAccess; - xf86AccessRec io_memAccess; - xf86AccessRec memAccess; pciSave save; pciSave restore; Bool ctrl; @@ -69,6 +66,5 @@ void PciStateEnter(void); void PciBusStateEnter(void); void PciStateLeave(void); void PciBusStateLeave(void); -void pciConvertRange2Host(int entityIndex, resRange *pRange); #endif /* _XF86_PCI_BUS_H */ diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h index 3b1346f05..9cb66eb81 100644 --- a/hw/xfree86/common/xf86str.h +++ b/hw/xfree86/common/xf86str.h @@ -556,145 +556,6 @@ typedef enum { PM_NONE } pmWait; -/* - * The IO access enabler struct. This contains the address for - * the IOEnable/IODisable funcs for their specific bus along - * with a pointer to data needed by them - */ -typedef struct _AccessRec { - void (*AccessDisable)(void *arg); - void (*AccessEnable)(void *arg); - void *arg; -} xf86AccessRec, *xf86AccessPtr; - -typedef struct { - xf86AccessPtr mem; - xf86AccessPtr io; - xf86AccessPtr io_mem; -} xf86SetAccessFuncRec, *xf86SetAccessFuncPtr; - -/* bus-access-related types */ -typedef enum { - NONE, - IO, - MEM_IO, - MEM -} resType; - -typedef struct _EntityAccessRec { - xf86AccessPtr fallback; - xf86AccessPtr pAccess; - resType rt; - pointer busAcc; - struct _EntityAccessRec *next; -} EntityAccessRec, *EntityAccessPtr; - -typedef struct _CurrAccRec { - EntityAccessPtr pMemAccess; - EntityAccessPtr pIoAccess; -} xf86CurrentAccessRec, *xf86CurrentAccessPtr; - -/* new RAC */ - -/* Resource Type values */ -#define ResNone ((unsigned long)(-1)) - -#define ResMem 0x0001 -#define ResIo 0x0002 -#define ResPhysMask 0x000F - -#define ResExclusive 0x0010 -#define ResShared 0x0020 -#define ResAny 0x0040 -#define ResAccMask 0x0070 -#define ResUnused 0x0080 - -#define ResUnusedOpr 0x0100 -#define ResDisableOpr 0x0200 -#define ResOprMask 0x0300 - -#define ResBlock 0x0400 -#define ResSparse 0x0800 -#define ResExtMask 0x0C00 - -#define ResEstimated 0x001000 -#define ResInit 0x002000 -#define ResBios 0x004000 -#define ResMiscMask 0x00F000 - -#define ResBus 0x010000 - -#if defined(__alpha__) && defined(linux) -# define ResDomain 0x1ff000000ul -#else -# define ResDomain 0xff000000ul -#endif -#define ResTypeMask (ResPhysMask | ResDomain) /* For conflict check */ - -#define ResEnd ResNone - -#define ResExcMemBlock (ResMem | ResExclusive | ResBlock) -#define ResExcIoBlock (ResIo | ResExclusive | ResBlock) -#define ResShrMemBlock (ResMem | ResShared | ResBlock) -#define ResShrIoBlock (ResIo | ResShared | ResBlock) -#define ResExcUusdMemBlock (ResMem | ResExclusive | ResUnused | ResBlock) -#define ResExcUusdIoBlock (ResIo | ResExclusive | ResUnused | ResBlock) -#define ResShrUusdMemBlock (ResMem | ResShared | ResUnused | ResBlock) -#define ResShrUusdIoBlock (ResIo | ResShared | ResUnused | ResBlock) -#define ResExcUusdMemSparse (ResMem | ResExclusive | ResUnused | ResSparse) -#define ResExcUusdIoSparse (ResIo | ResExclusive | ResUnused | ResSparse) -#define ResShrUusdMemSparse (ResMem | ResShared | ResUnused | ResSparse) -#define ResShrUusdIoSparse (ResIo | ResShared | ResUnused | ResSparse) - -#define ResExcMemSparse (ResMem | ResExclusive | ResSparse) -#define ResExcIoSparse (ResIo | ResExclusive | ResSparse) -#define ResShrMemSparse (ResMem | ResShared | ResSparse) -#define ResShrIoSparse (ResIo | ResShared | ResSparse) -#define ResUusdMemSparse (ResMem | ResUnused | ResSparse) -#define ResUusdIoSparse (ResIo | ResUnused | ResSparse) - -#define ResIsMem(r) (((r)->type & ResPhysMask) == ResMem) -#define ResIsIo(r) (((r)->type & ResPhysMask) == ResIo) -#define ResIsExclusive(r) (((r)->type & ResAccMask) == ResExclusive) -#define ResIsShared(r) (((r)->type & ResAccMask) == ResShared) -#define ResIsUnused(r) (((r)->type & ResAccMask) == ResUnused) -#define ResIsBlock(r) (((r)->type & ResExtMask) == ResBlock) -#define ResIsSparse(r) (((r)->type & ResExtMask) == ResSparse) -#define ResIsEstimated(r) (((r)->type & ResMiscMask) == ResEstimated) - -typedef struct { - unsigned long type; /* shared, exclusive, unused etc. */ - memType a; - memType b; -} resRange, *resList; - -#define RANGE_TYPE(type, domain) \ - (((unsigned long)(domain) << 24) | ((type) & ~ResBus)) -#define RANGE(r,u,v,t) {\ - (r).a = (u);\ - (r).b = (v);\ - (r).type = (t);\ - } - -#define rBase a -#define rMask b -#define rBegin a -#define rEnd b - -/* resource record */ -typedef struct _resRec *resPtr; -typedef struct _resRec { - resRange val; - int entityIndex; /* who owns the resource */ - resPtr next; -} resRec; - -#define sparse_base val.rBase -#define sparse_mask val.rMask -#define block_begin val.rBegin -#define block_end val.rEnd -#define res_type val.type - typedef struct _PciChipsets { /** * Key used to match this device with its name in an array of @@ -720,12 +581,14 @@ typedef struct _PciChipsets { */ int PCIid; - /** - * Resources associated with this type of device. - */ - resRange *resList; +/* dummy place holders for drivers to build against old/new servers */ +#define RES_UNDEFINED NULL +#define RES_EXCLUSIVE_VGA NULL +#define RES_SHARED_VGA NULL + void *dummy; } PciChipsets; + /* Entity properties */ typedef void (*EntityProc)(int entityIndex,pointer private); @@ -734,7 +597,6 @@ typedef struct _entityInfo { BusRec location; int chipset; Bool active; - resPtr resources; GDevPtr device; DriverPtr driver; } EntityInfoRec, *EntityInfoPtr; @@ -926,12 +788,6 @@ typedef struct _ScrnInfoRec { int chipID; int chipRev; - int racMemFlags; - int racIoFlags; - pointer access; - xf86CurrentAccessPtr CurrentAccess; - resType resourceType; - pointer busAccess; /* Allow screens to be enabled/disabled individually */ Bool vtSema; diff --git a/hw/xfree86/loader/sdksyms.sh b/hw/xfree86/loader/sdksyms.sh index b320661c7..8bda8d70b 100755 --- a/hw/xfree86/loader/sdksyms.sh +++ b/hw/xfree86/loader/sdksyms.sh @@ -117,11 +117,9 @@ cat > sdksyms.c << EOF #include "xf86PciInfo.h" #include "xf86Priv.h" #include "xf86Privstr.h" -#include "xf86Resources.h" #include "xf86cmap.h" #include "xf86fbman.h" #include "xf86str.h" -#include "xf86RAC.h" #include "xf86Xinput.h" #include "xisb.h" #if XV diff --git a/hw/xfree86/os-support/bsd/Makefile.am b/hw/xfree86/os-support/bsd/Makefile.am index e52dac13b..b6ecdf1d1 100644 --- a/hw/xfree86/os-support/bsd/Makefile.am +++ b/hw/xfree86/os-support/bsd/Makefile.am @@ -17,9 +17,6 @@ else KMOD_SOURCES = $(srcdir)/../shared/kmod_noop.c endif -# FIXME: Non-i386/ia64 resource support. -RES_SOURCES = $(srcdir)/../shared/stdResource.c - if AGP AGP_SOURCES = $(srcdir)/../linux/lnx_agp.c else diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c index e210fa1ab..3d77d7f93 100644 --- a/hw/xfree86/os-support/bus/linuxPci.c +++ b/hw/xfree86/os-support/bus/linuxPci.c @@ -453,58 +453,3 @@ xf86MapLegacyIO(struct pci_device *dev) return (IOADDRESS)DomainMmappedIO[domain]; } -resPtr -xf86AccResFromOS(resPtr pRes) -{ - struct pci_device *dev; - struct pci_device_iterator *iter; - resRange range; - - iter = pci_id_match_iterator_create(& match_host_bridge); - while ((dev = pci_device_next(iter)) != NULL) { - const int domain = dev->domain; - const struct pciSizes * const sizes = linuxGetSizesStruct(dev); - - /* - * At minimum, the top and bottom resources must be claimed, so - * that resources that are (or appear to be) unallocated can be - * relocated. - */ - RANGE(range, 0x00000000u, 0x0009ffffu, - RANGE_TYPE(ResExcMemBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - RANGE(range, 0x000c0000u, 0x000effffu, - RANGE_TYPE(ResExcMemBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - RANGE(range, 0x000f0000u, 0x000fffffu, - RANGE_TYPE(ResExcMemBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - - RANGE(range, (ADDRESS)(sizes->mem_size - 1), - (ADDRESS)(sizes->mem_size - 1), - RANGE_TYPE(ResExcMemBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - - RANGE(range, 0x00000000u, 0x00000000u, - RANGE_TYPE(ResExcIoBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - RANGE(range, (IOADDRESS)(sizes->io_size - 1), - (IOADDRESS)(sizes->io_size - 1), - RANGE_TYPE(ResExcIoBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - - /* FIXME: The old code reserved domain 0 for a special purpose. The - * FIXME: new code just uses whatever domains the kernel tells it, - * FIXME: but there is no way to get a domain < 0. What should - * FIXME: happen here? - * - if (domain <= 0) - break; - */ - } - - pci_iterator_destroy(iter); - - return pRes; -} - diff --git a/hw/xfree86/os-support/hurd/Makefile.am b/hw/xfree86/os-support/hurd/Makefile.am index 9bbe2afaf..3e8224753 100644 --- a/hw/xfree86/os-support/hurd/Makefile.am +++ b/hw/xfree86/os-support/hurd/Makefile.am @@ -4,7 +4,6 @@ libhurd_la_SOURCES = hurd_bell.c hurd_init.c hurd_mmap.c \ hurd_video.c \ $(srcdir)/../shared/VTsw_noop.c \ $(srcdir)/../shared/posix_tty.c \ - $(srcdir)/../shared/stdResource.c \ $(srcdir)/../shared/vidmem.c \ $(srcdir)/../shared/sigiostubs.c \ $(srcdir)/../shared/pm_noop.c \ diff --git a/hw/xfree86/os-support/linux/Makefile.am b/hw/xfree86/os-support/linux/Makefile.am index 81bd055e3..1239c8f6b 100644 --- a/hw/xfree86/os-support/linux/Makefile.am +++ b/hw/xfree86/os-support/linux/Makefile.am @@ -32,7 +32,6 @@ liblinux_la_SOURCES = lnx_init.c lnx_video.c \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/vidmem.c \ $(srcdir)/../shared/sigio.c \ - $(srcdir)/../shared/stdResource.c \ $(ACPI_SRCS) \ $(APM_SRCS) \ $(PLATFORM_PCI_SUPPORT) diff --git a/hw/xfree86/os-support/shared/stdResource.c b/hw/xfree86/os-support/shared/stdResource.c deleted file mode 100644 index 491b4cebe..000000000 --- a/hw/xfree86/os-support/shared/stdResource.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 1999-2003 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -/* Standard resource information code */ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include <X11/X.h> -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86Privstr.h" -#define NEED_OS_RAC_PROTOS -#include "xf86_OSlib.h" -#include "xf86Resources.h" - -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ - defined(__NetBSD__) || defined(__OpenBSD__) || \ - defined(__DragonFly__) || defined(__sun) || defined(__GNU__) -#define xf86StdAccResFromOS xf86AccResFromOS -#endif - -resPtr -xf86StdAccResFromOS(resPtr ret) -{ - resRange range; - - /* - * Fallback is to claim the following areas: - * - * 0x00000000 - 0x0009ffff low 640k host memory - * 0x000c0000 - 0x000effff location of VGA and other extensions ROMS - * 0x000f0000 - 0x000fffff system BIOS - * 0x00100000 - 0x3fffffff low 1G - 1MB host memory - * 0xfec00000 - 0xfecfffff default I/O APIC config space - * 0xfee00000 - 0xfeefffff default Local APIC config space - * 0xffe00000 - 0xffffffff high BIOS area (should this be included?) - * - * reference: Intel 440BX AGP specs - * - * The two APIC spaces appear to be BX-specific and should be dealt with - * elsewhere. - */ - - /* Fallback is to claim 0x0 - 0x9ffff and 0x100000 - 0x7fffffff */ - RANGE(range, 0x00000000, 0x0009ffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x000c0000, 0x000effff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x000f0000, 0x000fffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); -#if 0 - RANGE(range, 0xfec00000, 0xfecfffff, ResExcMemBlock | ResBios); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xfee00000, 0xfeefffff, ResExcMemBlock | ResBios); - ret = xf86AddResToList(ret, &range, -1); - /* airlied - remove BIOS range it shouldn't be here - this should use E820 - or THE OS */ - RANGE(range, 0xffe00000, 0xffffffff, ResExcMemBlock | ResBios); - ret = xf86AddResToList(ret, &range, -1); -#endif - /* - * Fallback would be to claim well known ports in the 0x0 - 0x3ff range - * along with their sparse I/O aliases, but that's too imprecise. Instead - * claim a bare minimum here. - */ - RANGE(range, 0x00000000, 0x000000ff, ResExcIoBlock); /* For mainboard */ - ret = xf86AddResToList(ret, &range, -1); - - /* - * At minimum, the top and bottom resources must be claimed, so that - * resources that are (or appear to be) unallocated can be relocated. - */ -/* RANGE(range, 0x00000000, 0x00000000, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xffffffff, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x00000000, 0x00000000, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); */ - RANGE(range, 0x0000ffff, 0x0000ffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - - /* XXX add others */ - return ret; -} diff --git a/hw/xfree86/os-support/solaris/Makefile.am b/hw/xfree86/os-support/solaris/Makefile.am index 4496ee122..c09ae3282 100644 --- a/hw/xfree86/os-support/solaris/Makefile.am +++ b/hw/xfree86/os-support/solaris/Makefile.am @@ -22,7 +22,6 @@ libsolaris_la_SOURCES = sun_init.c \ $(srcdir)/../shared/kmod_noop.c \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/sigio.c \ - $(srcdir)/../shared/stdResource.c \ $(srcdir)/../shared/vidmem.c \ $(VTSW_SRC) nodist_libsolaris_la_SOURCES = $(SOLARIS_INOUT_SRC) diff --git a/hw/xfree86/os-support/xf86_OSproc.h b/hw/xfree86/os-support/xf86_OSproc.h index 0f16607bd..98d7932e7 100644 --- a/hw/xfree86/os-support/xf86_OSproc.h +++ b/hw/xfree86/os-support/xf86_OSproc.h @@ -210,15 +210,6 @@ extern _X_EXPORT int xf86ProcessArgument(int, char **, int); extern _X_EXPORT void xf86UseMsg(void); extern _X_EXPORT PMClose xf86OSPMOpen(void); -#ifdef NEED_OS_RAC_PROTOS -/* RAC-related privs */ -/* internal to os-support layer */ -extern _X_EXPORT resPtr xf86StdAccResFromOS(resPtr ret); - -/* available to the common layer */ -extern _X_EXPORT resPtr xf86AccResFromOS(resPtr ret); -#endif /* NEED_OS_RAC_PROTOS */ - extern _X_EXPORT void xf86MakeNewMapping(int, int, unsigned long, unsigned long, pointer); extern _X_EXPORT void xf86InitVidMem(void); |