Skip to content

Commit 234489e

Browse files
committed
drm/virtio: batch display query
Move virtio_gpu_notify() to higher-level functions for virtio_gpu_cmd_get_display_info() and virtio_gpu_cmd_get_edids(). virtio_gpu_config_changed_work_func() and virtio_gpu_init() will batch commands and notify only once per update Signed-off-by: Gerd Hoffmann <[email protected]> Reviewed-by: Chia-I Wu <[email protected]> Reviewed-by: Gurchetan Singh <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 2e819a1 commit 234489e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/gpu/drm/virtio/virtgpu_kms.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ static void virtio_gpu_config_changed_work_func(struct work_struct *work)
4444
if (vgdev->has_edid)
4545
virtio_gpu_cmd_get_edids(vgdev);
4646
virtio_gpu_cmd_get_display_info(vgdev);
47+
virtio_gpu_notify(vgdev);
4748
drm_helper_hpd_irq_event(vgdev->ddev);
4849
events_clear |= VIRTIO_GPU_EVENT_DISPLAY;
4950
}
@@ -205,6 +206,7 @@ int virtio_gpu_init(struct drm_device *dev)
205206
if (vgdev->has_edid)
206207
virtio_gpu_cmd_get_edids(vgdev);
207208
virtio_gpu_cmd_get_display_info(vgdev);
209+
virtio_gpu_notify(vgdev);
208210
wait_event_timeout(vgdev->resp_wq, !vgdev->display_info_pending,
209211
5 * HZ);
210212
return 0;

drivers/gpu/drm/virtio/virtgpu_vq.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,6 @@ int virtio_gpu_cmd_get_display_info(struct virtio_gpu_device *vgdev)
775775
vgdev->display_info_pending = true;
776776
cmd_p->type = cpu_to_le32(VIRTIO_GPU_CMD_GET_DISPLAY_INFO);
777777
virtio_gpu_queue_ctrl_buffer(vgdev, vbuf);
778-
virtio_gpu_notify(vgdev);
779778
return 0;
780779
}
781780

@@ -903,7 +902,6 @@ int virtio_gpu_cmd_get_edids(struct virtio_gpu_device *vgdev)
903902
cmd_p->hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_GET_EDID);
904903
cmd_p->scanout = cpu_to_le32(scanout);
905904
virtio_gpu_queue_ctrl_buffer(vgdev, vbuf);
906-
virtio_gpu_notify(vgdev);
907905
}
908906

909907
return 0;

0 commit comments

Comments
 (0)