Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1221376 > unrolled thread
| Started by | Gerd Hoffmann <kraxel@redhat.com> |
|---|---|
| First post | 2015-09-09 13:50 +0200 |
| Last post | 2015-09-10 16:10 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 1/5] virtio-gpu: add virtio_gpu_queue_ctrl_buffer_nolock Gerd Hoffmann <kraxel@redhat.com> - 2015-09-09 13:50 +0200
Re: [PATCH 1/5] virtio-gpu: add virtio_gpu_queue_ctrl_buffer_nolock Emil Velikov <emil.l.velikov@gmail.com> - 2015-09-10 10:50 +0200
Re: [PATCH 1/5] virtio-gpu: add virtio_gpu_queue_ctrl_buffer_nolock Gerd Hoffmann <kraxel@redhat.com> - 2015-09-10 16:10 +0200
| From | Gerd Hoffmann <kraxel@redhat.com> |
|---|---|
| Date | 2015-09-09 13:50 +0200 |
| Subject | [PATCH 1/5] virtio-gpu: add virtio_gpu_queue_ctrl_buffer_nolock |
| Message-ID | <q6M2Z-1ZO-1@gated-at.bofh.it> |
Add virtio_gpu_queue_ctrl_buffer_nolock function, which does the same as
virtio_gpu_queue_ctrl_buffer but does not take the virtqueue lock. The
caller must hold the lock instead.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
drivers/gpu/drm/virtio/virtgpu_vq.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c
index 1698669f..b9275c7 100644
--- a/drivers/gpu/drm/virtio/virtgpu_vq.c
+++ b/drivers/gpu/drm/virtio/virtgpu_vq.c
@@ -293,8 +293,8 @@ void virtio_gpu_dequeue_cursor_func(struct work_struct *work)
wake_up(&vgdev->cursorq.ack_queue);
}
-static int virtio_gpu_queue_ctrl_buffer(struct virtio_gpu_device *vgdev,
- struct virtio_gpu_vbuffer *vbuf)
+static int virtio_gpu_queue_ctrl_buffer_nolock(struct virtio_gpu_device *vgdev,
+ struct virtio_gpu_vbuffer *vbuf)
{
struct virtqueue *vq = vgdev->ctrlq.vq;
struct scatterlist *sgs[3], vcmd, vout, vresp;
@@ -320,7 +320,6 @@ static int virtio_gpu_queue_ctrl_buffer(struct virtio_gpu_device *vgdev,
incnt++;
}
- spin_lock(&vgdev->ctrlq.qlock);
retry:
ret = virtqueue_add_sgs(vq, sgs, outcnt, incnt, vbuf, GFP_ATOMIC);
if (ret == -ENOSPC) {
@@ -331,13 +330,23 @@ retry:
} else {
virtqueue_kick(vq);
}
- spin_unlock(&vgdev->ctrlq.qlock);
if (!ret)
ret = vq->num_free;
return ret;
}
+static int virtio_gpu_queue_ctrl_buffer(struct virtio_gpu_device *vgdev,
+ struct virtio_gpu_vbuffer *vbuf)
+{
+ int rc;
+
+ spin_lock(&vgdev->ctrlq.qlock);
+ rc = virtio_gpu_queue_ctrl_buffer_nolock(vgdev, vbuf);
+ spin_unlock(&vgdev->ctrlq.qlock);
+ return rc;
+}
+
static int virtio_gpu_queue_cursor(struct virtio_gpu_device *vgdev,
struct virtio_gpu_vbuffer *vbuf)
{
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Emil Velikov <emil.l.velikov@gmail.com> |
|---|---|
| Date | 2015-09-10 10:50 +0200 |
| Message-ID | <q75In-4L3-59@gated-at.bofh.it> |
| In reply to | #1221376 |
Hi Gerd, On 9 September 2015 at 12:42, Gerd Hoffmann <kraxel@redhat.com> wrote: > Add virtio_gpu_queue_ctrl_buffer_nolock function, which does the same as > virtio_gpu_queue_ctrl_buffer but does not take the virtqueue lock. The > caller must hold the lock instead. > The drm subsystem tends to use *_locked and *_unlocked suffixes. With the latter being less common. Not a big deal but perhaps you can use one of those for virtio ? Cheers, Emil -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Gerd Hoffmann <kraxel@redhat.com> |
|---|---|
| Date | 2015-09-10 16:10 +0200 |
| Message-ID | <q7aI2-3GV-17@gated-at.bofh.it> |
| In reply to | #1222035 |
On Do, 2015-09-10 at 09:39 +0100, Emil Velikov wrote: > Hi Gerd, > > On 9 September 2015 at 12:42, Gerd Hoffmann <kraxel@redhat.com> wrote: > > Add virtio_gpu_queue_ctrl_buffer_nolock function, which does the same as > > virtio_gpu_queue_ctrl_buffer but does not take the virtqueue lock. The > > caller must hold the lock instead. > > > The drm subsystem tends to use *_locked and *_unlocked suffixes. With > the latter being less common. > Not a big deal but perhaps you can use one of those for virtio ? _locked looks correct for this case to me (looking at drm_vm_close + drm_vm_close_locked to compare). I'll change it. cheers, Gerd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web