Re: [PATCH 1/2] drm/virtio: factor out the sg_table from virtio_gpu_object

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Tue, Mar 3, 2020 at 1:56 AM Gerd Hoffmann <kraxel@xxxxxxxxxx> wrote:
  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?

It ends up being a little more complicated, due to casting to virtio_gpu_object and then virtio_gpu_object_shmem in virtio_gpu_transfer_to_host_ioctl, so I omitted it v2...
 

hostmem will not need transfers ...

cheers,
  Gerd

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux