diff options
author | Luc Verhaegen <libv@skynet.be> | 2009-10-26 03:57:56 +0100 |
---|---|---|
committer | Luc Verhaegen <libv@skynet.be> | 2009-11-04 15:13:02 +0100 |
commit | 98f84368d942fef3a0f3a600311c7fc8b8977b4f (patch) | |
tree | 74bfbad3038ba33710b4ba85934e7eef76868619 | |
parent | b261850ba7dc0d5b7347bda587dc334344da6a5e (diff) |
XvMC: Hide noisy debugging messages behind a macro.
-rw-r--r-- | lib/xvmc/xvmc_unichrome.c | 80 | ||||
-rw-r--r-- | src/via_mpeg.c | 25 | ||||
-rw-r--r-- | src/via_mpeg.h | 7 | ||||
-rw-r--r-- | src/via_xvmc.c | 3 |
4 files changed, 65 insertions, 50 deletions
diff --git a/lib/xvmc/xvmc_unichrome.c b/lib/xvmc/xvmc_unichrome.c index 6422e68..23b4840 100644 --- a/lib/xvmc/xvmc_unichrome.c +++ b/lib/xvmc/xvmc_unichrome.c @@ -37,6 +37,13 @@ #include "xvmce.h" #include "xvmce_proto.h" +/* enable this to have extra debugging */ +#if 0 +#define MPEGDebug(x) (x) +#else +#define MPEGDebug(x) +#endif + #define FOURCC_MPEG (('G' << 24) | ('E' << 16) | ('P' << 8) | 'M') /* Oh you must be kidding me. What a bunch of clueless idiots. @@ -89,7 +96,7 @@ XvMCCreateContext(Display *display, XvPortID port, int surface_type_id, XvImageFormatValues *ImageFormats; int count, i; - printf("%s\n", __func__); + MPEGDebug(printf("%s\n", __func__)); if (!display || !context) return BadValue; @@ -163,7 +170,8 @@ _X_EXPORT Status XvMCDestroyContext(Display *display, XvMCContext *context) { Status status; - printf("%s\n", __func__); + + MPEGDebug(printf("%s\n", __func__)); if (!display || !context) return BadValue; @@ -197,7 +205,7 @@ XvMCCreateSurface(Display *display, XvMCContext *context, XvMCSurface *surface) int priv_count; CARD32 *priv_data = NULL; - printf("%s\n", __func__); + MPEGDebug(printf("%s\n", __func__)); if (!display || !context) return XvMCBadContext; @@ -210,7 +218,7 @@ XvMCCreateSurface(Display *display, XvMCContext *context, XvMCSurface *surface) if (status != Success) printf("%s: _xvmc_create_surface failed: %d\n", __func__, status); - printf("%s: Claimed 0x%08X.\n", __func__, surface->surface_id); + MPEGDebug(printf("%s: Claimed 0x%08X.\n", __func__, surface->surface_id)); return status; } @@ -222,12 +230,12 @@ XvMCCreateSurface(Display *display, XvMCContext *context, XvMCSurface *surface) _X_EXPORT Status XvMCDestroySurface(Display *display, XvMCSurface *surface) { - printf("%s\n", __func__); + MPEGDebug(printf("%s\n", __func__)); if (!display || !surface) return BadValue; - printf("%s: releasing 0x%08X\n", __func__, surface->surface_id); + MPEGDebug(printf("%s: releasing 0x%08X\n", __func__, surface->surface_id)); return _xvmc_destroy_surface(display, surface); } @@ -243,7 +251,7 @@ XvMCPutSurface(Display *display, XvMCSurface *surface, Drawable draw, { Status status; - printf("%s: 0x%08X\n", __func__, surface->surface_id); + MPEGDebug(printf("%s: 0x%08X\n", __func__, surface->surface_id)); /* We have to fake our own GC, how cool an interface is this? */ if (XvMCDrawable != draw) { @@ -273,7 +281,7 @@ XvMCHideSurface(Display *display, XvMCSurface *surface) { Status status = Success; - printf("%s\n", __func__); + MPEGDebug(printf("%s\n", __func__)); if (XvMCDrawable) status = XvStopVideo(display, XvMCPortID, XvMCDrawable); @@ -293,7 +301,8 @@ XvMCHideSurface(Display *display, XvMCSurface *surface) _X_EXPORT Status XvMCFlushSurface(Display *display, XvMCSurface *surface) { - printf("%s: 0x%08X (%dbytes)\n", __func__, surface->surface_id, current_surface_size); + MPEGDebug(printf("%s: 0x%08X (%dbytes)\n", __func__, + surface->surface_id, current_surface_size)); /* We don't need to do this with our hardware. */ @@ -310,7 +319,7 @@ XvMCGetSurfaceStatus(Display *display, XvMCSurface *surface, int *stat) Status status; int StatusFlags; - printf("%s: 0x%08X\n", __func__, surface->surface_id); + MPEGDebug(printf("%s: 0x%08X\n", __func__, surface->surface_id)); status = XVMCEBufferStatus(display, XvMCPortID, surface->surface_id, &StatusFlags); @@ -345,7 +354,7 @@ XvMCSyncSurface(Display *display, XvMCSurface *surface) Status status; int StatusFlags, i; - printf("%s: 0x%08X\n", __func__, surface->surface_id); + MPEGDebug(printf("%s: 0x%08X\n", __func__, surface->surface_id)); for (i = 0; i < 0x1000; i++) { status = XVMCEBufferStatus(display, XvMCPortID, @@ -383,15 +392,15 @@ XvMCBeginSurface(Display *display, XvMCContext *context, XvMCSurface *target, current_surface_id = target->surface_id; current_surface_size = 0; - printf("%s: 0x%08X (0x%08X <- | -> 0x%08X)\n", __func__, - target->surface_id, - past ? past->surface_id : 0, - future? future->surface_id : 0); + MPEGDebug(printf("%s: 0x%08X (0x%08X <- | -> 0x%08X)\n", __func__, + target->surface_id, past ? past->surface_id : 0, + future? future->surface_id : 0)); - /* printf("Backwards vertical: %d\n", control->BVMV_range); - printf("Backwards horizontal: %d\n", control->BHMV_range); - printf("Forwards vertical: %d\n", control->FVMV_range); - printf("Forwards horizontal: %d\n", control->FHMV_range); */ +#if 0 + printf("Backwards vertical: %d\n", control->BVMV_range); + printf("Backwards horizontal: %d\n", control->BHMV_range); + printf("Forwards vertical: %d\n", control->FVMV_range); + printf("Forwards horizontal: %d\n", control->FHMV_range); printf("Picture Structure: %d\n", control->picture_structure); @@ -399,6 +408,7 @@ XvMCBeginSurface(Display *display, XvMCContext *context, XvMCSurface *target, printf("picture_coding_type: %d\n", control->picture_coding_type); printf("mpeg_coding: %d\n", control->mpeg_coding); printf("flags: 0x%08X\n", control->flags); +#endif PictureType = 0; PictureType |= control->picture_structure & @@ -447,8 +457,10 @@ XvMCPutSlice(Display *display, XvMCContext *context, { Status status; - /* printf("%s:0x%08X (%dbytes): %08X\n", __func__, - current_surface_id, size, *((unsigned int *) slice)); */ +#if 0 /* loud. */ + MPEGDebug(printf("%s:0x%08X (%dbytes): %08X\n", __func__, + current_surface_id, size, *((unsigned int *) slice))); +#endif current_surface_size += size; @@ -471,8 +483,10 @@ XvMCPutSlice2(Display *display, XvMCContext *context, { Status status; - /* printf("%s: 0x%08X: %02X (%dbytes)\n", __func__, - current_surface_id, slicecode, size); */ +#if 0 /* loud. */ + MPEGDebug(printf("%s: 0x%08X: %02X (%dbytes)\n", __func__, + current_surface_id, slicecode, size)); +#endif current_surface_size += size; @@ -602,7 +616,7 @@ XvMCGetAttribute(Display *display, XvMCContext *context, _X_EXPORT Status XvMCSyncSubpicture(Display *display, XvMCSubpicture *subpicture) { - printf("%s\n", __func__); + fprintf(stderr, "%s is not implemented.\n", __func__); return BadImplementation; } @@ -614,7 +628,7 @@ XvMCSyncSubpicture(Display *display, XvMCSubpicture *subpicture) _X_EXPORT Status XvMCFlushSubpicture(Display *display, XvMCSubpicture *subpicture) { - printf("%s\n", __func__); + fprintf(stderr, "%s is not implemented.\n", __func__); return Success; } @@ -626,7 +640,7 @@ XvMCFlushSubpicture(Display *display, XvMCSubpicture *subpicture) _X_EXPORT Status XvMCGetSubpictureStatus(Display *display, XvMCSubpicture *subpicture, int *stat) { - printf("%s\n", __func__); + fprintf(stderr, "%s is not implemented.\n", __func__); return BadImplementation; } @@ -640,7 +654,7 @@ XvMCCreateSubpicture(Display *display, XvMCContext *context, XvMCSubpicture *subpicture, unsigned short width, unsigned short height, int xvimage_id) { - printf("%s\n", __func__); + fprintf(stderr, "%s is not implemented.\n", __func__); return BadImplementation; } @@ -654,7 +668,7 @@ XvMCClearSubpicture(Display *display, XvMCSubpicture *subpicture, short x, short y, unsigned short width, unsigned short height, unsigned int colour) { - printf("%s\n", __func__); + fprintf(stderr, "%s is not implemented.\n", __func__); return BadImplementation; } @@ -669,7 +683,7 @@ XvMCCompositeSubpicture(Display *display, XvMCSubpicture *subpicture, unsigned short width, unsigned short height, short dst_x, short dst_y) { - printf("%s\n", __func__); + fprintf(stderr, "%s is not implemented.\n", __func__); return BadImplementation; } @@ -681,7 +695,7 @@ XvMCCompositeSubpicture(Display *display, XvMCSubpicture *subpicture, _X_EXPORT Status XvMCDestroySubpicture(Display *display, XvMCSubpicture *subpicture) { - printf("%s\n", __func__); + fprintf(stderr, "%s is not implemented.\n", __func__); return BadImplementation; } @@ -694,7 +708,7 @@ _X_EXPORT Status XvMCSetSubpicturePalette(Display *display, XvMCSubpicture *subpicture, unsigned char *palette) { - printf("%s\n", __func__); + fprintf(stderr, "%s is not implemented.\n", __func__); return BadImplementation; } @@ -710,7 +724,7 @@ XvMCBlendSubpicture(Display *display, XvMCSurface *surface, short surface_x, short surface_y, unsigned short surface_width, unsigned short surface_h) { - printf("%s\n", __func__); + fprintf(stderr, "%s is not implemented.\n", __func__); return BadImplementation; } @@ -726,7 +740,7 @@ XvMCBlendSubpicture2(Display *display, XvMCSurface *source, XvMCSurface *target, short surface_x, short surface_y, unsigned short surface_width, unsigned short surface_h) { - printf("%s\n", __func__); + fprintf(stderr, "%s is not implemented.\n", __func__); return BadImplementation; } diff --git a/src/via_mpeg.c b/src/via_mpeg.c index dcebc62..935fe48 100644 --- a/src/via_mpeg.c +++ b/src/via_mpeg.c @@ -207,7 +207,7 @@ ViaMpegQMatrix(struct ViaMpeg *Mpeg, CARD32 Type, CARD8 Matrix[64]) CARD32 *Temp = (CARD32 *) Matrix; int i; - VIAFUNC(Mpeg); + MPEGDebug(VIAFUNC(Mpeg)); ViaMpegEngineIdle(Mpeg); @@ -232,11 +232,9 @@ ViaMpegSliceInit(struct ViaMpeg *Mpeg, XID BufferID, XID FRefID, XID BRefID, CARD16 Width, Height; int Buffer = 0xFFFFFFFF, FRef = 0xFFFFFFFF, BRef = 0xFFFFFFFF; - /* VIAFUNC(Mpeg); */ - /* TODO: we need to adjust Width and Height when using an interlaced stream */ - ViaDebug(Mpeg->scrnIndex, "%s: 0x%08X: FRef 0x%02X; BRef 0x%02X\n", - __func__, BufferID, FRefID, BRefID); + MPEGDebug(ViaDebug(Mpeg->scrnIndex, "%s: 0x%08X: FRef 0x%02X; BRef 0x%02X\n", + __func__, BufferID, FRefID, BRefID)); /* Check ID */ for (Buffer = 0; Buffer < VIAMPEG_BUFFERS_MAX; Buffer++) @@ -403,10 +401,8 @@ ViaMpegSlicePut(struct ViaMpeg *Mpeg, XID BufferID, CARD8 SliceCode, CARD32 *p = (CARD32 *) Slice, Mask; CARD32 i, count; - /* VIAFUNC(Mpeg); */ - - /* ViaDebug(Mpeg->scrnIndex, "%s: 0x%08lX: 0x%08lX: %ld bytes\n", - __func__, BufferID, SliceCode, SliceLength); */ + MPEGDebug(ViaDebug(Mpeg->scrnIndex, "%s: 0x%08lX: 0x%08lX: %ld bytes\n", + __func__, BufferID, SliceCode, SliceLength)); if (BufferID != Mpeg->CurrentID) { xf86DrvMsg(Mpeg->scrnIndex, X_WARNING, @@ -442,9 +438,6 @@ ViaMpegSlicePut(struct ViaMpeg *Mpeg, XID BufferID, CARD8 SliceCode, Mpeg->Regs->SliceStream[0] = 0; Mpeg->Regs->SliceStream[0] = 0; - /* ViaDebug(Mpeg->scrnIndex, "%s: Slice ReadBack: 0x%08lX\n", __func__, - Mpeg->Regs->SliceStreamOut); */ - return Success; } @@ -456,8 +449,8 @@ ViaMpegBufferIDVerify(struct ViaMpeg *Mpeg, XID BufferID, int Width, int Height) { int i; - ViaDebug(Mpeg->scrnIndex, "%s: 0x%08X (%dx%d)\n", - __func__, BufferID, Width, Height); + MPEGDebug(ViaDebug(Mpeg->scrnIndex, "%s: 0x%08X (%dx%d)\n", + __func__, BufferID, Width, Height)); if ((Width != Mpeg->Width) || (Height != Mpeg->Height)) { xf86DrvMsg(Mpeg->scrnIndex, X_WARNING, "%s: Wrong dimensions for Buffer" @@ -490,8 +483,8 @@ ViaMpegBufferFlip(struct ViaMpeg *Mpeg, XID BufferID) { int i; - ViaDebug(Mpeg->scrnIndex, "%s: 0x%08X\n", - __func__, BufferID); + MPEGDebug(ViaDebug(Mpeg->scrnIndex, "%s: 0x%08X\n", + __func__, BufferID)); /* Check ID */ for (i = 0; i < VIAMPEG_BUFFERS_MAX; i++) diff --git a/src/via_mpeg.h b/src/via_mpeg.h index a3c9fdd..34fe381 100644 --- a/src/via_mpeg.h +++ b/src/via_mpeg.h @@ -28,6 +28,13 @@ #ifndef HAVE_VIA_MPEG_H #define HAVE_VIA_MPEG_H 1 +/* Enable this to have extra debugging in the Xorg log. */ +#if 0 +#define MPEGDebug(x) (x) +#else +#define MPEGDebug(x) +#endif + #define FOURCC_MPEG (('G' << 24) | ('E' << 16) | ('P' << 8) | 'M') /* xine seems to need at least 8, engine can only handle 4, diff --git a/src/via_xvmc.c b/src/via_xvmc.c index 3df7c64..d775f79 100644 --- a/src/via_xvmc.c +++ b/src/via_xvmc.c @@ -266,7 +266,8 @@ XvMCEProcBufferSliceInit(ClientPtr client) else UseIntraDCTable1 = FALSE; - ViaDebug(pScrn->scrnIndex, "%s: Buffer 0x%08X\n", __func__, stuff->Buffer); + MPEGDebug(ViaDebug(pScrn->scrnIndex, "%s: Buffer 0x%08X\n", __func__, + stuff->Buffer)); #if 0 ViaDebug(pScrn->scrnIndex, "\t PictureType: 0x%02X, SliceFlags: 0x%02X\n", stuff->PictureType, stuff->SliceFlags); |