Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2392319ioo; Sat, 28 May 2022 12:11:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEgU0vb5cBk6deGxdU8h56HCoTetmy6yrEk9YKQi2Owewy2S5OUS1/uNZx/rguEsBnRKVw X-Received: by 2002:a17:90b:1b07:b0:1e0:41c2:9e15 with SMTP id nu7-20020a17090b1b0700b001e041c29e15mr14570720pjb.20.1653765117643; Sat, 28 May 2022 12:11:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653765117; cv=none; d=google.com; s=arc-20160816; b=Li614jijS4LId8ILcTSgdMJLz18NNfQ0pIf+N6t9a8pElYI6B6T4MDn9qEjNRJjcuQ j0cKH54H8C7mbu1y+uky7Hjfv+1avzeG2YP0TgHhKO7gz+4KeUj+gju0fYduKxXbWLIo pNt0ZBQtLu1OThaoxleIDXc7o6PHKmckPN+2Lk4lY2SyKwi+JuKaje8ebOGy5BLWwPYR rtrq5GFde/3P9bpPt+kqUHJLTMm0g5/wuiunZWlr97TdyEvFRNe7+LUtDHpsToEuU91U oZIqWN9hp7mrMO57aSoo+U7Nzaz2vRjnvQcZKYtBGzavCZWoFRZUe9exwg4guOPFltEs 7DhA== 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=6/vv454Dlz9hZrTrT+botOkF3LB8gGZXDtAtpswFn8I=; b=Htw5yVOvDGRax4SC1uDqCo20YwjbxSaUR2qNel4JWKRLO+PMGzEH55vYJCnYTMTzL9 3FKgx1i/lLwYHxCftXMOg2r7ejOaWHk2/btydctXASv+L/kJ5S9Bjz7JqYju+u4XnnL6 MVG1qIuXOTAqQcTtE56HGhf2u0U/AwmCI9jyCFN4xAc+ZO4Eo5WpnUP12pxNROfGMzmM pfmQJ5LQp6+P7zAxYPmYmO2939oTosd0vbUBMLnrqWVl4eDOpmmaR4MwM/l1ul+uHSM+ Ems96QCYMGR48RHFoiNhMYfDqmCSr6hMY3s3VX9Yq1PZZit80gIWGhGscs9C8ifx2DHp RSlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="Af352/Po"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id y30-20020a056a001c9e00b0050d6ea9b033si8395379pfw.225.2022.05.28.12.11.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 12:11:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="Af352/Po"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6499142A07; Sat, 28 May 2022 11:48:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349753AbiEZXzB (ORCPT + 99 others); Thu, 26 May 2022 19:55:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349602AbiEZXyj (ORCPT ); Thu, 26 May 2022 19:54:39 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A21BFEBE83; Thu, 26 May 2022 16:54:37 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id A34931F40887 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1653609276; bh=yzbiLRskhwUnKi8FuSZ/Li8as+mXkO3KrAAU56S2aFI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Af352/Ponwfde8alC1lYZz/ODMV/pdk2FiMi8cKYhruO+snZP/fcdv8DtPSyIEPkX C1NG915yozGxnkojZrMnDlnj5C27toqp2ZJpeVSvcRYUxbcaEfjThosEKK85jBMN1w fAsLdL6H+f2EflalAZPwIwhwEFKJUWsvUL9DLuriWb4HSVRiPVgVfZFSjE619sOqli G25+CcmWgHfVtCbTMGKjjlIEQqZF9iTLv5sgnF2DB9ug0DcrXa9cuogSjOfVSTF2Pp n7o6ra1QeQB/8XMHMuxYJ8lqET2Bk+X+agYoE3cglAqFCsOU1BNXL48zdmy4l+WeN2 NcZLjif3gYXfg== 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?= , "Pan, Xinhui" , Thierry Reding , Tomasz Figa , Marek Szyprowski , Mauro Carvalho Chehab , Alex Deucher , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Dmitry Osipenko , Dmitry Osipenko , linux-tegra@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernel@collabora.com Subject: [PATCH v6 09/22] drm/virtio: Use appropriate atomic state in virtio_gpu_plane_cleanup_fb() Date: Fri, 27 May 2022 02:50:27 +0300 Message-Id: <20220526235040.678984-10-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220526235040.678984-1-dmitry.osipenko@collabora.com> References: <20220526235040.678984-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=no 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.3