Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp332561rwl; Wed, 5 Apr 2023 01:00:08 -0700 (PDT) X-Google-Smtp-Source: AKy350aQLh+PNGtxL09YWRffW+4XbCcCg3CzR6O8h7Uioqch2BaJv58g9HOh2FHLntbdfYyYVJRt X-Received: by 2002:a17:906:a54:b0:948:b1d4:c3d1 with SMTP id x20-20020a1709060a5400b00948b1d4c3d1mr1837387ejf.70.1680681607826; Wed, 05 Apr 2023 01:00:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680681607; cv=none; d=google.com; s=arc-20160816; b=JTunW4oEMBJHz+2M26ggixhgjQ7B88aB/n+bTmnbWrcqtj3dum7CCWD0cU+UXrvG5Y 1n2OpQW2y1auGWxcO7kVZBJZPySmi0TfW6ECx3wjvvNCNovsc4DQ6+8dF2yKJEtC8p2c 4mh6JzwAlUZ7HHCxvhv6vXqFUjgwjjfQdTa9DCbgDWJkDs3HqhU98/DNAMamy2ZIasHn dBgeZE043h96ezvyI+NbppzD45ojXIXpVmGUDSpCTrzOvJMhbPfASFTXuxoGWZGmkvvb nFcw/B1lRU2ytJkoPHTo9WcEaJYRWN9RITXWKAK4s2IuIb6Eio1RvK/qZJ1MTH/UkJrD Ormg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=7SBSkYNegGJEqfKYfRSv37qruEG8RJ8bRHf7fXfzSzY=; b=DW+ePgAL1z//GeL76yLFQz7GQ5OhPniUmDL2yLvSSOZv2o0JgJOJBaV4wJ2iWRqItj eQTUafCfCDqghrnpBDlinU5wMDeeFAiqSD67szV47px6NMiOiBG+4IShCiuPLNkD+5td luK/1HgKRSl/+ZPvw8OxAIg5MyGOj9MKmbe+A8FFZkyNFnaiwOT44cU36zMd5YWqq7Qp WRasMNPVe62oSdh01ICPktl2DNUG1SfYs7zeTfKQw7d2nJGSQzyPyWJzrq6C0lxFMj2h Qh2rncMbLHfh7zxuSLYVnz+d1LCTtOlYe3VeGrvlSKXd0qQTicHhHK3oEYaFFM87/K3p H0UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=YsXVlBit; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s25-20020a170906c31900b008d17b125784si2241447ejz.30.2023.04.05.00.59.43; Wed, 05 Apr 2023 01:00:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=YsXVlBit; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237037AbjDEH6n (ORCPT + 99 others); Wed, 5 Apr 2023 03:58:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236881AbjDEH6l (ORCPT ); Wed, 5 Apr 2023 03:58:41 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66B4730E2 for ; Wed, 5 Apr 2023 00:58:39 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5029d4d90fbso4643a12.0 for ; Wed, 05 Apr 2023 00:58:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; t=1680681518; x=1683273518; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=7SBSkYNegGJEqfKYfRSv37qruEG8RJ8bRHf7fXfzSzY=; b=YsXVlBitEhbmbuzcKAXoVGfue6vdXaT4ovDEVFJcG9/mTl+Xo8ptJSsQCqqzN/Z0Ib DUWmxqn4QHjOGV4gFBOnpkvrehfKm3eXSV9nBNJaFSuZ9l4j0zx1cXVlHfY/mlUP9PVY WXhe3Ry2PQS4fOT9NpTG0tCeq04xbjrzKnEHA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680681518; x=1683273518; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7SBSkYNegGJEqfKYfRSv37qruEG8RJ8bRHf7fXfzSzY=; b=6vsQ4jOWy76vJ/waftxuA/8PdeSK0J3DMAXDmgJKgzCzbHFab8lg8lf8G7t9MZPjD8 y4rka2JVE9VBQbFEcjaLek2rg1I3NK38t94uOIxoRQvp0hFCM0XuU9h/0EiMTA5iYrvp 6AjBjIPb6Fq6ZOuykXaXtvPh2gA4Sj15o79twJUfgc3VPct9DVeI1a3/GkiWwTx1KyNK HPzOQLmSQ+XnZZ4O57ZFlFcax/9kivWJvqueE+XHRCwnogQRoRZRajL/T/6lFd4Uw/Ha 2SGYRcXo6TWRgVM7jjSm/Dn7IHdA6xKIMrDaHwAm68T7U7FPIQhOFeyhl6Vj4w4xxSIi pMnQ== X-Gm-Message-State: AAQBX9cOtW4ac9sXjANj+vFIQoweSWOAmuam2WcmWfe2LZ8rw3icaRFr a0GQ89E8UZtysrnfeL4aAIHvLQ== X-Received: by 2002:a17:906:1d5:b0:949:148d:82bc with SMTP id 21-20020a17090601d500b00949148d82bcmr1100490ejj.2.1680681517810; Wed, 05 Apr 2023 00:58:37 -0700 (PDT) Received: from phenom.ffwll.local (212-51-149-33.fiber7.init7.net. [212.51.149.33]) by smtp.gmail.com with ESMTPSA id r19-20020a50c013000000b004fd29e87535sm6856022edb.14.2023.04.05.00.58.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 00:58:37 -0700 (PDT) Date: Wed, 5 Apr 2023 09:58:35 +0200 From: Daniel Vetter To: Dmitry Baryshkov Cc: Rob Clark , dri-devel@lists.freedesktop.org, Rob Clark , Christian =?iso-8859-1?Q?K=F6nig?= , intel-gfx@lists.freedesktop.org, open list , Luben Tuikov , Thomas Zimmermann , Rodrigo Vivi , Matt Turner , freedreno@lists.freedesktop.org Subject: Re: [PATCH v10 11/15] drm/atomic-helper: Set fence deadline for vblank Message-ID: Mail-Followup-To: Dmitry Baryshkov , Rob Clark , dri-devel@lists.freedesktop.org, Rob Clark , Christian =?iso-8859-1?Q?K=F6nig?= , intel-gfx@lists.freedesktop.org, open list , Luben Tuikov , Thomas Zimmermann , Rodrigo Vivi , Matt Turner , freedreno@lists.freedesktop.org References: <20230308155322.344664-1-robdclark@gmail.com> <20230308155322.344664-12-robdclark@gmail.com> <198c42ad-73de-9e9d-23d4-f36cb6840b5d@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <198c42ad-73de-9e9d-23d4-f36cb6840b5d@linaro.org> X-Operating-System: Linux phenom 6.1.0-7-amd64 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 05, 2023 at 12:53:29AM +0300, Dmitry Baryshkov wrote: > On 04/04/2023 22:16, Daniel Vetter wrote: > > On Tue, Apr 04, 2023 at 08:22:05PM +0300, Dmitry Baryshkov wrote: > > > On 08/03/2023 17:53, Rob Clark wrote: > > > > From: Rob Clark > > > > > > > > For an atomic commit updating a single CRTC (ie. a pageflip) calculate > > > > the next vblank time, and inform the fence(s) of that deadline. > > > > > > > > v2: Comment typo fix (danvet) > > > > v3: If there are multiple CRTCs, consider the time of the soonest vblank > > > > > > > > Signed-off-by: Rob Clark > > > > Reviewed-by: Daniel Vetter > > > > Signed-off-by: Rob Clark > > > > --- > > > > drivers/gpu/drm/drm_atomic_helper.c | 37 +++++++++++++++++++++++++++++ > > > > 1 file changed, 37 insertions(+) > > > > > > As I started playing with hotplug on RB5 (sm8250, DSI-HDMI bridge), I found > > > that this patch introduces the following backtrace on HDMI hotplug. Is there > > > anything that I can do to debug/fix the issue? The warning seems harmless, > > > but it would be probably be good to still fix it. With addresses decoded: > > > > Bit a shot in the dark, but does the below help? > > This indeed seems to fix the issue. I'm not sure about the possible side > effects, but, if you were to send the patch: > > Tested-by: Dmitry Baryshkov Thanks for the quick feedback, I already discussed this with Rob on irc yesterday (and landed his more throughrough version of the drm_vblank.c fix to drm-misc-next). I'll polish the drm_atomic_helper.c part asap and will send it out. Would be great if you can then retest to make sure all the pieces still work together for your case. -Daniel > > > > > > > diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c > > index f21b5a74176c..6640d80d84f3 100644 > > --- a/drivers/gpu/drm/drm_atomic_helper.c > > +++ b/drivers/gpu/drm/drm_atomic_helper.c > > @@ -1528,6 +1528,9 @@ static void set_fence_deadline(struct drm_device *dev, > > for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { > > ktime_t v; > > + if (drm_atomic_crtc_needs_modeset(new_crtc_state)) > > + continue; > > + > > if (drm_crtc_next_vblank_start(crtc, &v)) > > continue; > > diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c > > index 78a8c51a4abf..7ae38e8e27e8 100644 > > --- a/drivers/gpu/drm/drm_vblank.c > > +++ b/drivers/gpu/drm/drm_vblank.c > > @@ -1001,6 +1001,9 @@ int drm_crtc_next_vblank_start(struct drm_crtc *crtc, ktime_t *vblanktime) > > struct drm_display_mode *mode = &vblank->hwmode; > > u64 vblank_start; > > + if (!drm_dev_has_vblank(crtc->dev)) > > + return -EINVAL; > > + > > if (!vblank->framedur_ns || !vblank->linedur_ns) > > return -EINVAL; > > > > > > > > [ 31.151348] ------------[ cut here ]------------ > > > [ 31.157043] msm_dpu ae01000.display-controller: > > > drm_WARN_ON_ONCE(drm_drv_uses_atomic_modeset(dev)) > > > [ 31.157177] WARNING: CPU: 0 PID: 13 at drivers/gpu/drm/drm_vblank.c:728 > > > drm_crtc_vblank_helper_get_vblank_timestamp_internal > > > (drivers/gpu/drm/drm_vblank.c:728) > > > [ 31.180629] Modules linked in: > > > [ 31.184106] CPU: 0 PID: 13 Comm: kworker/0:1 Not tainted > > > 6.3.0-rc2-00008-gd39e48ca80c0 #542 > > > [ 31.193358] Hardware name: Qualcomm Technologies, Inc. Robotics RB5 (DT) > > > [ 31.200796] Workqueue: events lt9611uxc_hpd_work > > > [ 31.205990] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS > > > BTYPE=--) > > > [ 31.213722] pc : drm_crtc_vblank_helper_get_vblank_timestamp_internal > > > (drivers/gpu/drm/drm_vblank.c:728) > > > [ 31.222032] lr : drm_crtc_vblank_helper_get_vblank_timestamp_internal > > > (drivers/gpu/drm/drm_vblank.c:728) > > > [ 31.230341] sp : ffff8000080bb8d0 > > > [ 31.234061] x29: ffff8000080bb900 x28: 0000000000000038 x27: > > > ffff61a7956b8d60 > > > [ 31.242051] x26: 0000000000000000 x25: 0000000000000000 x24: > > > ffff8000080bb9c4 > > > [ 31.250038] x23: 0000000000000001 x22: ffffbf0033b94ef0 x21: > > > ffff61a7957901d0 > > > [ 31.258029] x20: ffff61a795710000 x19: ffff61a78128b000 x18: > > > fffffffffffec278 > > > [ 31.266014] x17: 0040000000000465 x16: 0000000000000020 x15: > > > 0000000000000060 > > > [ 31.274001] x14: 0000000000000001 x13: ffffbf00354550e0 x12: > > > 0000000000000825 > > > [ 31.281989] x11: 00000000000002b7 x10: ffffbf00354b1208 x9 : > > > ffffbf00354550e0 > > > [ 31.289976] x8 : 00000000ffffefff x7 : ffffbf00354ad0e0 x6 : > > > 00000000000002b7 > > > [ 31.297963] x5 : ffff61a8feebbe48 x4 : 40000000fffff2b7 x3 : > > > ffffa2a8c9f64000 > > > [ 31.305947] x2 : 0000000000000000 x1 : 0000000000000000 x0 : > > > ffff61a780283100 > > > [ 31.313934] Call trace: > > > [ 31.316719] drm_crtc_vblank_helper_get_vblank_timestamp_internal > > > (drivers/gpu/drm/drm_vblank.c:728) > > > [ 31.324646] drm_crtc_vblank_helper_get_vblank_timestamp > > > (drivers/gpu/drm/drm_vblank.c:843) > > > [ 31.331528] drm_crtc_get_last_vbltimestamp > > > (drivers/gpu/drm/drm_vblank.c:884) > > > [ 31.337170] drm_crtc_next_vblank_start > > > (drivers/gpu/drm/drm_vblank.c:1006) > > > [ 31.342430] drm_atomic_helper_wait_for_fences > > > (drivers/gpu/drm/drm_atomic_helper.c:1531 > > > drivers/gpu/drm/drm_atomic_helper.c:1578) > > > [ 31.348561] drm_atomic_helper_commit > > > (drivers/gpu/drm/drm_atomic_helper.c:2007) > > > [ 31.353724] drm_atomic_commit (drivers/gpu/drm/drm_atomic.c:1444) > > > [ 31.358127] drm_client_modeset_commit_atomic > > > (drivers/gpu/drm/drm_client_modeset.c:1045) > > > [ 31.364146] drm_client_modeset_commit_locked > > > (drivers/gpu/drm/drm_client_modeset.c:1148) > > > [ 31.370071] drm_client_modeset_commit > > > (drivers/gpu/drm/drm_client_modeset.c:1174) > > > [ 31.375233] drm_fb_helper_set_par (drivers/gpu/drm/drm_fb_helper.c:254 > > > drivers/gpu/drm/drm_fb_helper.c:229 drivers/gpu/drm/drm_fb_helper.c:1644) > > > [ 31.380108] drm_fb_helper_hotplug_event > > > (drivers/gpu/drm/drm_fb_helper.c:2302 (discriminator 4)) > > > [ 31.385456] drm_fb_helper_output_poll_changed > > > (drivers/gpu/drm/drm_fb_helper.c:2331) > > > [ 31.391376] drm_kms_helper_hotplug_event > > > (drivers/gpu/drm/drm_probe_helper.c:697) > > > [ 31.396825] drm_bridge_connector_hpd_cb > > > (drivers/gpu/drm/drm_bridge_connector.c:129) > > > [ 31.402175] drm_bridge_hpd_notify (drivers/gpu/drm/drm_bridge.c:1315) > > > [ 31.406954] lt9611uxc_hpd_work > > > (drivers/gpu/drm/bridge/lontium-lt9611uxc.c:185) > > > [ 31.411450] process_one_work (kernel/workqueue.c:2395) > > > [ 31.415949] worker_thread (include/linux/list.h:292 > > > kernel/workqueue.c:2538) > > > [ 31.426843] kthread (kernel/kthread.c:376) > > > [ 31.437182] ret_from_fork (arch/arm64/kernel/entry.S:871) > > > [ 31.447828] irq event stamp: 44642 > > > [ 31.458284] hardirqs last enabled at (44641): __up_console_sem > > > (arch/arm64/include/asm/irqflags.h:182 (discriminator 1) > > > arch/arm64/include/asm/irqflags.h:202 (discriminator 1) > > > kernel/printk/printk.c:345 (discriminator 1)) > > > [ 31.474540] hardirqs last disabled at (44642): el1_dbg > > > (arch/arm64/kernel/entry-common.c:335 arch/arm64/kernel/entry-common.c:406) > > > [ 31.489882] softirqs last enabled at (42912): _stext > > > (arch/arm64/include/asm/current.h:19 arch/arm64/include/asm/preempt.h:13 > > > kernel/softirq.c:415 kernel/softirq.c:600) > > > [ 31.505256] softirqs last disabled at (42907): ____do_softirq > > > (arch/arm64/kernel/irq.c:81) > > > [ 31.521139] ---[ end trace 0000000000000000 ]--- > > > > > > > > > > > > -- > > > With best wishes > > > Dmitry > > > > > > > -- > With best wishes > Dmitry > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch