From patchwork Mon Oct 24 11:26:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9381 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp478068wru; Mon, 24 Oct 2022 07:16:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5pHCzu1WhdyM2T/fNrz8HK/+sG+28tRGCJj7Xdn0qVxmmFoenQnyb1DUCH/s0TizcDXV+p X-Received: by 2002:a17:906:4bd3:b0:731:3bdf:b95c with SMTP id x19-20020a1709064bd300b007313bdfb95cmr28147425ejv.677.1666621009197; Mon, 24 Oct 2022 07:16:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666621009; cv=none; d=google.com; s=arc-20160816; b=YHDRSDYKdWqi4VAzE3+F/kzPLqVYBTMioZzPyiczmPBx9+tYzRrG5imSulQXZimzQd eBac48SidMk6m/i1kCy8EWvkZLPSYZkZatEwREvTxeOr1KrPD7EyBgsqF3JCNM5hu7gv LLA80t7ua6e4XlZdlrjLzfjGjquL35vYDnvfzBbgzRCpwNaMJsiKsX5vug/E73MFRBz0 Y/60hoGUGH3O+XdA/NW4trlGTn8hb+DqiTS1trGo8DWsvvsL7kHxdtV96OBcMyolSl+C 5XVilBGVmaqtpGaph9zumOdcfJ+eBWDhgnCNmlqgCGNoxPTM+SofanaawKrZkKZuYTja l/tw== 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=l+R+T3kSXfmStJ7/Cc+/rCfYRwf7bFuHvwLVvY8tGtI=; b=RoUzIthTV1qN4dBYwbsQ0uq8/FRYBc1BkBOBjJFm3NLpscce3v6JOEDH8UrV0SxtMM Czmt/iIFJPBBHz9xMcuK/ZpDGuZMwQIb2fb0NaNNbw40nNI2w/q6xne5WwOGArvpxGlN ynW8cP7GJQ4dHlHHpOqxo9kXGbHCb/aD1BG7B39nJSupY6Mrgv311/EUI0+Yx/BhAbUd KYg+HaxWhbXRtiMkPFXUdeBTxWyu3JZVJdJgGxiJACu45NXYRLve7NtBKX4O9sHbkpoC BrtUYJsV63DAanNrarzJpdlPU1zPDrBFuBSl6eRDPlXmVkq9L7gx7xKxuvdNh1EX1/FS gW1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oFVEANo1; 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 c8-20020a05640227c800b0045dbd131cd7si21631826ede.65.2022.10.24.07.16.23; Mon, 24 Oct 2022 07:16: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=oFVEANo1; 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 S233419AbiJXODz (ORCPT + 99 others); Mon, 24 Oct 2022 10:03:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236959AbiJXOCZ (ORCPT ); Mon, 24 Oct 2022 10:02:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C55AB8FD54; Mon, 24 Oct 2022 05:48:19 -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 9200161257; Mon, 24 Oct 2022 12:35:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1346C433D6; Mon, 24 Oct 2022 12:35:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614923; bh=9wnVQkB6VeEvEgltELShvZ6rUY1AmG0YjjZxUDUUUy0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oFVEANo11iD21vFNLjyaRvtBM/PlexuS0bB8U8pvBGqgLztPRCWskX4yE3zfDanze qaL5BCtUxqorMOn1J/3DxcoZS6oqIKwe1r0fbPrTuPxVFvxPy3sXaJg75YmDymEi92 HwHc+p0oQg/WU0kpic89LLYJD5ZsSJbX60RT1S4Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Osipenko , Gerd Hoffmann Subject: [PATCH 5.15 054/530] drm/virtio: Use appropriate atomic state in virtio_gpu_plane_cleanup_fb() Date: Mon, 24 Oct 2022 13:26:38 +0200 Message-Id: <20221024113047.479784422@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747578791134075021?= X-GMAIL-MSGID: =?utf-8?q?1747578791134075021?= 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 @@ -265,14 +265,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;