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

2019-09-11 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| 78

[PATCH] drm/virtio: Fix warning in virtio_gpu_queue_fenced_ctrl_buffer.

2019-09-12 Thread David Riley
Fix warning introduced with commit e1218b8c0cc1 ("drm/virtio: Use vmalloc for command buffer allocations.") from drm-misc-next. Signed-off-by: David Riley --- drivers/gpu/drm/virtio/virtgpu_vq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/

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

2019-08-29 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| 74

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

2019-08-29 Thread David Riley
On Thu, Aug 29, 2019 at 11:09 PM Gerd Hoffmann wrote: > Hi, > > > { > > if (vbuf->resp_size > MAX_INLINE_RESP_SIZE) > > kfree(vbuf->resp_buf); > > - kfree(vbuf->data_buf); > > + kvfree(vbuf->data_buf); > > if (is_vmalloc_addr(vbuf->data_buf)) ... > > needed here I g

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

2019-08-30 Thread David Riley
Hi Gerd, On Fri, Aug 30, 2019 at 4:16 AM Gerd Hoffmann wrote: > > Hi, > > > > > - kfree(vbuf->data_buf); > > > > + kvfree(vbuf->data_buf); > > > > > > if (is_vmalloc_addr(vbuf->data_buf)) ... > > > > > > needed here I gues? > > > > > > > kvfree() handles vmalloc/kmalloc/kvmalloc interna

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

2019-09-03 Thread David Riley
On Sun, Sep 1, 2019 at 10:28 PM Gerd Hoffmann wrote: > > On Fri, Aug 30, 2019 at 10:49:25AM -0700, David Riley wrote: > > Hi Gerd, > > > > On Fri, Aug 30, 2019 at 4:16 AM Gerd Hoffmann wrote: > > > > > > Hi, > > > > > > > > >

[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

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 s

[PATCH v3 1/2] drm/virtio: Rewrite virtio_gpu_queue_ctrl_buffer using fenced version.

2019-09-10 Thread David Riley
Factor function in preparation to generating scatterlist prior to locking. Signed-off-by: David Riley --- drivers/gpu/drm/virtio/virtgpu_vq.c | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio

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

2019-09-10 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| 79

Re: [PATCH v3 1/2] drm/virtio: Rewrite virtio_gpu_queue_ctrl_buffer using fenced version.

2019-09-11 Thread David Riley
They were based off of Linus' https://github.com/torvalds/linux master from yesterday. I can rebase onto drm-misc-next. On Tue, Sep 10, 2019 at 10:12 PM Gerd Hoffmann wrote: > > On Tue, Sep 10, 2019 at 01:06:50PM -0700, David Riley wrote: > > Factor function in preparat

[PATCH v4 1/2] drm/virtio: Rewrite virtio_gpu_queue_ctrl_buffer using fenced version.

2019-09-11 Thread David Riley
Factor function in preparation to generating scatterlist prior to locking. Signed-off-by: David Riley --- drivers/gpu/drm/virtio/virtgpu_vq.c | 20 +++- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio

[PATCH v4 0/2] drm/virtio: Use vmalloc for command buffer alllocations.

2019-09-11 Thread David Riley
s. v4: Rebase onto drm-misc-next. David Riley (2): drm/virtio: Rewrite virtio_gpu_queue_ctrl_buffer using fenced version. drm/virtio: Use vmalloc for command buffer allocations. drivers/gpu/drm/virtio/virtgpu_ioctl.c | 4 +- drivers/gpu/drm/virtio/virtgpu_vq.c| 98