diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-24 00:35:30 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-24 00:35:30 +0100 |
commit | 58d7a89b93ba4022f45465e479d2799b8903137a (patch) | |
tree | 9e1da6a4d4ba75c3b21dcdf72395f519ceffc85b | |
parent | 3c1d5bc35e02dfd8234c029dcab5661e1656ca8e (diff) |
sna: Don't render to invalid surfaces
Fixes a regression from d0362a. In bypassing the is_wedged checked, we
also ended up bypassing the checks that we could indeed render to the
target bo. With the result that we were creating GPU buffers for SHM
surfaces, something that requires Xserver fixes before we can actually
enable...
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/kgem.c | 5 | ||||
-rw-r--r-- | src/sna/sna_accel.c | 2 | ||||
-rw-r--r-- | src/sna/sna_io.c | 3 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index df1546df..e5c4e7b9 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -1177,9 +1177,12 @@ static bool _kgem_can_create_2d(struct kgem *kgem, if (bpp < 8) return false; - if (kgem->wedged) + if (tiling >= 0 && kgem->wedged) return false; + if (tiling < 0) + tiling = -tiling; + size = kgem_surface_size(kgem, width, height, bpp, tiling, &pitch); if (size == 0 || size > kgem->aperture_low) size = kgem_surface_size(kgem, width, height, bpp, I915_TILING_NONE, &pitch); diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 2b78e92f..0155ede0 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -684,7 +684,7 @@ sna_pixmap_force_to_gpu(PixmapPtr pixmap) priv = sna_pixmap(pixmap); if (priv == NULL) { - priv = _sna_pixmap_attach(pixmap); + priv = sna_pixmap_attach(pixmap); if (priv == NULL) return NULL; diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c index 41f36713..61d10625 100644 --- a/src/sna/sna_io.c +++ b/src/sna/sna_io.c @@ -411,7 +411,8 @@ struct kgem_bo *sna_replace(struct sna *sna, struct kgem *kgem = &sna->kgem; void *dst; - DBG(("%s(%d, %d)\n", __FUNCTION__, width, height)); + DBG(("%s(%dx%d, bpp=%d, tiling=%d)\n", + __FUNCTION__, width, height, bpp, bo->tiling)); assert(bo->reusable); if (kgem_bo_is_busy(kgem, bo)) { |