drm/virtio: use old_state when disabling a plane
Subsystems (3)
PATCH 1/1 drm/virtio: use old_state when disabling a plane
From: Gustavo Padovan <[email protected]>
When disabling a plane it current plane->state->crtc is NULL and thus can't be used to to retrieve the crtc index. In this case we should get the old_state->crtc and disable the plane on it.
Signed-off-by Gustavo Padovan <[email protected]>
--- drivers/gpu/drm/virtio/virtgpu_plane.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/virtio/virtgpu_plane.c +2 -2
@@ -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,
Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel