summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWang Zhenyu <zhenyu.z.wang@intel.com>2007-01-11 17:10:29 +0800
committerWang Zhenyu <zhenyu.z.wang@intel.com>2007-01-11 17:10:29 +0800
commit60a48c17797593d45e7a1bae4886b34bc9080a69 (patch)
tree1d3114aee53b38c2f61f4bd37891b939dd833f34
parentfcc351eea41ea579f25bcaede7a63ca3905866b6 (diff)
downloadxorg-driver-xf86-video-intel-60a48c17797593d45e7a1bae4886b34bc9080a69.tar.gz
clean up log message for mem allocation
show dryrun explicit
-rw-r--r--src/i830_memory.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 9806feb0..5af9138f 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -788,6 +788,9 @@ I830AllocateCursorMemory (ScrnInfoPtr pScrn, I830MemRange *cursor_mem,
I830Ptr pI830 = I830PTR(pScrn);
int cursFlags = 0;
unsigned long size, alloced;
+ Bool dryrun = ((flags & ALLOCATE_DRY_RUN) != 0);
+ int verbosity = dryrun ? 4 : 1;
+ const char *s = dryrun ? "[dryrun] " : "";
/*
* Mouse cursor -- The i810-i830 need a physical address in system
@@ -804,16 +807,17 @@ I830AllocateCursorMemory (ScrnInfoPtr pScrn, I830MemRange *cursor_mem,
&(pI830->StolenPool), size,
GTT_PAGE_SIZE, flags | cursFlags);
if (alloced < size) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ if (!dryrun)
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Failed to allocate HW cursor space.\n");
return FALSE;
} else {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Allocated %ld kB for HW cursor at 0x%lx",
+ "%sAllocated %ld kB for HW cursor at 0x%lx\n",s,
alloced / 1024, cursor_mem->Start);
if (pI830->CursorNeedsPhysical)
- xf86ErrorF(" (0x%08lx)", cursor_mem->Physical);
- xf86ErrorF("\n");
+ xf86ErrorFVerb(verbosity, " (0x%08lx)", cursor_mem->Physical);
+ xf86ErrorFVerb(verbosity, "\n");
}
size = HWCURSOR_SIZE_ARGB;
@@ -825,16 +829,17 @@ I830AllocateCursorMemory (ScrnInfoPtr pScrn, I830MemRange *cursor_mem,
&(pI830->StolenPool), size,
GTT_PAGE_SIZE, flags | cursFlags);
if (alloced < size) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ if (!dryrun)
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Failed to allocate HW (ARGB) cursor space.\n");
return FALSE;
} else {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Allocated %ld kB for HW (ARGB) cursor at 0x%lx",
+ "%sAllocated %ld kB for HW (ARGB) cursor at 0x%lx\n",s,
alloced / 1024, cursor_mem_argb->Start);
if (pI830->CursorNeedsPhysical)
- xf86ErrorF(" (0x%08lx)", cursor_mem_argb->Physical);
- xf86ErrorF("\n");
+ xf86ErrorFVerb(verbosity, " (0x%08lx)", cursor_mem_argb->Physical);
+ xf86ErrorFVerb(verbosity, "\n");
}
return TRUE;
@@ -967,8 +972,8 @@ I830Allocate2DMemory(ScrnInfoPtr pScrn, const int flags)
}
return FALSE;
} else {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Successful allocation of "
- "EXA offscreen memory at 0x%lx, size %ld KB\n",
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%sSuccessful allocation of "
+ "EXA offscreen memory at 0x%lx, size %ld KB\n",s,
pI830->Offscreen.Start, pI830->Offscreen.Size/1024);
}
}