[g3dvl] remove unused backbuffer from xvmc
authorChristian König <deathsimple@vodafone.de>
Sat, 26 Mar 2011 23:19:25 +0000 (00:19 +0100)
committerChristian König <deathsimple@vodafone.de>
Sat, 26 Mar 2011 23:19:25 +0000 (00:19 +0100)
src/gallium/state_trackers/xorg/xvmc/context.c
src/gallium/state_trackers/xorg/xvmc/surface.c
src/gallium/state_trackers/xorg/xvmc/xvmc_private.h

index b1d17cc914959c2b8bb1a74bba03a3e23ba82d9d..bcfd085de39dbea27016db62f25fc5fa893b00a0 100644 (file)
@@ -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);
index b3b594125a21614e677f898962318ff314f3e4b1..67dc57d43440c4713c30a64a0ab5876021b04471 100644 (file)
@@ -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};
index 5e976cb8916a06e295bb9c96f658fb79f7cbc060..330c8c2cf9d662ad82d217cecd3d58d5b83a5c55 100644 (file)
@@ -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;