diff options
author | marha <marha@users.sourceforge.net> | 2012-03-26 14:23:28 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-03-26 14:23:28 +0200 |
commit | 76bcc36ed305418a3ddc5752d287ede894243e1b (patch) | |
tree | bacb320c825768471ce56f058f17ce863d592376 /xorg-server/hw/xfree86/common/xf86Bus.c | |
parent | 7d894e32566b710952c44cbc71939ad1d9e2fa8d (diff) | |
parent | 0f834b91a4768673833ab4917e87d86c237bb1a6 (diff) | |
download | vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.tar.gz vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.tar.bz2 vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
pixman/pixman/pixman-mmx.c
xorg-server/Xext/shm.c
xorg-server/Xext/syncsrv.h
xorg-server/Xext/xvmain.c
xorg-server/Xi/exevents.c
xorg-server/Xi/opendev.c
xorg-server/composite/compalloc.c
xorg-server/composite/compoverlay.c
xorg-server/dix/colormap.c
xorg-server/dix/devices.c
xorg-server/dix/dispatch.c
xorg-server/dix/dixfonts.c
xorg-server/dix/eventconvert.c
xorg-server/dix/events.c
xorg-server/dix/gc.c
xorg-server/dix/getevents.c
xorg-server/dix/main.c
xorg-server/dix/privates.c
xorg-server/dix/registry.c
xorg-server/dix/resource.c
xorg-server/exa/exa_accel.c
xorg-server/exa/exa_migration_classic.c
xorg-server/exa/exa_unaccel.c
xorg-server/fb/fb.h
xorg-server/fb/fbcopy.c
xorg-server/fb/fbpixmap.c
xorg-server/glx/dispatch.h
xorg-server/glx/glapi.h
xorg-server/glx/glapi_gentable.c
xorg-server/glx/glapitable.h
xorg-server/glx/glprocs.h
xorg-server/glx/glxcmds.c
xorg-server/glx/glxcmdsswap.c
xorg-server/glx/glxdricommon.c
xorg-server/glx/glxdriswrast.c
xorg-server/glx/glxext.c
xorg-server/glx/indirect_dispatch.c
xorg-server/glx/indirect_dispatch.h
xorg-server/glx/indirect_dispatch_swap.c
xorg-server/glx/indirect_size.h
xorg-server/glx/indirect_size_get.h
xorg-server/glx/indirect_table.c
xorg-server/glx/indirect_util.c
xorg-server/glx/rensize.c
xorg-server/glx/single2swap.c
xorg-server/glx/singlepix.c
xorg-server/glx/singlepixswap.c
xorg-server/glx/singlesize.c
xorg-server/hw/dmx/dmxinit.c
xorg-server/hw/kdrive/ephyr/ephyr.c
xorg-server/hw/kdrive/ephyr/hostx.c
xorg-server/hw/kdrive/ephyr/hostx.h
xorg-server/hw/kdrive/src/kinput.c
xorg-server/hw/xfree86/common/compiler.h
xorg-server/hw/xwin/InitInput.c
xorg-server/hw/xwin/InitOutput.c
xorg-server/hw/xwin/ddraw.h
xorg-server/hw/xwin/glx/glwrap.c
xorg-server/hw/xwin/glx/indirect.c
xorg-server/hw/xwin/glx/wgl_ext_api.h
xorg-server/hw/xwin/glx/winpriv.c
xorg-server/hw/xwin/win.h
xorg-server/hw/xwin/winallpriv.c
xorg-server/hw/xwin/winauth.c
xorg-server/hw/xwin/winclipboard.h
xorg-server/hw/xwin/winclipboardinit.c
xorg-server/hw/xwin/winclipboardthread.c
xorg-server/hw/xwin/winclipboardunicode.c
xorg-server/hw/xwin/winclipboardwndproc.c
xorg-server/hw/xwin/winclipboardwrappers.c
xorg-server/hw/xwin/winclipboardxevents.c
xorg-server/hw/xwin/wincmap.c
xorg-server/hw/xwin/winconfig.c
xorg-server/hw/xwin/wincreatewnd.c
xorg-server/hw/xwin/wincursor.c
xorg-server/hw/xwin/windialogs.c
xorg-server/hw/xwin/winengine.c
xorg-server/hw/xwin/winerror.c
xorg-server/hw/xwin/wingc.c
xorg-server/hw/xwin/wingetsp.c
xorg-server/hw/xwin/winkeybd.c
xorg-server/hw/xwin/winkeybd.h
xorg-server/hw/xwin/winlayouts.h
xorg-server/hw/xwin/winmisc.c
xorg-server/hw/xwin/winmonitors.c
xorg-server/hw/xwin/winmouse.c
xorg-server/hw/xwin/winmsg.c
xorg-server/hw/xwin/winmsg.h
xorg-server/hw/xwin/winmultiwindowclass.c
xorg-server/hw/xwin/winmultiwindowicons.c
xorg-server/hw/xwin/winmultiwindowshape.c
xorg-server/hw/xwin/winmultiwindowwindow.c
xorg-server/hw/xwin/winmultiwindowwm.c
xorg-server/hw/xwin/winmultiwindowwndproc.c
xorg-server/hw/xwin/winnativegdi.c
xorg-server/hw/xwin/winpfbdd.c
xorg-server/hw/xwin/winpixmap.c
xorg-server/hw/xwin/winpolyline.c
xorg-server/hw/xwin/winprefs.c
xorg-server/hw/xwin/winprocarg.c
xorg-server/hw/xwin/winregistry.c
xorg-server/hw/xwin/winscrinit.c
xorg-server/hw/xwin/winsetsp.c
xorg-server/hw/xwin/winshaddd.c
xorg-server/hw/xwin/winshadddnl.c
xorg-server/hw/xwin/winshadgdi.c
xorg-server/hw/xwin/wintrayicon.c
xorg-server/hw/xwin/winwin32rootless.c
xorg-server/hw/xwin/winwin32rootlesswindow.c
xorg-server/hw/xwin/winwin32rootlesswndproc.c
xorg-server/hw/xwin/winwindow.c
xorg-server/hw/xwin/winwindow.h
xorg-server/hw/xwin/winwindowswm.c
xorg-server/hw/xwin/winwndproc.c
xorg-server/include/callback.h
xorg-server/include/dixstruct.h
xorg-server/include/misc.h
xorg-server/include/os.h
xorg-server/include/scrnintstr.h
xorg-server/mi/micmap.c
xorg-server/mi/miinitext.c
xorg-server/mi/mioverlay.c
xorg-server/mi/misprite.c
xorg-server/mi/mivaltree.c
xorg-server/mi/miwindow.c
xorg-server/miext/damage/damage.c
xorg-server/miext/rootless/rootlessGC.c
xorg-server/miext/rootless/rootlessWindow.c
xorg-server/os/WaitFor.c
xorg-server/os/access.c
xorg-server/os/connection.c
xorg-server/os/io.c
xorg-server/os/log.c
xorg-server/os/osinit.c
xorg-server/os/utils.c
xorg-server/os/xdmcp.c
xorg-server/os/xprintf.c
xorg-server/os/xstrans.c
xorg-server/render/mipict.c
xorg-server/xkb/xkbActions.c
xorg-server/xkb/xkbInit.c
xorg-server/xkeyboard-config/compat/default.in
Diffstat (limited to 'xorg-server/hw/xfree86/common/xf86Bus.c')
-rw-r--r-- | xorg-server/hw/xfree86/common/xf86Bus.c | 296 |
1 files changed, 153 insertions, 143 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86Bus.c b/xorg-server/hw/xfree86/common/xf86Bus.c index c665a2019..b176e8cc4 100644 --- a/xorg-server/hw/xfree86/common/xf86Bus.c +++ b/xorg-server/hw/xfree86/common/xf86Bus.c @@ -51,11 +51,11 @@ #include "xf86VGAarbiter.h" #endif /* Entity data */ -EntityPtr *xf86Entities = NULL; /* Bus slots claimed by drivers */ +EntityPtr *xf86Entities = NULL; /* Bus slots claimed by drivers */ int xf86NumEntities = 0; static int xf86EntityPrivateCount = 0; -BusRec primaryBus = { BUS_NONE, { 0 } }; +BusRec primaryBus = { BUS_NONE, {0} }; /** * Call the driver's correct probe function. @@ -73,9 +73,10 @@ BusRec primaryBus = { BUS_NONE, { 0 } }; * returned. Otherwise, \c FALSE is returned. */ Bool -xf86CallDriverProbe( DriverPtr drv, Bool detect_only ) +xf86CallDriverProbe(DriverPtr drv, Bool detect_only) { - Bool foundScreen = FALSE; + Bool foundScreen = FALSE; + #ifdef XSERVER_LIBPCIACCESS if (drv->PciProbe != NULL) { if (xf86DoConfigure && xf86DoConfigurePass1) { @@ -83,16 +84,16 @@ xf86CallDriverProbe( DriverPtr drv, Bool detect_only ) foundScreen = xf86PciAddMatchingDev(drv); } else { - assert(! detect_only); + assert(!detect_only); foundScreen = xf86PciProbeDev(drv); } } #endif if (!foundScreen && (drv->Probe != NULL)) { - xf86Msg( X_WARNING, "Falling back to old probe method for %s\n", - drv->driverName); - foundScreen = (*drv->Probe)(drv, (detect_only) ? PROBE_DETECT - : PROBE_DEFAULT); + xf86Msg(X_WARNING, "Falling back to old probe method for %s\n", + drv->driverName); + foundScreen = (*drv->Probe) (drv, (detect_only) ? PROBE_DETECT + : PROBE_DEFAULT); } return foundScreen; @@ -119,13 +120,14 @@ xf86BusConfig(void) */ for (i = 0; i < xf86NumDrivers; i++) { xorgHWFlags flags; + if (!xorgHWAccess) { if (!xf86DriverList[i]->driverFunc - || !xf86DriverList[i]->driverFunc(NULL, - GET_REQUIRED_HW_INTERFACES, - &flags) - || NEED_IO_ENABLED(flags)) - continue; + || !xf86DriverList[i]->driverFunc(NULL, + GET_REQUIRED_HW_INTERFACES, + &flags) + || NEED_IO_ENABLED(flags)) + continue; } xf86CallDriverProbe(xf86DriverList[i], FALSE); @@ -155,11 +157,13 @@ xf86BusConfig(void) for (layout = xf86ConfigLayout.screens; layout->screen != NULL; layout++) { Bool found = FALSE; + for (j = 0; j < xf86Screens[i]->numEntities; j++) { - GDevPtr dev = xf86GetDevFromEntity( - xf86Screens[i]->entityList[j], - xf86Screens[i]->entityInstanceList[j]); + GDevPtr dev = + xf86GetDevFromEntity(xf86Screens[i]->entityList[j], + xf86Screens[i]->entityInstanceList[j]); + if (dev == layout->screen->device) { /* A match has been found */ xf86Screens[i]->confScreen = layout->screen; @@ -167,12 +171,14 @@ xf86BusConfig(void) break; } } - if (found) break; + if (found) + break; } if (layout->screen == NULL) { /* No match found */ xf86Msg(X_ERROR, - "Screen %d deleted because of no matching config section.\n", i); + "Screen %d deleted because of no matching config section.\n", + i); xf86DeleteScreen(i--, 0); } } @@ -180,7 +186,7 @@ xf86BusConfig(void) /* If no screens left, return now. */ if (xf86NumScreens == 0) { xf86Msg(X_ERROR, - "Device(s) detected, but none match those in the config file.\n"); + "Device(s) detected, but none match those in the config file.\n"); return FALSE; } @@ -210,31 +216,31 @@ xf86BusProbe(void) */ BusType -StringToBusType(const char* busID, const char **retID) +StringToBusType(const char *busID, const char **retID) { char *p, *s; BusType ret = BUS_NONE; /* If no type field, Default to PCI */ if (isdigit(busID[0])) { - if (retID) - *retID = busID; - return BUS_PCI; + if (retID) + *retID = busID; + return BUS_PCI; } s = xstrdup(busID); p = strtok(s, ":"); if (p == NULL || *p == 0) { - free(s); - return BUS_NONE; + free(s); + return BUS_NONE; } if (!xf86NameCmp(p, "pci") || !xf86NameCmp(p, "agp")) - ret = BUS_PCI; + ret = BUS_PCI; if (!xf86NameCmp(p, "sbus")) - ret = BUS_SBUS; + ret = BUS_SBUS; if (ret != BUS_NONE) - if (retID) - *retID = busID + strlen(p) + 1; + if (retID) + *retID = busID + strlen(p) + 1; free(s); return ret; } @@ -244,10 +250,10 @@ xf86AllocateEntity(void) { xf86NumEntities++; xf86Entities = xnfrealloc(xf86Entities, - sizeof(EntityPtr) * xf86NumEntities); - xf86Entities[xf86NumEntities - 1] = xnfcalloc(1,sizeof(EntityRec)); + sizeof(EntityPtr) * xf86NumEntities); + xf86Entities[xf86NumEntities - 1] = xnfcalloc(1, sizeof(EntityRec)); xf86Entities[xf86NumEntities - 1]->entityPrivates = - xnfcalloc(sizeof(DevUnion) * xf86EntityPrivateCount, 1); + xnfcalloc(sizeof(DevUnion) * xf86EntityPrivateCount, 1); return xf86NumEntities - 1; } @@ -255,25 +261,26 @@ Bool xf86IsEntityPrimary(int entityIndex) { EntityPtr pEnt = xf86Entities[entityIndex]; - - if (primaryBus.type != pEnt->bus.type) return FALSE; + + if (primaryBus.type != pEnt->bus.type) + return FALSE; switch (pEnt->bus.type) { case BUS_PCI: - return pEnt->bus.id.pci == primaryBus.id.pci; + return pEnt->bus.id.pci == primaryBus.id.pci; case BUS_SBUS: - return pEnt->bus.id.sbus.fbNum == primaryBus.id.sbus.fbNum; + return pEnt->bus.id.sbus.fbNum == primaryBus.id.sbus.fbNum; default: - return FALSE; + return FALSE; } } - + Bool xf86SetEntityFuncs(int entityIndex, EntityProc init, EntityProc enter, - EntityProc leave, pointer private) + EntityProc leave, pointer private) { if (entityIndex >= xf86NumEntities) - return FALSE; + return FALSE; xf86Entities[entityIndex]->entityInit = init; xf86Entities[entityIndex]->entityEnter = enter; xf86Entities[entityIndex]->entityLeave = leave; @@ -285,9 +292,10 @@ Bool xf86DriverHasEntities(DriverPtr drvp) { int i; + for (i = 0; i < xf86NumEntities; i++) { - if (xf86Entities[i]->driver == drvp) - return TRUE; + if (xf86Entities[i]->driver == drvp) + return TRUE; } return FALSE; } @@ -296,20 +304,20 @@ void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex) { if (entityIndex == -1) - return; + return; if (xf86Entities[entityIndex]->inUse && - !(xf86Entities[entityIndex]->entityProp & IS_SHARED_ACCEL)) { - ErrorF("Requested Entity already in use!\n"); - return; + !(xf86Entities[entityIndex]->entityProp & IS_SHARED_ACCEL)) { + ErrorF("Requested Entity already in use!\n"); + return; } pScrn->numEntities++; pScrn->entityList = xnfrealloc(pScrn->entityList, - pScrn->numEntities * sizeof(int)); + pScrn->numEntities * sizeof(int)); pScrn->entityList[pScrn->numEntities - 1] = entityIndex; xf86Entities[entityIndex]->inUse = TRUE; pScrn->entityInstanceList = xnfrealloc(pScrn->entityInstanceList, - pScrn->numEntities * sizeof(int)); + pScrn->numEntities * sizeof(int)); pScrn->entityInstanceList[pScrn->numEntities - 1] = 0; } @@ -319,13 +327,13 @@ xf86SetEntityInstanceForScreen(ScrnInfoPtr pScrn, int entityIndex, int instance) int i; if (entityIndex == -1 || entityIndex >= xf86NumEntities) - return; + return; for (i = 0; i < pScrn->numEntities; i++) { - if (pScrn->entityList[i] == entityIndex) { - pScrn->entityInstanceList[i] = instance; - break; - } + if (pScrn->entityList[i] == entityIndex) { + pScrn->entityInstanceList[i] = instance; + break; + } } } @@ -336,17 +344,18 @@ xf86SetEntityInstanceForScreen(ScrnInfoPtr pScrn, int entityIndex, int instance) ScrnInfoPtr xf86FindScreenForEntity(int entityIndex) { - int i,j; + int i, j; + + if (entityIndex == -1) + return NULL; - if (entityIndex == -1) return NULL; - if (xf86Screens) { - for (i = 0; i < xf86NumScreens; i++) { - for (j = 0; j < xf86Screens[i]->numEntities; j++) { - if ( xf86Screens[i]->entityList[j] == entityIndex ) - return xf86Screens[i]; - } - } + for (i = 0; i < xf86NumScreens; i++) { + for (j = 0; j < xf86Screens[i]->numEntities; j++) { + if (xf86Screens[i]->entityList[j] == entityIndex) + return xf86Screens[i]; + } + } } return NULL; } @@ -355,15 +364,15 @@ void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex) { int i; - + for (i = 0; i < pScrn->numEntities; i++) { - if (pScrn->entityList[i] == entityIndex) { - for (i++; i < pScrn->numEntities; i++) - pScrn->entityList[i-1] = pScrn->entityList[i]; - pScrn->numEntities--; - xf86Entities[entityIndex]->inUse = FALSE; - break; - } + if (pScrn->entityList[i] == entityIndex) { + for (i++; i < pScrn->numEntities; i++) + pScrn->entityList[i - 1] = pScrn->entityList[i]; + pScrn->numEntities--; + xf86Entities[entityIndex]->inUse = FALSE; + break; + } } } @@ -376,13 +385,14 @@ xf86ClearEntityListForScreen(int scrnIndex) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; int i, entityIndex; - - if (pScrn->entityList == NULL || pScrn->numEntities == 0) return; - + + if (pScrn->entityList == NULL || pScrn->numEntities == 0) + return; + for (i = 0; i < pScrn->numEntities; i++) { - entityIndex = pScrn->entityList[i]; - xf86Entities[entityIndex]->inUse = FALSE; - /* disable resource: call the disable function */ + entityIndex = pScrn->entityList[i]; + xf86Entities[entityIndex]->inUse = FALSE; + /* disable resource: call the disable function */ } free(pScrn->entityList); free(pScrn->entityInstanceList); @@ -398,14 +408,14 @@ void xf86AddDevToEntity(int entityIndex, GDevPtr dev) { EntityPtr pEnt; - + if (entityIndex >= xf86NumEntities) - return; - + return; + pEnt = xf86Entities[entityIndex]; pEnt->numInstances++; pEnt->devices = xnfrealloc(pEnt->devices, - pEnt->numInstances * sizeof(GDevPtr)); + pEnt->numInstances * sizeof(GDevPtr)); pEnt->devices[pEnt->numInstances - 1] = dev; dev->claimed = TRUE; } @@ -420,28 +430,29 @@ xf86GetEntityInfo(int entityIndex) { EntityInfoPtr pEnt; int i; - + if (entityIndex == -1) - return NULL; + return NULL; if (entityIndex >= xf86NumEntities) - return NULL; - - pEnt = xnfcalloc(1,sizeof(EntityInfoRec)); + return NULL; + + pEnt = xnfcalloc(1, sizeof(EntityInfoRec)); pEnt->index = entityIndex; pEnt->location = xf86Entities[entityIndex]->bus; pEnt->active = xf86Entities[entityIndex]->active; pEnt->chipset = xf86Entities[entityIndex]->chipset; pEnt->driver = xf86Entities[entityIndex]->driver; - if ( (xf86Entities[entityIndex]->devices) && - (xf86Entities[entityIndex]->devices[0]) ) { - for (i = 0; i < xf86Entities[entityIndex]->numInstances; i++) - if (xf86Entities[entityIndex]->devices[i]->screen == 0) - break; - pEnt->device = xf86Entities[entityIndex]->devices[i]; - } else - pEnt->device = NULL; - + if ((xf86Entities[entityIndex]->devices) && + (xf86Entities[entityIndex]->devices[0])) { + for (i = 0; i < xf86Entities[entityIndex]->numInstances; i++) + if (xf86Entities[entityIndex]->devices[i]->screen == 0) + break; + pEnt->device = xf86Entities[entityIndex]->devices[i]; + } + else + pEnt->device = NULL; + return pEnt; } @@ -449,8 +460,8 @@ int xf86GetNumEntityInstances(int entityIndex) { if (entityIndex >= xf86NumEntities) - return -1; - + return -1; + return xf86Entities[entityIndex]->numInstances; } @@ -458,19 +469,19 @@ GDevPtr xf86GetDevFromEntity(int entityIndex, int instance) { int i; - + /* We might not use AddDevtoEntity */ - if ( (!xf86Entities[entityIndex]->devices) || - (!xf86Entities[entityIndex]->devices[0]) ) - return NULL; + if ((!xf86Entities[entityIndex]->devices) || + (!xf86Entities[entityIndex]->devices[0])) + return NULL; if (entityIndex >= xf86NumEntities || - instance >= xf86Entities[entityIndex]->numInstances) - return NULL; - + instance >= xf86Entities[entityIndex]->numInstances) + return NULL; + for (i = 0; i < xf86Entities[entityIndex]->numInstances; i++) - if (xf86Entities[entityIndex]->devices[i]->screen == instance) - break; + if (xf86Entities[entityIndex]->devices[i]->screen == instance) + break; return xf86Entities[entityIndex]->devices[i]; } @@ -485,7 +496,7 @@ xf86AccessEnter(void) for (i = 0; i < xf86NumEntities; i++) if (xf86Entities[i]->entityEnter) - xf86Entities[i]->entityEnter(i,xf86Entities[i]->private); + xf86Entities[i]->entityEnter(i, xf86Entities[i]->private); } void @@ -495,7 +506,7 @@ xf86AccessLeave(void) for (i = 0; i < xf86NumEntities; i++) if (xf86Entities[i]->entityLeave) - xf86Entities[i]->entityLeave(i,xf86Entities[i]->private); + xf86Entities[i]->entityLeave(i, xf86Entities[i]->private); } /* @@ -509,28 +520,29 @@ xf86PostProbe(void) if (fbSlotClaimed && ( #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) - sbusSlotClaimed || + sbusSlotClaimed || #endif #ifdef XSERVER_LIBPCIACCESS - pciSlotClaimed + pciSlotClaimed #else - TRUE + TRUE #endif - )) - FatalError("Cannot run in framebuffer mode. Please specify busIDs " - " for all framebuffer devices\n"); + )) + FatalError("Cannot run in framebuffer mode. Please specify busIDs " + " for all framebuffer devices\n"); for (i = 0; i < xf86NumEntities; i++) if (xf86Entities[i]->entityInit) - xf86Entities[i]->entityInit(i,xf86Entities[i]->private); + xf86Entities[i]->entityInit(i, xf86Entities[i]->private); } int xf86GetLastScrnFlag(int entityIndex) { - if(entityIndex < xf86NumEntities) { + if (entityIndex < xf86NumEntities) { return xf86Entities[entityIndex]->lastScrnFlag; - } else { + } + else { return -1; } } @@ -538,7 +550,7 @@ xf86GetLastScrnFlag(int entityIndex) void xf86SetLastScrnFlag(int entityIndex, int scrnIndex) { - if(entityIndex < xf86NumEntities) { + if (entityIndex < xf86NumEntities) { xf86Entities[entityIndex]->lastScrnFlag = scrnIndex; } } @@ -546,10 +558,10 @@ xf86SetLastScrnFlag(int entityIndex, int scrnIndex) Bool xf86IsEntityShared(int entityIndex) { - if(entityIndex < xf86NumEntities) { - if(xf86Entities[entityIndex]->entityProp & IS_SHARED_ACCEL) { - return TRUE; - } + if (entityIndex < xf86NumEntities) { + if (xf86Entities[entityIndex]->entityProp & IS_SHARED_ACCEL) { + return TRUE; + } } return FALSE; } @@ -557,7 +569,7 @@ xf86IsEntityShared(int entityIndex) void xf86SetEntityShared(int entityIndex) { - if(entityIndex < xf86NumEntities) { + if (entityIndex < xf86NumEntities) { xf86Entities[entityIndex]->entityProp |= IS_SHARED_ACCEL; } } @@ -565,10 +577,10 @@ xf86SetEntityShared(int entityIndex) Bool xf86IsEntitySharable(int entityIndex) { - if(entityIndex < xf86NumEntities) { - if(xf86Entities[entityIndex]->entityProp & ACCEL_IS_SHARABLE) { - return TRUE; - } + if (entityIndex < xf86NumEntities) { + if (xf86Entities[entityIndex]->entityProp & ACCEL_IS_SHARABLE) { + return TRUE; + } } return FALSE; } @@ -576,7 +588,7 @@ xf86IsEntitySharable(int entityIndex) void xf86SetEntitySharable(int entityIndex) { - if(entityIndex < xf86NumEntities) { + if (entityIndex < xf86NumEntities) { xf86Entities[entityIndex]->entityProp |= ACCEL_IS_SHARABLE; } } @@ -584,10 +596,10 @@ xf86SetEntitySharable(int entityIndex) Bool xf86IsPrimInitDone(int entityIndex) { - if(entityIndex < xf86NumEntities) { - if(xf86Entities[entityIndex]->entityProp & SA_PRIM_INIT_DONE) { - return TRUE; - } + if (entityIndex < xf86NumEntities) { + if (xf86Entities[entityIndex]->entityProp & SA_PRIM_INIT_DONE) { + return TRUE; + } } return FALSE; } @@ -595,7 +607,7 @@ xf86IsPrimInitDone(int entityIndex) void xf86SetPrimInitDone(int entityIndex) { - if(entityIndex < xf86NumEntities) { + if (entityIndex < xf86NumEntities) { xf86Entities[entityIndex]->entityProp |= SA_PRIM_INIT_DONE; } } @@ -603,12 +615,11 @@ xf86SetPrimInitDone(int entityIndex) void xf86ClearPrimInitDone(int entityIndex) { - if(entityIndex < xf86NumEntities) { + if (entityIndex < xf86NumEntities) { xf86Entities[entityIndex]->entityProp &= ~SA_PRIM_INIT_DONE; } } - /* * Allocate a private in the entities. */ @@ -622,12 +633,12 @@ xf86AllocateEntityPrivateIndex(void) idx = xf86EntityPrivateCount++; for (i = 0; i < xf86NumEntities; i++) { - pEnt = xf86Entities[i]; - nprivs = xnfrealloc(pEnt->entityPrivates, - xf86EntityPrivateCount * sizeof(DevUnion)); - /* Zero the new private */ - memset(&nprivs[idx], 0, sizeof(DevUnion)); - pEnt->entityPrivates = nprivs; + pEnt = xf86Entities[i]; + nprivs = xnfrealloc(pEnt->entityPrivates, + xf86EntityPrivateCount * sizeof(DevUnion)); + /* Zero the new private */ + memset(&nprivs[idx], 0, sizeof(DevUnion)); + pEnt->entityPrivates = nprivs; } return idx; } @@ -636,8 +647,7 @@ DevUnion * xf86GetEntityPrivate(int entityIndex, int privIndex) { if (entityIndex >= xf86NumEntities || privIndex >= xf86EntityPrivateCount) - return NULL; + return NULL; return &(xf86Entities[entityIndex]->entityPrivates[privIndex]); } - |