diff options
author | Younes Manton <[email protected]> | 2010-03-05 23:14:49 -0500 |
---|---|---|
committer | Younes Manton <[email protected]> | 2010-03-05 23:14:49 -0500 |
commit | 8580b7a0eeed3fc29320b2c0a184084e4267661a (patch) | |
tree | 4b7b4174cea14256e85412309e056adcca67aa73 /src/gallium/state_trackers/xorg/xvmc/surface.c | |
parent | 40cd082afa42c86e320f73389f3d0836587f97d9 (diff) |
vl: Add some basic debug output for XvMC.
Set the XVMC_DEBUG env var to:
0 for no extra output
1 for error output
2 for warning output
3 for tracing output
Diffstat (limited to 'src/gallium/state_trackers/xorg/xvmc/surface.c')
-rw-r--r-- | src/gallium/state_trackers/xorg/xvmc/surface.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/xorg/xvmc/surface.c b/src/gallium/state_trackers/xorg/xvmc/surface.c index f640b1464f4..79dae3fb8b7 100644 --- a/src/gallium/state_trackers/xorg/xvmc/surface.c +++ b/src/gallium/state_trackers/xorg/xvmc/surface.c @@ -48,6 +48,8 @@ static enum pipe_mpeg12_macroblock_type TypeToPipe(int xvmc_mb_type) assert(0); + XVMC_MSG(XVMC_ERR, "[XvMC] Unrecognized mb type 0x%08X.\n", xvmc_mb_type); + return -1; } @@ -64,6 +66,8 @@ static enum pipe_mpeg12_picture_type PictureToPipe(int xvmc_pic) assert(0); } + XVMC_MSG(XVMC_ERR, "[XvMC] Unrecognized picture type 0x%08X.\n", xvmc_pic); + return -1; } @@ -71,8 +75,11 @@ static enum pipe_mpeg12_motion_type MotionToPipe(int xvmc_motion_type, int xvmc_ { switch (xvmc_motion_type) { case XVMC_PREDICTION_FRAME: - return xvmc_dct_type == XVMC_DCT_TYPE_FIELD ? - PIPE_MPEG12_MOTION_TYPE_16x8 : PIPE_MPEG12_MOTION_TYPE_FRAME; + if (xvmc_dct_type == XVMC_DCT_TYPE_FIELD) + return PIPE_MPEG12_MOTION_TYPE_16x8; + else if (xvmc_dct_type == XVMC_DCT_TYPE_FRAME) + return PIPE_MPEG12_MOTION_TYPE_FRAME; + break; case XVMC_PREDICTION_FIELD: return PIPE_MPEG12_MOTION_TYPE_FIELD; case XVMC_PREDICTION_DUAL_PRIME: @@ -81,6 +88,8 @@ static enum pipe_mpeg12_motion_type MotionToPipe(int xvmc_motion_type, int xvmc_ assert(0); } + XVMC_MSG(XVMC_ERR, "[XvMC] Unrecognized motion type 0x%08X (with DCT type 0x%08X).\n", xvmc_motion_type, xvmc_dct_type); + return -1; } @@ -183,6 +192,8 @@ Status XvMCCreateSurface(Display *dpy, XvMCContext *context, XvMCSurface *surfac XvMCSurfacePrivate *surface_priv; struct pipe_video_surface *vsfc; + XVMC_MSG(XVMC_TRACE, "[XvMC] Creating surface %p.\n", surface); + assert(dpy); if (!context) @@ -197,6 +208,7 @@ Status XvMCCreateSurface(Display *dpy, XvMCContext *context, XvMCSurface *surfac if (!surface_priv) return BadAlloc; + assert(vpipe->screen->video_surface_create); vsfc = vpipe->screen->video_surface_create(vpipe->screen, vpipe->chroma_format, vpipe->width, vpipe->height); if (!vsfc) { @@ -216,6 +228,8 @@ Status XvMCCreateSurface(Display *dpy, XvMCContext *context, XvMCSurface *surfac SyncHandle(); + XVMC_MSG(XVMC_TRACE, "[XvMC] Surface %p created.\n", surface); + return Success; } @@ -236,6 +250,8 @@ Status XvMCRenderSurface(Display *dpy, XvMCContext *context, unsigned int pictur struct pipe_mpeg12_macroblock pipe_macroblocks[num_macroblocks]; unsigned int i; + XVMC_MSG(XVMC_TRACE, "[XvMC] Rendering to surface %p.\n", target_surface); + assert(dpy); if (!context || !context->privData) @@ -288,6 +304,8 @@ Status XvMCRenderSurface(Display *dpy, XvMCContext *context, unsigned int pictur for (i = 0; i < num_macroblocks; ++i) vpipe->screen->buffer_destroy(pipe_macroblocks[i].blocks); + XVMC_MSG(XVMC_TRACE, "[XvMC] Submitted surface %p for rendering.\n", target_surface); + return Success; } @@ -328,6 +346,8 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable, struct pipe_video_rect src_rect = {srcx, srcy, srcw, srch}; struct pipe_video_rect dst_rect = {destx, desty, destw, desth}; + XVMC_MSG(XVMC_TRACE, "[XvMC] Displaying surface %p.\n", surface); + assert(dpy); if (!surface || !surface->privData) @@ -363,7 +383,7 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable, context_priv->backbuffer, &dst_rect, surface_priv->disp_fence); vl_video_bind_drawable(context_priv->vctx, drawable); - + vpipe->screen->flush_frontbuffer ( vpipe->screen, @@ -371,6 +391,8 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable, vpipe->priv ); + XVMC_MSG(XVMC_TRACE, "[XvMC] Submitted surface %p for display.\n", surface); + return Success; } @@ -392,6 +414,8 @@ Status XvMCDestroySurface(Display *dpy, XvMCSurface *surface) { XvMCSurfacePrivate *surface_priv; + XVMC_MSG(XVMC_TRACE, "[XvMC] Destroying surface %p.\n", surface); + assert(dpy); if (!surface || !surface->privData) @@ -402,6 +426,8 @@ Status XvMCDestroySurface(Display *dpy, XvMCSurface *surface) FREE(surface_priv); surface->privData = NULL; + XVMC_MSG(XVMC_TRACE, "[XvMC] Surface %p destroyed.\n", surface); + return Success; } |