sna: Be paranoid and check for errors from mmapping the bo

Now that the error propagation is actually in place, we may as well use
it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-12-29 09:03:21 +00:00
parent 98e053503a
commit c9f7f10bc5
1 changed files with 9 additions and 0 deletions

View File

@ -692,6 +692,9 @@ sna_pixmap_move_to_cpu(PixmapPtr pixmap, unsigned int flags)
pixmap->devPrivate.ptr =
kgem_bo_map(&sna->kgem, priv->gpu_bo,
PROT_WRITE);
if (pixmap->devPrivate.ptr == NULL)
goto skip_inplace_map;
priv->mapped = 1;
sna_damage_all(&priv->gpu_damage,
@ -885,6 +888,9 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
pixmap->devPrivate.ptr =
kgem_bo_map(&sna->kgem, priv->gpu_bo,
PROT_WRITE);
if (pixmap->devPrivate.ptr == NULL)
return false;
priv->mapped = 1;
sna_damage_subtract(&priv->cpu_damage, region);
@ -920,6 +926,9 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
pixmap->devPrivate.ptr =
kgem_bo_map(&sna->kgem, priv->gpu_bo,
PROT_WRITE);
if (pixmap->devPrivate.ptr == NULL)
return false;
priv->mapped = 1;
sna_damage_subtract(&priv->cpu_damage, region);