Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2503041imb; Mon, 4 Mar 2019 06:51:35 -0800 (PST) X-Google-Smtp-Source: AHgI3IbWqEyCDcNENgZyQWn4MjONLTx7OSexOT1MzSFg+2pxb3Yat5xxDFWtG44JBOkQyJ3HWJnx X-Received: by 2002:a62:20d1:: with SMTP id m78mr19989790pfj.250.1551711095888; Mon, 04 Mar 2019 06:51:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551711095; cv=none; d=google.com; s=arc-20160816; b=LT+hRMYAQeuExZUgJ4VZuRZVEBepCvGYJ+oIwwqD+7XpQIWF0pLNVyhOkA/j1LSMpB ehjx6RPTSGycHplDLQgkdi/RT8JaERplQtqWfD2c47gp7VT6HwyLHq7SUpDCV5a858I4 rI7lF1iDD6C4vbrTpg7yjiCtQM2e4nQ7MUUVkqSbsw266/JGLmo3qxHAmT8Sc1r1QxZR t+5RhpaJL+0cchbg/rZG3Xz/CFI5U9PA3HsQjQXYB6178QcQHAaE7wu25eLd5Wtm4bim PpoigeGP+0Mq0/p8nZKvdjlSyuR91CkOanw8yDDiqVbrPyEA4IRaY4CKOUlMTcHvtDek Thqw== 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=GjnRGuw+e+jw4e8BNObQbAumxhtdYl0uOg5eS8A7ay4=; b=HIB8WW5jbqcLmP7wwyvL4t0CHTXe+g3BsLagIWH8AgR+6VGm0MqOY5Fpx6JJh2eTXI PNPG/0UxfQzvAFRKKibcpaFz8n5PWdbnHXWcrx1j15YSnheN/9gtGZReAwqeyqCCsN67 6+KUhq7cjvGkHXjX0vLvUfaYOPJjCNFQvpKqdzBfU0L1VYqLhFjXtUwGjYOzrSMYMRAm u1IhJFuAd79B9d9BWce0a6OfmDT18UisP6kCEEppq8JyubnC8xeB+m+NlvMTzCSygQCN i7eLfjWXL6EDay0MP1kuK5TVWD4hAOo64WNR0hyrfs92tDIKzm1OFCdTP8tCWGkh4zjx h8Kw== 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 y3si5279156pgk.490.2019.03.04.06.51.20; Mon, 04 Mar 2019 06:51:35 -0800 (PST) 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 S1727117AbfCDOto (ORCPT + 99 others); Mon, 4 Mar 2019 09:49:44 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:49334 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726161AbfCDOtn (ORCPT ); Mon, 4 Mar 2019 09:49:43 -0500 Received: from localhost.localdomain (unknown [IPv6:2804:431:9718:a1b1:9d17:4c45:79a4:9c61]) (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 C37A328079A; Mon, 4 Mar 2019 14:49:36 +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?= Subject: [PATCH 4/5] drm/msm: fix fb references in async update Date: Mon, 4 Mar 2019 11:49:08 -0300 Message-Id: <20190304144909.6267-5-helen.koike@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190304144909.6267-1-helen.koike@collabora.com> References: <20190304144909.6267-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. Cc: # v4.14+: 25dc194b34dd: drm: Block fb changes for async plane updates Cc: # v4.14+: 8105bbaf9afd: drm: don't block fb changes for async plane updates Fixes: 25dc194b34dd ("drm: Block fb changes for async plane updates") Suggested-by: Boris Brezillon Signed-off-by: Helen Koike --- Hello, As mentioned in the cover letter, I tested on the rockchip and on i915 using igt plane_cursor_legacy and kms_cursor_legacy and I didn't see any regressions. But I couldn't test on MSM because I don't have the hardware and I would appreciate if anyone could test it. In other platforms (VC4, AMD, Rockchip), there is a hidden drm_framebuffer_get(new_fb)/drm_framebuffer_put(old_fb) in async_update that is wrong, but I couldn't identify those here, not sure if it is hidden somewhere else, but if tests fail this is probably the cause. Thanks! Helen drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index be13140967b4..b854f471e9e5 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c @@ -502,6 +502,8 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, static void mdp5_plane_atomic_async_update(struct drm_plane *plane, struct drm_plane_state *new_state) { + struct drm_framebuffer *old_fb = plane->state->fb; + plane->state->src_x = new_state->src_x; plane->state->src_y = new_state->src_y; plane->state->crtc_x = new_state->crtc_x; @@ -524,6 +526,8 @@ static void mdp5_plane_atomic_async_update(struct drm_plane *plane, *to_mdp5_plane_state(plane->state) = *to_mdp5_plane_state(new_state); + + new_state->fb = old_fb; } static const struct drm_plane_helper_funcs mdp5_plane_helper_funcs = { -- 2.20.1