Hi

On Wed, Jun 5, 2024 at 7:30 PM Weifeng Liu <weifeng.li...@gmail.com> wrote:

> 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.li...@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;
>

ok, stride defined by QEMUCursor layout


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

ok (destination image stride)


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

here however, it's unclear to me what the stride could be, I think it could
depend on resource format (virgl doesn't set stride either).

Gurchetan?



>      transfer.d = 1;
>
>      result = rutabaga_resource_transfer_write(vr->rutabaga, 0,
> t2d.resource_id,
> --
> 2.45.0
>
>
>

-- 
Marc-André Lureau

Reply via email to