Re: [PATCH v2] drm/virtio: Use vmalloc for command buffer allocations.

2019-09-09 Thread David Riley
On Thu, Sep 5, 2019 at 10:18 PM Gerd Hoffmann wrote: > > > +/* How many bytes left in this page. */ > > +static unsigned int rest_of_page(void *data) > > +{ > > + return PAGE_SIZE - offset_in_page(data); > > +} > > Not needed. > > > +/* Create sg_table from a vmalloc'd buffer. */ > > +static

Re: [PATCH v2] drm/virtio: Use vmalloc for command buffer allocations.

2019-09-05 Thread Gerd Hoffmann
> +/* How many bytes left in this page. */ > +static unsigned int rest_of_page(void *data) > +{ > + return PAGE_SIZE - offset_in_page(data); > +} Not needed. > +/* Create sg_table from a vmalloc'd buffer. */ > +static struct sg_table *vmalloc_to_sgt(char *data, uint32_t size, int >

[PATCH v2] drm/virtio: Use vmalloc for command buffer allocations.

2019-09-05 Thread David Riley
Userspace requested command buffer allocations could be too large to make as a contiguous allocation. Use vmalloc if necessary to satisfy those allocations. Signed-off-by: David Riley --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 4 +- drivers/gpu/drm/virtio/virtgpu_vq.c| 114