Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp938536pxb; Tue, 9 Feb 2021 17:20:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyT2AFO9nn2YLdMM7WJMuFbQ2KDuLUUgiSXFsq36oEtQKfxTSuy5kt6WxQQNG4inCVGXVu2 X-Received: by 2002:a17:906:b31a:: with SMTP id n26mr489617ejz.358.1612920032008; Tue, 09 Feb 2021 17:20:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612920032; cv=none; d=google.com; s=arc-20160816; b=t2iegQwgVdNU9pkNtTpjx0K6VdWmt3pQS3+zTyUWFoDQsni8qv2ETCzj4KeqYcNq0Y STNiIHdOB59N5nif6ujZjc5Q/Y9uQN/KUaXK8ZAnJEsnzr49VVjjGRgtXXgUJ2HVx/Jp ebIJszvyWqFL7WWVXJkH7ZFgGKkQRRQELNtPLNeC49e73zekg+IFRqzyvLfh9rs3mYMH xKgZs9XfWQ9eDoxC7fm/wBpZCnvCpqXqNeKz/ng4W+SEIkn4AGLDhwPJbg7PBik4BasT ddNiMRZ2PpFcRLwpU3F1EHhNCHkW4ZV/16OCwyshRWdGIiBReRqDoD7BYun0eE3maS1g 2yYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:subject:cc:to:from:date:mime-version :dkim-signature; bh=YYEZ2wEiCYmA0LWqHCD7zvMT/VIYTEjeg2vRMJxSuvg=; b=bBl8ruyCkt1MnPX8yjCbcISg12N9MPDl6nx4OAlPWGq4jsl4bOUuifSqboQfYAW1MM SSkqbSuYM8yjqMipatTzxlXd+/aKI5HcND4JGvJyfapsl9n988t67mr7m3LApAyy/wbQ 2HtfEF3AM/EeNX4+ZWf57AK2kXf96vkt+iulCOvm9KlrBxiuCuZ5vQZF+tVcTWh6t30O yHiX2F/c47EM0Qkvzk2KeeIcgtFHMVIi+jtknk8VR3C9ftuTdFvRfnUi+9JZheQVH8L+ vcrBI9q2faBZBsrLULBieXUZXRo9Z58TTq6sJyWIiMu2XBosJxTM3gzveJNvfufrr9/G LobA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=MePaVHAs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p4si258401edq.597.2021.02.09.17.20.08; Tue, 09 Feb 2021 17:20:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=MePaVHAs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234905AbhBJBR3 (ORCPT + 99 others); Tue, 9 Feb 2021 20:17:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233831AbhBIWUN (ORCPT ); Tue, 9 Feb 2021 17:20:13 -0500 Received: from mail.kapsi.fi (mail.kapsi.fi [IPv6:2001:67c:1be8::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6B46C0698E4 for ; Tue, 9 Feb 2021 13:38:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Transfer-Encoding:Content-Type:Message-ID:References: In-Reply-To:Subject:Cc:To:From:Date:MIME-Version:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=YYEZ2wEiCYmA0LWqHCD7zvMT/VIYTEjeg2vRMJxSuvg=; b=MePaVHAsFDdj9YFvPrfEO9PvCM OKl59gt6WZAJ+pLzzNthwBrv4J5mjAYdjUqlChjWzOyfRGYwxE3HmwtRDQfuZWtnUHNUHN49bhY2F n+WDMfIRwbU20oQAM/QH2o0QkLaF0mB1kSuQFXOJzJWSB+Na7YdQlVL/QZq9zJRbh9uHLpJqRswTH Cs5tUqHFC103+ISedJNszwXEefUQSBaQSOZfQW9m7ZLnc3WXarfbQanSG8c7bpVKCBnjhi1h9zDGr MuOBzZSvG4LNWvcQt9As2Nz9QjYFersefXv9xaXCIvAvVAxgz2lJcTGuQh0zYa7SBev57TVctTrWi eqMWEEtw==; Received: from webng-gw.kapsi.fi ([91.232.154.200] helo=roundcube.kapsi.fi) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1l9ahv-0001os-K0; Tue, 09 Feb 2021 23:38:03 +0200 MIME-Version: 1.0 Date: Tue, 09 Feb 2021 23:38:01 +0200 From: Jyri Sarha To: quanyang.wang@windriver.com Cc: Tomi Valkeinen , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [RESEND][PATCH] drm/tilcdc: send vblank event when disabling crtc In-Reply-To: <20210209082415.382602-1-quanyang.wang@windriver.com> References: <20210209082415.382602-1-quanyang.wang@windriver.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: X-Sender: jyri.sarha@iki.fi Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 91.232.154.200 X-SA-Exim-Mail-From: jyri.sarha@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-02-09 10:24, quanyang.wang@windriver.com wrote: > From: Quanyang Wang > > When run xrandr to change resolution on Beaglebone Black board, it will > print the error information: > > root@beaglebone:~# xrandr -display :0 --output HDMI-1 --mode 720x400 > [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out > [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:32:tilcdc > crtc] commit wait timed out > [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out > [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* > [CONNECTOR:34:HDMI-A-1] commit wait timed out > [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out > [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* > [PLANE:31:plane-0] commit wait timed out > tilcdc 4830e000.lcdc: already pending page flip! > > This is because there is operation sequence as below: > > drm_atomic_connector_commit_dpms(mode is DRM_MODE_DPMS_OFF): > ... > drm_atomic_helper_setup_commit <- > init_completion(commit_A->flip_done) > drm_atomic_helper_commit_tail > tilcdc_crtc_atomic_disable > tilcdc_plane_atomic_update <- drm_crtc_send_vblank_event in > tilcdc_crtc_irq > is skipped since > tilcdc_crtc->enabled is 0 > tilcdc_crtc_atomic_flush <- drm_crtc_send_vblank_event is > skipped since > crtc->state->event is set to be > NULL in > tilcdc_plane_atomic_update > drm_mode_setcrtc: > ... > drm_atomic_helper_setup_commit <- > init_completion(commit_B->flip_done) > drm_atomic_helper_wait_for_dependencies > drm_crtc_commit_wait <- wait for commit_A->flip_done > completing > > Just as shown above, the steps which could complete commit_A->flip_done > are all skipped and commit_A->flip_done will never be completed. This > will > result a time-out ERROR when drm_crtc_commit_wait check the > commit_A->flip_done. > So add drm_crtc_send_vblank_event in tilcdc_crtc_atomic_disable to > complete commit_A->flip_done. > > Fixes: cb345decb4d2 ("drm/tilcdc: Use standard > drm_atomic_helper_commit") > Signed-off-by: Quanyang Wang Reviewed-by: Jyri Sarha Tested-by: Jyri Sarha Thanks a lot! I think I have bumbed into this once or twice, but latelu I have had time to look into this. I'll merge this to drm-misc-next soon. Best regards, Jyri > --- > drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c > b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c > index 30213708fc99..d99afd19ca08 100644 > --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c > +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c > @@ -515,6 +515,15 @@ static void tilcdc_crtc_off(struct drm_crtc > *crtc, bool shutdown) > > drm_crtc_vblank_off(crtc); > > + spin_lock_irq(&crtc->dev->event_lock); > + > + if (crtc->state->event) { > + drm_crtc_send_vblank_event(crtc, crtc->state->event); > + crtc->state->event = NULL; > + } > + > + spin_unlock_irq(&crtc->dev->event_lock); > + > tilcdc_crtc_disable_irqs(dev); > > pm_runtime_put_sync(dev->dev);