From patchwork Thu Feb 13 12:01:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enric Balletbo i Serra X-Patchwork-Id: 11381853 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C9E2F930 for ; Fri, 14 Feb 2020 08:08:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B2B8A217F4 for ; Fri, 14 Feb 2020 08:08:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B2B8A217F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AE6176E527; Fri, 14 Feb 2020 08:07:59 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 69FEE6E56A for ; Thu, 13 Feb 2020 12:01:17 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 8D7602950AB From: Enric Balletbo i Serra To: linux-kernel@vger.kernel.org Subject: [PATCH] drm/mediatek: Update the fb property mtk_plane_atomic_async_update Date: Thu, 13 Feb 2020 13:01:03 +0100 Message-Id: <20200213120103.823501-1-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 14 Feb 2020 08:07:58 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: drinkcat@chromium.org, David Airlie , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, hsinyi@chromium.org, matthias.bgg@gmail.com, Collabora Kernel ML , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Commit 920fffcc8912 ("drm/mediatek: update cursors by using async atomic update") added support to async updates of cursors by using the new atomic interface for that. Unfortunately, introduced two issues. The first one is that since then, the drm_atomic_helper_async_commit triggers a WARNING due current fb is not the new fb. The second one, is that we get a black screen connecting the external display on Elm device and another WARNING due vblank wait timed out. Swap the fb in mtk_plane_atomic_async_update to fix both issues. Fixes: 920fffcc8912 ("drm/mediatek: update cursors by using async atomic update") Signed-off-by: Enric Balletbo i Serra --- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c index 914cc7619cd7..7eb10115e72a 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c @@ -116,6 +116,7 @@ static void mtk_plane_atomic_async_update(struct drm_plane *plane, plane->state->src_h = new_state->src_h; plane->state->src_w = new_state->src_w; state->pending.async_dirty = true; + swap(plane->state->fb, new_state->fb); mtk_drm_crtc_async_update(new_state->crtc, plane, new_state); }