From 874c722c86b06ac0aa10e6943d3faf76fcb751be Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 8 Dec 2011 12:07:28 +0000 Subject: [PATCH] sna: Beware flushing partial buffers before they are written A partial buffer is considered finished upon the next batch submission, so one needs to be careful that it is completely written to before such an event is triggered. move-to-cpu is such a trigger as demonstrated by the picture fixup routine for handling convolution filters. Reported-by: Victor Machado Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43607 Signed-off-by: Chris Wilson --- src/sna/sna_render.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c index cf227c6e..13c0526d 100644 --- a/src/sna/sna_render.c +++ b/src/sna/sna_render.c @@ -900,6 +900,9 @@ sna_render_picture_fixup(struct sna *sna, __FUNCTION__, channel->pict_format, pitch, picture->format)); } + if (picture->pDrawable) + sna_drawable_move_to_cpu(picture->pDrawable, false); + channel->bo = kgem_create_buffer(&sna->kgem, pitch*h, KGEM_BUFFER_WRITE, &ptr); @@ -923,9 +926,6 @@ sna_render_picture_fixup(struct sna *sna, return 0; } - if (picture->pDrawable) - sna_drawable_move_to_cpu(picture->pDrawable, false); - src = image_from_pict(picture, FALSE, &dx, &dy); if (src == NULL) { pixman_image_unref(dst);