Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp339301ybx; Wed, 6 Nov 2019 01:16:41 -0800 (PST) X-Google-Smtp-Source: APXvYqxAeUrWYdIycfVX/ze7zOnJ7uzSaIi7Lvl3xu013smiJtngpltgBTy2YmEVQ6n+ZuW6FSK9 X-Received: by 2002:a50:895c:: with SMTP id f28mr1392201edf.125.1573031801830; Wed, 06 Nov 2019 01:16:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573031801; cv=none; d=google.com; s=arc-20160816; b=UeBYeCqQOkLl/jAq1i1x1E7uJo2eaiausHuzMAy0LXWrLKXwWx1BN+vh68pFq7uifV 5WgFxrIm3Vcm529alLW3P/eMAOSMJQi769vT+R9Uc0dbWe4xCeQK/m+soyYWaajIdtEr OPczRgtckasP22WY9+j86fubfU2BTFxAHcF8vuIwSoFbMpx4mOtoKEZrOZ6N3qCnD7gZ Vx5Psrpnf0dWZXlXKY4u+7i4MrDpyZUp8xtya54OTCsjVHrzS2B0dPZTXpY8Ab5cllzb CLHTQZmc2hcPFBEtszXy26/4FHpAgO6YFNY7aY0c++QDyJd42MjaMGTU5kOdtixlo5Ze Irqg== 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=O6AuVKgFw7zLmWZdaZJV4WSVASSDbO+N+zUJl8YFNCQ=; b=f8bXxPeUXdJTUs7w7Pr5qNhc+yns93dfI+O7P90X/vfoWqYuzO3FlxV7F2LmevCdhZ 5YvQYtiFlMoecEo0pV1GgIYWrezp8k3ykwjxgPWRgOuTQ45T5oPtT7O1i2DqC3SCp+FY Xhp6vDM7WjC9q9VlgQv/yo62yCdYSmByDKxhFxxIqCXUmzEj5Pj+oY08kT+UGiT+WmyP rQ6/GeYsqU/69UKq2rJQmCArE0bysSl3es196pF0qnzWjLjm1wAuE4ZtpytN8CaVvHZB hIoZMT93TLeQwUX/bDcpRK90ej8zhVKF+Q6pmNjQ+v5oaZVlXmNBv6SeqGnWOgpa7/53 n7zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@onstation.org header.s=default header.b=JZ7pcRrn; 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 r29si14963142edb.156.2019.11.06.01.16.18; Wed, 06 Nov 2019 01:16:41 -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=JZ7pcRrn; 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 S1731465AbfKFJNi (ORCPT + 99 others); Wed, 6 Nov 2019 04:13:38 -0500 Received: from onstation.org ([52.200.56.107]:50818 "EHLO onstation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727068AbfKFJNh (ORCPT ); Wed, 6 Nov 2019 04:13:37 -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 4C6AD3E89E; Wed, 6 Nov 2019 09:13:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=onstation.org; s=default; t=1573031616; bh=RUF1WwHyOvF/ICJ9FPqUfBjj8jBynQSgDGGQCKj3KcU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JZ7pcRrncpt2INI1fhnGVZld48I0H1BWpwgs/IFVtpcbeS3G0hex4iVWfr2R9CiAk ilG9jWvfBz7JtizUD21xVJSid8A/XPYJn+J3RL0SvBM2aS0s7PV+nkZrLi5UUPcbiG WncMd6mFPNbEg7eMg5YKAyiHFBJs1AopFvKSpK7Y= Date: Wed, 6 Nov 2019 04:13:35 -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: <20191106091335.GA16729@onstation.org> References: <20191105000129.GA6536@onstation.org> <20191105100804.GA9492@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 Tue, Nov 05, 2019 at 08:23:27AM -0800, Rob Clark wrote: > On Tue, Nov 5, 2019 at 2:08 AM Brian Masney wrote: > > 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. > > > I think this is along the lines of what we need to enable async commit > for mdp5 (but also removing the flush from the atomic-commit path).. > the principle behind the async commit is to do all the atomic state > commit normally, but defer writing the flush bits. This way, if you > get another async update before the next vblank, you just apply it > immediately instead of waiting for vblank. > > But I guess you are on a command mode panel, if I remember? Which is > a case I didn't have a way to test. And I'm not entirely about how > kms_funcs->vsync_time() should be implemented for cmd mode panels. Yes, this is a command-mode panel and there's no hardware frame counter available. The key to getting the display working on this phone was this patch: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2bab52af6fe68c43b327a57e5ce5fc10eefdfadf > That all said, I think we should first fix what is broken, before > worrying about extending async commit support to mdp5.. which > shouldn't hit the async==true path, due to not implementing > kms_funcs->vsync_time(). > > What I think is going on is that, in the cmd mode case, > mdp5_wait_flush() (indirectly) calls mdp5_crtc_wait_for_pp_done(), > which waits for a pp-done irq regardless of whether there is a flush > in progress. Since there is no flush pending, the irq never comes. > But the expectation is that kms_funcs->wait_flush() returns > immediately if there is nothing to wait for. I don't think that's happening in this case. I added some pr_info() statements to request_pp_done_pending() and mdp5_crtc_pp_done_irq(). Here's the first two sets of messages that appear in dmesg: [ 14.018907] msm fd900000.mdss: pp done time out, lm=0 [ 14.018993] request_pp_done_pending: HERE [ 14.074208] mdp5_crtc_pp_done_irq: HERE [ 14.074368] Console: switching to colour frame buffer device 135x120 [ 14.138938] msm fd900000.mdss: pp done time out, lm=0 [ 14.139021] request_pp_done_pending: HERE [ 14.158097] mdp5_crtc_pp_done_irq: HERE The messages go on like this with the same pattern. I tried two different changes: 1) I moved the request_pp_done_pending() and corresponding if statement from mdp5_crtc_atomic_flush() and into mdp5_crtc_atomic_begin(). 2) I increased the timeout in wait_for_completion_timeout() by several increments; all the way to 5 seconds. I haven't dug into the new code anymore. Brian