From patchwork Sat Oct 22 07:19:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7219 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1090393wrr; Sat, 22 Oct 2022 00:46:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7ApG+MGSMnuBVXsde+QPXp52zAFO8IjwwG73CUIMnaqpgm8hVE2Hbk3gfmWI83H9U1fH/2 X-Received: by 2002:a17:90b:1d03:b0:212:cd82:aa0c with SMTP id on3-20020a17090b1d0300b00212cd82aa0cmr8072112pjb.214.1666424812400; Sat, 22 Oct 2022 00:46:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666424812; cv=none; d=google.com; s=arc-20160816; b=ETIuNe+1IRP6LYNn5izf9Z0eiBD9tHUq6YkrBlV+n7P3FxYJPFNuoNlwP1N9VW7t0P qS8NBipAhV+hG8Aalk4vGqQZas+UctElo7MHBW9GaUaIOyoTVqnJMhb9mI8iTBF+tEeT 1rx7kUvgL4L4O7EjF7pSq0WcbW39XTf6+HyQD/7VgGfcAkQKV0krwcTga6Zj2+jIoUcv vy8uHgR8GjH9eQ8puE8sRzqd9LFD8ANz9hAKtq1uliNJemsC8MvMz7jnn5nzUpP/qXcM PsRXbPC4kNC08PwWRwvrdMQYsUC6hCl0b4l1sIBqI1IcS/Z2XNpi88ol2jgVpRT5L6XF +aVQ== 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=VE3Q44bzEmogmFhSmCUHWLOdESANMxWg0++3ThQq2FHabGkGN+TnhhSIjjoTOZWtBG eMkTLCtxhR/8FEkEwIvn8YXfYdiqAWi0wHsJktPbjTE690k8FM6V94m1lZY7kImwhfHX 3MX1j9xfOrOSJcb6DPvmgYWABzaAjXwhX4WpeYADS5ZNGPX+2t2dCvGjXmOAgWzh2U1r 45MicmyqmBzeTf3FXzt52+S09liSnLU+pZ3hZrFbDF/nQSPdNZtVDhzBgCuIqIQQUrWh maTssI5n+VLIaL61/G9qckBJ0MM62TEIuLfyxJIr7058ZPa8J5mkkXpAp66e/SAY0GFk PWXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JSXa5X+s; 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 cw15-20020a056a00450f00b00563ab8e5e43si26671852pfb.77.2022.10.22.00.46.40; Sat, 22 Oct 2022 00:46:52 -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=JSXa5X+s; 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 S231450AbiJVHqY (ORCPT + 99 others); Sat, 22 Oct 2022 03:46:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231496AbiJVHoV (ORCPT ); Sat, 22 Oct 2022 03:44:21 -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 A97D87295E; Sat, 22 Oct 2022 00:42:59 -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 BCCA860ADC; Sat, 22 Oct 2022 07:38:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4329C433D6; Sat, 22 Oct 2022 07:38:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424316; bh=MbFzbGmRV9ls7pOfhD3dBXJvQ3BbcGXsMvn+R0z7rNM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JSXa5X+sC6JG99BML+aE0MkfItc7cR+lhpj4BcxmVhMQE2Y6FsdftGbJFmwAcP30B Kro6M+9QSD/o/cRmM9a6EmNn9YAhW1AvausC0mEUYfnKAk74ec4uljRphxP6noYE/P DnY3avWJpE5tftBZpBAAgxEHK0EQFgCOJtjtrWNw= 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.19 070/717] drm/virtio: Use appropriate atomic state in virtio_gpu_plane_cleanup_fb() Date: Sat, 22 Oct 2022 09:19:09 +0200 Message-Id: <20221022072427.601481487@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747373064075971580?= X-GMAIL-MSGID: =?utf-8?q?1747373064075971580?= 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;