lib/igt_draw: fix pwrite_tiled()

Don't forget to flush in case we're in the last iteration of the loop.
This fixes failures of kms_frontbuffer_tracking when used with
--use-small-modes on eDP monitors.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
This commit is contained in:
Paulo Zanoni 2015-08-13 17:25:31 -03:00
parent caaf3b869f
commit 9194f4efdf

View File

@ -375,7 +375,8 @@ static void draw_rect_pwrite_tiled(int fd, struct buf_data *buf,
flush_tmp = true;
}
if (tmp_used == tmp_size || (flush_tmp && tmp_used > 0)) {
if (tmp_used == tmp_size || (flush_tmp && tmp_used > 0) ||
tiled_pos + pixel_size >= buf->size) {
gem_write(fd, buf->handle, tmp_start_pos, tmp,
tmp_used * pixel_size);
flush_tmp = false;