drm/virtio: move drm_connector_update_edid_property() call
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 5 Apr 2019 04:46:02 +0000 (06:46 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 26 Jun 2019 09:05:05 +0000 (11:05 +0200)
drm_connector_update_edid_property can sleep, we must not
call it while holding a spinlock.  Move the callsite.

Fixes: b4b01b4995fb ("drm/virtio: add edid support")
Reported-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Max Filippov <jcmvbkbc@gmail.com>
Tested-by: Cornelia Huck <cohuck@redhat.com>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20190405044602.2334-1-kraxel@redhat.com
drivers/gpu/drm/virtio/virtgpu_vq.c

index e62fe24b1a2e29b0f2ff9707e95aa9495b579454..5bb0f0a084e9cb293a8a91030e8a6f9a050eb987 100644 (file)
@@ -619,11 +619,11 @@ static void virtio_gpu_cmd_get_edid_cb(struct virtio_gpu_device *vgdev,
        output = vgdev->outputs + scanout;
 
        new_edid = drm_do_get_edid(&output->conn, virtio_get_edid_block, resp);
+       drm_connector_update_edid_property(&output->conn, new_edid);
 
        spin_lock(&vgdev->display_info_lock);
        old_edid = output->edid;
        output->edid = new_edid;
-       drm_connector_update_edid_property(&output->conn, output->edid);
        spin_unlock(&vgdev->display_info_lock);
 
        kfree(old_edid);