From: Christian König Date: Thu, 25 Nov 2010 20:23:48 +0000 (+0100) Subject: [g3dvl] add dump option to xvmc X-Git-Tag: 062012170305~4979^2~338 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9cff90534389c2aad9b58ff04b1a5d624e3d0bdb;p=profile%2Fivi%2Fmesa.git [g3dvl] add dump option to xvmc --- diff --git a/src/gallium/state_trackers/xorg/xvmc/surface.c b/src/gallium/state_trackers/xorg/xvmc/surface.c index 0a236e2..209dffd 100644 --- a/src/gallium/state_trackers/xorg/xvmc/surface.c +++ b/src/gallium/state_trackers/xorg/xvmc/surface.c @@ -26,6 +26,7 @@ **************************************************************************/ #include +#include #include #include #include @@ -373,6 +374,8 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable, short destx, short desty, unsigned short destw, unsigned short desth, int flags) { + static int dump_window = -1; + struct pipe_video_context *vpipe; XvMCSurfacePrivate *surface_priv; XvMCContextPrivate *context_priv; @@ -451,6 +454,17 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable, pipe_surface_reference(&drawable_surface, NULL); + if(dump_window == -1) { + dump_window = debug_get_num_option("XVMC_DUMP", 0); + } + + if(dump_window) { + static unsigned int framenum = 0; + char cmd[256]; + sprintf(cmd, "xwd -id %d -out xvmc_frame_%08d.xwd", (int)drawable, ++framenum); + system(cmd); + } + XVMC_MSG(XVMC_TRACE, "[XvMC] Pushed surface %p to front buffer.\n", surface); return Success;