Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2431748pxb; Sun, 17 Apr 2022 22:59:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8he2oczzzoKypsqqDrDzUpN4oGeMQ3RChehhJTrS80sS04VBwWufJWlS5TAgNzIoUu0L/ X-Received: by 2002:a17:906:3101:b0:6d6:5b64:906f with SMTP id 1-20020a170906310100b006d65b64906fmr7690238ejx.513.1650261567162; Sun, 17 Apr 2022 22:59:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650261567; cv=none; d=google.com; s=arc-20160816; b=ZER/lGM15ksbJqtiLLIzsaY0VguaVQS+vBkE9dHlK95Yw8Le+Yt3uIBrHeuUolPnxz K+B9v36k+OFGI3hmMUV1Xfiknm/8vnbMEC4Pwbhb/vjV6M16D5quEFkGccf7GjF/c2Vg G7wyQf4iQljukiSan83NtNgBvUOO2sKftsHJPwg4t0fqsq7aw8R6XugwvTECSJagaWX6 WW5q1+jbXR0rFqay+1ZmQB+BXE3H8cTJs6szcY84bmtF4VjxBS+WQncz8IPJK7rujQ90 I+lAoiwLe6zU3F8Az4rE9N6WQl/3v2mhDQjPpZh/k1F054Fp0lnUKzkk85YKvF9bPFCY oOUA== 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=Geg7OacLMHvRJn7S9jrUX8BO3btOag9HDIsdny2EeL25HazASxdAu0+4JOMTpy0v1Z EUOOkIwkJamY1f15oSng45E/e1I4aobknLNWnHfFzOZ5hc4fd8BEOgj0axFriYrxM93Q LAhwKnPyf2TV9RXDJAuzT2RFno5SVYLgPi7ubCnX2Nno1z00ISlXGxbMl87JK4kaWmmW nno3JYeoSwHbISiARWOTjxP3LOODGOxQxQtqG9sFKQIvfwTyfIRp9k1IvYh9Vi3p1pJF 8snE3j+VodMixERAknDc2UBmc1Mr6PLjT3c/LjPaGY7a6ENC7aNYyQ8B5MO3P7LgqApT i27w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=H0u2FLJv; 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 y20-20020a056402441400b00418c2b5bed1si7358912eda.435.2022.04.17.22.58.56; Sun, 17 Apr 2022 22:59:27 -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=H0u2FLJv; 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 S235213AbiDQWkZ (ORCPT + 99 others); Sun, 17 Apr 2022 18:40:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235172AbiDQWkP (ORCPT ); Sun, 17 Apr 2022 18:40:15 -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 C2DBA1705B for ; Sun, 17 Apr 2022 15:37:37 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id 142DB1F40EAA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1650235056; bh=H5TVWLdKQBunPI+41h2cAjj6IZ6UbyVtXydAliQEN5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H0u2FLJvyXydUArevNFss2N8rGoWV9xNgc7iipzFbqhgQ98n4/zoOSSIkdStqEKNr 661T5qJQBQXeUgEOB4U9NSOSa7Cu4kCHr8MIcZAtpjQY9Vic6X0b9Js1CLLohnPT7D xLw/qO/r0JwiNNb9dhfoVoPX4/nJ4aMyRXcKEKbT9Q/WiML0FeSiSMOt4+cm+D5ZSr 1HOt8T0o8jCvoYHoLYPaYRhxx75fy7jQyVu4IeX9K6+hg0+VuAHuEGY9mfXV9Qn99V +pFWVglJaBSLmpsb2v3VJGHVxRCEXCMk7t23QapoCzY6MiXWsw20xCwR3kEHa1HK9P wwkNwmqXpkI/Q== From: Dmitry Osipenko To: David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Daniel Almeida , Gert Wollny , Gustavo Padovan , Daniel Stone , Tomeu Vizoso , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Steven Price , Alyssa Rosenzweig , Rob Clark , Emil Velikov , Robin Murphy Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Dmitry Osipenko , Dmitry Osipenko Subject: [PATCH v4 05/15] drm/virtio: Use appropriate atomic state in virtio_gpu_plane_cleanup_fb() Date: Mon, 18 Apr 2022 01:36:57 +0300 Message-Id: <20220417223707.157113-6-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220417223707.157113-1-dmitry.osipenko@collabora.com> References: <20220417223707.157113-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