drm/virtio: Use appropriate atomic state in virtio_gpu_plane_cleanup_fb()
authorDmitry Osipenko <dmitry.osipenko@collabora.com>
Thu, 30 Jun 2022 20:07:22 +0000 (23:07 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 30 Oct 2022 08:41:18 +0000 (09:41 +0100)
[ Upstream commit 4656b3a26a9e9fe5f04bfd2ab55b066266ba7f4d ]

Make virtio_gpu_plane_cleanup_fb() to clean the state which DRM core
wants to clean up and not the current plane's state. Normally the older
atomic state is cleaned up, but the newer state could also be cleaned up
in case of aborted commits.

Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20220630200726.1884320-6-dmitry.osipenko@collabora.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/virtio/virtgpu_plane.c

index 6a311cd934403914e87ae3b0b2acafcbe40c4032..e6de627342695ba9008bb58183f7d3c211a02ccd 100644 (file)
@@ -213,14 +213,14 @@ static int virtio_gpu_cursor_prepare_fb(struct drm_plane *plane,
 }
 
 static void virtio_gpu_cursor_cleanup_fb(struct drm_plane *plane,
-                                        struct drm_plane_state *old_state)
+                                       struct drm_plane_state *state)
 {
        struct virtio_gpu_framebuffer *vgfb;
 
-       if (!plane->state->fb)
+       if (!state->fb)
                return;
 
-       vgfb = to_virtio_gpu_framebuffer(plane->state->fb);
+       vgfb = to_virtio_gpu_framebuffer(state->fb);
        if (vgfb->fence) {
                dma_fence_put(&vgfb->fence->f);
                vgfb->fence = NULL;