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>
This commit is contained in:
Chris Wilson 2011-11-08 09:55:07 +00:00
parent 5f0886dae2
commit 33256af40b
2 changed files with 10 additions and 1 deletions

View File

@ -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)

View File

@ -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(&region, 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(&region))
return NULL;
if (wedged(sna))
goto fallback;
if (sna_drawable_use_gpu_bo(dst, &region.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, &region, true);