Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp878373lfv; Tue, 12 Apr 2022 07:47:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGJYgmX58OusaE5+Oo8MMiHUFQDOiAwrrqugUQ6vWExe2GKZ/G6cF7Zn/jFhNncRWLgOvM X-Received: by 2002:a17:90a:510e:b0:1cb:b1de:27a0 with SMTP id t14-20020a17090a510e00b001cbb1de27a0mr5465266pjh.196.1649774824271; Tue, 12 Apr 2022 07:47:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649774824; cv=none; d=google.com; s=arc-20160816; b=VhRUHphD7tUxIlWKWc3ssh7KWA5WmdoPQlSBYq+/o6gE1ELBiZ6gAgMr0c+P4pdag7 egLItZsI0+u3XXGByyY8YLBKTVIu5Tmv87E3u26KdGmfvzSO86KAgO+Pm8ABy+iAK+uV +VVUrzGOe3kRrzLxrAhRO86AS94iCJhFTqqnHur8TtGLuGo8YbiYUt23/KAid4ebCYuu I5J4oUL8vOM24pt2y2WV3cO5Zmr9KqKcFqyXGqPDz1bqra6ZH8LuSt2LBIEy8N2Ed2WC MxSr2pMn2GDYh6WPPHZ8iutoYfgJ9h2lZIEAELx4dvxgPmZghFQOsPYmAsMtnMPqNdpF /J4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Jr5mOY+gtvSUC6VyxQBomw+ordFbWm6r1Xe/dwbNDIo=; b=dGiUnj0zL3m+UgnZi/UCWjleUUN3w63cVuqAijBXWTvBd7Gj9f3PZLcjwS08sGtBDv SiK8bTTJXapOscL/OVY11i3lH1hmGlkAG38vdp6qcNSHJpzbJO6P7p8ToDw2PGs8ZBup q/hu2exiOIa92WhYCayUZl+2LunmNIdo45uG2UVI4cJrSBQ0dGOk0/yCNDALYTsyiYGQ HyLUKjPOjYWHOg7m1i+oE/FtKxzOF42Qe0qAW6/E1SJ9SjJhr2T/9oV6I55RUpJCPPQC /QH3Y+GVXH84J2f/0i5KrJcwSZTbutUUi6uQAmiSXnsCeaiDjaZzZDmsCw4d8RMM3SgJ xrSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ghRkbXF8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j11-20020a170902758b00b001585d8cc865si6483454pll.72.2022.04.12.07.46.40; Tue, 12 Apr 2022 07:47:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ghRkbXF8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350292AbiDKWC5 (ORCPT + 99 others); Mon, 11 Apr 2022 18:02:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350376AbiDKWCk (ORCPT ); Mon, 11 Apr 2022 18:02:40 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C43CDBC5 for ; Mon, 11 Apr 2022 15:00:25 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id 306EB1F43C86 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1649714424; bh=H5TVWLdKQBunPI+41h2cAjj6IZ6UbyVtXydAliQEN5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ghRkbXF8rhL12mWU1KFreAJI9IWMEWq2ZRIsd90oRUbv2Hi22nfvWlGYPyx1iO2Im lLepkN8foGV3yYTi/kthftgh9ENBp8b7zqRqle9F6fYOnHDfVSbhI8GzOT2hwaGSGS /A9STdZ5CD57NoJuhmSH9+3wm4N/Rbnd3gwu2JHh/UaekEDaQbVEtZW2zIbMnuK+Ei vJ9nKFF0g73jEi//GPA6LAidI0lgOOscDFiB2ovh753SJpGMgB78FCJdtcr6okk34Z iERUQs1LXIUQrYCJxf7S+GhF4m+eVHXZ6hnye92nR2xg0sDYgozC5onFTpl7k71MfR JkzMscCGSUXlg== From: Dmitry Osipenko To: David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Daniel Almeida , Gert Wollny , Tomeu Vizoso , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Steven Price , Alyssa Rosenzweig , Rob Clark Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Gustavo Padovan , Daniel Stone , virtualization@lists.linux-foundation.org, Dmitry Osipenko , Dmitry Osipenko Subject: [PATCH v3 05/15] drm/virtio: Use appropriate atomic state in virtio_gpu_plane_cleanup_fb() Date: Tue, 12 Apr 2022 00:59:27 +0300 Message-Id: <20220411215937.281655-6-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220411215937.281655-1-dmitry.osipenko@collabora.com> References: <20220411215937.281655-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/gpu/drm/virtio/virtgpu_plane.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index 6d3cc9e238a4..7148f3813d8b 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -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; -- 2.35.1