xf86-video-intel: 2 commits - src/intel_dri.c uxa/uxa-glyphs.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Jul 12 05:11:33 PDT 2012


 src/intel_dri.c  |    5 +++--
 uxa/uxa-glyphs.c |   12 +++++++++++-
 2 files changed, 14 insertions(+), 3 deletions(-)

New commits:
commit 1d9ab2e7101167075112a472ee82530dc0365183
Author: Zhigang Gong <zhigang.gong at linux.intel.com>
Date:   Thu Jul 12 18:47:50 2012 +0800

    uxa/dri: Fix a buffer leak on pageflipping when enabling glamor.
    
    We need to put current front_buffer to back buffer thus we
    don't need to create a new back buffer next time. This behaviou
    should be the same with or without glamor. Previous code
    incorrectly discard the previous front_buffer and cause a
    big buffer leak problem.
    
    Signed-off-by: Zhigang Gong <zhigang.gong at linux.intel.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/intel_dri.c b/src/intel_dri.c
index ed5078e..0405937 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -1023,9 +1023,10 @@ I830DRI2ScheduleFlip(struct intel_screen_private *intel,
 	priv = info->front->driverPrivate;
 
 	/* Exchange the current front-buffer with the fresh bo */
+
+	intel->back_buffer = intel->front_buffer;
+	drm_intel_bo_reference(intel->back_buffer);
 	if (!(intel->uxa_flags & UXA_USE_GLAMOR)) {
-		intel->back_buffer = intel->front_buffer;
-		drm_intel_bo_reference(intel->back_buffer);
 		intel_set_pixmap_bo(priv->pixmap, new_back);
 		drm_intel_bo_unreference(new_back);
 	}
commit fa89e0614563cbe0cc45e6d7e7584cb333244c27
Author: Zhigang Gong <zhigang.gong at linux.intel.com>
Date:   Thu Jul 12 18:47:51 2012 +0800

    uxa/glyphs: Bypass uxa glyphs operations if using glamor.
    
    glamor_glyphs will never fallback. We don't need to keep a
    uxa glyphs cache picture here. Thus simply bypass the
    corresponding operations.
    
    Signed-off-by: Zhigang Gong <zhigang.gong at linux.intel.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c
index 6bdf101..527942a 100644
--- a/uxa/uxa-glyphs.c
+++ b/uxa/uxa-glyphs.c
@@ -112,6 +112,9 @@ static void uxa_unrealize_glyph_caches(ScreenPtr pScreen)
 	uxa_screen_t *uxa_screen = uxa_get_screen(pScreen);
 	int i;
 
+	if (uxa_screen->info->flags & UXA_USE_GLAMOR)
+		return;
+
 	if (!uxa_screen->glyph_cache_initialized)
 		return;
 
@@ -211,6 +214,11 @@ bail:
 
 Bool uxa_glyphs_init(ScreenPtr pScreen)
 {
+
+	uxa_screen_t *uxa_screen = uxa_get_screen(pScreen);
+
+	if (uxa_screen->info->flags & UXA_USE_GLAMOR)
+		return TRUE;
 #if HAS_DIXREGISTERPRIVATEKEY
 	if (!dixRegisterPrivateKey(&uxa_glyph_key, PRIVATE_GLYPH, 0))
 		return FALSE;
@@ -307,8 +315,10 @@ uxa_glyph_unrealize(ScreenPtr screen,
 	struct uxa_glyph *priv;
 	uxa_screen_t *uxa_screen = uxa_get_screen(screen);
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR)
+	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
 		glamor_glyph_unrealize(screen, glyph);
+		return;
+	}
 
 	/* Use Lookup in case we have not attached to this glyph. */
 	priv = dixLookupPrivate(&glyph->devPrivates, &uxa_glyph_key);


More information about the xorg-commit mailing list