Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp966440iog; Thu, 30 Jun 2022 14:01:26 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sA3EORTTb1Lq0Oz7tJNSQ5DD5/yBvLJL170ekXQStYfF75i3qzBm90V77CQM3shA/1l0xK X-Received: by 2002:a05:6a00:1a48:b0:522:9716:4e0a with SMTP id h8-20020a056a001a4800b0052297164e0amr16198145pfv.22.1656622885895; Thu, 30 Jun 2022 14:01:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656622885; cv=none; d=google.com; s=arc-20160816; b=wR8C9KjZTq7PNb3ikWTCrsT8mHuGpCv9kYCgHXWgHz3JZj0PBHq3zI+oSFaMzJKfeY bDMJLcWfvhBDfs7hGjuTtp5c0OV3ijarqn3VwMvy2wwrtxsw6xV85+7kCbUplzM9mvD8 wSAjN7OWX5xemH/9soT+jYZL7DBfMzWfvDdo5H++7ruQKDJYw8jeOr0Ol0ucMw3lq7lz leVD0iq6hHnwuOmg+F5y3oe7gHBguAqNwaw+wu6799s4rReNYCXxKfZdLxL7zOx689Uk u9FnFak/ctL6cIljtWP02moqj60lelUxn/nbwAOPI0maq3eDocjdqchzqv4vT0klnDDW ZKPw== 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=wNx7iWIhOAs7n+FOteDgjSDHyGWuzUHlhMuHpBOdWmQ=; b=vxDX32hfIRfHeVtAqkIzmAabciU8Wfra4quJtHMnzDSAdPxjzvK662QjG13U1yefAl /3YPOrL9oNTN64OT9yuknOLUvONnfkK02l/LijIxu+U85ydLvmJD+NbyFe/vOe8bHT6H NorVAFC3Sn8Yxuyr32iUmeLpqd1ToDdS/Q9hkvVJnHDPB3pA5o2RTa6EvbYT0Gc/Fe+z HxF50WvPc1QiCJATDml7gEpezBtRfFz4Q4VczbW7/SHCOUX7kxGdEmIRNTKiSlOtBj9w efflDEinXStiu+8eRqNo6VxQkdAsURWII3Fru2jcUKCa95OU2xl5CyM0VIJYAcv3tx4l s6/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=aHH9j1FR; 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 e9-20020a170902ef4900b0016b9dbcdb5bsi7687136plx.85.2022.06.30.14.01.13; Thu, 30 Jun 2022 14:01:25 -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=aHH9j1FR; 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 S237085AbiF3UII (ORCPT + 99 others); Thu, 30 Jun 2022 16:08:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237043AbiF3UIA (ORCPT ); Thu, 30 Jun 2022 16:08:00 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 816F945074 for ; Thu, 30 Jun 2022 13:07:59 -0700 (PDT) Received: from dimapc.. (109-252-118-164.nat.spd-mgts.ru [109.252.118.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id 6E55A6601979; Thu, 30 Jun 2022 21:07:57 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1656619678; bh=ppiHU1nHxnlqhseAkxfgAUsmo7TgwderWDB16dgdP1c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aHH9j1FRucsL7URkdnVA9GbGKzz1VbmywQGV+6YXZ16z56JVWUG05J71sRt5/+AWm ct4eEUaFkVD81VdD0SyP0h5tOAdUR7+k/heSAYezF+CtRGmKAe1E/omLNVBVMsUI8K iGoDGoJi79E8GFRkJh1UZXp79M7JNIaGVYroqC/qgBscNyrjkKqK8g6Qzb6gxq1P+q KrbQ3oTT8wRttqJuitjKQrtN2zY/iHFL2ZjHksIENROJkOH4fXPBF7l82PIW0majmr ta2MwYWRC5fK1XMr3Jn8Cxgi8AZLC1PRqDns5CDgyF1A9jQEFS07KVdMFqpSHHvT9P TMRqZL5lEvwBA== From: Dmitry Osipenko To: David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Thomas Zimmermann , Emil Velikov , Robin Murphy , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Dmitry Osipenko , kernel@collabora.com Subject: [PATCH v7 5/9] drm/virtio: Use appropriate atomic state in virtio_gpu_plane_cleanup_fb() Date: Thu, 30 Jun 2022 23:07:22 +0300 Message-Id: <20220630200726.1884320-6-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220630200726.1884320-1-dmitry.osipenko@collabora.com> References: <20220630200726.1884320-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_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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.36.1