xserver: Branch 'master'

Keith Packard keithp at kemper.freedesktop.org
Sun Aug 17 14:17:56 PDT 2014


 glamor/glamor_xv.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

New commits:
commit d4111239e698f0126123830429d74da7d24910ed
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Aug 13 11:30:11 2014 -0700

    glamor: Free Xv put image data immediately after use
    
    The Xv StopVideo callback is not invoked on textured video ports, so
    the temporary pixmaps allocated for the video planes are never freed.
    
    Freeing the storage immediately after use is a simple solution to this
    problem which doesn't appear to have any visible performance impact.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Eric Anholt <eric at anholt.net>

diff --git a/glamor/glamor_xv.c b/glamor/glamor_xv.c
index 3f3e064..26bdef6 100644
--- a/glamor/glamor_xv.c
+++ b/glamor/glamor_xv.c
@@ -136,6 +136,11 @@ glamor_init_xv_shader(ScreenPtr screen)
 void
 glamor_xv_stop_video(glamor_port_private *port_priv)
 {
+}
+
+static void
+glamor_xv_free_port_data(glamor_port_private *port_priv)
+{
     int i;
 
     for (i = 0; i < 3; i++) {
@@ -144,6 +149,8 @@ glamor_xv_stop_video(glamor_port_private *port_priv)
             port_priv->src_pix[i] = NULL;
         }
     }
+    RegionUninit(&port_priv->clip);
+    RegionNull(&port_priv->clip);
 }
 
 int
@@ -381,6 +388,8 @@ glamor_xv_render(glamor_port_private *port_priv)
     glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE);
 
     DamageDamageRegion(port_priv->pDraw, &port_priv->clip);
+
+    glamor_xv_free_port_data(port_priv);
 }
 
 int
@@ -468,9 +477,7 @@ glamor_xv_put_image(glamor_port_private *port_priv,
     else
         port_priv->pPixmap = (PixmapPtr) pDrawable;
 
-    if (!RegionEqual(&port_priv->clip, clipBoxes)) {
-        RegionCopy(&port_priv->clip, clipBoxes);
-    }
+    RegionCopy(&port_priv->clip, clipBoxes);
 
     port_priv->src_x = src_x;
     port_priv->src_y = src_y;


More information about the xorg-commit mailing list