Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp578488ybx; Tue, 5 Nov 2019 02:12:02 -0800 (PST) X-Google-Smtp-Source: APXvYqxmUSK/TpGraEBw/ji4XIqzf/kt7ftMlGgGGHPaEr0e5KNPoIyjBnj3lXkCRtQ49Hw6MkIC X-Received: by 2002:a17:906:5407:: with SMTP id q7mr3326198ejo.24.1572948722345; Tue, 05 Nov 2019 02:12:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572948722; cv=none; d=google.com; s=arc-20160816; b=rTo2TgJ+0voPcILQENMiDtvIaBHohtUEq4cSEG0X2cWS0vsEkilVtOhk3Q8oNKSCbX ORn7MTT+8k0D5K167YtqU1LeGFMpsskTfzsFw9OGUgTLleEjgIm5WC+5ZxJC4jdMrzA0 Z+UE54lbuFao14kOyTBuCPok7ZFEKbW3EpdczakKAM1yy9nujdnvw6/4y2cMCR+THgwF rjLQTImdKPdwoc43RhLnyqb2sJ6XRdIrxwwQFj7kHluJqIywWIpVAtsHOPVRnrb8/SPY xIDeUdjtE/CfMFmJly3rNl91Vly3toB+rayFdGgiFE9ucsynoz8UF+r+0BKE97V0Ebk0 G9Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=SPjKrCY6EbdmufmsuKVzAGuTDvpskY9767fmCulvRJo=; b=xjflE0LRJkQG2ZJcuMAlKhPbGBphpVJAQc2I3oUGApRr1KR9y9+DfXJNkzcfjAsxF8 KkXlK+ci1HJAQt3BHjIjMRj6b+P8x8nBXnVHMMfMUyH5pmNUWITVBY/29zF/BluKmj5b kb0BawJ6PPZfbR4FlR/LCRaStmEtktlOF2umz6m52uUbMAcTVPiwglDmS+ggbP6Tl0bn i0pb75zhCWtvRYMIufwaArdpekJa7M210y8ChfNU9ztpC79FrwQyXlhvJeMKd9FphWTl UAzitZclV1Hs2qgOpeTlDN10W0N2RVehRdJlahYl9atqaFVIGujKpdSDE9OwIsbWSPJd Pumg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@onstation.org header.s=default header.b=IxBhVMZS; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a11si9073228ejt.202.2019.11.05.02.11.38; Tue, 05 Nov 2019 02:12:02 -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; dkim=pass (test mode) header.i=@onstation.org header.s=default header.b=IxBhVMZS; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388264AbfKEKIG (ORCPT + 99 others); Tue, 5 Nov 2019 05:08:06 -0500 Received: from onstation.org ([52.200.56.107]:46082 "EHLO onstation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730699AbfKEKIG (ORCPT ); Tue, 5 Nov 2019 05:08:06 -0500 Received: from localhost (c-98-239-145-235.hsd1.wv.comcast.net [98.239.145.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: masneyb) by onstation.org (Postfix) with ESMTPSA id D806B3E8F7; Tue, 5 Nov 2019 10:08:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=onstation.org; s=default; t=1572948485; bh=KfnIsJjT3r6plldCySNd3bmNluaRX31wCcNiy0r6Xts=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IxBhVMZS5/JpU1eXgyW7Fv/ilzktRpbORgO1mzIb3PZ5lNrugn5u3ATQ9cNwuha1E noZYlzhYK/Q5PDYDmWXe/MuCrmSuA6oFs/5vz/dn1UZEm8jAVoAAiQ1PjB7Q+oTFs4 O1twcRr93yW/W5G65ZNSOc5vHZAcwId3oMz6ZtSs= Date: Tue, 5 Nov 2019 05:08:04 -0500 From: Brian Masney To: Rob Clark Cc: Rob Clark , freedreno , Sean Paul , Linux Kernel Mailing List , dri-devel , linux-arm-msm Subject: Re: [Freedreno] drm/msm: 'pp done time out' errors after async commit changes Message-ID: <20191105100804.GA9492@onstation.org> References: <20191105000129.GA6536@onstation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 04, 2019 at 04:19:07PM -0800, Rob Clark wrote: > On Mon, Nov 4, 2019 at 4:01 PM Brian Masney wrote: > > > > Hey Rob, > > > > Since commit 2d99ced787e3 ("drm/msm: async commit support"), the frame > > buffer console on my Nexus 5 began throwing these errors: > > > > msm fd900000.mdss: pp done time out, lm=0 > > > > The display still works. > > > > I see that mdp5_flush_commit() was introduced in commit 9f6b65642bd2 > > ("drm/msm: add kms->flush_commit()") with a TODO comment and the commit > > description mentions flushing registers. I assume that this is the > > proper fix. If so, can you point me to where these registers are > > defined and I can work on the mdp5 implementation. > > See mdp5_ctl_commit(), which writes the CTL_FLUSH registers.. the idea > would be to defer writing CTL_FLUSH[ctl_id] = flush_mask until > kms->flush() (which happens from a timer shortly before vblank). > > But I think the async flush case should not come up with fbcon? It > was really added to cope with hwcursor updates (and userspace that > assumes it can do an unlimited # of cursor updates per frame).. the > intention was that nothing should change in the sequence for mdp5 (but > I guess that was not the case). The 'pp done time out' errors go away if I revert the following three commits: cd6d923167b1 ("drm/msm/dpu: async commit support") d934a712c5e6 ("drm/msm: add atomic traces") 2d99ced787e3 ("drm/msm: async commit support") I reverted the first one to fix a compiler error, and the second one so that the last patch can be reverted without any merge conflicts. I see that crtc_flush() calls mdp5_ctl_commit(). I tried to use crtc_flush_all() in mdp5_flush_commit() and the contents of the frame buffer dance around the screen like its out of sync. I renamed crtc_flush_all() to mdp5_crtc_flush_all() and removed the static declaration. Here's the relevant part of what I tried: --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c @@ -171,7 +171,15 @@ static void mdp5_prepare_commit(struct msm_kms *kms, struct drm_atomic_state *st static void mdp5_flush_commit(struct msm_kms *kms, unsigned crtc_mask) { - /* TODO */ + struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(kms)); + struct drm_crtc *crtc; + + for_each_crtc_mask(mdp5_kms->dev, crtc, crtc_mask) { + if (!crtc->state->active) + continue; + + mdp5_crtc_flush_all(crtc); + } } Any tips would be appreciated. Brian