Raspberry Pi 4 vc4-kms-v3d-pi4 Kernel Errors

Not sure where to go with this so I apologize in advance

Device: Raspberry Pi 4B 4Gb
Kernel: linux-rpi4-mainline 5.6.2-1

I enabled the "full" kms experimental module, vc4-kms-v3d-pi4, today and got the following two stack traces on reboot:

Trace at 6.173186

[    6.173186] ------------[ cut here ]------------
[    6.173231] WARNING: CPU: 3 PID: 198 at drivers/gpu/drm/vc4/vc4_hdmi_phy.c:414 vc5_hdmi_phy_init+0x7b4/0x2078 [vc4]
[    6.173234] Modules linked in: brcmutil sha256_generic libsha256 vc4(+) sha256_arm64 bcm2835_codec(C) videobuf2_dma_contig bcm2835_v4l2(C) drm_kms_helper v4l2_mem2mem cfg80211 bcm2835_mmal_vchiq(C) videobuf2_vmalloc rfkill videobuf2_memops v3d videobuf2_v4l2 snd_soc_core snd_bcm2835(C) videobuf2_common gpu_sched snd_compress raspberrypi_hwmon videodev hwmon snd_pcm_dmaengine snd_pcm mc snd_timer snd syscopyarea sysfillrect vc_sm_cma(C) sysimgblt fb_sys_fops rpivid_mem uio_pdrv_genirq uio sch_fq_codel crypto_user drm drm_panel_orientation_quirks backlight ip_tables x_tables ipv6 nf_defrag_ipv6
[    6.173282] CPU: 3 PID: 198 Comm: systemd-udevd Tainted: G         C        5.6.2-1-MANJARO-ARM #1
[    6.173283] Hardware name: Raspberry Pi 4 Model B Rev 1.2 (DT)
[    6.173287] pstate: 20000005 (nzCv daif -PAN -UAO)
[    6.173304] pc : vc5_hdmi_phy_init+0x7b4/0x2078 [vc4]
[    6.173321] lr : vc4_hdmi_encoder_enable+0x1c0/0x1e48 [vc4]
[    6.173323] sp : ffffffc01145b180
[    6.173325] x29: ffffffc01145b180 x28: ffffff80f388bcf0 
[    6.173329] x27: ffffff80f46d8000 x26: 00000000897aaaaa 
[    6.173332] x25: ffffffc00908b860 x24: 0000000000002060 
[    6.173334] x23: 00000000097aaaaa x22: 0000000000000300 
[    6.173337] x21: 000000000822d320 x20: ffffff80f3a2d080 
[    6.173340] x19: 00000000f414bdc0 x18: 0000000000000000 
[    6.173343] x17: 0000000000000000 x16: 0000000000000000 
[    6.173345] x15: 0000000000000000 x14: 0000000000000000 
[    6.173348] x13: ffffffc01000d000 x12: 0000000000000001 
[    6.173350] x11: 0000000000000000 x10: 0000000000000000 
[    6.173353] x9 : ffffffc00907b610 x8 : ffffffc01000d038 
[    6.173356] x7 : 0000000000000001 x6 : 0000000000000000 
[    6.173359] x5 : ffffffc010e68000 x4 : 000000000000004c 
[    6.173361] x3 : 0000000000000000 x2 : ffffffc00908b860 
[    6.173364] x1 : ffffffc011415f44 x0 : 00000000dc8984ff 
[    6.173367] Call trace:
[    6.173384]  vc5_hdmi_phy_init+0x7b4/0x2078 [vc4]
[    6.173401]  vc4_hdmi_encoder_enable+0x1c0/0x1e48 [vc4]
[    6.173439]  drm_atomic_helper_commit_modeset_enables+0x228/0x250 [drm_kms_helper]
[    6.173455]  vc4_atomic_complete_commit+0xd4/0x578 [vc4]
[    6.173470]  vc4_atomic_commit+0x190/0x1e0 [vc4]
[    6.173548]  drm_atomic_commit+0x50/0x60 [drm]
[    6.173588]  drm_client_modeset_commit_atomic.isra.0+0x17c/0x238 [drm]
[    6.173627]  drm_client_modeset_commit_force+0x60/0x198 [drm]
[    6.173646]  drm_fb_helper_restore_fbdev_mode_unlocked+0x78/0xd8 [drm_kms_helper]
[    6.173664]  drm_fb_helper_set_par+0x34/0x68 [drm_kms_helper]
[    6.173673]  fbcon_init+0x3b0/0x538
[    6.173676]  visual_init+0xb4/0x108
[    6.173679]  do_bind_con_driver+0x1d8/0x3b0
[    6.173682]  do_take_over_console+0x144/0x200
[    6.173685]  do_fbcon_takeover+0x70/0xd8
[    6.173688]  fbcon_fb_registered+0x100/0x110
[    6.173691]  register_framebuffer+0x1f0/0x310
[    6.173709]  __drm_fb_helper_initial_config_and_unlock+0x300/0x4a8 [drm_kms_helper]
[    6.173727]  drm_fbdev_client_hotplug+0xd4/0x1a8 [drm_kms_helper]
[    6.173744]  drm_fbdev_generic_setup+0xb4/0x130 [drm_kms_helper]
[    6.173760]  vc4_drm_bind+0x168/0x1a8 [vc4]
[    6.173765]  try_to_bring_up_master+0x16c/0x1c8
[    6.173768]  component_master_add_with_match+0xbc/0x100
[    6.173783]  vc4_platform_drm_probe+0xcc/0x100 [vc4]
[    6.173789]  platform_drv_probe+0x58/0xa8
[    6.173791]  really_probe+0xdc/0x318
[    6.173794]  driver_probe_device+0x5c/0xf0
[    6.173797]  device_driver_attach+0x74/0x80
[    6.173800]  __driver_attach+0x5c/0xd8
[    6.173802]  bus_for_each_dev+0x74/0xc8
[    6.173805]  driver_attach+0x28/0x30
[    6.173808]  bus_add_driver+0x14c/0x1f0
[    6.173810]  driver_register+0x68/0x118
[    6.173814]  __platform_driver_register+0x4c/0x58
[    6.173829]  vc4_drm_register+0x4c/0x1000 [vc4]
[    6.173833]  do_one_initcall+0x4c/0x288
[    6.173837]  do_init_module+0x5c/0x248
[    6.173840]  load_module+0x1ebc/0x2578
[    6.173842]  __do_sys_finit_module+0xd0/0xe8
[    6.173845]  __arm64_sys_finit_module+0x24/0x30
[    6.173849]  el0_svc_common.constprop.0+0x78/0x190
[    6.173852]  do_el0_svc+0x28/0x88
[    6.173856]  el0_sync_handler+0x114/0x198
[    6.173858]  el0_sync+0x140/0x180
[    6.173860] ---[ end trace 5dab75dc028df9c6 ]---

Trace at 8.042823

[    8.042823] ------------[ cut here ]------------
[    8.042875] WARNING: CPU: 1 PID: 389 at drivers/gpu/drm/vc4/vc4_hdmi_phy.c:414 vc5_hdmi_phy_init+0x7b4/0x2078 [vc4]
[    8.042878] Modules linked in: brcmfmac brcmutil sha256_generic libsha256 vc4 sha256_arm64 bcm2835_codec(C) videobuf2_dma_contig bcm2835_v4l2(C) drm_kms_helper v4l2_mem2mem cfg80211 bcm2835_mmal_vchiq(C) videobuf2_vmalloc rfkill videobuf2_memops v3d videobuf2_v4l2 snd_soc_core snd_bcm2835(C) videobuf2_common gpu_sched snd_compress raspberrypi_hwmon videodev hwmon snd_pcm_dmaengine snd_pcm mc snd_timer snd syscopyarea sysfillrect vc_sm_cma(C) sysimgblt fb_sys_fops rpivid_mem uio_pdrv_genirq uio sch_fq_codel crypto_user drm drm_panel_orientation_quirks backlight ip_tables x_tables ipv6 nf_defrag_ipv6
[    8.042962] CPU: 1 PID: 389 Comm: Xorg Tainted: G        WC        5.6.2-1-MANJARO-ARM #1
[    8.042965] Hardware name: Raspberry Pi 4 Model B Rev 1.2 (DT)
[    8.042972] pstate: 20000005 (nzCv daif -PAN -UAO)
[    8.043000] pc : vc5_hdmi_phy_init+0x7b4/0x2078 [vc4]
[    8.043027] lr : vc4_hdmi_encoder_enable+0x1c0/0x1e48 [vc4]
[    8.043030] sp : ffffffc011cd3950
[    8.043034] x29: ffffffc011cd3950 x28: ffffff80f388bcf0 
[    8.043041] x27: ffffff80f54d8000 x26: 00000000897aaaaa 
[    8.043047] x25: ffffffc00908b860 x24: 0000000000002060 
[    8.043052] x23: 00000000097aaaaa x22: 0000000000000300 
[    8.043058] x21: 000000000822d320 x20: ffffff80f3a2d080 
[    8.043063] x19: 00000000f414bdc0 x18: 0000000000000000 
[    8.043069] x17: 0000000000000000 x16: 0000000000000000 
[    8.043074] x15: 0000000000000000 x14: 0000000000000000 
[    8.043079] x13: ffffffc01000d000 x12: 0000000000000001 
[    8.043084] x11: 0000000000000000 x10: 0000000000000000 
[    8.043089] x9 : ffffffc00907b610 x8 : ffffffc01000d038 
[    8.043095] x7 : 0000000000000001 x6 : 0000000000000000 
[    8.043100] x5 : ffffffc010e68000 x4 : 000000000000004c 
[    8.043105] x3 : 0000000000000000 x2 : ffffffc00908b860 
[    8.043110] x1 : ffffffc011415f44 x0 : 00000000dc8984ff 
[    8.043116] Call trace:
[    8.043142]  vc5_hdmi_phy_init+0x7b4/0x2078 [vc4]
[    8.043166]  vc4_hdmi_encoder_enable+0x1c0/0x1e48 [vc4]
[    8.043208]  drm_atomic_helper_commit_modeset_enables+0x228/0x250 [drm_kms_helper]
[    8.043233]  vc4_atomic_complete_commit+0xd4/0x578 [vc4]
[    8.043258]  vc4_atomic_commit+0x190/0x1e0 [vc4]
[    8.043343]  drm_atomic_commit+0x50/0x60 [drm]
[    8.043422]  drm_client_modeset_commit_atomic.isra.0+0x17c/0x238 [drm]
[    8.043499]  drm_client_modeset_commit_force+0x60/0x198 [drm]
[    8.043537]  drm_fb_helper_pan_display+0xb0/0x1f0 [drm_kms_helper]
[    8.043547]  fb_pan_display+0x9c/0x110
[    8.043554]  do_fb_ioctl+0x2c8/0x788
[    8.043559]  fb_ioctl+0x3c/0x50
[    8.043567]  ksys_ioctl+0x90/0xd0
[    8.043573]  __arm64_sys_ioctl+0x24/0x30
[    8.043582]  el0_svc_common.constprop.0+0x78/0x190
[    8.043587]  do_el0_svc+0x28/0x88
[    8.043594]  el0_sync_handler+0x114/0x198
[    8.043599]  el0_sync+0x140/0x180
[    8.043603] ---[ end trace 5dab75dc028df9c7 ]---

My Raspberry Pi booted and DRI still works so it's not all bad!

For additional background on full kms support see:
Full KMS on RetroPi
Moving to kernel 5.4

Not sure if it's is an issue with the experimental driver or whether it's an issue with kernel compilation? Just starting here because I don't know where else to start.

Time to roll-up the sleeves, pull the hoodie over my head, and dig in. I'll post an update if I can find anything.

I use the pi4 defconfig for a base so it has all what the RPi people recommends. I have been waiting and testing every new kernel I build for the pi4 that I push to the manjaro-arm repo hoping they would get vc4-kms-v3d going with gpu v3d acceleration. They have been very slow getting things going for the 64bit kernel.

The kernels here have vc4-fkms-v3d with 3d gpu acceleration by not having video-fbturbo-git installed. By looking at the links you provided they never mentioned disabling fbturbo in any of their steps and that is pretty much installed in most images so omxplayer and mmal can be used. I am not getting any graphics here trying to use V3D but I am getting page flipping errors involving my Vizio tv. The pi 4 does not get the edid info from my tv and has been problematic for me with the pi4.

I can install video-fbturbo-git and use vc4-kms-v3d-pi4 and things work ok and actually I receive hardly any dropped frames on youtube playing a 4k video. I get more dropped frames with vc4-fkms-3d with v3d acceleration. The sound fix they linked to does not work for me but I also have the latest kernel 5.4.35-1 that I compiled and pushed to the Manjaro arm-unstable repo today. All I had to do was delete the ~/.config/pulse directory and reboot to get sound.

If you are actually getting graphics there with vc4-kms-v3d-pi4 and video-fbturbo-git not installed then you may want to test the linux-rpi4-next-5.4.35-1 I pushed to the arm-unstable branch today.

1 Like

Thanks for the reply @Darksky. I'll give linux-rpi4-next-5.4.35-1 a try and post an update.

tbh, "full" kms support on raspberry pi 4 is so new I didn't think anyone had updated a kernel with the new overlay. I just posted the links above for awareness sake.

Some kernels ago before the rpi4 came out vc4-kms-v3d worked great with V3D gpu acceleration then upstream changed things and the RPi people had to redo things in their tree and it is not up to full speed yet then the pi4 came out and added a whole new set of issues to be worked out as it plays with a different set of rules.

Will be interested on how things go on your end with the new kernel.

@Darksky linux-rpi4-next-5.4.35-1 resolved the stack trace on boot :slight_smile: Unfortunately, hardware acceleration is still problematic, as you are aware. :frowning:

I have some more testing to do and will post more info later.

I haven't run into any issues. Changed to resolved.

Thanks for the great work!

Forum kindly sponsored by