Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1623996pxb; Fri, 29 Jan 2021 00:20:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1KJ2Po+YoiNnuoXDQW8tCR3GFSWBngxQGEflxH/V6E9jkpN4o32TfsxA4aOZAd1sNozsv X-Received: by 2002:a50:ec05:: with SMTP id g5mr3814224edr.182.1611908433355; Fri, 29 Jan 2021 00:20:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611908433; cv=none; d=google.com; s=arc-20160816; b=C1GoNtp0W8s3XOVcZml7vZkVsmrUJ/ThO028QqXpAvboqD/Cix2dyyAhk8SS7HM1+l WWBDAfgonkgE2gu3ArmdRROwaN27wwR7JLllqgFub7Oc5wcmod8vX1tE/uPPrZOPMQA5 LLllWLH/26KcHyT+VeD5vMo/Twy0jtFTt0uhgFl+GK47tXV+RleBZEM6Kz4MMj3msFCz v0CJOorMLL0oR9Q0rO8So5/dtbKYkpIU34yE9ZJwQBRRWnUJdQgaScStmI3iARbVO+3Y iq9OENnMc+5+u2gu0I7KZ2Hut6qoTIgkMDzFXoI+HgxTC+UNq/FtdPleTPbIdWhP/gMm oEbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:autocrypt:from :references:cc:to:subject:dkim-signature; bh=fNJH5lyNv6LkGnUYvoxDP8cM14QQd2Y6zmQ6vC8JFs4=; b=SVTjz0vANNVfe3pkDwywD2fbO4BjQwojDVRoCLU0foFriBbKz2RbMB4pG9/X7wVPyx Vhh7p2r5pVgzyzHQPVMvluv9CelT5WiwTnUgGfoOYCAYCKbkDesQY4NP+6Z/+/CRFNUx ijYS5c9I2yd3PSYIo+ZtVWuwMZUnwRbnFvtgq/dftxD5Jq7vEl2bH8hJT0yhpE99JK3e 51cSAlhX8lifupgZLiMzChHeUiyxyWXnOgIbu6J1+FYRip13I1ozfdTsVzjeJNUcbGV1 /hiEFUQRjzDh/wtE7zZEt3trQ6Q3NK8BP7/RNMsUi2Bis183dXQzIGXyq+IncPs6mSxn fZCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=IcDB7V+s; 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 g5si4097470ejw.228.2021.01.29.00.19.53; Fri, 29 Jan 2021 00:20:33 -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=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=IcDB7V+s; 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 S232415AbhA2H6K (ORCPT + 99 others); Fri, 29 Jan 2021 02:58:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232401AbhA2H54 (ORCPT ); Fri, 29 Jan 2021 02:57:56 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85594C061573 for ; Thu, 28 Jan 2021 23:58:38 -0800 (PST) Received: from [192.168.1.111] (91-157-208-71.elisa-laajakaista.fi [91.157.208.71]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5C7652E0; Fri, 29 Jan 2021 08:58:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1611907114; bh=Zkhc5qwxtLG9p6iYagBBIoG30YEBIJWm3QpQrx/2aks=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=IcDB7V+sLQYg6eBn5kGdj2rBhDmdEn6osnVv9z0oDsK7noiA7De8mohJLkzpAGVeW 6cbsi2noA3tVBsMMktTd67xR5D9Zw2910mtPmR0sD411m0WlTxQTubZYZPANkdnkJM ImScSScTkJf3j6Rzyyav7cKBWKU1y4SCFnYo8eGY= Subject: Re: [PATCH] drm/tilcdc: send vblank event when disabling crtc To: quanyang.wang@windriver.com, David Airlie , Daniel Vetter , Jyri Sarha Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Tomi Valkeinen References: <20210129055831.1702862-1-quanyang.wang@windriver.com> From: Tomi Valkeinen Autocrypt: addr=tomi.valkeinen@ideasonboard.com; keydata= mQINBE6ms0cBEACyizowecZqXfMZtnBniOieTuFdErHAUyxVgtmr0f5ZfIi9Z4l+uUN4Zdw2 wCEZjx3o0Z34diXBaMRJ3rAk9yB90UJAnLtb8A97Oq64DskLF81GCYB2P1i0qrG7UjpASgCA Ru0lVvxsWyIwSfoYoLrazbT1wkWRs8YBkkXQFfL7Mn3ZMoGPcpfwYH9O7bV1NslbmyJzRCMO eYV258gjCcwYlrkyIratlHCek4GrwV8Z9NQcjD5iLzrONjfafrWPwj6yn2RlL0mQEwt1lOvn LnI7QRtB3zxA3yB+FLsT1hx0va6xCHpX3QO2gBsyHCyVafFMrg3c/7IIWkDLngJxFgz6DLiA G4ld1QK/jsYqfP2GIMH1mFdjY+iagG4DqOsjip479HCWAptpNxSOCL6z3qxCU8MCz8iNOtZk DYXQWVscM5qgYSn+fmMM2qN+eoWlnCGVURZZLDjg387S2E1jT/dNTOsM/IqQj+ZROUZuRcF7 0RTtuU5q1HnbRNwy+23xeoSGuwmLQ2UsUk7Q5CnrjYfiPo3wHze8avK95JBoSd+WIRmV3uoO rXCoYOIRlDhg9XJTrbnQ3Ot5z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cYNbzWO/GHgsNT1WnM4sa9lwCSWH8Fw1o/3bX1VVPEsnESOfxkNdu+gAF5S6+I6n3a ueeIlwJl5CpT5l8RpoZXEOVtXYn8zzOJ7oGZYINRV9Pf8qKGLf3Dft7zKBP832I3PQjeok7F yjt+9S+KgSFSHP3Pa4E7lsSdWhSlHYNdG/czhoUkSCN09C0rEK93wxACx3vtxPLjXu6RptBw 3dRq7n+mQChEB1am0BueV1JZaBboIL0AGlSJkm23kw== Message-ID: <1c6bd553-ee27-c93b-59e6-8d3c8368213a@ideasonboard.com> Date: Fri, 29 Jan 2021 09:58:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210129055831.1702862-1-quanyang.wang@windriver.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); >