sna: Handle GPU creation failure when uploading subtexture

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-01-29 14:20:33 +00:00
parent 518a99ea34
commit d3fb1e1e89
2 changed files with 14 additions and 9 deletions

View File

@ -1043,20 +1043,23 @@ sna_render_picture_extract(struct sna *sna,
if (!sna_pixmap_move_to_cpu(pixmap, MOVE_READ))
return 0;
} else {
if (texture_is_cpu(pixmap, &box) &&
!move_to_gpu(pixmap, &box)) {
bool upload = true;
if (!texture_is_cpu(pixmap, &box) &&
move_to_gpu(pixmap, &box)) {
struct sna_pixmap *priv;
priv = sna_pixmap_move_to_gpu(pixmap, MOVE_READ);
if (priv) {
src_bo = priv->gpu_bo;
upload = false;
}
}
if (upload)
bo = kgem_upload_source_image(&sna->kgem,
pixmap->devPrivate.ptr,
&box,
pixmap->devKind,
pixmap->drawable.bitsPerPixel);
} else {
struct sna_pixmap *priv;
priv = sna_pixmap_move_to_gpu(pixmap, MOVE_READ);
if (priv)
src_bo = priv->gpu_bo;
}
}
if (src_bo) {
bo = kgem_create_2d(&sna->kgem, w, h,

View File

@ -3973,6 +3973,8 @@ trap_mask_converter(PicturePtr picture,
pixmap = get_drawable_pixmap(picture->pDrawable);
priv = sna_pixmap_move_to_gpu(pixmap, MOVE_READ | MOVE_WRITE);
if (priv == NULL)
return false;
/* XXX strict adherence to the Render specification */
if (picture->polyMode == PolyModePrecise) {