[PATCH 2/2] fix page flipping

Ville Syrjala syrjala at sci.fi
Mon May 2 14:55:51 PDT 2011


---
 src/radeon_dri2.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index ddb2721..93b3647 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -1051,6 +1051,30 @@ static int radeon_dri2_schedule_swap(ClientPtr client, DrawablePtr draw,
     divisor &= 0xffffffff;
     remainder &= 0xffffffff;
 
+    {
+         int r;
+         PixmapPtr pixmap;
+         struct dri2_buffer_priv *priv = front->driverPrivate;
+         struct radeon_exa_pixmap_priv *driver_priv;
+
+         if (draw->type == DRAWABLE_PIXMAP) {
+              pixmap = (PixmapPtr)draw;
+         } else {
+              pixmap = (*draw->pScreen->GetWindowPixmap)((WindowPtr)draw);
+         }
+         pixmap->refcnt++;
+
+         exaMoveInPixmap(pixmap);
+         driver_priv = exaGetPixmapDriverPrivate(pixmap);
+         r = radeon_gem_get_kernel_name(driver_priv->bo, &front->name);
+         if (r)
+              return r;
+         (*draw->pScreen->DestroyPixmap)(priv->pixmap);
+         front->pitch = pixmap->devKind;
+         front->cpp = pixmap->drawable.bitsPerPixel / 8;
+         priv->pixmap = pixmap;
+    }
+
     /* radeon_dri2_frame_event_handler will get called some unknown time in the
      * future with these buffers.  Take a reference to ensure that they won't
      * get destroyed before then. 
-- 
1.7.3.4

-- 
Ville Syrjälä
syrjala at sci.fi
http://www.sci.fi/~syrjala/


More information about the xorg-devel mailing list