virtio-gpu: fix output lookup
Subsystems (4)
Gerd Hoffmann
maintainerPATCH 1/1 virtio-gpu: fix output lookup
Needed for multihead setups where we can have disabled outputs and therefore plane->crtc can be NULL.
--- drivers/gpu/drm/virtio/virtgpu_plane.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/virtio/virtgpu_plane.c +7 -1
@@ -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);
Signature · 1 line
1.8.3.1
Quoted 4 lines · Gerd Hoffmann
Needed for multihead setups where we can have disabled outputs and therefore
plane->crtccan be NULL.Signed-off-by Gerd Hoffmann <[email protected]>
See my reply in the other thread, but I think you have a more fundamental issue here. I dropped two suggestions worth trying, both need your own atomic_commit_tail (on top of my branch at least):
- set active_only to true in commit_planes()
- move commit_planes after commit_modeset_enables().
Cheers, Daniel
Quoted 34 lines
--- drivers/gpu/drm/virtio/virtgpu_plane.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)drivers/gpu/drm/virtio/virtgpu_plane.c +7
-1@@ -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);Signature · 6 lines
1.8.3.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Quoted 4 lines · Gerd Hoffmann
Needed for multihead setups where we can have disabled outputs and therefore
plane->crtccan be NULL.Signed-off-by Gerd Hoffmann <[email protected]>
See my reply in the other thread, but I think you have a more fundamental issue here. I dropped two suggestions worth trying, both need your own atomic_commit_tail (on top of my branch at least):
- set active_only to true in commit_planes()
- move commit_planes after commit_modeset_enables().
Cheers, Daniel
Quoted 34 lines
--- drivers/gpu/drm/virtio/virtgpu_plane.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)drivers/gpu/drm/virtio/virtgpu_plane.c +7
-1@@ -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);Signature · 6 lines
1.8.3.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Daniel Vetter
AppliedQuoted 4 lines · Gerd Hoffmann
Needed for multihead setups where we can have disabled outputs and therefore
plane->crtccan be NULL.Signed-off-by Gerd Hoffmann <[email protected]>
Applied to drm-misc, thanks.
-Daniel
Quoted 34 lines
--- drivers/gpu/drm/virtio/virtgpu_plane.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)drivers/gpu/drm/virtio/virtgpu_plane.c +7
-1@@ -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);Signature · 6 lines
1.8.3.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Daniel Vetter
AppliedQuoted 4 lines · Gerd Hoffmann
Needed for multihead setups where we can have disabled outputs and therefore
plane->crtccan be NULL.Signed-off-by Gerd Hoffmann <[email protected]>
Applied to drm-misc, thanks.
-Daniel
Quoted 34 lines
--- drivers/gpu/drm/virtio/virtgpu_plane.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)drivers/gpu/drm/virtio/virtgpu_plane.c +7
-1@@ -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);Signature · 6 lines
1.8.3.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel