summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-05-09 10:33:20 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-05-16 12:20:57 +1000
commite3f296d91dfe6b827195e1d387e1a04aa73b85c3 (patch)
tree69fc12c860aca64f37c4c3c5d77b74d0e91f62da
parent9c5b761c8c86cca56f4b4af272f42ba89c9c3ba5 (diff)
xfree86: Remove superfluous ifdef DEBUG checks.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--hw/xfree86/common/xf86Bus.c46
-rw-r--r--hw/xfree86/common/xf86Config.c12
-rw-r--r--hw/xfree86/common/xf86Events.c20
-rw-r--r--hw/xfree86/common/xf86Helper.c46
-rw-r--r--hw/xfree86/common/xf86Init.c18
-rw-r--r--hw/xfree86/common/xf86Mode.c16
-rw-r--r--hw/xfree86/common/xf86VidMode.c18
-rw-r--r--hw/xfree86/common/xf86fbman.c36
-rw-r--r--hw/xfree86/common/xf86sbusBus.c14
-rw-r--r--hw/xfree86/os-support/linux/int10/linux.c36
-rw-r--r--hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c4
-rw-r--r--hw/xfree86/os-support/linux/lnx_acpi.c14
-rw-r--r--hw/xfree86/os-support/linux/lnx_apm.c14
-rw-r--r--hw/xfree86/os-support/linux/lnx_axp.c12
-rw-r--r--hw/xfree86/os-support/linux/lnx_font.c12
-rw-r--r--hw/xfree86/os-support/linux/lnx_video.c20
-rw-r--r--hw/xfree86/os-support/sco/sco_video.c8
-rw-r--r--hw/xfree86/os-support/shared/bios_mmap.c4
-rw-r--r--hw/xfree86/os-support/shared/posix_tty.c21
-rw-r--r--hw/xfree86/ramdac/TI.c4
-rw-r--r--hw/xfree86/vbe/vbeModes.c4
-rw-r--r--hw/xfree86/vgahw/vgaHW.c40
22 files changed, 118 insertions, 301 deletions
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 8040f580b..8382d911a 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -639,9 +639,7 @@ xf86EnableAccess(ScrnInfoPtr pScrn)
register xf86AccessPtr pAcc;
EntityAccessPtr tmp;
-#ifdef DEBUG
- ErrorF("Enable access %i\n",pScrn->scrnIndex);
-#endif
+ DebugF("Enable access %i\n",pScrn->scrnIndex);
/* Entity is not under access control or currently enabled */
if (!pScrn->access) {
@@ -844,10 +842,8 @@ checkConflictBlock(resRange *range, resPtr pRes)
case ResBlock:
if (range->rBegin < pRes->block_end &&
range->rEnd > pRes->block_begin) {
-#ifdef DEBUG
- ErrorF("b-b conflict w: %lx %lx\n",
+ DebugF("b-b conflict w: %lx %lx\n",
pRes->block_begin,pRes->block_end);
-#endif
return 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;
val = (~pRes->sparse_mask | pRes->sparse_base) & getMask(range->rEnd);
-#ifdef DEBUG
- ErrorF("base = 0x%lx, mask = 0x%lx, begin = 0x%lx, end = 0x%lx ,"
+ 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);
-#endif
i = sizeof(memType) * 8;
tmp = prev = pRes->sparse_base;
@@ -873,11 +867,9 @@ checkConflictBlock(resRange *range, resPtr pRes)
prev = tmp;
}
if (tmp >= range->rBegin) {
-#ifdef DEBUG
- ErrorF("conflict found at: 0x%lx\n",tmp);
- ErrorF("b-d conflict w: %lx %lx\n",
+ DebugF("conflict found at: 0x%lx\n",tmp);
+ DebugF("b-d conflict w: %lx %lx\n",
pRes->sparse_base,pRes->sparse_mask);
-#endif
return tmp;
}
else
@@ -902,10 +894,8 @@ checkConflictSparse(resRange *range, resPtr pRes)
case ResSparse:
tmp = pRes->sparse_mask & range->rMask;
if ((tmp & pRes->sparse_base) == (tmp & range->rBase)) {
-#ifdef DEBUG
- ErrorF("s-b conflict w: %lx %lx\n",
+ DebugF("s-b conflict w: %lx %lx\n",
pRes->sparse_base,pRes->sparse_mask);
-#endif
return pRes->sparse_mask;
}
return 0;
@@ -918,9 +908,7 @@ checkConflictSparse(resRange *range, resPtr pRes)
tmp = prev = range->rBase;
while (i) {
-#ifdef DEBUG
- ErrorF("tmp = 0x%lx\n",tmp);
-#endif
+ DebugF("tmp = 0x%lx\n",tmp);
tmp |= 1<< (--i) & val;
if (tmp > pRes->block_end)
tmp = prev;
@@ -947,11 +935,9 @@ checkConflictSparse(resRange *range, resPtr pRes)
m_mask = mask > m_mask ? mask : m_mask;
base = base + mask + 1;
}
-#ifdef DEBUG
- ErrorF("conflict found at: 0x%lx\n",tmp);
- ErrorF("b-b conflict w: %lx %lx\n",
+ DebugF("conflict found at: 0x%lx\n",tmp);
+ DebugF("b-b conflict w: %lx %lx\n",
pRes->block_begin,pRes->block_end);
-#endif
return ~m_mask;
}
}
@@ -1557,12 +1543,10 @@ xf86EnterServerState(xf86State state)
* We take care not to call xf86BlockSIGIO() twice.
*/
SetSIGIOForState(state);
-#ifdef DEBUG
if (state == SETUP)
- ErrorF("Entering SETUP state\n");
+ DebugF("Entering SETUP state\n");
else
- ErrorF("Entering OPERATING state\n");
-#endif
+ DebugF("Entering OPERATING state\n");
/* When servicing a dumb framebuffer we don't need to do anything */
if (doFramebufferMode) return;
@@ -1620,10 +1604,8 @@ xf86EnterServerState(xf86State state)
xf86Screens[i]->busAccess = NULL;
}
-#ifdef DEBUG
if (xf86Screens[i]->busAccess)
- ErrorF("Screen %i setting vga route\n",i);
-#endif
+ 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);
@@ -1967,9 +1949,7 @@ xf86PostScreenInit(void)
return;
}
-#ifdef DEBUG
- ErrorF("PostScreenInit generation: %i\n",serverGeneration);
-#endif
+ DebugF("PostScreenInit generation: %i\n",serverGeneration);
if (serverGeneration == 1) {
checkRoutingForScreens(OPERATING);
for (i=0; i<xf86NumEntities; i++) {
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 7ea6197de..2ecb63961 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1519,10 +1519,8 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
adjp = (XF86ConfAdjacencyPtr)adjp->list.next;
}
-#ifdef DEBUG
- ErrorF("Found %d screens in the layout section %s",
+ DebugF("Found %d screens in the layout section %s",
count, conf_layout->lay_identifier);
-#endif
if (!count) /* alloc enough storage even if no screen is specified */
count = 1;
@@ -1679,10 +1677,8 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
count++;
idp = (XF86ConfInactivePtr)idp->list.next;
}
-#ifdef DEBUG
- ErrorF("Found %d inactive devices in the layout section %s\n",
+ DebugF("Found %d inactive devices in the layout section %s\n",
count, conf_layout->lay_identifier);
-#endif
gdp = xnfalloc((count + 1) * sizeof(GDevRec));
gdp[count].identifier = NULL;
idp = conf_layout->lay_inactive_lst;
@@ -1704,10 +1700,8 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
count++;
irp = (XF86ConfInputrefPtr)irp->list.next;
}
-#ifdef DEBUG
- ErrorF("Found %d input devices in the layout section %s\n",
+ DebugF("Found %d input devices in the layout section %s\n",
count, conf_layout->lay_identifier);
-#endif
indp = xnfcalloc((count + 1), sizeof(IDevPtr));
indp[count] = NULL;
irp = conf_layout->lay_input_lst;
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index aa818c358..e9b4dfe60 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -183,9 +183,7 @@ ProcessInputEvents (void)
void
xf86ProcessActionEvent(ActionEvent action, void *arg)
{
-#ifdef DEBUG
- ErrorF("ProcessActionEvent(%d,%x)\n", (int) action, arg);
-#endif
+ DebugF("ProcessActionEvent(%d,%x)\n", (int) action, arg);
switch (action) {
case ACTION_TERMINATE:
if (!xf86Info.dontZap) {
@@ -429,9 +427,7 @@ xf86VTSwitch(void)
InputInfoPtr pInfo;
IHPtr ih;
-#ifdef DEBUG
- ErrorF("xf86VTSwitch()\n");
-#endif
+ DebugF("xf86VTSwitch()\n");
#ifdef XFreeXDGA
if(!DGAVTSwitch())
@@ -444,10 +440,8 @@ xf86VTSwitch(void)
*/
if (xf86Screens[0]->vtSema) {
-#ifdef DEBUG
- ErrorF("xf86VTSwitch: Leaving, xf86Exiting is %s\n",
+ DebugF("xf86VTSwitch: Leaving, xf86Exiting is %s\n",
BOOLTOSTRING((dispatchException & DE_TERMINATE) ? TRUE : FALSE));
-#endif
#ifdef DPMSExtension
if (DPMSPowerLevel != DPMSModeOn)
DPMSSet(serverClient, DPMSModeOn);
@@ -483,9 +477,7 @@ xf86VTSwitch(void)
* switch failed
*/
-#ifdef DEBUG
- ErrorF("xf86VTSwitch: Leave failed\n");
-#endif
+ DebugF("xf86VTSwitch: Leave failed\n");
prevSIGIO = xf86BlockSIGIO();
xf86AccessEnter();
xf86EnterServerState(SETUP);
@@ -534,9 +526,7 @@ xf86VTSwitch(void)
}
} else {
-#ifdef DEBUG
- ErrorF("xf86VTSwitch: Entering\n");
-#endif
+ DebugF("xf86VTSwitch: Entering\n");
if (!xf86VTSwitchTo()) return;
prevSIGIO = xf86BlockSIGIO();
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 0db77178a..d59c6380d 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -212,15 +212,13 @@ xf86AllocateScreen(DriverPtr drv, int flags)
xf86Screens[i]->CurrentAccess = &xf86CurrentAccess;
xf86Screens[i]->resourceType = MEM_IO;
-#ifdef DEBUG
/* OOps -- What's this ? */
- ErrorF("xf86AllocateScreen - xf86Screens[%d]->pScreen = %p\n",
+ DebugF("xf86AllocateScreen - xf86Screens[%d]->pScreen = %p\n",
i, 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 );
}
-#endif
xf86Screens[i]->DriverFunc = drv->driverFunc;
@@ -1735,9 +1733,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
}
-#ifdef DEBUG
- ErrorF("%s instances found: %d\n", driverName, allocatedInstances);
-#endif
+ DebugF("%s instances found: %d\n", driverName, allocatedInstances);
/*
* Check for devices that need duplicated instances. This is required
@@ -1820,9 +1816,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
instances[i].dev = dev;
}
}
-#ifdef DEBUG
- ErrorF("%s instances found: %d\n", driverName, numClaimedInstances);
-#endif
+ DebugF("%s instances found: %d\n", driverName, numClaimedInstances);
/*
* Now check that a chipset or chipID override in the device section
* is valid. Chipset has precedence over chipID.
@@ -1926,11 +1920,9 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
if (instances[i].screen == 0 && !xf86CheckPciSlot( pPci ))
continue;
-#ifdef DEBUG
- ErrorF("%s: card at %d:%d:%d is claimed by a Device section\n",
+ DebugF("%s: card at %d:%d:%d is claimed by a Device section\n",
driverName, pPci->bus, pPci->dev, pPci->func);
-#endif
-
+
/* Allocate an entry in the lists to be returned */
numFound++;
retEntities = xnfrealloc(retEntities, numFound * sizeof(int));
@@ -2621,10 +2613,8 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
int i;
Bool existing = FALSE;
-#ifdef DEBUG
- ErrorF("xf86RegisterRootWindowProperty(%d, %ld, %ld, %d, %ld, %p)\n",
+ DebugF("xf86RegisterRootWindowProperty(%d, %ld, %ld, %d, %ld, %p)\n",
ScrnIndex, property, type, format, len, value);
-#endif
if (ScrnIndex<0 || ScrnIndex>=xf86NumScreens) {
return(BadMatch);
@@ -2660,15 +2650,11 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
pNewProp->size = len;
pNewProp->data = value;
-#ifdef DEBUG
- ErrorF("new property filled\n");
-#endif
+ DebugF("new property filled\n");
if (NULL==xf86RegisteredPropertiesTable) {
-#ifdef DEBUG
- ErrorF("creating xf86RegisteredPropertiesTable[] size %d\n",
+ DebugF("creating xf86RegisteredPropertiesTable[] size %d\n",
xf86NumScreens);
-#endif
if ( NULL==(xf86RegisteredPropertiesTable=(RootWinPropPtr*)xnfcalloc(sizeof(RootWinProp),xf86NumScreens) )) {
return(BadAlloc);
}
@@ -2677,12 +2663,10 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
}
}
-#ifdef DEBUG
- ErrorF("xf86RegisteredPropertiesTable %p\n",
+ DebugF("xf86RegisteredPropertiesTable %p\n",
(void *)xf86RegisteredPropertiesTable);
- ErrorF("xf86RegisteredPropertiesTable[%d] %p\n",
+ DebugF("xf86RegisteredPropertiesTable[%d] %p\n",
ScrnIndex, (void *)xf86RegisteredPropertiesTable[ScrnIndex]);
-#endif
if (!existing) {
if ( xf86RegisteredPropertiesTable[ScrnIndex] == NULL) {
@@ -2690,17 +2674,13 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
} else {
pRegProp = xf86RegisteredPropertiesTable[ScrnIndex];
while (pRegProp->next != NULL) {
-#ifdef DEBUG
- ErrorF("- next %p\n", (void *)pRegProp);
-#endif
+ DebugF("- next %p\n", (void *)pRegProp);
pRegProp = pRegProp->next;
}
pRegProp->next = pNewProp;
}
}
-#ifdef DEBUG
- ErrorF("xf86RegisterRootWindowProperty succeeded\n");
-#endif
+ DebugF("xf86RegisterRootWindowProperty succeeded\n");
return(Success);
}
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index cf28ae73e..c4e5898ae 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -316,9 +316,7 @@ xf86CreateRootWindow(WindowPtr pWin)
CreateWindowProcPtr CreateWindow = (CreateWindowProcPtr)
dixLookupPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey);
-#ifdef DEBUG
- ErrorF("xf86CreateRootWindow(%p)\n", pWin);
-#endif
+ DebugF("xf86CreateRootWindow(%p)\n", pWin);
if ( pScreen->CreateWindow != xf86CreateRootWindow ) {
/* Can't find hook we are hung on */
@@ -365,9 +363,7 @@ xf86CreateRootWindow(WindowPtr pWin)
}
}
-#ifdef DEBUG
- ErrorF("xf86CreateRootWindow() returns %d\n", ret);
-#endif
+ DebugF("xf86CreateRootWindow() returns %d\n", ret);
return (ret);
}
@@ -471,10 +467,8 @@ probe_devices_from_device_sections(DriverPtr drvp)
if ( (devList[i]->screen == 0) && !xf86CheckPciSlot( pPci ) )
continue;
-#ifdef DEBUG
- ErrorF("%s: card at %d:%d:%d is claimed by a Device section\n",
+ DebugF("%s: card at %d:%d:%d is claimed by a Device section\n",
drvp->driverName, pPci->bus, pPci->dev, pPci->func);
-#endif
/* Allocate an entry in the lists to be returned */
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);
}
-#ifdef DEBUG
- ErrorF("InitOutput - xf86Screens[%d]->pScreen = %p\n",
+ DebugF("InitOutput - xf86Screens[%d]->pScreen = %p\n",
i, xf86Screens[i]->pScreen );
- ErrorF("xf86Screens[%d]->pScreen->CreateWindow = %p\n",
+ DebugF("xf86Screens[%d]->pScreen->CreateWindow = %p\n",
i, xf86Screens[i]->pScreen->CreateWindow );
-#endif
dixSetPrivate(&screenInfo.screens[scr_index]->devPrivates,
xf86CreateRootWindowKey,
diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index 522d3c28b..6dcebe15e 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -654,10 +654,8 @@ xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor)
return MODE_ERROR;
}
-#ifdef DEBUG
- ErrorF("xf86CheckModeForMonitor(%p %s, %p %s)\n",
+ DebugF("xf86CheckModeForMonitor(%p %s, %p %s)\n",
mode, mode->name, monitor, monitor->id);
-#endif
/* Some basic mode validity checks */
if (0 >= mode->HDisplay || mode->HDisplay > mode->HSyncStart ||
@@ -808,10 +806,8 @@ xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
return MODE_ERROR;
}
-#ifdef DEBUG
- ErrorF("xf86InitialCheckModeForDriver(%p, %p %s, %p, 0x%x, %d, %d, %d)\n",
+ DebugF("xf86InitialCheckModeForDriver(%p, %p %s, %p, 0x%x, %d, %d, %d)\n",
scrp, mode, mode->name , clockRanges, strategy, maxPitch, virtualX, virtualY);
-#endif
/* Some basic mode validity checks */
if (0 >= mode->HDisplay || mode->HDisplay > mode->HSyncStart ||
@@ -1210,14 +1206,12 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
range vrefresh[MAX_VREFRESH];
Bool inferred_virtual = FALSE;
-#ifdef DEBUG
- ErrorF("xf86ValidateModes(%p, %p, %p, %p,\n\t\t %p, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x)\n",
+ DebugF("xf86ValidateModes(%p, %p, %p, %p,\n\t\t %p, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x)\n",
scrp, availModes, modeNames, clockRanges,
linePitches, minPitch, maxPitch, pitchInc,
minHeight, maxHeight, virtualX, virtualY,
apertureSize, strategy
);
-#endif
/* Some sanity checking */
if (scrp == NULL || scrp->name == NULL || !scrp->monitor ||
@@ -1860,15 +1854,13 @@ xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags)
do {
xf86SetModeCrtc(p, adjustFlags);
-#ifdef DEBUG
- ErrorF("%sMode %s: %d (%d) %d %d (%d) %d %d (%d) %d %d (%d) %d\n",
+ DebugF("%sMode %s: %d (%d) %d %d (%d) %d %d (%d) %d %d (%d) %d\n",
(p->type & M_T_DEFAULT) ? "Default " : "",
p->name, p->CrtcHDisplay, p->CrtcHBlankStart,
p->CrtcHSyncStart, p->CrtcHSyncEnd, p->CrtcHBlankEnd,
p->CrtcHTotal, p->CrtcVDisplay, p->CrtcVBlankStart,
p->CrtcVSyncStart, p->CrtcVSyncEnd, p->CrtcVBlankEnd,
p->CrtcVTotal);
-#endif
p = p->next;
} while (p != NULL && p != scrp->modes);
}
diff --git a/hw/xfree86/common/xf86VidMode.c b/hw/xfree86/common/xf86VidMode.c
index d855bd1a8..49b86e73a 100644
--- a/hw/xfree86/common/xf86VidMode.c
+++ b/hw/xfree86/common/xf86VidMode.c
@@ -56,12 +56,6 @@ static Bool VidModeClose(int i, ScreenPtr pScreen);
#endif
-#ifdef DEBUG
-# define DEBUG_P(x) ErrorF(x"\n");
-#else
-# define DEBUG_P(x) /**/
-#endif
-
Bool
VidModeExtensionInit(ScreenPtr pScreen)
{
@@ -69,7 +63,7 @@ VidModeExtensionInit(ScreenPtr pScreen)
VidModePtr pVidMode;
if (!xf86GetVidModeEnabled()) {
- DEBUG_P("!xf86GetVidModeEnabled()");
+ DebugF("!xf86GetVidModeEnabled()\n");
return FALSE;
}
@@ -77,7 +71,7 @@ VidModeExtensionInit(ScreenPtr pScreen)
if (!dixSetPrivate(&pScreen->devPrivates, VidModeKey,
xcalloc(sizeof(VidModeRec), 1))) {
- DEBUG_P("xcalloc failed");
+ DebugF("xcalloc failed\n");
return FALSE;
}
@@ -89,7 +83,7 @@ VidModeExtensionInit(ScreenPtr pScreen)
VidModeCount++;
return TRUE;
#else
- DEBUG_P("no vidmode extension");
+ DebugF("no vidmode extension\n");
return FALSE;
#endif
}
@@ -123,13 +117,13 @@ VidModeAvailable(int scrnIndex)
VidModePtr pVidMode;
if (VidModeKey == NULL) {
- DEBUG_P("VidModeKey == NULL");
+ DebugF("VidModeKey == NULL\n");
return FALSE;
}
pScrn = xf86Screens[scrnIndex];
if (pScrn == NULL) {
- DEBUG_P("pScrn == NULL");
+ DebugF("pScrn == NULL\n");
return FALSE;
}
@@ -137,7 +131,7 @@ VidModeAvailable(int scrnIndex)
if (pVidMode)
return TRUE;
else {
- DEBUG_P("pVidMode == NULL");
+ DebugF("pVidMode == NULL\n");
return FALSE;
}
}
diff --git a/hw/xfree86/common/xf86fbman.c b/hw/xfree86/common/xf86fbman.c
index 510c3d8c4..5b8871723 100644
--- a/hw/xfree86/common/xf86fbman.c
+++ b/hw/xfree86/common/xf86fbman.c
@@ -802,10 +802,10 @@ LinearRemoveCBWrapper(FBAreaPtr area)
xfree(pLink);
}
-#ifdef DEBUG
static void
-Dump(FBLinearLinkPtr pLink)
+DumpDebug(FBLinearLinkPtr pLink)
{
+#ifdef DEBUG
if (!pLink) ErrorF("MMmm, PLINK IS NULL!\n");
while (pLink) {
@@ -817,8 +817,8 @@ Dump(FBLinearLinkPtr pLink)
pLink = pLink->next;
}
-}
#endif
+}
static FBLinearPtr
AllocateLinear(
@@ -889,9 +889,7 @@ AllocateLinear(
linear->linear.RemoveLinearCallback = NULL;
linear->linear.devPrivate.ptr = NULL;
-#ifdef DEBUG
- Dump(offman->LinearAreas);
-#endif
+ DumpDebug(offman->LinearAreas);
return &(linear->linear);
}
@@ -916,15 +914,11 @@ localAllocateOffscreenLinear(
xf86FBScreenKey);
/* Try to allocate from linear memory first...... */
-#ifdef DEBUG
- ErrorF("ALLOCATING LINEAR\n");
-#endif
+ DebugF("ALLOCATING LINEAR\n");
if ((linear = AllocateLinear(offman, length, gran, privData)))
return linear;
-#ifdef DEBUG
- ErrorF("NOPE, ALLOCATING AREA\n");
-#endif
+ DebugF("NOPE, ALLOCATING AREA\n");
if(!(link = xalloc(sizeof(FBLinearLink))))
return NULL;
@@ -978,9 +972,7 @@ localAllocateOffscreenLinear(
} else
xfree(link);
-#ifdef DEBUG
- Dump(offman->LinearAreas);
-#endif
+ DumpDebug(offman->LinearAreas);
return linear;
}
@@ -1005,17 +997,13 @@ localFreeOffscreenLinear(FBLinearPtr linear)
}
if(pLink->area) { /* really an XY area */
-#ifdef DEBUG
- ErrorF("FREEING AREA\n");
-#endif
+ DebugF("FREEING AREA\n");
localFreeOffscreenArea(pLink->area);
if(pLinkPrev)
pLinkPrev->next = pLink->next;
else offman->LinearAreas = pLink->next;
xfree(pLink);
-#ifdef DEBUG
- Dump(offman->LinearAreas);
-#endif
+ DumpDebug(offman->LinearAreas);
return;
}
@@ -1037,10 +1025,8 @@ localFreeOffscreenLinear(FBLinearPtr linear)
}
}
-#ifdef DEBUG
- ErrorF("FREEING LINEAR\n");
- Dump(offman->LinearAreas);
-#endif
+ DebugF("FREEING LINEAR\n");
+ DumpDebug(offman->LinearAreas);
}
diff --git a/hw/xfree86/common/xf86sbusBus.c b/hw/xfree86/common/xf86sbusBus.c
index 924c2bcb6..4936e75be 100644
--- a/hw/xfree86/common/xf86sbusBus.c
+++ b/hw/xfree86/common/xf86sbusBus.c
@@ -435,9 +435,7 @@ xf86MatchSbusInstances(const char *driverName, int sbusDevId,
return actualcards;
}
-#ifdef DEBUG
- ErrorF("%s instances found: %d\n", driverName, allocatedInstances);
-#endif
+ DebugF("%s instances found: %d\n", driverName, allocatedInstances);
for (i = 0; i < allocatedInstances; i++) {
char *promPath = NULL;
@@ -494,9 +492,7 @@ xf86MatchSbusInstances(const char *driverName, int sbusDevId,
xfree(promPath);
}
-#ifdef DEBUG
- ErrorF("%s instances found: %d\n", driverName, numClaimedInstances);
-#endif
+ DebugF("%s instances found: %d\n", driverName, numClaimedInstances);
/*
* 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))
continue;
-#ifdef DEBUG
- ErrorF("%s: card at fb%d %08x is claimed by a Device section\n",
+ DebugF("%s: card at fb%d %08x is claimed by a Device section\n",
driverName, psdp->fbNum, psdp->node.node);
-#endif
-
+
/* Allocate an entry in the lists to be returned */
numFound++;
retEntities = xnfrealloc(retEntities, numFound * sizeof(int));
diff --git a/hw/xfree86/os-support/linux/int10/linux.c b/hw/xfree86/os-support/linux/int10/linux.c
index 8274bbbfb..0cf3507c3 100644
--- a/hw/xfree86/os-support/linux/int10/linux.c
+++ b/hw/xfree86/os-support/linux/int10/linux.c
@@ -115,9 +115,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
if ((!vidMem) || (!sysMem)) {
if ((fd = open(DEV_MEM, O_RDWR, 0)) >= 0) {
if (!sysMem) {
-#ifdef DEBUG
- ErrorF("Mapping sys bios area\n");
-#endif
+ DebugF("Mapping sys bios area\n");
if ((sysMem = mmap((void *)(SYS_BIOS), BIOS_SIZE,
PROT_READ | PROT_EXEC,
MAP_SHARED | MAP_FIXED, fd, SYS_BIOS))
@@ -128,9 +126,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
}
}
if (!vidMem) {
-#ifdef DEBUG
- ErrorF("Mapping VRAM area\n");
-#endif
+ DebugF("Mapping VRAM area\n");
if ((vidMem = mmap((void *)(V_RAM), VRAM_SIZE,
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_SHARED | MAP_FIXED, fd, V_RAM))
@@ -162,9 +158,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
(pointer)xnfcalloc(1, ALLOC_ENTRIES(pagesize));
if (!xf86IsEntityPrimary(entityIndex)) {
-#ifdef DEBUG
- ErrorF("Mapping high memory area\n");
-#endif
+ DebugF("Mapping high memory area\n");
if ((high_mem = shmget(counter++, HIGH_MEM_SIZE,
IPC_CREAT | SHM_R | SHM_W)) == -1) {
if (errno == ENOSYS)
@@ -176,9 +170,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
goto error1;
}
} else {
-#ifdef DEBUG
- ErrorF("Mapping Video BIOS\n");
-#endif
+ DebugF("Mapping Video BIOS\n");
videoBiosMapped = TRUE;
if ((fd = open(DEV_MEM, O_RDWR, 0)) >= 0) {
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;
-#ifdef DEBUG
- ErrorF("Mapping 640kB area\n");
-#endif
+ DebugF("Mapping 640kB area\n");
if ((low_mem = shmget(counter++, V_RAM,
IPC_CREAT | SHM_R | SHM_W)) == -1) {
xf86DrvMsg(screen, X_ERROR,
@@ -229,16 +219,12 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
Int10Current = pInt;
-#ifdef DEBUG
- ErrorF("Mapping int area\n");
-#endif
+ DebugF("Mapping int area\n");
if (xf86ReadBIOS(0, 0, (unsigned char *)0, LOW_PAGE_SIZE) < 0) {
xf86DrvMsg(screen, X_ERROR, "Cannot read int vect\n");
goto error3;
}
-#ifdef DEBUG
- ErrorF("done\n");
-#endif
+ DebugF("done\n");
/*
* Read in everything between V_BIOS and SYS_BIOS as some system BIOSes
* have executable code there. Note that xf86ReadBIOS() can only bring in
@@ -246,17 +232,13 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
*/
if (!videoBiosMapped) {
memset((pointer)V_BIOS, 0, SYS_BIOS - V_BIOS);
-#ifdef DEBUG
- ErrorF("Reading BIOS\n");
-#endif
+ DebugF("Reading BIOS\n");
for (cs = V_BIOS; cs < SYS_BIOS; cs += V_BIOS_SIZE)
if (xf86ReadBIOS(cs, 0, (pointer)cs, V_BIOS_SIZE) < V_BIOS_SIZE)
xf86DrvMsg(screen, X_WARNING,
"Unable to retrieve all of segment 0x%06lX.\n",
(long)cs);
-#ifdef DEBUG
- ErrorF("done\n");
-#endif
+ DebugF("done\n");
}
if (xf86IsEntityPrimary(entityIndex) && !(initPrimary(options))) {
diff --git a/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c b/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c
index 9412b07a4..34afd9502 100644
--- a/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c
+++ b/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c
@@ -172,9 +172,7 @@ vm86_GP_fault(xf86Int10InfoPtr pInt)
break;
case 0xf4:
-#ifdef DEBUG
- ErrorF("hlt at %p\n", lina);
-#endif
+ DebugF("hlt at %p\n", lina);
return FALSE;
case 0x0f:
diff --git a/hw/xfree86/os-support/linux/lnx_acpi.c b/hw/xfree86/os-support/linux/lnx_acpi.c
index 8e11f4a59..5fad19451 100644
--- a/hw/xfree86/os-support/linux/lnx_acpi.c
+++ b/hw/xfree86/os-support/linux/lnx_acpi.c
@@ -135,15 +135,11 @@ lnxACPIOpen(void)
int r = -1;
static int warned = 0;
-#ifdef DEBUG
- ErrorF("ACPI: OSPMOpen called\n");
-#endif
+ DebugF("ACPI: OSPMOpen called\n");
if (ACPIihPtr || !xf86Info.pmFlag)
return NULL;
-#ifdef DEBUG
- ErrorF("ACPI: Opening device\n");
-#endif
+ DebugF("ACPI: Opening device\n");
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) > -1) {
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
@@ -172,10 +168,8 @@ static void
lnxCloseACPI(void)
{
int fd;
-
-#ifdef DEBUG
- ErrorF("ACPI: Closing device\n");
-#endif
+
+ DebugF("ACPI: Closing device\n");
if (ACPIihPtr) {
fd = xf86RemoveGeneralHandler(ACPIihPtr);
shutdown(fd, 2);
diff --git a/hw/xfree86/os-support/linux/lnx_apm.c b/hw/xfree86/os-support/linux/lnx_apm.c
index 9dae00e57..4ccc7d662 100644
--- a/hw/xfree86/os-support/linux/lnx_apm.c
+++ b/hw/xfree86/os-support/linux/lnx_apm.c
@@ -160,15 +160,11 @@ lnxAPMOpen(void)
{
int fd, pfd;
-#ifdef DEBUG
- ErrorF("APM: OSPMOpen called\n");
-#endif
+ DebugF("APM: OSPMOpen called\n");
if (APMihPtr || !xf86Info.pmFlag)
return NULL;
-#ifdef DEBUG
- ErrorF("APM: Opening device\n");
-#endif
+ DebugF("APM: Opening device\n");
if ((fd = open( APM_DEVICE, O_RDWR )) > -1) {
if (access( APM_PROC, R_OK ) ||
((pfd = open( APM_PROC, O_RDONLY)) == -1)) {
@@ -191,10 +187,8 @@ static void
lnxCloseAPM(void)
{
int fd;
-
-#ifdef DEBUG
- ErrorF("APM: Closing device\n");
-#endif
+
+ DebugF("APM: Closing device\n");
if (APMihPtr) {
fd = xf86RemoveGeneralHandler(APMihPtr);
close(fd);
diff --git a/hw/xfree86/os-support/linux/lnx_axp.c b/hw/xfree86/os-support/linux/lnx_axp.c
index f7151c8f4..d25999924 100644
--- a/hw/xfree86/os-support/linux/lnx_axp.c
+++ b/hw/xfree86/os-support/linux/lnx_axp.c
@@ -69,21 +69,15 @@ lnxGetAXP(void)
switch (count) {
case 1:
sscanf(res, "cpu model : %s",cpu);
-#ifdef DEBUG
- ErrorF("CPU %s\n",cpu);
-#endif
+ DebugF("CPU %s\n",cpu);
break;
case 5:
sscanf(res, "system type : %s",systype);
-#ifdef DEBUG
- ErrorF("system type : %s\n",systype);
-#endif
+ DebugF("system type : %s\n",systype);
break;
case 6:
sscanf(res, "system variation : %s",sysvari);
-#ifdef DEBUG
- ErrorF("system variation: %s\n",sysvari);
-#endif
+ DebugF("system variation: %s\n",sysvari);
break;
}
count++;
diff --git a/hw/xfree86/os-support/linux/lnx_font.c b/hw/xfree86/os-support/linux/lnx_font.c
index e9a5b6aef..5b2696af5 100644
--- a/hw/xfree86/os-support/linux/lnx_font.c
+++ b/hw/xfree86/os-support/linux/lnx_font.c
@@ -65,9 +65,7 @@ getfont(int *width, int *height,
op.flags = 0;
SYSCALL(result = ioctl(xf86Info.consoleFd, KDFONTOP, &op));
-#ifdef DEBUG
- ErrorF("Console font read: h: %i count: %i\n",op.height,op.charcount);
-#endif
+ DebugF("Console font read: h: %i count: %i\n",op.height,op.charcount);
if (!result) {
@@ -130,9 +128,7 @@ lnx_savefont(void)
int fd;
int width = 32, height = 32, charcount = 2048;
-#ifdef DEBUG
- ErrorF("SAVE font\n");
-#endif
+ DebugF("SAVE font\n");
#if CHECK_OS_VERSION
/* Check if the kernel has full support for this */
@@ -247,9 +243,7 @@ lnx_restorefont(void)
{
if (lnxfont.data == NULL)
return FALSE;
-#ifdef DEBUG
- ErrorF("RESTORE font\n");
-#endif
+ DebugF("RESTORE font\n");
#if 0
/* must wack the height to make the kernel reprogram the VGA registers */
if (!setfont(lnxfont.width, lnxfont.height + 1, lnxfont.charcount,
diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
index ed3576638..73409dfba 100644
--- a/hw/xfree86/os-support/linux/lnx_video.c
+++ b/hw/xfree86/os-support/linux/lnx_video.c
@@ -292,9 +292,7 @@ mtrr_add_wc_region(int screenNum, unsigned long base, unsigned long size,
lbase = lbase >> 1, d_size <<= 1);
while (d_size > n_size)
d_size = d_size >> 1;
-#ifdef DEBUG
- ErrorF("WC_BASE: 0x%lx WC_END: 0x%lx\n",base,base+d_size-1);
-#endif
+ DebugF("WC_BASE: 0x%lx WC_END: 0x%lx\n",base,base+d_size-1);
n_base += d_size;
n_size -= d_size;
if (n_size) {
@@ -424,11 +422,9 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
realBase = Base & ~(getpagesize() - 1);
alignOff = Base - realBase;
-#ifdef DEBUG
- ErrorF("base: %lx, realBase: %lx, alignOff: %lx \n",
+ DebugF("base: %lx, realBase: %lx, alignOff: %lx \n",
Base,realBase,alignOff);
-#endif
-
+
#if defined(__ia64__) || defined(__arm__) || defined(__s390__)
#ifndef MAP_WRITECOMBINED
#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,
strerror(errno));
}
-#ifdef DEBUG
- ErrorF("base: %lx aligned base: %lx\n",base, base + alignOff);
-#endif
+ DebugF("base: %lx aligned base: %lx\n",base, base + alignOff);
return (char *)base + alignOff;
}
#endif /* !(__sparc__) */
@@ -481,10 +475,8 @@ unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
{
memType alignOff = (memType)Base
- ((memType)Base & ~(getpagesize() - 1));
-
-#ifdef DEBUG
- ErrorF("alignment offset: %lx\n",alignOff);
-#endif
+
+ DebugF("alignment offset: %lx\n",alignOff);
munmap((caddr_t)((memType)Base - alignOff), (Size + alignOff));
}
diff --git a/hw/xfree86/os-support/sco/sco_video.c b/hw/xfree86/os-support/sco/sco_video.c
index 7edf71db3..f63b71df8 100644
--- a/hw/xfree86/os-support/sco/sco_video.c
+++ b/hw/xfree86/os-support/sco/sco_video.c
@@ -124,9 +124,7 @@ mapVidMemMMAP(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
realBase = Base & ~(getpagesize() - 1);
alignOff = Base - realBase;
-#ifdef DEBUG
- ErrorF("base: %lx, realBase: %lx, alignOff: %lx\n", Base,realBase,alignOff);
-#endif
+ DebugF("base: %lx, realBase: %lx, alignOff: %lx\n", Base,realBase,alignOff);
base = mmap((caddr_t)0, Size + alignOff,
(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 */
}
-#ifdef DEBUG
- ErrorF("base: %lx aligned base: %lx\n",base, base + alignOff);
-#endif
+ DebugF("base: %lx aligned base: %lx\n",base, base + alignOff);
return (pointer)((char *)base + alignOff);
}
diff --git a/hw/xfree86/os-support/shared/bios_mmap.c b/hw/xfree86/os-support/shared/bios_mmap.c
index 96d56bf1c..40afd5b8e 100644
--- a/hw/xfree86/os-support/shared/bios_mmap.c
+++ b/hw/xfree86/os-support/shared/bios_mmap.c
@@ -68,10 +68,8 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
close(fd);
return(-1);
}
-#ifdef DEBUG
- ErrorF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
+ DebugF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
Base, ptr[0] | (ptr[1] << 8));
-#endif
(void)memcpy(Buf, (void *)(ptr + Offset), Len);
(void)munmap((caddr_t)ptr, mlen);
(void)close(fd);
diff --git a/hw/xfree86/os-support/shared/posix_tty.c b/hw/xfree86/os-support/shared/posix_tty.c
index 697d0e51c..bf1bb03a3 100644
--- a/hw/xfree86/os-support/shared/posix_tty.c
+++ b/hw/xfree86/os-support/shared/posix_tty.c
@@ -400,17 +400,14 @@ int
xf86ReadSerial (int fd, void *buf, int count)
{
int r;
-#ifdef DEBUG
int i;
-#endif
+
SYSCALL (r = read (fd, buf, count));
-#ifdef DEBUG
- ErrorF("ReadingSerial: 0x%x",
+ DebugF("ReadingSerial: 0x%x",
(unsigned char)*(((unsigned char *)buf)));
for (i = 1; i < r; i++)
- ErrorF(", 0x%x",(unsigned char)*(((unsigned char *)buf) + i));
- ErrorF("\n");
-#endif
+ DebugF(", 0x%x",(unsigned char)*(((unsigned char *)buf) + i));
+ DebugF("\n");
return (r);
}
@@ -418,14 +415,12 @@ int
xf86WriteSerial (int fd, const void *buf, int count)
{
int r;
-#ifdef DEBUG
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++)
ErrorF(", 0x%x",(unsigned char)*(((unsigned char *)buf) + i));
- ErrorF("\n");
-#endif
+ DebugF("\n");
SYSCALL (r = write (fd, buf, count));
return (r);
}
@@ -482,9 +477,7 @@ xf86FlushInput(int fd)
struct timeval timeout;
char c[4];
-#ifdef DEBUG
- ErrorF("FlushingSerial\n");
-#endif
+ DebugF("FlushingSerial\n");
if (tcflush(fd, TCIFLUSH) == 0)
return 0;
diff --git a/hw/xfree86/ramdac/TI.c b/hw/xfree86/ramdac/TI.c
index f421fc39a..1c541d76b 100644
--- a/hw/xfree86/ramdac/TI.c
+++ b/hw/xfree86/ramdac/TI.c
@@ -115,10 +115,8 @@ TIramdacCalculateMNPForClock(
VCO = 8.0 * IntRef * best_m / best_n;
ActualClock = VCO / ( 1 << p );
-#ifdef DEBUG
- ErrorF( "f_out=%ld f_vco=%.1f n=%d m=%d p=%d\n",
+ DebugF( "f_out=%ld f_vco=%.1f n=%d m=%d p=%d\n",
ActualClock, VCO, *rN, *rM, *rP);
-#endif
return (ActualClock);
}
diff --git a/hw/xfree86/vbe/vbeModes.c b/hw/xfree86/vbe/vbeModes.c
index fb730a708..1a4d2407c 100644
--- a/hw/xfree86/vbe/vbeModes.c
+++ b/hw/xfree86/vbe/vbeModes.c
@@ -414,11 +414,9 @@ VBESetModeParameters(ScrnInfoPtr pScrn, vbeInfoPtr pVbe)
data->block->PixelClock = best->Clock * 1000;
/* XXX May not have this. */
clock = VBEGetPixelClock(pVbe, data->mode, data->block->PixelClock);
-#ifdef DEBUG
- ErrorF("Setting clock %.2fMHz, closest is %.2fMHz\n",
+ DebugF("Setting clock %.2fMHz, closest is %.2fMHz\n",
(double)data->block->PixelClock / 1000000.0,
(double)clock / 1000000.0);
-#endif
if (clock)
data->block->PixelClock = clock;
data->mode |= (1 << 11);
diff --git a/hw/xfree86/vgahw/vgaHW.c b/hw/xfree86/vgahw/vgaHW.c
index 9d466e3dc..004376b75 100644
--- a/hw/xfree86/vgahw/vgaHW.c
+++ b/hw/xfree86/vgahw/vgaHW.c
@@ -1025,32 +1025,24 @@ vgaHWSaveMode(ScrnInfoPtr scrninfp, vgaRegPtr save)
for (i = 0; i < save->numCRTC; i++) {
save->CRTC[i] = hwp->readCrtc(hwp, i);
-#ifdef DEBUG
- ErrorF("CRTC[0x%02x] = 0x%02x\n", i, save->CRTC[i]);
-#endif
+ DebugF("CRTC[0x%02x] = 0x%02x\n", i, save->CRTC[i]);
}
hwp->enablePalette(hwp);
for (i = 0; i < save->numAttribute; i++) {
save->Attribute[i] = hwp->readAttr(hwp, i);
-#ifdef DEBUG
- ErrorF("Attribute[0x%02x] = 0x%02x\n", i, save->Attribute[i]);
-#endif
+ DebugF("Attribute[0x%02x] = 0x%02x\n", i, save->Attribute[i]);
}
hwp->disablePalette(hwp);
for (i = 0; i < save->numGraphics; i++) {
save->Graphics[i] = hwp->readGr(hwp, i);
-#ifdef DEBUG
- ErrorF("Graphics[0x%02x] = 0x%02x\n", i, save->Graphics[i]);
-#endif
+ DebugF("Graphics[0x%02x] = 0x%02x\n", i, save->Graphics[i]);
}
for (i = 1; i < save->numSequencer; i++) {
save->Sequencer[i] = hwp->readSeq(hwp, i);
-#ifdef DEBUG
- ErrorF("Sequencer[0x%02x] = 0x%02x\n", i, save->Sequencer[i]);
-#endif
+ DebugF("Sequencer[0x%02x] = 0x%02x\n", i, save->Sequencer[i]);
}
}
@@ -1088,18 +1080,16 @@ vgaHWSaveColormap(ScrnInfoPtr scrninfp, vgaRegPtr save)
hwp->writeDacReadAddr(hwp, 0x00);
for (i = 0; i < 6; i++) {
save->DAC[i] = hwp->readDacData(hwp);
-#ifdef DEBUG
switch (i % 3) {
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;
case 1:
- ErrorF("0x%02x, ", save->DAC[i]);
+ DebugF("0x%02x, ", save->DAC[i]);
break;
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++) {
save->DAC[i] = hwp->readDacData(hwp);
DACDelay(hwp);
-#ifdef DEBUG
switch (i % 3) {
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;
case 1:
- ErrorF("0x%02x, ", save->DAC[i]);
+ DebugF("0x%02x, ", save->DAC[i]);
break;
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
* for now.
*/
-#ifdef DEBUG
- ErrorF("Mapping VGAMem\n");
-#endif
+ DebugF("Mapping VGAMem\n");
hwp->Base = xf86MapDomainMemory(scr_index, VIDMEM_MMIO_32BIT, hwp->dev,
hwp->MapPhys, hwp->MapSize);
return hwp->Base != NULL;
@@ -1790,9 +1776,7 @@ vgaHWUnmapMem(ScrnInfoPtr scrp)
if (hwp->Base == NULL)
return;
-#ifdef DEBUG
- ErrorF("Unmapping VGAMem\n");
-#endif
+ DebugF("Unmapping VGAMem\n");
xf86UnMapVidMem(scr_index, hwp->Base, hwp->MapSize);
hwp->Base = NULL;
}