From 86d349aa7b0a596fbb9530e896c19349405bf3ba Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 26 Apr 2010 09:12:54 +0100 Subject: [PATCH] i830: tidy in flight bo reuse. A left-over cleanup patch for c374c94. *sigh* Signed-off-by: Chris Wilson --- src/i830_uxa.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/i830_uxa.c b/src/i830_uxa.c index 984069e7..79dfeaee 100644 --- a/src/i830_uxa.c +++ b/src/i830_uxa.c @@ -937,14 +937,26 @@ i830_uxa_create_pixmap(ScreenPtr screen, int w, int h, int depth, list_foreach_entry(priv, struct intel_pixmap, &intel->in_flight, in_flight) { - if (priv->tiling == tiling && - priv->stride >= stride && - priv->bo->size >= priv->stride * aligned_h) { - list_del(&priv->in_flight); - screen->ModifyPixmapHeader(pixmap, w, h, 0, 0, priv->stride, NULL); - i830_uxa_set_pixmap_intel(pixmap, priv); - return pixmap; + if (priv->tiling != tiling) + continue; + + if (tiling == I915_TILING_NONE) { + if (priv->bo->size < size) + continue; + + priv->stride = stride; + } else { + if (priv->stride < stride || + priv->bo->size < priv->stride * aligned_h) + continue; + + stride = priv->stride; } + + list_del(&priv->in_flight); + screen->ModifyPixmapHeader(pixmap, w, h, 0, 0, stride, NULL); + i830_uxa_set_pixmap_intel(pixmap, priv); + return pixmap; } }