From: Weifeng Liu <weifeng.liu.z@gmail.com>
To: qemu-devel@nongnu.org,
Gurchetan Singh <gurchetansingh@chromium.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>
Cc: "Weifeng Liu" <weifeng.liu.z@gmail.com>,
"Antonio Caggiano" <antonio.caggiano@collabora.com>,
"Huang Rui" <ray.huang@amd.com>,
"Dmitry Osipenko" <dmitry.osipenko@collabora.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [PATCH 1/3] virtio-gpu: rutabaga: Properly set stride when copying resources
Date: Wed, 5 Jun 2024 23:28:28 +0800 [thread overview]
Message-ID: <20240605152832.11618-2-weifeng.liu.z@gmail.com> (raw)
In-Reply-To: <20240605152832.11618-1-weifeng.liu.z@gmail.com>
The stride is not correctly assigned when copying pixel data, causing
images being displayed incomplete when using 2d component of rutabaga.
Signed-off-by: Weifeng Liu <weifeng.liu.z@gmail.com>
---
hw/display/virtio-gpu-rutabaga.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/display/virtio-gpu-rutabaga.c b/hw/display/virtio-gpu-rutabaga.c
index 17bf701a21..2ba6869606 100644
--- a/hw/display/virtio-gpu-rutabaga.c
+++ b/hw/display/virtio-gpu-rutabaga.c
@@ -53,6 +53,7 @@ virtio_gpu_rutabaga_update_cursor(VirtIOGPU *g, struct virtio_gpu_scanout *s,
transfer.z = 0;
transfer.w = res->width;
transfer.h = res->height;
+ transfer.stride = res->width * 4;
transfer.d = 1;
transfer_iovec.iov_base = s->current_cursor->data;
@@ -273,6 +274,7 @@ rutabaga_cmd_resource_flush(VirtIOGPU *g, struct virtio_gpu_ctrl_command *cmd)
transfer.z = 0;
transfer.w = res->width;
transfer.h = res->height;
+ transfer.stride = pixman_image_get_stride(res->image);
transfer.d = 1;
transfer_iovec.iov_base = pixman_image_get_data(res->image);
@@ -382,6 +384,7 @@ rutabaga_cmd_transfer_to_host_2d(VirtIOGPU *g,
transfer.z = 0;
transfer.w = t2d.r.width;
transfer.h = t2d.r.height;
+ transfer.stride = t2d.r.width * 4;
transfer.d = 1;
result = rutabaga_resource_transfer_write(vr->rutabaga, 0, t2d.resource_id,
--
2.45.0
next prev parent reply other threads:[~2024-06-05 15:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-05 15:28 [PATCH 0/3] virtio-gpu: Enable virglrenderer backend for rutabaga Weifeng Liu
2024-06-05 15:28 ` Weifeng Liu [this message]
2024-06-10 7:44 ` [PATCH 1/3] virtio-gpu: rutabaga: Properly set stride when copying resources Marc-André Lureau
2024-06-14 23:50 ` Gurchetan Singh
2024-06-05 15:28 ` [PATCH 2/3] virtio-gpu: rutabaga: Poll rutabaga upon events Weifeng Liu
2024-06-05 15:28 ` [PATCH 3/3] virtio-gpu: rutabaga: Add options to enable virgl and venus contexts Weifeng Liu
2024-06-06 10:43 ` [PATCH 0/3] virtio-gpu: Enable virglrenderer backend for rutabaga Alex Bennée
2024-06-07 6:47 ` Weifeng Liu
2024-06-07 11:10 ` Alex Bennée
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240605152832.11618-2-weifeng.liu.z@gmail.com \
--to=weifeng.liu.z@gmail.com \
--cc=antonio.caggiano@collabora.com \
--cc=dmitry.osipenko@collabora.com \
--cc=gurchetansingh@chromium.org \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=ray.huang@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).