diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-08 09:55:07 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-08 09:55:07 +0000 |
commit | 33256af40b3ce2cf8a899ced1fcbf40e316772e4 (patch) | |
tree | 5b8d13d16d4d761018b64455e6e591ea6cd0b316 /src | |
parent | 5f0886dae29429f498fb10a12d5dc8de6bd798fc (diff) |
sna: Fixes for DBG_NO_HW (i.e. simulated GPU hanges);
A couple of the recent GPU paths were failing to check for !wedged.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/kgem.c | 2 | ||||
-rw-r--r-- | src/sna/sna_accel.c | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index bdfefa83..75e75335 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -1451,7 +1451,7 @@ struct kgem_bo *kgem_create_2d(struct kgem *kgem, DBG(("%s(%dx%d, bpp=%d, tiling=%d, exact=%d, inactive=%d)\n", __FUNCTION__, width, height, bpp, tiling, !!exact, !!(flags & CREATE_INACTIVE))); - assert(_kgem_can_create_2d(kgem, width, height, bpp, tiling)); + assert(_kgem_can_create_2d(kgem, width, height, bpp, exact ? -tiling : tiling)); size = kgem_surface_size(kgem, width, height, bpp, tiling, &pitch); assert(size && size <= kgem->max_object_size); if (flags & CREATE_INACTIVE) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 9fddd4f0..11ae4d25 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -1647,6 +1647,7 @@ sna_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, int w, int h, int left, int format, char *bits) { + struct sna *sna = to_sna_from_drawable(drawable); PixmapPtr pixmap = get_drawable_pixmap(drawable); struct sna_pixmap *priv = sna_pixmap(pixmap); RegionRec region; @@ -1680,6 +1681,9 @@ sna_put_image(DrawablePtr drawable, GCPtr gc, int depth, RegionTranslate(®ion, dx, dy); + if (wedged(sna)) + goto fallback; + switch (format) { case ZPixmap: if (!PM_IS_SOLID(drawable, gc->planemask)) @@ -3124,6 +3128,7 @@ sna_copy_plane(DrawablePtr src, DrawablePtr dst, GCPtr gc, int dst_x, int dst_y, unsigned long bit) { + struct sna *sna = to_sna_from_drawable(dst); RegionRec region; struct sna_damage **damage; @@ -3145,6 +3150,9 @@ sna_copy_plane(DrawablePtr src, DrawablePtr dst, GCPtr gc, if (!RegionNotEmpty(®ion)) return NULL; + if (wedged(sna)) + goto fallback; + if (sna_drawable_use_gpu_bo(dst, ®ion.extents, &damage)) { struct sna_pixmap *priv = sna_pixmap(get_drawable_pixmap(dst)); if (priv->gpu_bo->tiling != I915_TILING_Y) { @@ -3158,6 +3166,7 @@ sna_copy_plane(DrawablePtr src, DrawablePtr dst, GCPtr gc, } } +fallback: DBG(("%s: fallback\n", __FUNCTION__)); sna_gc_move_to_cpu(gc, dst); sna_drawable_move_region_to_cpu(dst, ®ion, true); |