From: Christian König Date: Sat, 26 Mar 2011 23:19:25 +0000 (+0100) Subject: [g3dvl] remove unused backbuffer from xvmc X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e8a701f40b138d31050bcf778dc7d5857102f49b;p=mesa.git [g3dvl] remove unused backbuffer from xvmc --- diff --git a/src/gallium/state_trackers/xorg/xvmc/context.c b/src/gallium/state_trackers/xorg/xvmc/context.c index b1d17cc9149..bcfd085de39 100644 --- a/src/gallium/state_trackers/xorg/xvmc/context.c +++ b/src/gallium/state_trackers/xorg/xvmc/context.c @@ -285,7 +285,6 @@ Status XvMCDestroyContext(Display *dpy, XvMCContext *context) context_priv = context->privData; vctx = context_priv->vctx; - pipe_surface_reference(&context_priv->backbuffer, NULL); vscreen = vctx->vscreen; vl_video_destroy(vctx); vl_screen_destroy(vscreen); diff --git a/src/gallium/state_trackers/xorg/xvmc/surface.c b/src/gallium/state_trackers/xorg/xvmc/surface.c index b3b594125a2..67dc57d4344 100644 --- a/src/gallium/state_trackers/xorg/xvmc/surface.c +++ b/src/gallium/state_trackers/xorg/xvmc/surface.c @@ -95,57 +95,6 @@ static enum pipe_mpeg12_motion_type MotionToPipe(int xvmc_motion_type, unsigned return -1; } -#if 0 -static bool -CreateOrResizeBackBuffer(struct vl_context *vctx, unsigned int width, unsigned int height, - struct pipe_surface **backbuffer) -{ - struct pipe_video_context *vpipe; - struct pipe_resource template; - struct pipe_resource *tex; - - assert(vctx); - - vpipe = vctx->vpipe; - - if (*backbuffer) { - if ((*backbuffer)->width != width || (*backbuffer)->height != height) - pipe_surface_reference(backbuffer, NULL); - else - return true; - } - - memset(&template, 0, sizeof(struct pipe_resource)); - template.target = PIPE_TEXTURE_2D; - template.format = vctx->vscreen->format; - template.last_level = 0; - template.width0 = width; - template.height0 = height; - template.depth0 = 1; - template.array_size = 1; - template.usage = PIPE_USAGE_DEFAULT; - template.bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_BLIT_SOURCE; - template.flags = 0; - - tex = vpipe->screen->resource_create(vpipe->screen, &template); - if (!tex) - return false; - - *backbuffer = vpipe->screen->get_tex_surface(vpipe->screen, tex, 0, 0, 0, - template.bind); - pipe_resource_reference(&tex, NULL); - - if (!*backbuffer) - return false; - - /* Clear the backbuffer in case the video doesn't cover the whole window */ - /* FIXME: Need to clear every time a frame moves and leaves dirty rects */ - vpipe->surface_fill(vpipe, *backbuffer, 0, 0, width, height, 0); - - return true; -} -#endif - static void MacroBlocksToPipe(struct pipe_screen *screen, unsigned int xvmc_picture_structure, @@ -435,11 +384,6 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable, subpicture_priv = surface_priv->subpicture ? surface_priv->subpicture->privData : NULL; vpipe = context_priv->vctx->vpipe; -#if 0 - if (!CreateOrResizeBackBuffer(context_priv->vctx, width, height, &context_priv->backbuffer)) - return BadAlloc; -#endif - if (subpicture_priv) { struct pipe_video_rect src_rect = {surface_priv->subx, surface_priv->suby, surface_priv->subw, surface_priv->subh}; struct pipe_video_rect dst_rect = {surface_priv->surfx, surface_priv->surfy, surface_priv->surfw, surface_priv->surfh}; diff --git a/src/gallium/state_trackers/xorg/xvmc/xvmc_private.h b/src/gallium/state_trackers/xorg/xvmc/xvmc_private.h index 5e976cb8916..330c8c2cf9d 100644 --- a/src/gallium/state_trackers/xorg/xvmc/xvmc_private.h +++ b/src/gallium/state_trackers/xorg/xvmc/xvmc_private.h @@ -42,7 +42,6 @@ struct pipe_fence_handle; typedef struct { struct vl_context *vctx; - struct pipe_surface *backbuffer; unsigned short subpicture_max_width; unsigned short subpicture_max_height; } XvMCContextPrivate;