xf86-video-intel: src/sna/sna_dri.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Sep 22 04:31:00 PDT 2011


 src/sna/sna_dri.c |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 12070b8eb1e98cb158802fff3e59f906b1547877
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Sep 22 12:18:26 2011 +0100

    sna/dri: Play with marking bo reusable
    
    Since we have no recycling of wc pages in the kernel, we try hard to
    recycle buffers in userspace to avoid GTT thrashing. This requires
    co-operation between DRI clients and X, which is sadly lacking and so we
    need to discard any buffer given out to a client after it is finished.
    We cheat slightly for page-flips and access to the scanout.
    
    A further compromise.
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=38732
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index e905447..5bb1044 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -154,6 +154,7 @@ static struct kgem_bo *sna_pixmap_set_dri(struct sna *sna,
 
 	/* The bo is outside of our control, so presume it is written to */
 	priv->gpu_bo->needs_flush = 1;
+	priv->gpu_bo->reusable = false;
 
 	/* We need to submit any modifications to and reads from this
 	 * buffer before we send any reply to the Client.
@@ -202,6 +203,7 @@ sna_dri_create_buffer(DrawablePtr drawable,
 		pixmap = get_drawable_pixmap(drawable);
 		pixmap->refcnt++;
 		bo = sna_pixmap_set_dri(sna, pixmap);
+		bo->reusable = true;
 		bpp = pixmap->drawable.bitsPerPixel;
 		DBG(("%s: attaching to front buffer %dx%d [%p:%d]\n",
 		     __FUNCTION__,
@@ -942,6 +944,7 @@ static void set_pixmap(struct sna *sna, DRI2BufferPtr buffer, PixmapPtr pixmap)
 	priv->pixmap->refcnt--;
 	priv->pixmap = pixmap;
 	priv->bo = sna_pixmap_set_dri(sna, pixmap);
+	priv->bo->reusable = true;
 	buffer->name = kgem_bo_flink(&sna->kgem, priv->bo);
 	buffer->pitch = priv->bo->pitch;
 }


More information about the xorg-commit mailing list