Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3393115imc; Wed, 13 Mar 2019 17:23:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqyiipH3KTOAwQT8xj7gmgFeq1nXKtKiCijf5zVOohPz7TCZ4onCeeXBdy2yzKOaRSSkEUpa X-Received: by 2002:a17:902:a9c8:: with SMTP id b8mr11243282plr.12.1552522981348; Wed, 13 Mar 2019 17:23:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552522981; cv=none; d=google.com; s=arc-20160816; b=O1Oj84504coPHFwprsmOVfgAOiBcMLbUOAC7Eh1OKrrfVawCdI6CPqA7YU9XPG3Ilf urHfD7fa4x0DIZv1aZFZE3NwaxpCVpXv852lolLuc1HOjjrf64jCFOgWElrFJwZSH5KN Ut4tqZilWlwgk7Bxt96lZGHn1yeu5VjWlmHNtIM5jlwjiaxBYk3i2d1YuEzywleLkm8p 7K2fTApPqzCEsTHzmGZKJskXZZwPBnJyhJ6KQevXsv6h/2A85/SPvColZcsyyGCGD0nZ z5ghxtcxPrNQPxe8A4WPbXmDFmiHJbQv5f4zy7K7I1eyJX6ugUHl3ardnppU3LdpywQK n36Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=YWOrHlWDr9ceXRasM2Tf/Q8otRCsuQFY7s4BpV3yf9Q=; b=glUQwECV4UPyA5DFY3WOnfsmxprJPqepYkb4hMIzmBW86KzNL9bptmaUQczS6OoHz5 sdJZkp2lJZM36lXrHubMiWXEBWX4IH+5sk6jFtr8YW6gBhDLawFec3C4YY/xUNLxZ8Kw UT8bCnmY2Xz77R+hRMC2oY8a8efPly5ArMM/+9ClhL0j+nrrCC+5Dr9ELLKHADeP84Oi u5275iRGyxznT7tM9SZp6/mzo6oNzPN4z3Sy72hD+9JCZof/ywqJlGSJM3jPGlJVHfRQ Vr/zGMnbeeTdlwJhwbagYmXbZw+8tEI5XRLrI6fICfnLot3UCyzt+1fehS4f3BkXwrbr NUDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a4si11604317pfj.68.2019.03.13.17.22.45; Wed, 13 Mar 2019 17:23:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727315AbfCNAVP (ORCPT + 99 others); Wed, 13 Mar 2019 20:21:15 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:38174 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726640AbfCNAVM (ORCPT ); Wed, 13 Mar 2019 20:21:12 -0400 Received: from localhost.localdomain (unknown [IPv6:2804:431:9719:798c:867b:ebff:fe52:de60]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: koike) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id CB7E826016E; Thu, 14 Mar 2019 00:21:06 +0000 (GMT) From: Helen Koike To: dri-devel@lists.freedesktop.org, nicholas.kazlauskas@amd.com Cc: andrey.grodzovsky@amd.com, daniel.vetter@ffwll.ch, linux-kernel@vger.kernel.org, Tomasz Figa , boris.brezillon@collabora.com, David Airlie , Sean Paul , kernel@collabora.com, harry.wentland@amd.com, =?UTF-8?q?St=C3=A9phane=20Marchesin?= , Helen Koike , stable@vger.kernel.org, eric@anholt.net, Daniel Vetter Subject: [PATCH v3 4/5] drm/vc4: fix fb references in async update Date: Wed, 13 Mar 2019 21:20:25 -0300 Message-Id: <20190314002027.7833-5-helen.koike@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190314002027.7833-1-helen.koike@collabora.com> References: <20190314002027.7833-1-helen.koike@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Async update callbacks are expected to set the old_fb in the new_state so prepare/cleanup framebuffers are balanced. Calling drm_atomic_set_fb_for_plane() (which gets a reference of the new fb and put the old fb) is not required, as it's taken care by drm_mode_cursor_universal() when calling drm_atomic_helper_update_plane(). Cc: # v4.19+ Fixes: 539c320bfa97 ("drm/vc4: update cursors asynchronously through atomic") Suggested-by: Boris Brezillon Signed-off-by: Helen Koike Reviewed-by: Boris Brezillon --- Hello, I tested on a Raspberry Pi model B rev2 with igt plane_cursor_legacy and kms_cursor_legacy and I didn't see any regressions. Changes in v3: None Changes in v2: - Added reviewed-by tag - updated CC stable and Fixes tag drivers/gpu/drm/vc4/vc4_plane.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index 4d918d3e4858..afc80b245ea3 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -1025,7 +1025,7 @@ static void vc4_plane_atomic_async_update(struct drm_plane *plane, { struct vc4_plane_state *vc4_state, *new_vc4_state; - drm_atomic_set_fb_for_plane(plane->state, state->fb); + swap(plane->state->fb, state->fb); plane->state->crtc_x = state->crtc_x; plane->state->crtc_y = state->crtc_y; plane->state->crtc_w = state->crtc_w; -- 2.20.1