[PATCH 1/2] drm/virtio: factor out the sg_table from virtio_gpu_object
Gerd Hoffmann
kraxel at redhat.com
Tue Mar 3 09:56:50 UTC 2020
Hi,
> struct virtio_gpu_object {
> struct drm_gem_shmem_object base;
> uint32_t hw_res_handle;
> -
> - struct sg_table *pages;
> uint32_t mapped;
> -
> bool dumb;
> bool created;
> };
> #define gem_to_virtio_gpu_obj(gobj) \
> container_of((gobj), struct virtio_gpu_object, base.base)
>
> +struct virtio_gpu_object_shmem {
> + struct virtio_gpu_object base;
> + struct sg_table *pages;
> +};
mapped can be moved too.
> @@ -600,10 +600,11 @@ void virtio_gpu_cmd_transfer_to_host_2d(struct virtio_gpu_device *vgdev,
> + struct virtio_gpu_object_shmem *shmem = to_virtio_gpu_shmem(bo);
Should we pass struct virtio_gpu_object_shmem to
virtio_gpu_cmd_transfer_to_host_2d (+friends) instead?
hostmem will not need transfers ...
cheers,
Gerd
More information about the dri-devel
mailing list