Skip to content

Commit

Permalink
drm/virtio: Use appropriate atomic state in virtio_gpu_plane_cleanup_…
Browse files Browse the repository at this point in the history
…fb()

commit 4656b3a upstream.

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
digetx authored and gregkh committed Oct 21, 2022
1 parent 90f8112 commit 377aa83
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/virtio/virtgpu_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,14 @@ static int virtio_gpu_plane_prepare_fb(struct drm_plane *plane,
}

static void virtio_gpu_plane_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;
Expand Down

0 comments on commit 377aa83

Please sign in to comment.