Re: drm: Bogus WARN() in drm_atomic_helper_update_legacy_modeset_state() ?

Liviu Dudau
2015-11-12T10:34:53Z

On Thu, Nov 12, 2015 at 02:34:57PM +0800, Mark yao wrote:

Mark,

> On 2015年11月12日 14:27, Mark yao wrote:
>
> On 2015年11月11日 00:56, Thierry Reding wrote:
>
> On Tue, Nov 10, 2015 at 03:01:03PM +0000, Liviu Dudau wrote:
>
> Hello,
>
> When booting my Juno board with the HDLCD driver that I have converted to
> atomic operations I'm getting the following warning:
>
> Perhaps you can provide pointers to the source code, that might make it
> easier for people to spot what's going wrong.
>
> Thierry
>

Can you switch your email client to text mode and make it do proper reply quoting? It is
rather difficult to follow where your reply comes when you don't use HTML MUAs.

Best regards,
Liviu

> _______________________________________________
> dri-devel mailing list
> [1]dri-devel@lists.freedesktop.org
> [2]http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
> Hi Thierry
>     I encountered the same problem as Liviu.
>     I'm coverting rockchip drm to atomic api, when booting with hdmi connected, get under warning:
>
> [    1.300156] WARNING: CPU: 0 PID: 26 at drivers/gpu/drm/drm_atomic_helper.c:674 drm_atomic_helper_update_legacy_modeset_state+0x3c/0x1f8()
> [    1.300161] Modules linked in:
> [    1.300171] CPU: 0 PID: 26 Comm: kworker/0:1 Not tainted 4.3.0-rc5+ #160
> [    1.300174] Hardware name: Rockchip (Device Tree)
> [    1.300189] Workqueue: events output_poll_execute
> [    1.300224] [<c0015e54>] (unwind_backtrace) from [<c00123cc>] (show_stack+0x10/0x14)
> [    1.300241] [<c00123cc>] (show_stack) from [<c01a5980>] (dump_stack+0x6c/0x88)
> [    1.300255] [<c01a5980>] (dump_stack) from [<c0024050>] (warn_slowpath_common+0x80/0xa8)
> [    1.300265] [<c0024050>] (warn_slowpath_common) from [<c0024090>] (warn_slowpath_null+0x18/0x1c)
> [    1.300277] [<c0024090>] (warn_slowpath_null) from [<c0221184>] (drm_atomic_helper_update_legacy_modeset_state+0x3c/0x1f8)
> [    1.300293] [<c0221184>] (drm_atomic_helper_update_legacy_modeset_state) from [<c0221548>] (drm_atomic_helper_commit_modeset_disables+0x208/0x364)
> [    1.300305] [<c0221548>] (drm_atomic_helper_commit_modeset_disables) from [<c0222248>] (drm_atomic_helper_commit+0xf8/0x140)
> [    1.300320] [<c0222248>] (drm_atomic_helper_commit) from [<c02404cc>] (drm_atomic_commit+0x50/0x60)
> [    1.300333] [<c02404cc>] (drm_atomic_commit) from [<c0223180>] (restore_fbdev_mode+0xf4/0x278)
> [    1.300345] [<c0223180>] (restore_fbdev_mode) from [<c0224164>] (drm_fb_helper_restore_fbdev_mode_unlocked+0x30/0x68)
> [    1.300357] [<c0224164>] (drm_fb_helper_restore_fbdev_mode_unlocked) from [<c02241d8>] (drm_fb_helper_set_par+0x3c/0x54)
> [    1.300368] [<c02241d8>] (drm_fb_helper_set_par) from [<c022411c>] (drm_fb_helper_hotplug_event+0xe4/0xfc)
> [    1.300382] [<c022411c>] (drm_fb_helper_hotplug_event) from [<c021ade8>] (drm_kms_helper_hotplug_event+0x24/0x28)
> [    1.300396] [<c021ade8>] (drm_kms_helper_hotplug_event) from [<c021af20>] (output_poll_execute+0x134/0x18c)
> [    1.300413] [<c021af20>] (output_poll_execute) from [<c00377c0>] (process_one_work+0x1e0/0x318)
> [    1.300426] [<c00377c0>] (process_one_work) from [<c0037c70>] (worker_thread+0x378/0x4c4)
> [    1.300438] [<c0037c70>] (worker_thread) from [<c003c69c>] (kthread+0xdc/0xf0)
> [    1.300450] [<c003c69c>] (kthread) from [<c000f5d8>] (ret_from_fork+0x14/0x3c)
>
> I can't found who can set encoder->crtc value before atomic_commit, what's going wrong?
>
> --
> Ｍark Yao
>
> Hi
>    here is the message before warning happen (filtering by "dmesg | grep drm"),  Hope this helps:
>
> [    1.245700] [drm:drm_minor_register]
> [    1.245925] [drm:drm_minor_register] new minor registered 64
> [    1.245934] [drm:drm_minor_register]
> [    1.245942] [drm:drm_minor_register]
> [    1.246099] [drm:drm_minor_register] new minor registered 0
> [    1.272968] rockchip-drm display-subsystem: bound ff940000.vop (ops vop_component_ops)
> [    1.294790] rockchip-drm display-subsystem: bound ff930000.vop (ops vop_component_ops)
> [    1.295086] rockchip-drm display-subsystem: bound ff980000.hdmi (ops dw_hdmi_rockchip_ops)
> [    1.295218] [drm:drm_sysfs_connector_add] adding "HDMI-A-1" to sysfs
> [    1.295222] [drm:drm_sysfs_hotplug_event] generating hotplug event
> [    1.295268] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
> [    1.295270] [drm] No driver support for vblank timestamp query.
> [    1.295290] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:29:HDMI-A-1]
> [    1.295304] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:29:HDMI-A-1] status updated from 3 to 1
> [    1.295470] [drm:drm_do_probe_ddc_edid] drm: skipping non-existent adapter rk3x-i2c
> [    1.295513] [drm:drm_mode_debug_printmodeline] Modeline 30:"640x480" 0 25175 640 656 752 800 480 490 492 525 0x40 0xa
> [    1.295518] [drm:drm_mode_prune_invalid] Not using 640x480 mode: BAD
> [    1.295531] [drm:drm_mode_debug_printmodeline] Modeline 33:"848x480" 0 33750 848 864 976 1088 480 486 494 517 0x40 0x5
> [    1.295535] [drm:drm_mode_prune_invalid] Not using 848x480 mode: BAD
> [    1.295543] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:29:HDMI-A-1] probed modes :
> [    1.295555] [drm:drm_mode_debug_printmodeline] Modeline 34:"1024x768" 60 65000 1024 1048 1184 1344 768 771 777 806 0x40 0xa
> [    1.295564] [drm:drm_mode_debug_printmodeline] Modeline 32:"800x600" 60 40000 800 840 968 1056 600 601 605 628 0x40 0x5
> [    1.295573] [drm:drm_mode_debug_printmodeline] Modeline 31:"800x600" 56 36000 800 824 896 1024 600 601 603 625 0x40 0x5
> [    1.295581] [drm:drm_setup_crtcs]
> [    1.295594] [drm:drm_enable_connectors] connector 29 enabled? yes
> [    1.295601] [drm:drm_target_preferred] looking for cmdline mode on connector 29
> [    1.295606] [drm:drm_target_preferred] looking for preferred mode on connector 29 0
> [    1.295609] [drm:drm_target_preferred] found mode 1024x768
> [    1.295614] [drm:drm_setup_crtcs] picking CRTCs for 4096x4096 config
> [    1.295623] [drm:drm_setup_crtcs] desired mode 1024x768 set on crtc 20 (0,0)
> [    1.299403] [drm:rockchip_drm_fbdev_create] FB [1024x768]-24 kvaddr=f0121000 offset=0 size=3145728
> [    1.299512] [drm:drm_sysfs_hotplug_event] generating hotplug event
> [    1.299540] [drm:drm_fb_helper_hotplug_event]
> [    1.299546] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:29:HDMI-A-1]
> [    1.299712] [drm:drm_do_probe_ddc_edid] drm: skipping non-existent adapter rk3x-i2c
> [    1.299750] [drm:drm_mode_debug_printmodeline] Modeline 35:"640x480" 0 25175 640 656 752 800 480 490 492 525 0x40 0xa
> [    1.299755] [drm:drm_mode_prune_invalid] Not using 640x480 mode: BAD
> [    1.299764] [drm:drm_mode_debug_printmodeline] Modeline 38:"848x480" 0 33750 848 864 976 1088 480 486 494 517 0x40 0x5
> [    1.299769] [drm:drm_mode_prune_invalid] Not using 848x480 mode: BAD
> [    1.299776] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:29:HDMI-A-1] probed modes :
> [    1.299786] [drm:drm_mode_debug_printmodeline] Modeline 34:"1024x768" 60 65000 1024 1048 1184 1344 768 771 777 806 0x40 0xa
> [    1.299795] [drm:drm_mode_debug_printmodeline] Modeline 32:"800x600" 60 40000 800 840 968 1056 600 601 605 628 0x40 0x5
> [    1.299804] [drm:drm_mode_debug_printmodeline] Modeline 31:"800x600" 56 36000 800 824 896 1024 600 601 603 625 0x40 0x5
> [    1.299811] [drm:drm_setup_crtcs]
> [    1.299818] [drm:drm_enable_connectors] connector 29 enabled? yes
> [    1.299822] [drm:drm_target_preferred] looking for cmdline mode on connector 29
> [    1.299827] [drm:drm_target_preferred] looking for preferred mode on connector 29 0
> [    1.299831] [drm:drm_target_preferred] found mode 1024x768
> [    1.299836] [drm:drm_setup_crtcs] picking CRTCs for 4096x4096 config
> [    1.299842] [drm:drm_setup_crtcs] desired mode 1024x768 set on crtc 20 (0,0)
> [    1.299857] [drm:drm_atomic_state_init] Allocated atomic state ee38ebc0
> [    1.299868] [drm:drm_atomic_get_plane_state] Added [PLANE:18] ee38eac0 state to ee38ebc0
> [    1.299875] [drm:drm_atomic_get_plane_state] Added [PLANE:19] ee38ea80 state to ee38ebc0
> [    1.299880] [drm:drm_atomic_set_crtc_for_plane] Link plane state ee38ea80 to [NOCRTC]
> [    1.299885] [drm:drm_atomic_set_fb_for_plane] Set [NOFB] for plane state ee38ea80
> [    1.299892] [drm:drm_atomic_get_plane_state] Added [PLANE:21] ee38ea40 state to ee38ebc0
> [    1.299897] [drm:drm_atomic_set_crtc_for_plane] Link plane state ee38ea40 to [NOCRTC]
> [    1.299901] [drm:drm_atomic_set_fb_for_plane] Set [NOFB] for plane state ee38ea40
> [    1.299907] [drm:drm_atomic_get_plane_state] Added [PLANE:22] ee38ea00 state to ee38ebc0
> [    1.299911] [drm:drm_atomic_set_crtc_for_plane] Link plane state ee38ea00 to [NOCRTC]
> [    1.299916] [drm:drm_atomic_set_fb_for_plane] Set [NOFB] for plane state ee38ea00
> [    1.299922] [drm:drm_atomic_get_plane_state] Added [PLANE:23] ee38e9c0 state to ee38ebc0
> [    1.299929] [drm:drm_atomic_get_plane_state] Added [PLANE:24] ee38e980 state to ee38ebc0
> [    1.299933] [drm:drm_atomic_set_crtc_for_plane] Link plane state ee38e980 to [NOCRTC]
> [    1.299937] [drm:drm_atomic_set_fb_for_plane] Set [NOFB] for plane state ee38e980
> [    1.299943] [drm:drm_atomic_get_plane_state] Added [PLANE:26] ee38e940 state to ee38ebc0
> [    1.299947] [drm:drm_atomic_set_crtc_for_plane] Link plane state ee38e940 to [NOCRTC]
> [    1.299951] [drm:drm_atomic_set_fb_for_plane] Set [NOFB] for plane state ee38e940
> [    1.299958] [drm:drm_atomic_get_plane_state] Added [PLANE:27] ee38e900 state to ee38ebc0
> [    1.299962] [drm:drm_atomic_set_crtc_for_plane] Link plane state ee38e900 to [NOCRTC]
> [    1.299966] [drm:drm_atomic_set_fb_for_plane] Set [NOFB] for plane state ee38e900
> [    1.299975] [drm:drm_atomic_get_crtc_state] Added [CRTC:20] ee340000 state to ee38ebc0
> [    1.299985] [drm:drm_atomic_set_mode_for_crtc] Set [MODE:1024x768] for CRTC state ee340000
> [    1.299990] [drm:drm_atomic_set_crtc_for_plane] Link plane state ee38eac0 to [CRTC:20]
> [    1.299995] [drm:drm_framebuffer_reference] ee20f640: FB ID: 33 (1)
> [    1.300000] [drm:drm_atomic_set_fb_for_plane] Set [FB:33] for plane state ee38eac0
> [    1.300008] [drm:drm_atomic_get_connector_state] Added [CONNECTOR:29] ee38e8c0 state to ee38ebc0
> [    1.300015] [drm:drm_atomic_add_affected_connectors] Adding all current connectors for [CRTC:20] to ee38ebc0
> [    1.300021] [drm:drm_atomic_set_crtc_for_connector] Link connector state ee38e8c0 to [CRTC:20]
> [    1.300033] [drm:drm_atomic_get_crtc_state] Added [CRTC:25] ee393e00 state to ee38ebc0
> [    1.300038] [drm:drm_atomic_set_mode_for_crtc] Set [NOMODE] for CRTC state ee393e00
> [    1.300043] [drm:drm_atomic_set_crtc_for_plane] Link plane state ee38e9c0 to [NOCRTC]
> [    1.300047] [drm:drm_atomic_set_fb_for_plane] Set [NOFB] for plane state ee38e9c0
> [    1.300053] [drm:drm_atomic_add_affected_connectors] Adding all current connectors for [CRTC:20] to ee38ebc0
> [    1.300059] [drm:drm_atomic_add_affected_connectors] Adding all current connectors for [CRTC:25] to ee38ebc0
> [    1.300067] [drm:drm_atomic_connectors_for_crtc] State ee38ebc0 has 1 connectors for [CRTC:20]
> [    1.300071] [drm:drm_atomic_check_only] checking ee38ebc0
> [    1.300079] [drm:drm_atomic_helper_check_modeset] [CRTC:20] mode changed
> [    1.300083] [drm:drm_atomic_helper_check_modeset] [CRTC:20] enable changed
> [    1.300088] [drm:update_connector_routing] Updating routing for [CONNECTOR:29:HDMI-A-1]
> [    1.300095] [drm:update_connector_routing] [CONNECTOR:29:HDMI-A-1] using [ENCODER:28:TMDS-28] on [CRTC:20]
> [    1.300100] [drm:drm_atomic_helper_check_modeset] [CRTC:20] active changed
> [    1.300105] [drm:drm_atomic_helper_check_modeset] [CRTC:20] needs all connectors, enable: y, active: y
> [    1.300111] [drm:drm_atomic_add_affected_connectors] Adding all current connectors for [CRTC:20] to ee38ebc0
> [    1.300117] [drm:drm_atomic_connectors_for_crtc] State ee38ebc0 has 1 connectors for [CRTC:20]
> [    1.300130] [drm:drm_atomic_commit] commiting ee38ebc0
> [    1.300156] WARNING: CPU: 0 PID: 26 at drivers/gpu/drm/drm_atomic_helper.c:674 drm_atomic_helper_update_legacy_modeset_state+0x3c/0x1f8()
>
> --
> Ｍark Yao
>
> References
>
> Visible links
> 1. mailto:dri-devel@lists.freedesktop.org
> 2. http://lists.freedesktop.org/mailman/listinfo/dri-devel

--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯