sna: Fix the "trivial" fix to improve error handling

The logic was just backwards and we tried to upload a shadowless GPU
pixmap.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-01-29 15:43:42 +00:00
parent d3fb1e1e89
commit e1e67e8f39
2 changed files with 7 additions and 1 deletions

View File

@ -3490,6 +3490,12 @@ struct kgem_bo *kgem_upload_source_image(struct kgem *kgem,
DBG(("%s : (%d, %d), (%d, %d), stride=%d, bpp=%d\n",
__FUNCTION__, box->x1, box->y1, box->x2, box->y2, stride, bpp));
assert(data);
assert(width > 0);
assert(height > 0);
assert(stride);
assert(bpp);
bo = kgem_create_buffer_2d(kgem,
width, height, bpp,
KGEM_BUFFER_WRITE_INPLACE, &dst);

View File

@ -1044,7 +1044,7 @@ sna_render_picture_extract(struct sna *sna,
return 0;
} else {
bool upload = true;
if (!texture_is_cpu(pixmap, &box) &&
if (!texture_is_cpu(pixmap, &box) ||
move_to_gpu(pixmap, &box)) {
struct sna_pixmap *priv;