diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2016-05-30 08:03:26 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-05-31 03:30:37 -0400 |
commit | d1e372c4fbdf7de7270bd47a427872dd95973aa6 (patch) | |
tree | 5edf2077362202e77619db058f04123015294059 | |
parent | 0645de5a4c22638170f6e0bb31a0b1c9f52daf93 (diff) |
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>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1464609806-22013-1-git-send-email-kraxel@redhat.com
-rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_plane.c | 8 |
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, | |||
63 | { | 63 | { |
64 | struct drm_device *dev = plane->dev; | 64 | struct drm_device *dev = plane->dev; |
65 | struct virtio_gpu_device *vgdev = dev->dev_private; | 65 | struct virtio_gpu_device *vgdev = dev->dev_private; |
66 | struct virtio_gpu_output *output = drm_crtc_to_virtio_gpu_output(plane->crtc); | 66 | struct virtio_gpu_output *output = NULL; |
67 | struct virtio_gpu_framebuffer *vgfb; | 67 | struct virtio_gpu_framebuffer *vgfb; |
68 | struct virtio_gpu_object *bo; | 68 | struct virtio_gpu_object *bo; |
69 | uint32_t handle; | 69 | uint32_t handle; |
70 | 70 | ||
71 | if (plane->state->crtc) | ||
72 | output = drm_crtc_to_virtio_gpu_output(plane->state->crtc); | ||
73 | if (old_state->crtc) | ||
74 | output = drm_crtc_to_virtio_gpu_output(old_state->crtc); | ||
75 | WARN_ON(!output); | ||
76 | |||
71 | if (plane->state->fb) { | 77 | if (plane->state->fb) { |
72 | vgfb = to_virtio_gpu_framebuffer(plane->state->fb); | 78 | vgfb = to_virtio_gpu_framebuffer(plane->state->fb); |
73 | bo = gem_to_virtio_gpu_obj(vgfb->obj); | 79 | bo = gem_to_virtio_gpu_obj(vgfb->obj); |