mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 23:03:57 -04:00
drm/virtio: batch display update commands.
When the driver submits multiple commands in a row it makes sense to notify the host only after submitting the last one, so the host can process them all at once, with a single vmexit. Add functions to enable/disable notifications to allow that. Use the new functions for primary plane updates. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chia-I Wu <olvaffe@gmail.com> Link: http://patchwork.freedesktop.org/patch/msgid/20191212125346.8334-3-kraxel@redhat.com
This commit is contained in:
@@ -404,8 +404,12 @@ again:
|
||||
}
|
||||
notify = virtio_gpu_queue_ctrl_buffer_locked(vgdev, vbuf, vout);
|
||||
spin_unlock(&vgdev->ctrlq.qlock);
|
||||
if (notify)
|
||||
virtqueue_notify(vgdev->ctrlq.vq);
|
||||
if (notify) {
|
||||
if (vgdev->disable_notify)
|
||||
vgdev->pending_notify = true;
|
||||
else
|
||||
virtqueue_notify(vgdev->ctrlq.vq);
|
||||
}
|
||||
|
||||
if (sgt) {
|
||||
sg_free_table(sgt);
|
||||
@@ -413,6 +417,21 @@ again:
|
||||
}
|
||||
}
|
||||
|
||||
void virtio_gpu_disable_notify(struct virtio_gpu_device *vgdev)
|
||||
{
|
||||
vgdev->disable_notify = true;
|
||||
}
|
||||
|
||||
void virtio_gpu_enable_notify(struct virtio_gpu_device *vgdev)
|
||||
{
|
||||
vgdev->disable_notify = false;
|
||||
|
||||
if (!vgdev->pending_notify)
|
||||
return;
|
||||
vgdev->pending_notify = false;
|
||||
virtqueue_notify(vgdev->ctrlq.vq);
|
||||
}
|
||||
|
||||
static void virtio_gpu_queue_ctrl_buffer(struct virtio_gpu_device *vgdev,
|
||||
struct virtio_gpu_vbuffer *vbuf)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user