xfree86: Remove superfluous ifdef DEBUG checks.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2009-05-09 10:33:20 +10:00
parent 9c5b761c8c
commit e3f296d91d
22 changed files with 118 additions and 301 deletions

View File

@ -639,9 +639,7 @@ xf86EnableAccess(ScrnInfoPtr pScrn)
register xf86AccessPtr pAcc; register xf86AccessPtr pAcc;
EntityAccessPtr tmp; EntityAccessPtr tmp;
#ifdef DEBUG DebugF("Enable access %i\n",pScrn->scrnIndex);
ErrorF("Enable access %i\n",pScrn->scrnIndex);
#endif
/* Entity is not under access control or currently enabled */ /* Entity is not under access control or currently enabled */
if (!pScrn->access) { if (!pScrn->access) {
@ -844,10 +842,8 @@ checkConflictBlock(resRange *range, resPtr pRes)
case ResBlock: case ResBlock:
if (range->rBegin < pRes->block_end && if (range->rBegin < pRes->block_end &&
range->rEnd > pRes->block_begin) { range->rEnd > pRes->block_begin) {
#ifdef DEBUG DebugF("b-b conflict w: %lx %lx\n",
ErrorF("b-b conflict w: %lx %lx\n",
pRes->block_begin,pRes->block_end); pRes->block_begin,pRes->block_end);
#endif
return pRes->block_end < range->rEnd ? return pRes->block_end < range->rEnd ?
pRes->block_end : range->rEnd; pRes->block_end : range->rEnd;
} }
@ -856,12 +852,10 @@ checkConflictBlock(resRange *range, resPtr pRes)
if (pRes->sparse_base > range->rEnd) return 0; if (pRes->sparse_base > range->rEnd) return 0;
val = (~pRes->sparse_mask | pRes->sparse_base) & getMask(range->rEnd); val = (~pRes->sparse_mask | pRes->sparse_base) & getMask(range->rEnd);
#ifdef DEBUG DebugF("base = 0x%lx, mask = 0x%lx, begin = 0x%lx, end = 0x%lx ,"
ErrorF("base = 0x%lx, mask = 0x%lx, begin = 0x%lx, end = 0x%lx ,"
"val = 0x%lx\n", "val = 0x%lx\n",
pRes->sparse_base, pRes->sparse_mask, range->rBegin, pRes->sparse_base, pRes->sparse_mask, range->rBegin,
range->rEnd, val); range->rEnd, val);
#endif
i = sizeof(memType) * 8; i = sizeof(memType) * 8;
tmp = prev = pRes->sparse_base; tmp = prev = pRes->sparse_base;
@ -873,11 +867,9 @@ checkConflictBlock(resRange *range, resPtr pRes)
prev = tmp; prev = tmp;
} }
if (tmp >= range->rBegin) { if (tmp >= range->rBegin) {
#ifdef DEBUG DebugF("conflict found at: 0x%lx\n",tmp);
ErrorF("conflict found at: 0x%lx\n",tmp); DebugF("b-d conflict w: %lx %lx\n",
ErrorF("b-d conflict w: %lx %lx\n",
pRes->sparse_base,pRes->sparse_mask); pRes->sparse_base,pRes->sparse_mask);
#endif
return tmp; return tmp;
} }
else else
@ -902,10 +894,8 @@ checkConflictSparse(resRange *range, resPtr pRes)
case ResSparse: case ResSparse:
tmp = pRes->sparse_mask & range->rMask; tmp = pRes->sparse_mask & range->rMask;
if ((tmp & pRes->sparse_base) == (tmp & range->rBase)) { if ((tmp & pRes->sparse_base) == (tmp & range->rBase)) {
#ifdef DEBUG DebugF("s-b conflict w: %lx %lx\n",
ErrorF("s-b conflict w: %lx %lx\n",
pRes->sparse_base,pRes->sparse_mask); pRes->sparse_base,pRes->sparse_mask);
#endif
return pRes->sparse_mask; return pRes->sparse_mask;
} }
return 0; return 0;
@ -918,9 +908,7 @@ checkConflictSparse(resRange *range, resPtr pRes)
tmp = prev = range->rBase; tmp = prev = range->rBase;
while (i) { while (i) {
#ifdef DEBUG DebugF("tmp = 0x%lx\n",tmp);
ErrorF("tmp = 0x%lx\n",tmp);
#endif
tmp |= 1<< (--i) & val; tmp |= 1<< (--i) & val;
if (tmp > pRes->block_end) if (tmp > pRes->block_end)
tmp = prev; tmp = prev;
@ -947,11 +935,9 @@ checkConflictSparse(resRange *range, resPtr pRes)
m_mask = mask > m_mask ? mask : m_mask; m_mask = mask > m_mask ? mask : m_mask;
base = base + mask + 1; base = base + mask + 1;
} }
#ifdef DEBUG DebugF("conflict found at: 0x%lx\n",tmp);
ErrorF("conflict found at: 0x%lx\n",tmp); DebugF("b-b conflict w: %lx %lx\n",
ErrorF("b-b conflict w: %lx %lx\n",
pRes->block_begin,pRes->block_end); pRes->block_begin,pRes->block_end);
#endif
return ~m_mask; return ~m_mask;
} }
} }
@ -1557,12 +1543,10 @@ xf86EnterServerState(xf86State state)
* We take care not to call xf86BlockSIGIO() twice. * We take care not to call xf86BlockSIGIO() twice.
*/ */
SetSIGIOForState(state); SetSIGIOForState(state);
#ifdef DEBUG
if (state == SETUP) if (state == SETUP)
ErrorF("Entering SETUP state\n"); DebugF("Entering SETUP state\n");
else else
ErrorF("Entering OPERATING state\n"); DebugF("Entering OPERATING state\n");
#endif
/* When servicing a dumb framebuffer we don't need to do anything */ /* When servicing a dumb framebuffer we don't need to do anything */
if (doFramebufferMode) return; if (doFramebufferMode) return;
@ -1620,10 +1604,8 @@ xf86EnterServerState(xf86State state)
xf86Screens[i]->busAccess = NULL; xf86Screens[i]->busAccess = NULL;
} }
#ifdef DEBUG
if (xf86Screens[i]->busAccess) if (xf86Screens[i]->busAccess)
ErrorF("Screen %i setting vga route\n",i); DebugF("Screen %i setting vga route\n",i);
#endif
switch (rt) { switch (rt) {
case MEM_IO: case MEM_IO:
xf86MsgVerb(X_INFO, 3, "Screen %i shares mem & io resources\n",i); xf86MsgVerb(X_INFO, 3, "Screen %i shares mem & io resources\n",i);
@ -1967,9 +1949,7 @@ xf86PostScreenInit(void)
return; return;
} }
#ifdef DEBUG DebugF("PostScreenInit generation: %i\n",serverGeneration);
ErrorF("PostScreenInit generation: %i\n",serverGeneration);
#endif
if (serverGeneration == 1) { if (serverGeneration == 1) {
checkRoutingForScreens(OPERATING); checkRoutingForScreens(OPERATING);
for (i=0; i<xf86NumEntities; i++) { for (i=0; i<xf86NumEntities; i++) {

View File

@ -1519,10 +1519,8 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
adjp = (XF86ConfAdjacencyPtr)adjp->list.next; adjp = (XF86ConfAdjacencyPtr)adjp->list.next;
} }
#ifdef DEBUG DebugF("Found %d screens in the layout section %s",
ErrorF("Found %d screens in the layout section %s",
count, conf_layout->lay_identifier); count, conf_layout->lay_identifier);
#endif
if (!count) /* alloc enough storage even if no screen is specified */ if (!count) /* alloc enough storage even if no screen is specified */
count = 1; count = 1;
@ -1679,10 +1677,8 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
count++; count++;
idp = (XF86ConfInactivePtr)idp->list.next; idp = (XF86ConfInactivePtr)idp->list.next;
} }
#ifdef DEBUG DebugF("Found %d inactive devices in the layout section %s\n",
ErrorF("Found %d inactive devices in the layout section %s\n",
count, conf_layout->lay_identifier); count, conf_layout->lay_identifier);
#endif
gdp = xnfalloc((count + 1) * sizeof(GDevRec)); gdp = xnfalloc((count + 1) * sizeof(GDevRec));
gdp[count].identifier = NULL; gdp[count].identifier = NULL;
idp = conf_layout->lay_inactive_lst; idp = conf_layout->lay_inactive_lst;
@ -1704,10 +1700,8 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
count++; count++;
irp = (XF86ConfInputrefPtr)irp->list.next; irp = (XF86ConfInputrefPtr)irp->list.next;
} }
#ifdef DEBUG DebugF("Found %d input devices in the layout section %s\n",
ErrorF("Found %d input devices in the layout section %s\n",
count, conf_layout->lay_identifier); count, conf_layout->lay_identifier);
#endif
indp = xnfcalloc((count + 1), sizeof(IDevPtr)); indp = xnfcalloc((count + 1), sizeof(IDevPtr));
indp[count] = NULL; indp[count] = NULL;
irp = conf_layout->lay_input_lst; irp = conf_layout->lay_input_lst;

View File

@ -183,9 +183,7 @@ ProcessInputEvents (void)
void void
xf86ProcessActionEvent(ActionEvent action, void *arg) xf86ProcessActionEvent(ActionEvent action, void *arg)
{ {
#ifdef DEBUG DebugF("ProcessActionEvent(%d,%x)\n", (int) action, arg);
ErrorF("ProcessActionEvent(%d,%x)\n", (int) action, arg);
#endif
switch (action) { switch (action) {
case ACTION_TERMINATE: case ACTION_TERMINATE:
if (!xf86Info.dontZap) { if (!xf86Info.dontZap) {
@ -429,9 +427,7 @@ xf86VTSwitch(void)
InputInfoPtr pInfo; InputInfoPtr pInfo;
IHPtr ih; IHPtr ih;
#ifdef DEBUG DebugF("xf86VTSwitch()\n");
ErrorF("xf86VTSwitch()\n");
#endif
#ifdef XFreeXDGA #ifdef XFreeXDGA
if(!DGAVTSwitch()) if(!DGAVTSwitch())
@ -444,10 +440,8 @@ xf86VTSwitch(void)
*/ */
if (xf86Screens[0]->vtSema) { if (xf86Screens[0]->vtSema) {
#ifdef DEBUG DebugF("xf86VTSwitch: Leaving, xf86Exiting is %s\n",
ErrorF("xf86VTSwitch: Leaving, xf86Exiting is %s\n",
BOOLTOSTRING((dispatchException & DE_TERMINATE) ? TRUE : FALSE)); BOOLTOSTRING((dispatchException & DE_TERMINATE) ? TRUE : FALSE));
#endif
#ifdef DPMSExtension #ifdef DPMSExtension
if (DPMSPowerLevel != DPMSModeOn) if (DPMSPowerLevel != DPMSModeOn)
DPMSSet(serverClient, DPMSModeOn); DPMSSet(serverClient, DPMSModeOn);
@ -483,9 +477,7 @@ xf86VTSwitch(void)
* switch failed * switch failed
*/ */
#ifdef DEBUG DebugF("xf86VTSwitch: Leave failed\n");
ErrorF("xf86VTSwitch: Leave failed\n");
#endif
prevSIGIO = xf86BlockSIGIO(); prevSIGIO = xf86BlockSIGIO();
xf86AccessEnter(); xf86AccessEnter();
xf86EnterServerState(SETUP); xf86EnterServerState(SETUP);
@ -534,9 +526,7 @@ xf86VTSwitch(void)
} }
} else { } else {
#ifdef DEBUG DebugF("xf86VTSwitch: Entering\n");
ErrorF("xf86VTSwitch: Entering\n");
#endif
if (!xf86VTSwitchTo()) return; if (!xf86VTSwitchTo()) return;
prevSIGIO = xf86BlockSIGIO(); prevSIGIO = xf86BlockSIGIO();

View File

@ -212,15 +212,13 @@ xf86AllocateScreen(DriverPtr drv, int flags)
xf86Screens[i]->CurrentAccess = &xf86CurrentAccess; xf86Screens[i]->CurrentAccess = &xf86CurrentAccess;
xf86Screens[i]->resourceType = MEM_IO; xf86Screens[i]->resourceType = MEM_IO;
#ifdef DEBUG
/* OOps -- What's this ? */ /* OOps -- What's this ? */
ErrorF("xf86AllocateScreen - xf86Screens[%d]->pScreen = %p\n", DebugF("xf86AllocateScreen - xf86Screens[%d]->pScreen = %p\n",
i, xf86Screens[i]->pScreen ); i, xf86Screens[i]->pScreen );
if ( NULL != xf86Screens[i]->pScreen ) { if ( NULL != xf86Screens[i]->pScreen ) {
ErrorF("xf86Screens[%d]->pScreen->CreateWindow = %p\n", DebugF("xf86Screens[%d]->pScreen->CreateWindow = %p\n",
i, xf86Screens[i]->pScreen->CreateWindow ); i, xf86Screens[i]->pScreen->CreateWindow );
} }
#endif
xf86Screens[i]->DriverFunc = drv->driverFunc; xf86Screens[i]->DriverFunc = drv->driverFunc;
@ -1735,9 +1733,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
} }
#ifdef DEBUG DebugF("%s instances found: %d\n", driverName, allocatedInstances);
ErrorF("%s instances found: %d\n", driverName, allocatedInstances);
#endif
/* /*
* Check for devices that need duplicated instances. This is required * Check for devices that need duplicated instances. This is required
@ -1820,9 +1816,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
instances[i].dev = dev; instances[i].dev = dev;
} }
} }
#ifdef DEBUG DebugF("%s instances found: %d\n", driverName, numClaimedInstances);
ErrorF("%s instances found: %d\n", driverName, numClaimedInstances);
#endif
/* /*
* Now check that a chipset or chipID override in the device section * Now check that a chipset or chipID override in the device section
* is valid. Chipset has precedence over chipID. * is valid. Chipset has precedence over chipID.
@ -1926,11 +1920,9 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
if (instances[i].screen == 0 && !xf86CheckPciSlot( pPci )) if (instances[i].screen == 0 && !xf86CheckPciSlot( pPci ))
continue; continue;
#ifdef DEBUG DebugF("%s: card at %d:%d:%d is claimed by a Device section\n",
ErrorF("%s: card at %d:%d:%d is claimed by a Device section\n",
driverName, pPci->bus, pPci->dev, pPci->func); driverName, pPci->bus, pPci->dev, pPci->func);
#endif
/* Allocate an entry in the lists to be returned */ /* Allocate an entry in the lists to be returned */
numFound++; numFound++;
retEntities = xnfrealloc(retEntities, numFound * sizeof(int)); retEntities = xnfrealloc(retEntities, numFound * sizeof(int));
@ -2621,10 +2613,8 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
int i; int i;
Bool existing = FALSE; Bool existing = FALSE;
#ifdef DEBUG DebugF("xf86RegisterRootWindowProperty(%d, %ld, %ld, %d, %ld, %p)\n",
ErrorF("xf86RegisterRootWindowProperty(%d, %ld, %ld, %d, %ld, %p)\n",
ScrnIndex, property, type, format, len, value); ScrnIndex, property, type, format, len, value);
#endif
if (ScrnIndex<0 || ScrnIndex>=xf86NumScreens) { if (ScrnIndex<0 || ScrnIndex>=xf86NumScreens) {
return(BadMatch); return(BadMatch);
@ -2660,15 +2650,11 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
pNewProp->size = len; pNewProp->size = len;
pNewProp->data = value; pNewProp->data = value;
#ifdef DEBUG DebugF("new property filled\n");
ErrorF("new property filled\n");
#endif
if (NULL==xf86RegisteredPropertiesTable) { if (NULL==xf86RegisteredPropertiesTable) {
#ifdef DEBUG DebugF("creating xf86RegisteredPropertiesTable[] size %d\n",
ErrorF("creating xf86RegisteredPropertiesTable[] size %d\n",
xf86NumScreens); xf86NumScreens);
#endif
if ( NULL==(xf86RegisteredPropertiesTable=(RootWinPropPtr*)xnfcalloc(sizeof(RootWinProp),xf86NumScreens) )) { if ( NULL==(xf86RegisteredPropertiesTable=(RootWinPropPtr*)xnfcalloc(sizeof(RootWinProp),xf86NumScreens) )) {
return(BadAlloc); return(BadAlloc);
} }
@ -2677,12 +2663,10 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
} }
} }
#ifdef DEBUG DebugF("xf86RegisteredPropertiesTable %p\n",
ErrorF("xf86RegisteredPropertiesTable %p\n",
(void *)xf86RegisteredPropertiesTable); (void *)xf86RegisteredPropertiesTable);
ErrorF("xf86RegisteredPropertiesTable[%d] %p\n", DebugF("xf86RegisteredPropertiesTable[%d] %p\n",
ScrnIndex, (void *)xf86RegisteredPropertiesTable[ScrnIndex]); ScrnIndex, (void *)xf86RegisteredPropertiesTable[ScrnIndex]);
#endif
if (!existing) { if (!existing) {
if ( xf86RegisteredPropertiesTable[ScrnIndex] == NULL) { if ( xf86RegisteredPropertiesTable[ScrnIndex] == NULL) {
@ -2690,17 +2674,13 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
} else { } else {
pRegProp = xf86RegisteredPropertiesTable[ScrnIndex]; pRegProp = xf86RegisteredPropertiesTable[ScrnIndex];
while (pRegProp->next != NULL) { while (pRegProp->next != NULL) {
#ifdef DEBUG DebugF("- next %p\n", (void *)pRegProp);
ErrorF("- next %p\n", (void *)pRegProp);
#endif
pRegProp = pRegProp->next; pRegProp = pRegProp->next;
} }
pRegProp->next = pNewProp; pRegProp->next = pNewProp;
} }
} }
#ifdef DEBUG DebugF("xf86RegisterRootWindowProperty succeeded\n");
ErrorF("xf86RegisterRootWindowProperty succeeded\n");
#endif
return(Success); return(Success);
} }

View File

@ -316,9 +316,7 @@ xf86CreateRootWindow(WindowPtr pWin)
CreateWindowProcPtr CreateWindow = (CreateWindowProcPtr) CreateWindowProcPtr CreateWindow = (CreateWindowProcPtr)
dixLookupPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey); dixLookupPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey);
#ifdef DEBUG DebugF("xf86CreateRootWindow(%p)\n", pWin);
ErrorF("xf86CreateRootWindow(%p)\n", pWin);
#endif
if ( pScreen->CreateWindow != xf86CreateRootWindow ) { if ( pScreen->CreateWindow != xf86CreateRootWindow ) {
/* Can't find hook we are hung on */ /* Can't find hook we are hung on */
@ -365,9 +363,7 @@ xf86CreateRootWindow(WindowPtr pWin)
} }
} }
#ifdef DEBUG DebugF("xf86CreateRootWindow() returns %d\n", ret);
ErrorF("xf86CreateRootWindow() returns %d\n", ret);
#endif
return (ret); return (ret);
} }
@ -471,10 +467,8 @@ probe_devices_from_device_sections(DriverPtr drvp)
if ( (devList[i]->screen == 0) && !xf86CheckPciSlot( pPci ) ) if ( (devList[i]->screen == 0) && !xf86CheckPciSlot( pPci ) )
continue; continue;
#ifdef DEBUG DebugF("%s: card at %d:%d:%d is claimed by a Device section\n",
ErrorF("%s: card at %d:%d:%d is claimed by a Device section\n",
drvp->driverName, pPci->bus, pPci->dev, pPci->func); drvp->driverName, pPci->bus, pPci->dev, pPci->func);
#endif
/* Allocate an entry in the lists to be returned */ /* Allocate an entry in the lists to be returned */
entry = xf86ClaimPciSlot(pPci, drvp, device_id, entry = xf86ClaimPciSlot(pPci, drvp, device_id,
@ -1246,12 +1240,10 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
FatalError("AddScreen/ScreenInit failed for driver %d\n", i); FatalError("AddScreen/ScreenInit failed for driver %d\n", i);
} }
#ifdef DEBUG DebugF("InitOutput - xf86Screens[%d]->pScreen = %p\n",
ErrorF("InitOutput - xf86Screens[%d]->pScreen = %p\n",
i, xf86Screens[i]->pScreen ); i, xf86Screens[i]->pScreen );
ErrorF("xf86Screens[%d]->pScreen->CreateWindow = %p\n", DebugF("xf86Screens[%d]->pScreen->CreateWindow = %p\n",
i, xf86Screens[i]->pScreen->CreateWindow ); i, xf86Screens[i]->pScreen->CreateWindow );
#endif
dixSetPrivate(&screenInfo.screens[scr_index]->devPrivates, dixSetPrivate(&screenInfo.screens[scr_index]->devPrivates,
xf86CreateRootWindowKey, xf86CreateRootWindowKey,

View File

@ -654,10 +654,8 @@ xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor)
return MODE_ERROR; return MODE_ERROR;
} }
#ifdef DEBUG DebugF("xf86CheckModeForMonitor(%p %s, %p %s)\n",
ErrorF("xf86CheckModeForMonitor(%p %s, %p %s)\n",
mode, mode->name, monitor, monitor->id); mode, mode->name, monitor, monitor->id);
#endif
/* Some basic mode validity checks */ /* Some basic mode validity checks */
if (0 >= mode->HDisplay || mode->HDisplay > mode->HSyncStart || if (0 >= mode->HDisplay || mode->HDisplay > mode->HSyncStart ||
@ -808,10 +806,8 @@ xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
return MODE_ERROR; return MODE_ERROR;
} }
#ifdef DEBUG DebugF("xf86InitialCheckModeForDriver(%p, %p %s, %p, 0x%x, %d, %d, %d)\n",
ErrorF("xf86InitialCheckModeForDriver(%p, %p %s, %p, 0x%x, %d, %d, %d)\n",
scrp, mode, mode->name , clockRanges, strategy, maxPitch, virtualX, virtualY); scrp, mode, mode->name , clockRanges, strategy, maxPitch, virtualX, virtualY);
#endif
/* Some basic mode validity checks */ /* Some basic mode validity checks */
if (0 >= mode->HDisplay || mode->HDisplay > mode->HSyncStart || if (0 >= mode->HDisplay || mode->HDisplay > mode->HSyncStart ||
@ -1210,14 +1206,12 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
range vrefresh[MAX_VREFRESH]; range vrefresh[MAX_VREFRESH];
Bool inferred_virtual = FALSE; Bool inferred_virtual = FALSE;
#ifdef DEBUG DebugF("xf86ValidateModes(%p, %p, %p, %p,\n\t\t %p, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x)\n",
ErrorF("xf86ValidateModes(%p, %p, %p, %p,\n\t\t %p, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x)\n",
scrp, availModes, modeNames, clockRanges, scrp, availModes, modeNames, clockRanges,
linePitches, minPitch, maxPitch, pitchInc, linePitches, minPitch, maxPitch, pitchInc,
minHeight, maxHeight, virtualX, virtualY, minHeight, maxHeight, virtualX, virtualY,
apertureSize, strategy apertureSize, strategy
); );
#endif
/* Some sanity checking */ /* Some sanity checking */
if (scrp == NULL || scrp->name == NULL || !scrp->monitor || if (scrp == NULL || scrp->name == NULL || !scrp->monitor ||
@ -1860,15 +1854,13 @@ xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags)
do { do {
xf86SetModeCrtc(p, adjustFlags); xf86SetModeCrtc(p, adjustFlags);
#ifdef DEBUG DebugF("%sMode %s: %d (%d) %d %d (%d) %d %d (%d) %d %d (%d) %d\n",
ErrorF("%sMode %s: %d (%d) %d %d (%d) %d %d (%d) %d %d (%d) %d\n",
(p->type & M_T_DEFAULT) ? "Default " : "", (p->type & M_T_DEFAULT) ? "Default " : "",
p->name, p->CrtcHDisplay, p->CrtcHBlankStart, p->name, p->CrtcHDisplay, p->CrtcHBlankStart,
p->CrtcHSyncStart, p->CrtcHSyncEnd, p->CrtcHBlankEnd, p->CrtcHSyncStart, p->CrtcHSyncEnd, p->CrtcHBlankEnd,
p->CrtcHTotal, p->CrtcVDisplay, p->CrtcVBlankStart, p->CrtcHTotal, p->CrtcVDisplay, p->CrtcVBlankStart,
p->CrtcVSyncStart, p->CrtcVSyncEnd, p->CrtcVBlankEnd, p->CrtcVSyncStart, p->CrtcVSyncEnd, p->CrtcVBlankEnd,
p->CrtcVTotal); p->CrtcVTotal);
#endif
p = p->next; p = p->next;
} while (p != NULL && p != scrp->modes); } while (p != NULL && p != scrp->modes);
} }

View File

@ -56,12 +56,6 @@ static Bool VidModeClose(int i, ScreenPtr pScreen);
#endif #endif
#ifdef DEBUG
# define DEBUG_P(x) ErrorF(x"\n");
#else
# define DEBUG_P(x) /**/
#endif
Bool Bool
VidModeExtensionInit(ScreenPtr pScreen) VidModeExtensionInit(ScreenPtr pScreen)
{ {
@ -69,7 +63,7 @@ VidModeExtensionInit(ScreenPtr pScreen)
VidModePtr pVidMode; VidModePtr pVidMode;
if (!xf86GetVidModeEnabled()) { if (!xf86GetVidModeEnabled()) {
DEBUG_P("!xf86GetVidModeEnabled()"); DebugF("!xf86GetVidModeEnabled()\n");
return FALSE; return FALSE;
} }
@ -77,7 +71,7 @@ VidModeExtensionInit(ScreenPtr pScreen)
if (!dixSetPrivate(&pScreen->devPrivates, VidModeKey, if (!dixSetPrivate(&pScreen->devPrivates, VidModeKey,
xcalloc(sizeof(VidModeRec), 1))) { xcalloc(sizeof(VidModeRec), 1))) {
DEBUG_P("xcalloc failed"); DebugF("xcalloc failed\n");
return FALSE; return FALSE;
} }
@ -89,7 +83,7 @@ VidModeExtensionInit(ScreenPtr pScreen)
VidModeCount++; VidModeCount++;
return TRUE; return TRUE;
#else #else
DEBUG_P("no vidmode extension"); DebugF("no vidmode extension\n");
return FALSE; return FALSE;
#endif #endif
} }
@ -123,13 +117,13 @@ VidModeAvailable(int scrnIndex)
VidModePtr pVidMode; VidModePtr pVidMode;
if (VidModeKey == NULL) { if (VidModeKey == NULL) {
DEBUG_P("VidModeKey == NULL"); DebugF("VidModeKey == NULL\n");
return FALSE; return FALSE;
} }
pScrn = xf86Screens[scrnIndex]; pScrn = xf86Screens[scrnIndex];
if (pScrn == NULL) { if (pScrn == NULL) {
DEBUG_P("pScrn == NULL"); DebugF("pScrn == NULL\n");
return FALSE; return FALSE;
} }
@ -137,7 +131,7 @@ VidModeAvailable(int scrnIndex)
if (pVidMode) if (pVidMode)
return TRUE; return TRUE;
else { else {
DEBUG_P("pVidMode == NULL"); DebugF("pVidMode == NULL\n");
return FALSE; return FALSE;
} }
} }

View File

@ -802,10 +802,10 @@ LinearRemoveCBWrapper(FBAreaPtr area)
xfree(pLink); xfree(pLink);
} }
#ifdef DEBUG
static void static void
Dump(FBLinearLinkPtr pLink) DumpDebug(FBLinearLinkPtr pLink)
{ {
#ifdef DEBUG
if (!pLink) ErrorF("MMmm, PLINK IS NULL!\n"); if (!pLink) ErrorF("MMmm, PLINK IS NULL!\n");
while (pLink) { while (pLink) {
@ -817,8 +817,8 @@ Dump(FBLinearLinkPtr pLink)
pLink = pLink->next; pLink = pLink->next;
} }
}
#endif #endif
}
static FBLinearPtr static FBLinearPtr
AllocateLinear( AllocateLinear(
@ -889,9 +889,7 @@ AllocateLinear(
linear->linear.RemoveLinearCallback = NULL; linear->linear.RemoveLinearCallback = NULL;
linear->linear.devPrivate.ptr = NULL; linear->linear.devPrivate.ptr = NULL;
#ifdef DEBUG DumpDebug(offman->LinearAreas);
Dump(offman->LinearAreas);
#endif
return &(linear->linear); return &(linear->linear);
} }
@ -916,15 +914,11 @@ localAllocateOffscreenLinear(
xf86FBScreenKey); xf86FBScreenKey);
/* Try to allocate from linear memory first...... */ /* Try to allocate from linear memory first...... */
#ifdef DEBUG DebugF("ALLOCATING LINEAR\n");
ErrorF("ALLOCATING LINEAR\n");
#endif
if ((linear = AllocateLinear(offman, length, gran, privData))) if ((linear = AllocateLinear(offman, length, gran, privData)))
return linear; return linear;
#ifdef DEBUG DebugF("NOPE, ALLOCATING AREA\n");
ErrorF("NOPE, ALLOCATING AREA\n");
#endif
if(!(link = xalloc(sizeof(FBLinearLink)))) if(!(link = xalloc(sizeof(FBLinearLink))))
return NULL; return NULL;
@ -978,9 +972,7 @@ localAllocateOffscreenLinear(
} else } else
xfree(link); xfree(link);
#ifdef DEBUG DumpDebug(offman->LinearAreas);
Dump(offman->LinearAreas);
#endif
return linear; return linear;
} }
@ -1005,17 +997,13 @@ localFreeOffscreenLinear(FBLinearPtr linear)
} }
if(pLink->area) { /* really an XY area */ if(pLink->area) { /* really an XY area */
#ifdef DEBUG DebugF("FREEING AREA\n");
ErrorF("FREEING AREA\n");
#endif
localFreeOffscreenArea(pLink->area); localFreeOffscreenArea(pLink->area);
if(pLinkPrev) if(pLinkPrev)
pLinkPrev->next = pLink->next; pLinkPrev->next = pLink->next;
else offman->LinearAreas = pLink->next; else offman->LinearAreas = pLink->next;
xfree(pLink); xfree(pLink);
#ifdef DEBUG DumpDebug(offman->LinearAreas);
Dump(offman->LinearAreas);
#endif
return; return;
} }
@ -1037,10 +1025,8 @@ localFreeOffscreenLinear(FBLinearPtr linear)
} }
} }
#ifdef DEBUG DebugF("FREEING LINEAR\n");
ErrorF("FREEING LINEAR\n"); DumpDebug(offman->LinearAreas);
Dump(offman->LinearAreas);
#endif
} }

View File

@ -435,9 +435,7 @@ xf86MatchSbusInstances(const char *driverName, int sbusDevId,
return actualcards; return actualcards;
} }
#ifdef DEBUG DebugF("%s instances found: %d\n", driverName, allocatedInstances);
ErrorF("%s instances found: %d\n", driverName, allocatedInstances);
#endif
for (i = 0; i < allocatedInstances; i++) { for (i = 0; i < allocatedInstances; i++) {
char *promPath = NULL; char *promPath = NULL;
@ -494,9 +492,7 @@ xf86MatchSbusInstances(const char *driverName, int sbusDevId,
xfree(promPath); xfree(promPath);
} }
#ifdef DEBUG DebugF("%s instances found: %d\n", driverName, numClaimedInstances);
ErrorF("%s instances found: %d\n", driverName, numClaimedInstances);
#endif
/* /*
* Of the claimed instances, check that another driver hasn't already * Of the claimed instances, check that another driver hasn't already
@ -510,11 +506,9 @@ xf86MatchSbusInstances(const char *driverName, int sbusDevId,
if (!xf86CheckSbusSlot(psdp->fbNum)) if (!xf86CheckSbusSlot(psdp->fbNum))
continue; continue;
#ifdef DEBUG DebugF("%s: card at fb%d %08x is claimed by a Device section\n",
ErrorF("%s: card at fb%d %08x is claimed by a Device section\n",
driverName, psdp->fbNum, psdp->node.node); driverName, psdp->fbNum, psdp->node.node);
#endif
/* Allocate an entry in the lists to be returned */ /* Allocate an entry in the lists to be returned */
numFound++; numFound++;
retEntities = xnfrealloc(retEntities, numFound * sizeof(int)); retEntities = xnfrealloc(retEntities, numFound * sizeof(int));

View File

@ -115,9 +115,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
if ((!vidMem) || (!sysMem)) { if ((!vidMem) || (!sysMem)) {
if ((fd = open(DEV_MEM, O_RDWR, 0)) >= 0) { if ((fd = open(DEV_MEM, O_RDWR, 0)) >= 0) {
if (!sysMem) { if (!sysMem) {
#ifdef DEBUG DebugF("Mapping sys bios area\n");
ErrorF("Mapping sys bios area\n");
#endif
if ((sysMem = mmap((void *)(SYS_BIOS), BIOS_SIZE, if ((sysMem = mmap((void *)(SYS_BIOS), BIOS_SIZE,
PROT_READ | PROT_EXEC, PROT_READ | PROT_EXEC,
MAP_SHARED | MAP_FIXED, fd, SYS_BIOS)) MAP_SHARED | MAP_FIXED, fd, SYS_BIOS))
@ -128,9 +126,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
} }
} }
if (!vidMem) { if (!vidMem) {
#ifdef DEBUG DebugF("Mapping VRAM area\n");
ErrorF("Mapping VRAM area\n");
#endif
if ((vidMem = mmap((void *)(V_RAM), VRAM_SIZE, if ((vidMem = mmap((void *)(V_RAM), VRAM_SIZE,
PROT_READ | PROT_WRITE | PROT_EXEC, PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_SHARED | MAP_FIXED, fd, V_RAM)) MAP_SHARED | MAP_FIXED, fd, V_RAM))
@ -162,9 +158,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
(pointer)xnfcalloc(1, ALLOC_ENTRIES(pagesize)); (pointer)xnfcalloc(1, ALLOC_ENTRIES(pagesize));
if (!xf86IsEntityPrimary(entityIndex)) { if (!xf86IsEntityPrimary(entityIndex)) {
#ifdef DEBUG DebugF("Mapping high memory area\n");
ErrorF("Mapping high memory area\n");
#endif
if ((high_mem = shmget(counter++, HIGH_MEM_SIZE, if ((high_mem = shmget(counter++, HIGH_MEM_SIZE,
IPC_CREAT | SHM_R | SHM_W)) == -1) { IPC_CREAT | SHM_R | SHM_W)) == -1) {
if (errno == ENOSYS) if (errno == ENOSYS)
@ -176,9 +170,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
goto error1; goto error1;
} }
} else { } else {
#ifdef DEBUG DebugF("Mapping Video BIOS\n");
ErrorF("Mapping Video BIOS\n");
#endif
videoBiosMapped = TRUE; videoBiosMapped = TRUE;
if ((fd = open(DEV_MEM, O_RDWR, 0)) >= 0) { if ((fd = open(DEV_MEM, O_RDWR, 0)) >= 0) {
if ((vMem = mmap((void *)(V_BIOS), SYS_BIOS - V_BIOS, if ((vMem = mmap((void *)(V_BIOS), SYS_BIOS - V_BIOS,
@ -195,9 +187,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
} }
((linuxInt10Priv*)pInt->private)->highMem = high_mem; ((linuxInt10Priv*)pInt->private)->highMem = high_mem;
#ifdef DEBUG DebugF("Mapping 640kB area\n");
ErrorF("Mapping 640kB area\n");
#endif
if ((low_mem = shmget(counter++, V_RAM, if ((low_mem = shmget(counter++, V_RAM,
IPC_CREAT | SHM_R | SHM_W)) == -1) { IPC_CREAT | SHM_R | SHM_W)) == -1) {
xf86DrvMsg(screen, X_ERROR, xf86DrvMsg(screen, X_ERROR,
@ -229,16 +219,12 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
Int10Current = pInt; Int10Current = pInt;
#ifdef DEBUG DebugF("Mapping int area\n");
ErrorF("Mapping int area\n");
#endif
if (xf86ReadBIOS(0, 0, (unsigned char *)0, LOW_PAGE_SIZE) < 0) { if (xf86ReadBIOS(0, 0, (unsigned char *)0, LOW_PAGE_SIZE) < 0) {
xf86DrvMsg(screen, X_ERROR, "Cannot read int vect\n"); xf86DrvMsg(screen, X_ERROR, "Cannot read int vect\n");
goto error3; goto error3;
} }
#ifdef DEBUG DebugF("done\n");
ErrorF("done\n");
#endif
/* /*
* Read in everything between V_BIOS and SYS_BIOS as some system BIOSes * Read in everything between V_BIOS and SYS_BIOS as some system BIOSes
* have executable code there. Note that xf86ReadBIOS() can only bring in * have executable code there. Note that xf86ReadBIOS() can only bring in
@ -246,17 +232,13 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
*/ */
if (!videoBiosMapped) { if (!videoBiosMapped) {
memset((pointer)V_BIOS, 0, SYS_BIOS - V_BIOS); memset((pointer)V_BIOS, 0, SYS_BIOS - V_BIOS);
#ifdef DEBUG DebugF("Reading BIOS\n");
ErrorF("Reading BIOS\n");
#endif
for (cs = V_BIOS; cs < SYS_BIOS; cs += V_BIOS_SIZE) for (cs = V_BIOS; cs < SYS_BIOS; cs += V_BIOS_SIZE)
if (xf86ReadBIOS(cs, 0, (pointer)cs, V_BIOS_SIZE) < V_BIOS_SIZE) if (xf86ReadBIOS(cs, 0, (pointer)cs, V_BIOS_SIZE) < V_BIOS_SIZE)
xf86DrvMsg(screen, X_WARNING, xf86DrvMsg(screen, X_WARNING,
"Unable to retrieve all of segment 0x%06lX.\n", "Unable to retrieve all of segment 0x%06lX.\n",
(long)cs); (long)cs);
#ifdef DEBUG DebugF("done\n");
ErrorF("done\n");
#endif
} }
if (xf86IsEntityPrimary(entityIndex) && !(initPrimary(options))) { if (xf86IsEntityPrimary(entityIndex) && !(initPrimary(options))) {

View File

@ -172,9 +172,7 @@ vm86_GP_fault(xf86Int10InfoPtr pInt)
break; break;
case 0xf4: case 0xf4:
#ifdef DEBUG DebugF("hlt at %p\n", lina);
ErrorF("hlt at %p\n", lina);
#endif
return FALSE; return FALSE;
case 0x0f: case 0x0f:

View File

@ -135,15 +135,11 @@ lnxACPIOpen(void)
int r = -1; int r = -1;
static int warned = 0; static int warned = 0;
#ifdef DEBUG DebugF("ACPI: OSPMOpen called\n");
ErrorF("ACPI: OSPMOpen called\n");
#endif
if (ACPIihPtr || !xf86Info.pmFlag) if (ACPIihPtr || !xf86Info.pmFlag)
return NULL; return NULL;
#ifdef DEBUG DebugF("ACPI: Opening device\n");
ErrorF("ACPI: Opening device\n");
#endif
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) > -1) { if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) > -1) {
memset(&addr, 0, sizeof(addr)); memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX; addr.sun_family = AF_UNIX;
@ -172,10 +168,8 @@ static void
lnxCloseACPI(void) lnxCloseACPI(void)
{ {
int fd; int fd;
#ifdef DEBUG DebugF("ACPI: Closing device\n");
ErrorF("ACPI: Closing device\n");
#endif
if (ACPIihPtr) { if (ACPIihPtr) {
fd = xf86RemoveGeneralHandler(ACPIihPtr); fd = xf86RemoveGeneralHandler(ACPIihPtr);
shutdown(fd, 2); shutdown(fd, 2);

View File

@ -160,15 +160,11 @@ lnxAPMOpen(void)
{ {
int fd, pfd; int fd, pfd;
#ifdef DEBUG DebugF("APM: OSPMOpen called\n");
ErrorF("APM: OSPMOpen called\n");
#endif
if (APMihPtr || !xf86Info.pmFlag) if (APMihPtr || !xf86Info.pmFlag)
return NULL; return NULL;
#ifdef DEBUG DebugF("APM: Opening device\n");
ErrorF("APM: Opening device\n");
#endif
if ((fd = open( APM_DEVICE, O_RDWR )) > -1) { if ((fd = open( APM_DEVICE, O_RDWR )) > -1) {
if (access( APM_PROC, R_OK ) || if (access( APM_PROC, R_OK ) ||
((pfd = open( APM_PROC, O_RDONLY)) == -1)) { ((pfd = open( APM_PROC, O_RDONLY)) == -1)) {
@ -191,10 +187,8 @@ static void
lnxCloseAPM(void) lnxCloseAPM(void)
{ {
int fd; int fd;
#ifdef DEBUG DebugF("APM: Closing device\n");
ErrorF("APM: Closing device\n");
#endif
if (APMihPtr) { if (APMihPtr) {
fd = xf86RemoveGeneralHandler(APMihPtr); fd = xf86RemoveGeneralHandler(APMihPtr);
close(fd); close(fd);

View File

@ -69,21 +69,15 @@ lnxGetAXP(void)
switch (count) { switch (count) {
case 1: case 1:
sscanf(res, "cpu model : %s",cpu); sscanf(res, "cpu model : %s",cpu);
#ifdef DEBUG DebugF("CPU %s\n",cpu);
ErrorF("CPU %s\n",cpu);
#endif
break; break;
case 5: case 5:
sscanf(res, "system type : %s",systype); sscanf(res, "system type : %s",systype);
#ifdef DEBUG DebugF("system type : %s\n",systype);
ErrorF("system type : %s\n",systype);
#endif
break; break;
case 6: case 6:
sscanf(res, "system variation : %s",sysvari); sscanf(res, "system variation : %s",sysvari);
#ifdef DEBUG DebugF("system variation: %s\n",sysvari);
ErrorF("system variation: %s\n",sysvari);
#endif
break; break;
} }
count++; count++;

View File

@ -65,9 +65,7 @@ getfont(int *width, int *height,
op.flags = 0; op.flags = 0;
SYSCALL(result = ioctl(xf86Info.consoleFd, KDFONTOP, &op)); SYSCALL(result = ioctl(xf86Info.consoleFd, KDFONTOP, &op));
#ifdef DEBUG DebugF("Console font read: h: %i count: %i\n",op.height,op.charcount);
ErrorF("Console font read: h: %i count: %i\n",op.height,op.charcount);
#endif
if (!result) { if (!result) {
@ -130,9 +128,7 @@ lnx_savefont(void)
int fd; int fd;
int width = 32, height = 32, charcount = 2048; int width = 32, height = 32, charcount = 2048;
#ifdef DEBUG DebugF("SAVE font\n");
ErrorF("SAVE font\n");
#endif
#if CHECK_OS_VERSION #if CHECK_OS_VERSION
/* Check if the kernel has full support for this */ /* Check if the kernel has full support for this */
@ -247,9 +243,7 @@ lnx_restorefont(void)
{ {
if (lnxfont.data == NULL) if (lnxfont.data == NULL)
return FALSE; return FALSE;
#ifdef DEBUG DebugF("RESTORE font\n");
ErrorF("RESTORE font\n");
#endif
#if 0 #if 0
/* must wack the height to make the kernel reprogram the VGA registers */ /* must wack the height to make the kernel reprogram the VGA registers */
if (!setfont(lnxfont.width, lnxfont.height + 1, lnxfont.charcount, if (!setfont(lnxfont.width, lnxfont.height + 1, lnxfont.charcount,

View File

@ -292,9 +292,7 @@ mtrr_add_wc_region(int screenNum, unsigned long base, unsigned long size,
lbase = lbase >> 1, d_size <<= 1); lbase = lbase >> 1, d_size <<= 1);
while (d_size > n_size) while (d_size > n_size)
d_size = d_size >> 1; d_size = d_size >> 1;
#ifdef DEBUG DebugF("WC_BASE: 0x%lx WC_END: 0x%lx\n",base,base+d_size-1);
ErrorF("WC_BASE: 0x%lx WC_END: 0x%lx\n",base,base+d_size-1);
#endif
n_base += d_size; n_base += d_size;
n_size -= d_size; n_size -= d_size;
if (n_size) { if (n_size) {
@ -424,11 +422,9 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
realBase = Base & ~(getpagesize() - 1); realBase = Base & ~(getpagesize() - 1);
alignOff = Base - realBase; alignOff = Base - realBase;
#ifdef DEBUG DebugF("base: %lx, realBase: %lx, alignOff: %lx \n",
ErrorF("base: %lx, realBase: %lx, alignOff: %lx \n",
Base,realBase,alignOff); Base,realBase,alignOff);
#endif
#if defined(__ia64__) || defined(__arm__) || defined(__s390__) #if defined(__ia64__) || defined(__arm__) || defined(__s390__)
#ifndef MAP_WRITECOMBINED #ifndef MAP_WRITECOMBINED
#define MAP_WRITECOMBINED 0x00010000 #define MAP_WRITECOMBINED 0x00010000
@ -469,9 +465,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
" (0x%08lx,0x%lx) (%s)\n", Base, Size, " (0x%08lx,0x%lx) (%s)\n", Base, Size,
strerror(errno)); strerror(errno));
} }
#ifdef DEBUG DebugF("base: %lx aligned base: %lx\n",base, base + alignOff);
ErrorF("base: %lx aligned base: %lx\n",base, base + alignOff);
#endif
return (char *)base + alignOff; return (char *)base + alignOff;
} }
#endif /* !(__sparc__) */ #endif /* !(__sparc__) */
@ -481,10 +475,8 @@ unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
{ {
memType alignOff = (memType)Base memType alignOff = (memType)Base
- ((memType)Base & ~(getpagesize() - 1)); - ((memType)Base & ~(getpagesize() - 1));
#ifdef DEBUG DebugF("alignment offset: %lx\n",alignOff);
ErrorF("alignment offset: %lx\n",alignOff);
#endif
munmap((caddr_t)((memType)Base - alignOff), (Size + alignOff)); munmap((caddr_t)((memType)Base - alignOff), (Size + alignOff));
} }

View File

@ -124,9 +124,7 @@ mapVidMemMMAP(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
realBase = Base & ~(getpagesize() - 1); realBase = Base & ~(getpagesize() - 1);
alignOff = Base - realBase; alignOff = Base - realBase;
#ifdef DEBUG DebugF("base: %lx, realBase: %lx, alignOff: %lx\n", Base,realBase,alignOff);
ErrorF("base: %lx, realBase: %lx, alignOff: %lx\n", Base,realBase,alignOff);
#endif
base = mmap((caddr_t)0, Size + alignOff, base = mmap((caddr_t)0, Size + alignOff,
(flags & VIDMEM_READONLY) ? PROT_READ : (PROT_READ | PROT_WRITE), (flags & VIDMEM_READONLY) ? PROT_READ : (PROT_READ | PROT_WRITE),
@ -138,9 +136,7 @@ mapVidMemMMAP(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
return 0; /* NOTREACHED */ return 0; /* NOTREACHED */
} }
#ifdef DEBUG DebugF("base: %lx aligned base: %lx\n",base, base + alignOff);
ErrorF("base: %lx aligned base: %lx\n",base, base + alignOff);
#endif
return (pointer)((char *)base + alignOff); return (pointer)((char *)base + alignOff);
} }

View File

@ -68,10 +68,8 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
close(fd); close(fd);
return(-1); return(-1);
} }
#ifdef DEBUG DebugF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
ErrorF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
Base, ptr[0] | (ptr[1] << 8)); Base, ptr[0] | (ptr[1] << 8));
#endif
(void)memcpy(Buf, (void *)(ptr + Offset), Len); (void)memcpy(Buf, (void *)(ptr + Offset), Len);
(void)munmap((caddr_t)ptr, mlen); (void)munmap((caddr_t)ptr, mlen);
(void)close(fd); (void)close(fd);

View File

@ -400,17 +400,14 @@ int
xf86ReadSerial (int fd, void *buf, int count) xf86ReadSerial (int fd, void *buf, int count)
{ {
int r; int r;
#ifdef DEBUG
int i; int i;
#endif
SYSCALL (r = read (fd, buf, count)); SYSCALL (r = read (fd, buf, count));
#ifdef DEBUG DebugF("ReadingSerial: 0x%x",
ErrorF("ReadingSerial: 0x%x",
(unsigned char)*(((unsigned char *)buf))); (unsigned char)*(((unsigned char *)buf)));
for (i = 1; i < r; i++) for (i = 1; i < r; i++)
ErrorF(", 0x%x",(unsigned char)*(((unsigned char *)buf) + i)); DebugF(", 0x%x",(unsigned char)*(((unsigned char *)buf) + i));
ErrorF("\n"); DebugF("\n");
#endif
return (r); return (r);
} }
@ -418,14 +415,12 @@ int
xf86WriteSerial (int fd, const void *buf, int count) xf86WriteSerial (int fd, const void *buf, int count)
{ {
int r; int r;
#ifdef DEBUG
int i; int i;
ErrorF("WritingSerial: 0x%x",(unsigned char)*(((unsigned char *)buf))); DebugF("WritingSerial: 0x%x",(unsigned char)*(((unsigned char *)buf)));
for (i = 1; i < count; i++) for (i = 1; i < count; i++)
ErrorF(", 0x%x",(unsigned char)*(((unsigned char *)buf) + i)); ErrorF(", 0x%x",(unsigned char)*(((unsigned char *)buf) + i));
ErrorF("\n"); DebugF("\n");
#endif
SYSCALL (r = write (fd, buf, count)); SYSCALL (r = write (fd, buf, count));
return (r); return (r);
} }
@ -482,9 +477,7 @@ xf86FlushInput(int fd)
struct timeval timeout; struct timeval timeout;
char c[4]; char c[4];
#ifdef DEBUG DebugF("FlushingSerial\n");
ErrorF("FlushingSerial\n");
#endif
if (tcflush(fd, TCIFLUSH) == 0) if (tcflush(fd, TCIFLUSH) == 0)
return 0; return 0;

View File

@ -115,10 +115,8 @@ TIramdacCalculateMNPForClock(
VCO = 8.0 * IntRef * best_m / best_n; VCO = 8.0 * IntRef * best_m / best_n;
ActualClock = VCO / ( 1 << p ); ActualClock = VCO / ( 1 << p );
#ifdef DEBUG DebugF( "f_out=%ld f_vco=%.1f n=%d m=%d p=%d\n",
ErrorF( "f_out=%ld f_vco=%.1f n=%d m=%d p=%d\n",
ActualClock, VCO, *rN, *rM, *rP); ActualClock, VCO, *rN, *rM, *rP);
#endif
return (ActualClock); return (ActualClock);
} }

View File

@ -414,11 +414,9 @@ VBESetModeParameters(ScrnInfoPtr pScrn, vbeInfoPtr pVbe)
data->block->PixelClock = best->Clock * 1000; data->block->PixelClock = best->Clock * 1000;
/* XXX May not have this. */ /* XXX May not have this. */
clock = VBEGetPixelClock(pVbe, data->mode, data->block->PixelClock); clock = VBEGetPixelClock(pVbe, data->mode, data->block->PixelClock);
#ifdef DEBUG DebugF("Setting clock %.2fMHz, closest is %.2fMHz\n",
ErrorF("Setting clock %.2fMHz, closest is %.2fMHz\n",
(double)data->block->PixelClock / 1000000.0, (double)data->block->PixelClock / 1000000.0,
(double)clock / 1000000.0); (double)clock / 1000000.0);
#endif
if (clock) if (clock)
data->block->PixelClock = clock; data->block->PixelClock = clock;
data->mode |= (1 << 11); data->mode |= (1 << 11);

View File

@ -1025,32 +1025,24 @@ vgaHWSaveMode(ScrnInfoPtr scrninfp, vgaRegPtr save)
for (i = 0; i < save->numCRTC; i++) { for (i = 0; i < save->numCRTC; i++) {
save->CRTC[i] = hwp->readCrtc(hwp, i); save->CRTC[i] = hwp->readCrtc(hwp, i);
#ifdef DEBUG DebugF("CRTC[0x%02x] = 0x%02x\n", i, save->CRTC[i]);
ErrorF("CRTC[0x%02x] = 0x%02x\n", i, save->CRTC[i]);
#endif
} }
hwp->enablePalette(hwp); hwp->enablePalette(hwp);
for (i = 0; i < save->numAttribute; i++) { for (i = 0; i < save->numAttribute; i++) {
save->Attribute[i] = hwp->readAttr(hwp, i); save->Attribute[i] = hwp->readAttr(hwp, i);
#ifdef DEBUG DebugF("Attribute[0x%02x] = 0x%02x\n", i, save->Attribute[i]);
ErrorF("Attribute[0x%02x] = 0x%02x\n", i, save->Attribute[i]);
#endif
} }
hwp->disablePalette(hwp); hwp->disablePalette(hwp);
for (i = 0; i < save->numGraphics; i++) { for (i = 0; i < save->numGraphics; i++) {
save->Graphics[i] = hwp->readGr(hwp, i); save->Graphics[i] = hwp->readGr(hwp, i);
#ifdef DEBUG DebugF("Graphics[0x%02x] = 0x%02x\n", i, save->Graphics[i]);
ErrorF("Graphics[0x%02x] = 0x%02x\n", i, save->Graphics[i]);
#endif
} }
for (i = 1; i < save->numSequencer; i++) { for (i = 1; i < save->numSequencer; i++) {
save->Sequencer[i] = hwp->readSeq(hwp, i); save->Sequencer[i] = hwp->readSeq(hwp, i);
#ifdef DEBUG DebugF("Sequencer[0x%02x] = 0x%02x\n", i, save->Sequencer[i]);
ErrorF("Sequencer[0x%02x] = 0x%02x\n", i, save->Sequencer[i]);
#endif
} }
} }
@ -1088,18 +1080,16 @@ vgaHWSaveColormap(ScrnInfoPtr scrninfp, vgaRegPtr save)
hwp->writeDacReadAddr(hwp, 0x00); hwp->writeDacReadAddr(hwp, 0x00);
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++) {
save->DAC[i] = hwp->readDacData(hwp); save->DAC[i] = hwp->readDacData(hwp);
#ifdef DEBUG
switch (i % 3) { switch (i % 3) {
case 0: case 0:
ErrorF("DAC[0x%02x] = 0x%02x, ", i / 3, save->DAC[i]); DebugF("DAC[0x%02x] = 0x%02x, ", i / 3, save->DAC[i]);
break; break;
case 1: case 1:
ErrorF("0x%02x, ", save->DAC[i]); DebugF("0x%02x, ", save->DAC[i]);
break; break;
case 2: case 2:
ErrorF("0x%02x\n", save->DAC[i]); DebugF("0x%02x\n", save->DAC[i]);
} }
#endif
} }
/* /*
@ -1131,18 +1121,16 @@ vgaHWSaveColormap(ScrnInfoPtr scrninfp, vgaRegPtr save)
for (i = 6; i < 768; i++) { for (i = 6; i < 768; i++) {
save->DAC[i] = hwp->readDacData(hwp); save->DAC[i] = hwp->readDacData(hwp);
DACDelay(hwp); DACDelay(hwp);
#ifdef DEBUG
switch (i % 3) { switch (i % 3) {
case 0: case 0:
ErrorF("DAC[0x%02x] = 0x%02x, ", i / 3, save->DAC[i]); DebugF("DAC[0x%02x] = 0x%02x, ", i / 3, save->DAC[i]);
break; break;
case 1: case 1:
ErrorF("0x%02x, ", save->DAC[i]); DebugF("0x%02x, ", save->DAC[i]);
break; break;
case 2: case 2:
ErrorF("0x%02x\n", save->DAC[i]); DebugF("0x%02x\n", save->DAC[i]);
} }
#endif
} }
} }
@ -1772,9 +1760,7 @@ vgaHWMapMem(ScrnInfoPtr scrp)
* XXX This is not correct but we do it * XXX This is not correct but we do it
* for now. * for now.
*/ */
#ifdef DEBUG DebugF("Mapping VGAMem\n");
ErrorF("Mapping VGAMem\n");
#endif
hwp->Base = xf86MapDomainMemory(scr_index, VIDMEM_MMIO_32BIT, hwp->dev, hwp->Base = xf86MapDomainMemory(scr_index, VIDMEM_MMIO_32BIT, hwp->dev,
hwp->MapPhys, hwp->MapSize); hwp->MapPhys, hwp->MapSize);
return hwp->Base != NULL; return hwp->Base != NULL;
@ -1790,9 +1776,7 @@ vgaHWUnmapMem(ScrnInfoPtr scrp)
if (hwp->Base == NULL) if (hwp->Base == NULL)
return; return;
#ifdef DEBUG DebugF("Unmapping VGAMem\n");
ErrorF("Unmapping VGAMem\n");
#endif
xf86UnMapVidMem(scr_index, hwp->Base, hwp->MapSize); xf86UnMapVidMem(scr_index, hwp->Base, hwp->MapSize);
hwp->Base = NULL; hwp->Base = NULL;
} }