summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/virtio/virtgpu_plane.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2016-05-27 14:20:24 +0200
committerGerd Hoffmann <kraxel@redhat.com>2016-06-07 10:33:11 +0200
commitd3767d49f16b619c1943ce003e1f74817414aeb0 (patch)
tree2a50f6160ae1a0a525ca01bd2dde2c57d8e52e71 /drivers/gpu/drm/virtio/virtgpu_plane.c
parentaf8c34ce6ae32addda3788d54a7e340cad22516b (diff)
downloadlinux-d3767d49f16b619c1943ce003e1f74817414aeb0.tar.bz2
virtio-gpu: fix output lookup
Needed for multihead setups where we can have disabled outputs and therefore plane->crtc can be NULL. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/virtio/virtgpu_plane.c')
-rw-r--r--drivers/gpu/drm/virtio/virtgpu_plane.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c
index 70b44a2345ab..e50674bccb09 100644
--- a/drivers/gpu/drm/virtio/virtgpu_plane.c
+++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
@@ -63,11 +63,17 @@ 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 virtio_gpu_output *output = NULL;
struct virtio_gpu_framebuffer *vgfb;
struct virtio_gpu_object *bo;
uint32_t handle;
+ if (plane->state->crtc)
+ output = drm_crtc_to_virtio_gpu_output(plane->state->crtc);
+ if (old_state->crtc)
+ output = drm_crtc_to_virtio_gpu_output(old_state->crtc);
+ WARN_ON(!output);
+
if (plane->state->fb) {
vgfb = to_virtio_gpu_framebuffer(plane->state->fb);
bo = gem_to_virtio_gpu_obj(vgfb->obj);