[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 07/12] virtio-gpu: Add virtio_gpu_resource_create_blob
From: |
Gerd Hoffmann |
Subject: |
Re: [PATCH v2 07/12] virtio-gpu: Add virtio_gpu_resource_create_blob |
Date: |
Wed, 28 Apr 2021 11:16:43 +0200 |
Hi,
> diff --git a/hw/display/virtio-gpu-udmabuf.c b/hw/display/virtio-gpu-udmabuf.c
> index 2c0e7b2455..8bbce08550 100644
> --- a/hw/display/virtio-gpu-udmabuf.c
> +++ b/hw/display/virtio-gpu-udmabuf.c
> @@ -72,7 +72,10 @@ static void virtio_gpu_create_udmabuf(struct
> virtio_gpu_simple_resource *res)
>
> static void virtio_gpu_remap_udmabuf(struct virtio_gpu_simple_resource *res)
> {
> - res->remapsz = res->width * res->height * 4;
> + if (res->blob_size) {
> + res->remapsz = res->blob_size;
> + }
> +
> res->remapsz = QEMU_ALIGN_UP(res->remapsz, qemu_real_host_page_size);
>
> res->remapped = mmap(NULL, res->remapsz, PROT_READ,
> @@ -152,7 +155,9 @@ void virtio_gpu_init_udmabuf(struct
> virtio_gpu_simple_resource *res)
> pdata = res->remapped;
> }
>
> - (void) pdata;
> + if (pdata) {
> + res->blob = pdata;
> + }
> }
That is confusing. Patch #2 introduces code which is removed here
(probably leftovers from udmabuf prototype which didn't use blob
resources). I think it would be useful to merge patch #2 with this one.
Also we might cleanup things a bit. Do we need separate remapsz +
blob_size fields in the first place? Probably not ...
take care,
Gerd
PS: Can you explicitly cc me on the next version of the patch series?
Some patches (this one for example) are on the list only and not in
my inbox. Thanks.
- [PATCH v2 00/12] virtio-gpu: Add support for Blob resources feature, Vivek Kasireddy, 2021/04/20
- [PATCH v2 01/12] ui: Get the fd associated with udmabuf driver, Vivek Kasireddy, 2021/04/20
- [PATCH v2 03/12] virtio-gpu: Add virtio_gpu_find_check_resource, Vivek Kasireddy, 2021/04/20
- [PATCH v2 04/12] virtio-gpu: Refactor virtio_gpu_set_scanout, Vivek Kasireddy, 2021/04/20
- [PATCH v2 02/12] virtio-gpu: Add udmabuf helpers, Vivek Kasireddy, 2021/04/20
- [PATCH v2 05/12] virtio-gpu: Refactor virtio_gpu_create_mapping_iov, Vivek Kasireddy, 2021/04/20
- [PATCH v2 06/12] virtio-gpu: Add initial definitions for blob resources, Vivek Kasireddy, 2021/04/20
- [PATCH v2 07/12] virtio-gpu: Add virtio_gpu_resource_create_blob, Vivek Kasireddy, 2021/04/20
- Re: [PATCH v2 07/12] virtio-gpu: Add virtio_gpu_resource_create_blob,
Gerd Hoffmann <=
- [PATCH v2 08/12] ui/pixman: Add qemu_pixman_to_drm_format(), Vivek Kasireddy, 2021/04/20
- [PATCH v2 10/12] virtio-gpu: Factor out update scanout, Vivek Kasireddy, 2021/04/20
- [PATCH v2 09/12] virtio-gpu: Add helpers to create and destroy dmabuf objects, Vivek Kasireddy, 2021/04/20
- [PATCH v2 11/12] virtio-gpu: Add virtio_gpu_set_scanout_blob, Vivek Kasireddy, 2021/04/20
- [PATCH v2 12/12] virtio-gpu: Update cursor data using blob, Vivek Kasireddy, 2021/04/20