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 <machado.prx@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43607
Signed-off-by: Chris Wilson <ickle@crestline.(none)>
This commit is contained in:
Chris Wilson 2011-12-08 12:07:28 +00:00 committed by Chris Wilson
parent 6ccb114a7e
commit 874c722c86
1 changed files with 3 additions and 3 deletions

View File

@ -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);