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

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

authored by

Gerd Hoffmann and committed by
Daniel Vetter
d1e372c4 0645de5a

+7 -1
+7 -1
drivers/gpu/drm/virtio/virtgpu_plane.c
··· 63 63 { 64 64 struct drm_device *dev = plane->dev; 65 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 67 struct virtio_gpu_framebuffer *vgfb; 68 68 struct virtio_gpu_object *bo; 69 69 uint32_t handle; 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); 70 76 71 77 if (plane->state->fb) { 72 78 vgfb = to_virtio_gpu_framebuffer(plane->state->fb);