Deprecating R128TRACE macro in favor of DEBUG macro used inside OpenChrome DDX.
Signed-off-by: Kevin Brace <kevinbr...@gmx.com> --- src/r128.h | 13 +++--- src/r128_accel.c | 57 ++++++++++++++++-------- src/r128_crtc.c | 117 +++++++++++++++++++++++++++++--------------------- src/r128_driver.c | 74 +++++++++++++++++++------------ src/r128_exa.c | 22 +++++++--- src/r128_exa_render.c | 67 +++++++++++++++++++++-------- 6 files changed, 223 insertions(+), 127 deletions(-) diff --git a/src/r128.h b/src/r128.h index 451d5d2..d09429b 100644 --- a/src/r128.h +++ b/src/r128.h @@ -120,13 +120,14 @@ #if R128_DEBUG #include "r128_version.h" -#define R128TRACE(x) \ - do { \ - ErrorF("(**) %s(%d): ", R128_NAME, pScrn->scrnIndex); \ - ErrorF x; \ - } while (0); +#endif + +#if R128_DEBUG +#define DEBUG(x) x + #else -#define R128TRACE(x) +#define DEBUG(x) + #endif diff --git a/src/r128_accel.c b/src/r128_accel.c index 7f70220..ab04b25 100644 --- a/src/r128_accel.c +++ b/src/r128_accel.c @@ -182,10 +182,13 @@ void R128WaitForFifoFunction(ScrnInfoPtr pScrn, int entries) info->fifo_slots = INREG(R128_GUI_STAT) & R128_GUI_FIFOCNT_MASK; if (info->fifo_slots >= entries) return; } - R128TRACE(("FIFO timed out: %d entries, stat=0x%08x, probe=0x%08x\n", - INREG(R128_GUI_STAT) & R128_GUI_FIFOCNT_MASK, - INREG(R128_GUI_STAT), - INREG(R128_GUI_PROBE))); + + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "FIFO timed out: %d entries, " + "stat=0x%08x, probe=0x%08x\n", + INREG(R128_GUI_STAT) & R128_GUI_FIFOCNT_MASK, + INREG(R128_GUI_STAT), + INREG(R128_GUI_PROBE))); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "FIFO timed out, resetting engine...\n"); R128EngineReset(pScrn); @@ -216,10 +219,13 @@ void R128WaitForIdle(ScrnInfoPtr pScrn) return; } } - R128TRACE(("Idle timed out: %d entries, stat=0x%08x, probe=0x%08x\n", - INREG(R128_GUI_STAT) & R128_GUI_FIFOCNT_MASK, - INREG(R128_GUI_STAT), - INREG(R128_GUI_PROBE))); + + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Idle timed out: %d entries, " + "stat=0x%08x, probe=0x%08x\n", + INREG(R128_GUI_STAT) & R128_GUI_FIFOCNT_MASK, + INREG(R128_GUI_STAT), + INREG(R128_GUI_PROBE))); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Idle timed out, resetting engine...\n"); #ifdef R128DRI @@ -526,10 +532,13 @@ static void R128SubsequentSolidFillTrap(ScrnInfoPtr pScrn, int y, int h, int origdxL = dxL; int origdxR = dxR; - R128TRACE(("Trap %d %d; L %d %d %d %d; R %d %d %d %d\n", - y, h, - left, dxL, dyL, eL, - right, dxR, dyR, eR)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Trap %d %d; " + "L %d %d %d %d; " + "R %d %d %d %d\n", + y, h, + left, dxL, dyL, eL, + right, dxR, dyR, eR)); if (dxL < 0) dxL = -dxL; else flags |= (1 << 0) /* | (1 << 8) */; if (dxR < 0) dxR = -dxR; else flags |= (1 << 6); @@ -680,7 +689,9 @@ static void R128SetupForColor8x8PatternFill(ScrnInfoPtr pScrn, R128InfoPtr info = R128PTR(pScrn); unsigned char *R128MMIO = info->MMIO; - R128TRACE(("Color8x8 %d %d %d\n", trans_color, patx, paty)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Color8x8 %d %d %d\n", + trans_color, patx, paty)); R128WaitForFifo(pScrn, 2); OUTREG(R128_DP_GUI_MASTER_CNTL, (info->dp_gui_master_cntl @@ -708,7 +719,9 @@ static void R128SubsequentColor8x8PatternFillRect( ScrnInfoPtr pScrn, R128InfoPtr info = R128PTR(pScrn); unsigned char *R128MMIO = info->MMIO; - R128TRACE(("Color8x8 %d,%d %d,%d %d %d\n", patx, paty, x, y, w, h)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Color8x8 %d,%d %d,%d %d %d\n", + patx, paty, x, y, w, h)); R128WaitForFifo(pScrn, 3); OUTREG(R128_SRC_Y_X, (paty << 16) | patx); OUTREG(R128_DST_Y_X, (y << 16) | x); @@ -1017,7 +1030,10 @@ void R128EngineInit(ScrnInfoPtr pScrn) R128InfoPtr info = R128PTR(pScrn); unsigned char *R128MMIO = info->MMIO; - R128TRACE(("EngineInit (%d/%d)\n", info->CurrentLayout.pixel_code, info->CurrentLayout.bitsPerPixel)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "EngineInit (%d/%d)\n", + info->CurrentLayout.pixel_code, + info->CurrentLayout.bitsPerPixel)); OUTREG(R128_SCALE_3D_CNTL, 0); R128EngineReset(pScrn); @@ -1029,13 +1045,16 @@ void R128EngineInit(ScrnInfoPtr pScrn) case 24: info->datatype = 5; break; case 32: info->datatype = 6; break; default: - R128TRACE(("Unknown depth/bpp = %d/%d (code = %d)\n", - info->CurrentLayout.depth, info->CurrentLayout.bitsPerPixel, - info->CurrentLayout.pixel_code)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Unknown depth/bpp = %d/%d (code = %d)\n", + info->CurrentLayout.depth, + info->CurrentLayout.bitsPerPixel, + info->CurrentLayout.pixel_code)); } info->pitch = (info->CurrentLayout.displayWidth / 8) * (info->CurrentLayout.pixel_bytes == 3 ? 3 : 1); - R128TRACE(("Pitch for acceleration = %d\n", info->pitch)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Pitch for acceleration = %d\n", info->pitch)); R128WaitForFifo(pScrn, 2); OUTREG(R128_DEFAULT_OFFSET, pScrn->fbOffset); diff --git a/src/r128_crtc.c b/src/r128_crtc.c index cb53c8a..5dc8e18 100644 --- a/src/r128_crtc.c +++ b/src/r128_crtc.c @@ -146,8 +146,11 @@ Bool R128InitCrtcRegisters(xf86CrtcPtr crtc, R128SavePtr save, DisplayModePtr mo : 0)); save->crtc_pitch = info->CurrentLayout.displayWidth / 8; - R128TRACE(("Pitch = %d bytes (virtualX = %d, displayWidth = %d)\n", - save->crtc_pitch, pScrn->virtualX, info->CurrentLayout.displayWidth)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Pitch = %d bytes (virtualX = %d, " + "displayWidth = %d)\n", + save->crtc_pitch, pScrn->virtualX, + info->CurrentLayout.displayWidth)); #if X_BYTE_ORDER == X_BIG_ENDIAN /* Change the endianness of the aperture */ @@ -238,9 +241,11 @@ Bool R128InitCrtc2Registers(xf86CrtcPtr crtc, R128SavePtr save, DisplayModePtr m : 0)); save->crtc2_pitch = info->CurrentLayout.displayWidth / 8; - R128TRACE(("Pitch = %d bytes (virtualX = %d, displayWidth = %d)\n", - save->crtc2_pitch, pScrn->virtualX, - info->CurrentLayout.displayWidth)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Pitch = %d bytes (virtualX = %d, " + "displayWidth = %d)\n", + save->crtc2_pitch, pScrn->virtualX, + info->CurrentLayout.displayWidth)); return TRUE; } @@ -381,11 +386,12 @@ static void R128InitPLLRegisters(xf86CrtcPtr crtc, R128SavePtr save, pll->reference_freq); save->post_div = post_div->divider; - R128TRACE(("dc=%d, of=%d, fd=%d, pd=%d\n", - save->dot_clock_freq, - save->pll_output_freq, - save->feedback_div, - save->post_div)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "dc=%d, of=%d, fd=%d, pd=%d\n", + save->dot_clock_freq, + save->pll_output_freq, + save->feedback_div, + save->post_div)); save->ppll_ref_div = pll->reference_div; save->ppll_div_3 = (save->feedback_div | (post_div->bitvalue << 16)); @@ -437,11 +443,12 @@ void R128InitPLL2Registers(xf86CrtcPtr crtc, R128SavePtr save, pll->reference_freq); save->post_div_2 = post_div->divider; - R128TRACE(("dc=%d, of=%d, fd=%d, pd=%d\n", - save->dot_clock_freq_2, - save->pll_output_freq_2, - save->feedback_div_2, - save->post_div_2)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "dc=%d, of=%d, fd=%d, pd=%d\n", + save->dot_clock_freq_2, + save->pll_output_freq_2, + save->feedback_div_2, + save->post_div_2)); save->p2pll_ref_div = pll->reference_div; save->p2pll_div_0 = (save->feedback_div_2 | (post_div->bitvalue<<16)); @@ -536,15 +543,18 @@ void R128RestorePLLRegisters(ScrnInfoPtr pScrn, R128SavePtr restore) | R128_PPLL_ATOMIC_UPDATE_EN | R128_PPLL_VGA_ATOMIC_UPDATE_EN)); - R128TRACE(("Wrote: 0x%08x 0x%08x 0x%08x (0x%08x)\n", - restore->ppll_ref_div, - restore->ppll_div_3, - restore->htotal_cntl, - INPLL(pScrn, R128_PPLL_CNTL))); - R128TRACE(("Wrote: rd=%d, fd=%d, pd=%d\n", - restore->ppll_ref_div & R128_PPLL_REF_DIV_MASK, - restore->ppll_div_3 & R128_PPLL_FB3_DIV_MASK, - (restore->ppll_div_3 & R128_PPLL_POST3_DIV_MASK) >> 16)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Wrote: 0x%08x 0x%08x 0x%08x (0x%08x)\n", + restore->ppll_ref_div, + restore->ppll_div_3, + restore->htotal_cntl, + INPLL(pScrn, R128_PPLL_CNTL))); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Wrote: rd=%d, fd=%d, pd=%d\n", + restore->ppll_ref_div & R128_PPLL_REF_DIV_MASK, + restore->ppll_div_3 & R128_PPLL_FB3_DIV_MASK, + (restore->ppll_div_3 & + R128_PPLL_POST3_DIV_MASK) >> 16)); usleep(5000); /* let the clock lock */ @@ -605,15 +615,18 @@ void R128RestorePLL2Registers(ScrnInfoPtr pScrn, R128SavePtr restore) | R128_P2PLL_ATOMIC_UPDATE_EN | R128_P2PLL_VGA_ATOMIC_UPDATE_EN)); - R128TRACE(("Wrote: 0x%08x 0x%08x 0x%08x (0x%08x)\n", - restore->p2pll_ref_div, - restore->p2pll_div_0, - restore->htotal_cntl2, - INPLL(pScrn, R128_P2PLL_CNTL))); - R128TRACE(("Wrote: rd=%d, fd=%d, pd=%d\n", - restore->p2pll_ref_div & R128_P2PLL_REF_DIV_MASK, - restore->p2pll_div_0 & R128_P2PLL_FB0_DIV_MASK, - (restore->p2pll_div_0 & R128_P2PLL_POST0_DIV_MASK) >>16)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Wrote: 0x%08x 0x%08x 0x%08x (0x%08x)\n", + restore->p2pll_ref_div, + restore->p2pll_div_0, + restore->htotal_cntl2, + INPLL(pScrn, R128_P2PLL_CNTL))); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Wrote: rd=%d, fd=%d, pd=%d\n", + restore->p2pll_ref_div & R128_P2PLL_REF_DIV_MASK, + restore->p2pll_div_0 & R128_P2PLL_FB0_DIV_MASK, + (restore->p2pll_div_0 & + R128_P2PLL_POST0_DIV_MASK) >>16)); usleep(5000); /* Let the clock to lock */ @@ -684,14 +697,17 @@ Bool R128InitDDARegisters(xf86CrtcPtr crtc, R128SavePtr save, save->dda_on_off = (Ron << 16) | Roff; - R128TRACE(("XclkFreq = %d; VclkFreq = %d; per = %d, %d (useable = %d)\n", - XclkFreq, - VclkFreq, - XclksPerTransfer, - XclksPerTransferPrecise, - UseablePrecision)); - R128TRACE(("Roff = %d, Ron = %d, Rloop = %d\n", - Roff, Ron, info->ram->Rloop)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "XclkFreq = %d; VclkFreq = %d; " + "per = %d, %d (useable = %d)\n", + XclkFreq, + VclkFreq, + XclksPerTransfer, + XclksPerTransferPrecise, + UseablePrecision)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Roff = %d, Ron = %d, Rloop = %d\n", + Roff, Ron, info->ram->Rloop)); return TRUE; } @@ -760,14 +776,17 @@ Bool R128InitDDA2Registers(xf86CrtcPtr crtc, R128SavePtr save, /* shift most be 18 otherwise there's corruption on crtc2 */ save->dda2_on_off = (Ron << 18) | Roff; - R128TRACE(("XclkFreq = %d; VclkFreq = %d; per = %d, %d (useable = %d)\n", - XclkFreq, - VclkFreq, - XclksPerTransfer, - XclksPerTransferPrecise, - UseablePrecision)); - R128TRACE(("Roff = %d, Ron = %d, Rloop = %d\n", - Roff, Ron, info->ram->Rloop)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "XclkFreq = %d; VclkFreq = %d; " + "per = %d, %d (useable = %d)\n", + XclkFreq, + VclkFreq, + XclksPerTransfer, + XclksPerTransferPrecise, + UseablePrecision)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Roff = %d, Ron = %d, Rloop = %d\n", + Roff, Ron, info->ram->Rloop)); return TRUE; } diff --git a/src/r128_driver.c b/src/r128_driver.c index c272a30..c6d4f8a 100644 --- a/src/r128_driver.c +++ b/src/r128_driver.c @@ -608,8 +608,9 @@ static Bool R128GetPLLParameters(ScrnInfoPtr pScrn) } else { uint16_t bios_header = R128_BIOS16(0x48); uint16_t pll_info_block = R128_BIOS16(bios_header + 0x30); - R128TRACE(("Header at 0x%04x; PLL Information at 0x%04x\n", - bios_header, pll_info_block)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Header at 0x%04x; PLL Information at 0x%04x\n", + bios_header, pll_info_block)); pll->reference_freq = R128_BIOS16(pll_info_block + 0x0e); pll->reference_div = R128_BIOS16(pll_info_block + 0x10); @@ -1262,7 +1263,8 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags) { R128InfoPtr info; - R128TRACE(("R128PreInit\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "R128PreInit\n")); if (flags & PROBE_DETECT) { return TRUE; @@ -1601,7 +1603,9 @@ Bool R128ScreenInit(SCREEN_INIT_ARGS_DECL) #endif char *optstr; - R128TRACE(("R128ScreenInit %x %d\n", pScrn->memPhysBase, pScrn->fbOffset)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "R128ScreenInit %x %d\n", + pScrn->memPhysBase, pScrn->fbOffset)); info->useEXA = FALSE; #ifdef USE_EXA #ifndef HAVE_XAA_H @@ -2298,14 +2302,17 @@ static void R128SavePLLRegisters(ScrnInfoPtr pScrn, R128SavePtr save) save->ppll_div_0 = INPLL(pScrn, R128_PPLL_DIV_0); save->htotal_cntl = INPLL(pScrn, R128_HTOTAL_CNTL); - R128TRACE(("Read: 0x%08x 0x%08x 0x%08x\n", - save->ppll_ref_div, - save->ppll_div_3, - save->htotal_cntl)); - R128TRACE(("Read: rd=%d, fd=%d, pd=%d\n", - save->ppll_ref_div & R128_PPLL_REF_DIV_MASK, - save->ppll_div_3 & R128_PPLL_FB3_DIV_MASK, - (save->ppll_div_3 & R128_PPLL_POST3_DIV_MASK) >> 16)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Read: 0x%08x 0x%08x 0x%08x\n", + save->ppll_ref_div, + save->ppll_div_3, + save->htotal_cntl)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Read: rd=%d, fd=%d, pd=%d\n", + save->ppll_ref_div & R128_PPLL_REF_DIV_MASK, + save->ppll_div_3 & R128_PPLL_FB3_DIV_MASK, + (save->ppll_div_3 & + R128_PPLL_POST3_DIV_MASK) >> 16)); } /* Read PLL2 registers. */ @@ -2315,14 +2322,17 @@ static void R128SavePLL2Registers(ScrnInfoPtr pScrn, R128SavePtr save) save->p2pll_div_0 = INPLL(pScrn, R128_P2PLL_DIV_0); save->htotal_cntl2 = INPLL(pScrn, R128_HTOTAL2_CNTL); - R128TRACE(("Read: 0x%08x 0x%08x 0x%08x\n", - save->p2pll_ref_div, - save->p2pll_div_0, - save->htotal_cntl2)); - R128TRACE(("Read: rd=%d, fd=%d, pd=%d\n", - save->p2pll_ref_div & R128_P2PLL_REF_DIV_MASK, - save->p2pll_div_0 & R128_P2PLL_FB0_DIV_MASK, - (save->p2pll_div_0 & R128_P2PLL_POST0_DIV_MASK) >> 16)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Read: 0x%08x 0x%08x 0x%08x\n", + save->p2pll_ref_div, + save->p2pll_div_0, + save->htotal_cntl2)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Read: rd=%d, fd=%d, pd=%d\n", + save->p2pll_ref_div & R128_P2PLL_REF_DIV_MASK, + save->p2pll_div_0 & R128_P2PLL_FB0_DIV_MASK, + (save->p2pll_div_0 & + R128_P2PLL_POST0_DIV_MASK) >> 16)); } /* Read DDA registers. */ @@ -2367,7 +2377,8 @@ static void R128SaveMode(ScrnInfoPtr pScrn, R128SavePtr save) R128InfoPtr info = R128PTR(pScrn); R128EntPtr pR128Ent = R128EntPriv(pScrn); - R128TRACE(("R128SaveMode(%p)\n", save)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "R128SaveMode(%p)\n", save)); R128SaveCommonRegisters(pScrn, save); R128SaveCrtcRegisters(pScrn, save); @@ -2383,7 +2394,8 @@ static void R128SaveMode(ScrnInfoPtr pScrn, R128SavePtr save) } R128SavePalette(pScrn, save); - R128TRACE(("R128SaveMode returns %p\n", save)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "R128SaveMode returns %p\n", save)); } /* Save everything needed to restore the original VC state. */ @@ -2393,7 +2405,8 @@ static void R128Save(ScrnInfoPtr pScrn) unsigned char *R128MMIO = info->MMIO; R128SavePtr save = &info->SavedReg; - R128TRACE(("R128Save\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "R128Save\n")); if (info->FBDev) { fbdevHWSave(pScrn); return; @@ -2436,7 +2449,8 @@ static void R128Restore(ScrnInfoPtr pScrn) unsigned char *R128MMIO = info->MMIO; R128SavePtr restore = &info->SavedReg; - R128TRACE(("R128Restore\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "R128Restore\n")); if (info->FBDev) { fbdevHWRestore(pScrn); return; @@ -2773,7 +2787,8 @@ Bool R128EnterVT(VT_FUNC_ARGS_DECL) SCRN_INFO_PTR(arg); R128InfoPtr info = R128PTR(pScrn); - R128TRACE(("R128EnterVT\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "R128EnterVT\n")); pScrn->vtSema = TRUE; if (info->FBDev) { @@ -2813,7 +2828,8 @@ void R128LeaveVT(VT_FUNC_ARGS_DECL) R128InfoPtr info = R128PTR(pScrn); R128SavePtr save = &info->ModeReg; - R128TRACE(("R128LeaveVT\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "R128LeaveVT\n")); #ifdef R128DRI if (info->directRenderingEnabled) { DRILock(pScrn->pScreen, 0); @@ -2841,7 +2857,8 @@ static Bool R128CloseScreen(CLOSE_SCREEN_ARGS_DECL) ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); - R128TRACE(("R128CloseScreen\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "R128CloseScreen\n")); #ifdef R128DRI /* Disable direct rendering */ @@ -2890,7 +2907,8 @@ void R128FreeScreen(FREE_SCREEN_ARGS_DECL) SCRN_INFO_PTR(arg); R128InfoPtr info = R128PTR(pScrn); - R128TRACE(("R128FreeScreen\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "R128FreeScreen\n")); if (info == NULL) return; #ifdef WITH_VGAHW diff --git a/src/r128_exa.c b/src/r128_exa.c index 2a628a8..1bbf470 100644 --- a/src/r128_exa.c +++ b/src/r128_exa.c @@ -92,12 +92,14 @@ static Bool R128GetOffsetPitch(PixmapPtr pPix, int bpp, uint32_t *pitch_offset, R128InfoPtr info = R128PTR(pScrn); if (pitch > 16320 || pitch % info->ExaDriver->pixmapPitchAlign != 0) { - R128TRACE(("Bad pitch 0x%08x\n", pitch)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Bad pitch 0x%08x\n", pitch)); return FALSE; } if (offset % info->ExaDriver->pixmapOffsetAlign != 0) { - R128TRACE(("Bad offset 0x%08x\n", offset)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Bad offset 0x%08x\n", offset)); return FALSE; } @@ -182,11 +184,13 @@ R128PrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg) uint32_t datatype, dst_pitch_offset; if (!R128GetDatatypeBpp(bpp, &datatype)) { - R128TRACE(("R128GetDatatypeBpp failed\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "R128GetDatatypeBpp failed\n")); return FALSE; } if (!R128GetPixmapOffsetPitch(pPixmap, &dst_pitch_offset)) { - R128TRACE(("R128GetPixmapOffsetPitch failed\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "R128GetPixmapOffsetPitch failed\n")); return FALSE; } if (info->state_2d.in_use) return FALSE; @@ -281,15 +285,19 @@ R128PrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, int ydir, uint32_t datatype, src_pitch_offset, dst_pitch_offset; if (!R128GetDatatypeBpp(bpp, &datatype)) { - R128TRACE(("R128GetDatatypeBpp failed\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "R128GetDatatypeBpp failed\n")); return FALSE; } if (!R128GetPixmapOffsetPitch(pSrcPixmap, &src_pitch_offset)) { - R128TRACE(("R128GetPixmapOffsetPitch source failed\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "R128GetPixmapOffsetPitch source " + "failed\n")); return FALSE; } if (!R128GetPixmapOffsetPitch(pDstPixmap, &dst_pitch_offset)) { - R128TRACE(("R128GetPixmapOffsetPitch dest failed\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "R128GetPixmapOffsetPitch dest failed\n")); return FALSE; } if (info->state_2d.in_use) return FALSE; diff --git a/src/r128_exa_render.c b/src/r128_exa_render.c index b9601ee..06de074 100644 --- a/src/r128_exa_render.c +++ b/src/r128_exa_render.c @@ -172,25 +172,31 @@ R128CheckCompositeTexture(PicturePtr pPict, PicturePtr pDstPict, int op) int h = pPict->pDrawable->height; if (pPict->repeat && ((w & (w - 1)) != 0 || (h & (h - 1)) != 0)) { - R128TRACE(("NPOT repeat unsupported (%dx%d)\n", w, h)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "NPOT repeat unsupported (%dx%d)\n", w, h)); return FALSE; } } if (pPict->filter != PictFilterNearest && pPict->filter != PictFilterBilinear) { - R128TRACE(("Unsupported filter 0x%x\n", pPict->filter)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Unsupported filter 0x%x\n", + pPict->filter)); return FALSE; } /* The radeon driver has a long explanation about this part that I don't really understand */ if (pPict->transform != 0 && repeatType == RepeatNone && PICT_FORMAT_A(pPict->format) == 0) { if (!(((op == PictOpSrc) || (op == PictOpClear)) && (PICT_FORMAT_A(pDstPict->format) == 0))) { - R128TRACE(("REPEAT_NONE unsupported for transformed xRGB source\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "REPEAT_NONE unsupported for " + "transformed xRGB source\n")); return FALSE; } } if (!R128TransformAffineOrScaled(pPict->transform)) { - R128TRACE(("Non-affine transforms not supported\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Non-affine transforms not supported\n")); return FALSE; } @@ -210,30 +216,40 @@ R128CCECheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, P /* Check for unsupported compositing operations. */ if (op >= sizeof(R128BlendOp) / sizeof(R128BlendOp[0])) { - R128TRACE(("Unsupported Composite op 0x%x\n", op)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Unsupported Composite op 0x%x\n", op)); return FALSE; } pDstPixmap = R128GetDrawablePixmap(pDstPicture->pDrawable); if (pDstPixmap->drawable.width > 1024 || pDstPixmap->drawable.height > 1024) { - R128TRACE(("Dest w/h too large (%d,%d).\n", pDstPixmap->drawable.width, pDstPixmap->drawable.height)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Dest w/h too large (%d,%d).\n", + pDstPixmap->drawable.width, + pDstPixmap->drawable.height)); return FALSE; } if (pSrcPicture->pDrawable) { pSrcPixmap = R128GetDrawablePixmap(pSrcPicture->pDrawable); if (pSrcPixmap->drawable.width > 1024 || pSrcPixmap->drawable.height > 1024) { - R128TRACE(("Source w/h too large (%d,%d).\n", pSrcPixmap->drawable.width, pSrcPixmap->drawable.height)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Source w/h too large (%d,%d).\n", + pSrcPixmap->drawable.width, + pSrcPixmap->drawable.height)); return FALSE; } } else if (pSrcPicture->pSourcePict->type != SourcePictTypeSolidFill) { - R128TRACE(("Gradient pictures not supported yet\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Gradient pictures not supported yet\n")); return FALSE; } if (pDstPicture->format == PICT_a8) { if (R128BlendOp[op].src_alpha || R128BlendOp[op].dst_alpha || pMaskPicture != NULL) { - R128TRACE(("Alpha blending unsupported with A8 dst?\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Alpha blending unsupported with " + "A8 dst?\n")); return FALSE; } } else { @@ -246,16 +262,22 @@ R128CCECheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, P if (pMaskPicture->pDrawable) { pMaskPixmap = R128GetDrawablePixmap(pMaskPicture->pDrawable); if (pMaskPixmap->drawable.width > 1024 || pMaskPixmap->drawable.height > 1024) { - R128TRACE(("Mask w/h too large (%d,%d).\n", pMaskPixmap->drawable.width, pMaskPixmap->drawable.height)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Mask w/h too large (%d,%d).\n", + pMaskPixmap->drawable.width, + pMaskPixmap->drawable.height)); return FALSE; } } else if (pMaskPicture->pSourcePict->type != SourcePictTypeSolidFill) { - R128TRACE(("Gradient pictures not supported yet\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Gradient pictures not supported yet\n")); return FALSE; } if (pMaskPicture->componentAlpha && R128BlendOp[op].src_alpha) { - R128TRACE(("Component alpha not supported with source alpha blending\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Component alpha not supported with " + "source alpha blending\n")); return FALSE; } @@ -284,7 +306,8 @@ R128TextureSetup(PicturePtr pPict, PixmapPtr pPix, int unit, uint32_t *txsize, u pitch = exaGetPixmapPitch(pPix); if ((pitch & (pitch - 1)) != 0) { - R128TRACE(("NPOT pitch 0x%x unsupported\n", pitch)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "NPOT pitch 0x%x unsupported\n", pitch)); return FALSE; } @@ -298,7 +321,8 @@ R128TextureSetup(PicturePtr pPict, PixmapPtr pPix, int unit, uint32_t *txsize, u } else if (pPict->filter == PictFilterNearest) { *tex_cntl_c |= R128_MIN_BLEND_NEAREST | R128_MAG_BLEND_NEAREST; } else { - R128TRACE(("Bad filter 0x%x\n", pPict->filter)); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Bad filter 0x%x\n", pPict->filter)); return FALSE; } @@ -316,7 +340,9 @@ R128TextureSetup(PicturePtr pPict, PixmapPtr pPix, int unit, uint32_t *txsize, u if (pPict->repeat && w == 1 && h == 1) { l2p = 0; } else if (pPict->repeat && l2p != l2w) { - R128TRACE(("Repeat not supported for pitch != width\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Repeat not supported for pitch != " + "width\n")); return FALSE; } @@ -398,7 +424,8 @@ R128CCEPrepareComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, if (pDstPicture->format == PICT_a8) { if (R128BlendOp[op].dst_alpha) { - R128TRACE(("Can't dst alpha blend A8\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Can't dst alpha blend A8\n")); return FALSE; } dstDatatype = R128_DATATYPE_Y8; @@ -409,7 +436,9 @@ R128CCEPrepareComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, if (!pSrc) { pSrc = R128SolidPixmap(pScreen, cpu_to_le32(pSrcPicture->pSourcePict->solidFill.color)); if (!pSrc) { - R128TRACE(("Failed to create solid scratch pixmap\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Failed to create solid scratch " + "pixmap\n")); return FALSE; } add_src = TRUE; @@ -422,7 +451,9 @@ R128CCEPrepareComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, if (!pSrcPicture->pDrawable) pScreen->DestroyPixmap(pSrc); info->state_2d.has_mask = FALSE; - R128TRACE(("Failed to create solid scratch pixmap\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Failed to create " + "solid scratch pixmap\n")); return FALSE; } add_msk = TRUE; -- 2.7.4 _______________________________________________ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org https://lists.x.org/mailman/listinfo/xorg-driver-ati