Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/virtgpu: initialise fbdev after getting initial display info

This should avoid issues with the fbdev path trying to render
before we've gotten the display info.

Signed-off-by: Dave Airlie <airlied@redhat.com>

[ kraxel: wait for display-info reply ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

authored by

Dave Airlie and committed by
Gerd Hoffmann
441012af 50cb941a

+6 -1
+1
drivers/gpu/drm/virtio/virtgpu_drv.h
··· 171 171 wait_queue_head_t resp_wq; 172 172 /* current display info */ 173 173 spinlock_t display_info_lock; 174 + bool display_info_pending; 174 175 175 176 struct virtio_gpu_fence_driver fence_drv; 176 177
+3 -1
drivers/gpu/drm/virtio/virtgpu_kms.c
··· 137 137 virtio_device_ready(vgdev->vdev); 138 138 vgdev->vqs_ready = true; 139 139 140 + virtio_gpu_cmd_get_display_info(vgdev); 141 + wait_event_timeout(vgdev->resp_wq, !vgdev->display_info_pending, 142 + 5 * HZ); 140 143 if (virtio_gpu_fbdev) 141 144 virtio_gpu_fbdev_init(vgdev); 142 - virtio_gpu_cmd_get_display_info(vgdev); 143 145 144 146 return 0; 145 147
+2
drivers/gpu/drm/virtio/virtgpu_vq.c
··· 534 534 } 535 535 } 536 536 537 + vgdev->display_info_pending = false; 537 538 spin_unlock(&vgdev->display_info_lock); 538 539 wake_up(&vgdev->resp_wq); 539 540 ··· 559 558 resp_buf); 560 559 memset(cmd_p, 0, sizeof(*cmd_p)); 561 560 561 + vgdev->display_info_pending = true; 562 562 cmd_p->type = cpu_to_le32(VIRTIO_GPU_CMD_GET_DISPLAY_INFO); 563 563 virtio_gpu_queue_ctrl_buffer(vgdev, vbuf); 564 564 return 0;