Mesa (pipe-video): [g3dvl] remove unused backbuffer from xvmc

Christian König deathsimple at kemper.freedesktop.org
Sat Apr 2 11:53:18 PDT 2011


Module: Mesa
Branch: pipe-video
Commit: e8a701f40b138d31050bcf778dc7d5857102f49b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e8a701f40b138d31050bcf778dc7d5857102f49b

Author: Christian König <deathsimple at vodafone.de>
Date:   Sun Mar 27 00:19:25 2011 +0100

[g3dvl] remove unused backbuffer from xvmc

---

 src/gallium/state_trackers/xorg/xvmc/context.c     |    1 -
 src/gallium/state_trackers/xorg/xvmc/surface.c     |   56 --------------------
 .../state_trackers/xorg/xvmc/xvmc_private.h        |    1 -
 3 files changed, 0 insertions(+), 58 deletions(-)

diff --git a/src/gallium/state_trackers/xorg/xvmc/context.c b/src/gallium/state_trackers/xorg/xvmc/context.c
index b1d17cc..bcfd085 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 b3b5941..67dc57d 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 5e976cb..330c8c2 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;



More information about the mesa-commit mailing list