From bc8a2c30c4f6bb9ce751b6717a3a2feaea0d6d4b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 7 Feb 2013 10:42:58 +0000 Subject: [PATCH] sna: Only try the SRC fixup into the buffer if it is CPU mapped On one particular machine, this operation is behaving as if it is reading back UC memory during the explicit write-only composite. Signed-off-by: Chris Wilson --- src/sna/sna_render.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c index 8f4f268a..7784a5b1 100644 --- a/src/sna/sna_render.c +++ b/src/sna/sna_render.c @@ -1576,8 +1576,10 @@ do_fixup: } /* Composite in the original format to preserve idiosyncracies */ - if (picture->format == channel->pict_format) - dst = pixman_image_create_bits(picture->format, + if (!kgem_buffer_is_inplace(channel->bo) && + (picture->pDrawable == NULL || + picture->format == channel->pict_format)) + dst = pixman_image_create_bits(channel->pict_format, w, h, ptr, channel->bo->pitch); else dst = pixman_image_create_bits(picture->format, w, h, NULL, 0); @@ -1603,7 +1605,7 @@ do_fixup: free_pixman_pict(picture, src); /* Then convert to card format */ - if (picture->format != channel->pict_format) { + if (pixman_image_get_data(dst) != ptr) { DBG(("%s: performing post-conversion %08x->%08x (%d, %d)\n", __FUNCTION__, picture->format, channel->pict_format,