virgl/vtest: fix front buffer flush with protocol version 0.
authorDave Airlie <airlied@redhat.com>
Thu, 27 Dec 2018 06:09:19 +0000 (16:09 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 28 Dec 2018 06:50:38 +0000 (16:50 +1000)
Older versions of virglrenderer before 33da7361aec486290df0aec4ad8dfa8ff6adde2c
in vtest mode, misrender gears.

Fixes: 9d81cd8e7c (virgl: Pass resource size and transfer offsets)
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c

index 65963ad50e1194e9e794c5bb918102877b21c4b5..5422b29e55a5be18710256198e7fb448e4581b61 100644 (file)
@@ -644,7 +644,7 @@ static void virgl_vtest_flush_frontbuffer(struct virgl_winsys *vws,
     * get the data. */
    virgl_vtest_recv_transfer_get_data(vtws, map + offset, size, valid_stride,
                                       &box, res->format,
-                                      util_format_get_stride(res->format, res->width));
+                                      vtws->protocol_version == 0 ? valid_stride : util_format_get_stride(res->format, res->width));
 
    vtws->sws->displaytarget_unmap(vtws->sws, res->dt);