From patchwork Wed Oct 19 08:22:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4557 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp204663wrs; Wed, 19 Oct 2022 01:46:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM78l39jepVt1pp6HlO6fDZ1jLn4cWk7xd88lx5fc3M9RYEpvS9VR2YY8kvLDkNrGd8DtVP/ X-Received: by 2002:a17:90b:4a90:b0:20d:5c5e:1622 with SMTP id lp16-20020a17090b4a9000b0020d5c5e1622mr44618678pjb.50.1666169209266; Wed, 19 Oct 2022 01:46:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666169209; cv=none; d=google.com; s=arc-20160816; b=w48jO1G3cVwgaeYm15bjLCBMhjbi52JX93IA9YKOV25FPezIsNPEoQPeF0TC1TiYo9 M8D3a90/PbsqJxD4Bat4XA40B3L4rlkwlWj2O9YY1+GO9N7WM00qILgG5R/QkQz+Baoa XDx7I+l1oOeV4lQycjghNNmhL6quGLMzSD4VUJ17MBoKg5FSkHLSWFsHItuGK5KRE2EA 3nBx17ppSqJ/RsJpWA5AST6FtHsGhmhZJgHsLarJ/Qfdq+0vG+muKlJNXX3esCmMvuzt cFurQUru72Lo/P9LdcA8/TaJNqyFBQxEP+t78f3jRzB9zG5Se1qN+2gOre3iAu65oT8m tArQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Fi7CoqUq7ZQ/iKNziBkLwqLr8c0taNoRZVPEr7KMkEs=; b=KFg7ejayLppcufrsxPtRLvmfSYFR9MgVs97zopU1tEj8EOkOQTbyt3N6llX14XQvh4 DsB58c6CqEbu9aspx+vnJFPOBzDCdo1HUQDTq75y4GzawjvP+OC3zozbwDwk4YuO1Y0n DR7C7wwrqdqXW7VyiAmEtVkrMCwLUKh2IxgI5n8jSGS6qGJu2IM+0RKF123s9SiAP4/i Big4LV94fxtxtI/whCxcbYSp8SBurPhUF1hbnfjLsU7Ayzfl1aLoPU2f65fthL40r7DR zesKchWNI2QcAJ4uKswXy8+vs7OLQar/ZX6fNvq3lO4IfVR2szCuCfjFANtbOdI28HY+ J0sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BoXLGdYE; 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=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 69-20020a630448000000b0046af6471adasi19034082pge.282.2022.10.19.01.46.27; Wed, 19 Oct 2022 01:46:49 -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=@linuxfoundation.org header.s=korg header.b=BoXLGdYE; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231349AbiJSIqI (ORCPT + 99 others); Wed, 19 Oct 2022 04:46:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231522AbiJSIoV (ORCPT ); Wed, 19 Oct 2022 04:44:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B77C688DE9; Wed, 19 Oct 2022 01:43:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C67E961805; Wed, 19 Oct 2022 08:42:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E019FC433D6; Wed, 19 Oct 2022 08:42:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666168973; bh=MbFzbGmRV9ls7pOfhD3dBXJvQ3BbcGXsMvn+R0z7rNM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BoXLGdYE01ZpsBLxMXD4E18Mciopu3kel3d44ABH/q2as4XdIIuAINmvAzR/eP7// Mo+fsaMsUay06w4/3/W7oebfX1E7auEx087qAU+AQxREn0/UzrenukbbGGbxvz7rI7 sef4K01tNem9BcLgXp4a0lmWKOh2vYfibPk1v5LQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Osipenko , Gerd Hoffmann Subject: [PATCH 6.0 077/862] drm/virtio: Use appropriate atomic state in virtio_gpu_plane_cleanup_fb() Date: Wed, 19 Oct 2022 10:22:44 +0200 Message-Id: <20221019083253.347461689@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747105044578304745?= X-GMAIL-MSGID: =?utf-8?q?1747105044578304745?= From: Dmitry Osipenko commit 4656b3a26a9e9fe5f04bfd2ab55b066266ba7f4d 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 Link: http://patchwork.freedesktop.org/patch/msgid/20220630200726.1884320-6-dmitry.osipenko@collabora.com Signed-off-by: Gerd Hoffmann Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/virtio/virtgpu_plane.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- 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(s } 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;