Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2688866pxb; Sun, 24 Apr 2022 23:29:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQs+PxzEIBWFmwqlcKLLUpELQdR0WA76NV7W8FGwukqYZnSrr/oE/qktQkl/PkrlEGKooe X-Received: by 2002:a17:906:2f97:b0:6ce:3ef6:94be with SMTP id w23-20020a1709062f9700b006ce3ef694bemr15275965eji.136.1650868194384; Sun, 24 Apr 2022 23:29:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650868194; cv=none; d=google.com; s=arc-20160816; b=arSqdA7Va2k3CjLijrNTtqNKeGy4de9foYaovvURaLz0JRgyRknY0snLZoKpbM5h+8 NHNbLM+JXbigPb6KqjEC6m1pwUMMd84vz9DdIC8zMACONMSjmNWWJUC8cffMpgpDoAHN 4+1QzZtkMjo8TyYhlQFbPFOqri0sYZnOiwLnZGm+e7G4+pp899YexzJczhwsRS2TYVXG SwqwiWpdpuUKlrlZ8N/gVVcBUSpmbLbNDzaTIZpRiNdbdrrzbO8dVrnUTwDZt7TWQw7B 20j7Dx2GPxDURn5dszltUnCGYNsAYyJvM/Azr1bmxiUtFzerjXUmwUS4N80WQIcW17zz Z/mQ== 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=qglUjln8VnmT0AdT94eUFp/zb/gB4jbIXv1Tz2VvksJUOBYT05Dqui62lY4+pyIBIr Je53ZAAqBbzQl4myEwOTsmsi8r9omIyiMwk8nYSk/H2X+W5i625NnCnVvO9TpWXN0CXv wjjq7t6U0izZKN/9s27kYxQ6YGBxsxawGOtZGbQ5PWkNawxc8mcBZKq6ApotkdRwqwG6 Ubzmitpm68kzx1Omb4r2FYhBw+hzq5usQhiyt34KQWqlLRsPx7HjpsdLfwy63WBm9ptr +U4tyGT6QnujKgEf+fXSJ/7+05h6XQ1GWTZdo/0hUjJBM1uc9FuS+8Lil4OAZLtJiVgC b41w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=kbBbsmNi; 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 r15-20020aa7cfcf000000b00425df4b9895si2398743edy.313.2022.04.24.23.29.31; Sun, 24 Apr 2022 23:29:54 -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=kbBbsmNi; 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 S237774AbiDXTIP (ORCPT + 99 others); Sun, 24 Apr 2022 15:08:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237757AbiDXTHs (ORCPT ); Sun, 24 Apr 2022 15:07:48 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DD9613976C for ; Sun, 24 Apr 2022 12:04:47 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id 0F6D31F40651 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1650827086; bh=H5TVWLdKQBunPI+41h2cAjj6IZ6UbyVtXydAliQEN5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kbBbsmNiTPU+IBOLounBpOr3xvTBE2JCl71TJeU+bnzs4eJKdiqmV2xMznXR4doaq kKwQlLpZKqNTUIggaaiP4bEAwIba5A4kkSBlIVwaQUkdj5fkR9N9ohnXwdchn8jFFt ricB3koe0UhOYVrWj6QYf6oOXJiu00dGMjK+qAcVKNfKfkv1ZtWirkgoiIO61Ga0Cf Kk8Tz79AaQ0cus92M9MYnI/sarH+j+aQvPRIpgD23F9sd6s/k2eW/TXDRCA4X9TYSI iQ3kX6VJ5Fb2JYf2+223wy9D1EdUjHzO5Im+1kntPezGNacGqmy8Tx5HuiDrWZ6Hyo NMJAFLNpt0OUA== 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 , Qiang Yu , Sumit Semwal , =?UTF-8?q?Christian=20K=C3=B6nig?= Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Dmitry Osipenko , Dmitry Osipenko Subject: [PATCH v5 06/17] drm/virtio: Use appropriate atomic state in virtio_gpu_plane_cleanup_fb() Date: Sun, 24 Apr 2022 22:04:13 +0300 Message-Id: <20220424190424.540501-7-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220424190424.540501-1-dmitry.osipenko@collabora.com> References: <20220424190424.540501-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, UNPARSEABLE_RELAY,URIBL_BLOCKED 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