Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp298001pxb; Tue, 9 Feb 2021 00:04:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJwFd7ZnMoBUyFY0YDw8CSkzjc98X7Ali0Kl2kJ0bXJrtsWxWAw51ZmUqjDHbuCYs1MaPK9K X-Received: by 2002:a17:906:2a42:: with SMTP id k2mr20930657eje.118.1612857846910; Tue, 09 Feb 2021 00:04:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612857846; cv=none; d=google.com; s=arc-20160816; b=eFbNiaNH17nKpYxKMwRnEWGLkHVGJPMzhrT5iPbS37ornQ8LPJVjuoOJ/hswiLD301 Jt6veiujQEAaUPn6rUSGaB8LDcF8M2nVPNcs9MHSvejXFhPmiME1FzfWu/ZnaYDmbIpP RwMYCvmG9zmovanslGSbK3lLqd3dNZltwcgT2/owqwOeVWsnK94zHXJ++uExtzLi1SzJ 6sfNFoog1f4wRmIFvYbiLNECmvmbNorYB5fEnsFWhda+IjbZ/yBE3+zHXvmygoZzQksC oGItkDtYiXtxjl5pD3daekkhhPzajABP8sR3mRmH8VZZZsE/Nye8hG2ViDYjyCHP0yse FIdw== 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=Fxdm02vMDANFITPepmem+ipILVHOG5tGKEVvchxGCqQ=; b=ez7pGQRMKX3nM/upY80qLRQin8cSbOhZTAmc0AnZ5kybsMMWwmuN8hIwfCznsOzcJx YQiOFeD/vsAXzd/xoXQKYAtmGbkgFQZPAZ9b+vSeUaWQv9c0WAfDu+Jj3MK0eh+DXeKR kATwuHWLZNORgX3xchTinWwyzT+TKjnTGUNraT7hSx7zJCq8vo7umXcHIeQy3lFEW3Rd +HfoxVahFAWSPWWf5+oj6ta8fJkwQ/GiFwBoCc6A6bjvaVR53Ajvhg4XncOWiuJ5indE SHbVhVvu9gfCLShk5a0widq/ECOcZPQKfal8RG0fLRwx3xQg3/8Nx+CF0eE2dIzb9Jor WEzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=0p8FKw8d; 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 bx22si13348919edb.142.2021.02.09.00.03.41; Tue, 09 Feb 2021 00:04:06 -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=0p8FKw8d; 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 S229716AbhBIH7x (ORCPT + 99 others); Tue, 9 Feb 2021 02:59:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbhBIH7l (ORCPT ); Tue, 9 Feb 2021 02:59:41 -0500 Received: from mail.kapsi.fi (mail.kapsi.fi [IPv6:2001:67c:1be8::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0F53C061786 for ; Mon, 8 Feb 2021 23:58:58 -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=Fxdm02vMDANFITPepmem+ipILVHOG5tGKEVvchxGCqQ=; b=0p8FKw8dQeSWWBt2I1luC0LLOJ Ywm0Z6RM85QbVQKOEC9f0it5H7EB6fTRTRpPA3hgnBVjN6hfX6X+Z5E4OvD4mhdmXfLy1KVHBaGHT 92SxPRzDKEgOWyhOAVlWTPCkhvTyZrix6I+EYg31mRbLq65GOP8xQzs8Pubtw6LBvPY4Lz+pXkZrI nSTfOgoID12jL9n7SnN922vK2lhXlo2A3moT7O+0ygsBlhLjxdyeZ9H9iab+98AvyLraDx7VkjkEH FdpUrjrfW8Cw58Nw+7/2qazUh29I9Jb+2hdyORUUsXh1yH2Zi29BnuWB80i8e3a13aOQgZmmKih03 K97cRbew==; 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 1l9Nv5-0002ox-HL; Tue, 09 Feb 2021 09:58:47 +0200 MIME-Version: 1.0 Date: Tue, 09 Feb 2021 09:58:45 +0200 From: Jyri Sarha To: "quanyang.wang" Cc: Tomi Valkeinen , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/tilcdc: send vblank event when disabling crtc In-Reply-To: <40037f81-2444-1fe0-f5da-194f2a3d3f22@windriver.com> References: <20210129055831.1702862-1-quanyang.wang@windriver.com> <1c6bd553-ee27-c93b-59e6-8d3c8368213a@ideasonboard.com> <40037f81-2444-1fe0-f5da-194f2a3d3f22@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 5:09, quanyang.wang wrote: > Ping. > Could you resend the original patch (I have not received it) so I can easily test and merge it? I'll find some time to do it soon. Best regards, Jyri > On 1/29/21 3:58 PM, Tomi Valkeinen wrote: >> Dropped the @ti.com addresses and added the new ones. >> >> Tomi >> >> On 29/01/2021 07:58, 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 >>> --- >>> 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); >>>