virgl/vtest: use correct resource stride in flush_frontbuffer

The displaytarget's resource stride is alignment is currently 64-bytes,
where the shared resource stride is unaligned.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11714>
This commit is contained in:
Italo Nicola 2021-07-09 07:47:29 -03:00 committed by Marge Bot
parent a235e02787
commit b6d0447027

View file

@ -628,7 +628,8 @@ static void virgl_vtest_flush_frontbuffer(struct virgl_winsys *vws,
if (sub_box) {
box = *sub_box;
offset = box.y / util_format_get_blockheight(res->format) * res->stride +
uint32_t shm_stride = util_format_get_stride(res->format, res->width);
offset = box.y / util_format_get_blockheight(res->format) * shm_stride +
box.x / util_format_get_blockwidth(res->format) * util_format_get_blocksize(res->format);
} else {
box.z = layer;