@@ -63,7 +63,7 @@ static void virtio_gpu_plane_atomic_update(struct drm_plane *plane,
{
struct drm_device *dev = plane->dev;
struct virtio_gpu_device *vgdev = dev->dev_private;
- struct virtio_gpu_output *output = drm_crtc_to_virtio_gpu_output(plane->crtc);
+ struct drm_crtc *crtc = plane->state->crtc ?: old_state->crtc;
struct virtio_gpu_framebuffer *vgfb;
struct virtio_gpu_object *bo;
uint32_t handle;
@@ -86,7 +86,7 @@ static void virtio_gpu_plane_atomic_update(struct drm_plane *plane,
DRM_DEBUG("handle 0x%x, crtc %dx%d+%d+%d\n", handle,
plane->state->crtc_w, plane->state->crtc_h,
plane->state->crtc_x, plane->state->crtc_y);
- virtio_gpu_cmd_set_scanout(vgdev, output->index, handle,
+ virtio_gpu_cmd_set_scanout(vgdev, drm_crtc_index(crtc), handle,
plane->state->crtc_w,
plane->state->crtc_h,
plane->state->crtc_x,