i830: tidy in flight bo reuse.

A left-over cleanup patch for c374c94. *sigh*

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2010-04-26 09:12:54 +01:00
parent 72fd7d191c
commit 86d349aa7b
1 changed files with 19 additions and 7 deletions

View File

@ -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;
}
}