summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-04-26 09:12:54 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-04-26 09:13:54 +0100
commit86d349aa7b0a596fbb9530e896c19349405bf3ba (patch)
tree698f7b6ca9e0d1e2c0c3bbc2b823584ebbd52dc6
parent72fd7d191c33c8d0b75b06ab0717d7ca0d4e019a (diff)
i830: tidy in flight bo reuse.
A left-over cleanup patch for c374c94. *sigh* Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/i830_uxa.c26
1 files 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;
}
}