agherzan / meta-raspberrypi

Yocto/OE BSP layer for the Raspberry Pi boards
https://www.yoctoproject.org/
MIT License
534 stars 410 forks source link

RPI 4 Model B only shows one DRM CRTC/Connector when two HDMI displays connected #919

Closed angusto closed 2 years ago

angusto commented 3 years ago

I am using gatesgarth branch meta-raspberrypi, and kernel is "Linux raspberrypi4-64 5.10.17-v8", when connecting two monitors(4k and 1080p) to the RPI 4 Model B two Micro HDMI ports, and the one HDMI port which near to USB Type-c power supply port can show the UI(GNOME-SHELL), the another one shows rainbow. after checking the DRM debug FS of kernel, find there is only one CRTC/Connector in DRM card0(vc4 Node), below is the details:

root@raspberrypi4-64:~# cd /sys/kernel/debug/dri/0/ root@raspberrypi4-64:/sys/kernel/debug/dri/0# ls HDMI-A-1 bo_stats clients crtc-0 framebuffer gem_names hvs_load_tracker internal_clients name state root@raspberrypi4-64:/sys/kernel/debug/dri/0# cat state plane[31]: plane-0 crtc=crtc-0 fb=97 allocated by = gnome-shell refcount=2 format=XR24 little-endian (0x34325258) modifier=0x0 size=3840x2160 layers: size[0]=3840x2160 pitch[0]=15360 offset[0]=0 obj[0]: name=0 refcount=3 start=00102f7a size=33177600 imported=no crtc-pos=3840x2160+0+0 src-pos=3840.000000x2160.000000+0.000000+0.000000 rotation=1 normalized-zpos=0 color-encoding=ITU-R BT.601 YCbCr color-range=YCbCr limited range plane[38]: plane-1 crtc=(null) fb=0 crtc-pos=0x0+0+0 src-pos=0.000000x0.000000+0.000000+0.000000 rotation=1 normalized-zpos=0 color-encoding=ITU-R BT.601 YCbCr color-range=YCbCr limited range plane[45]: plane-2 crtc=(null) fb=0 crtc-pos=0x0+0+0 src-pos=0.000000x0.000000+0.000000+0.000000 rotation=1 normalized-zpos=0 color-encoding=ITU-R BT.601 YCbCr color-range=YCbCr limited range plane[52]: plane-3 crtc=(null) fb=0 crtc-pos=0x0+0+0 src-pos=0.000000x0.000000+0.000000+0.000000 rotation=1 normalized-zpos=0 color-encoding=ITU-R BT.601 YCbCr color-range=YCbCr limited range plane[59]: plane-4 crtc=(null) fb=0 crtc-pos=0x0+0+0 src-pos=0.000000x0.000000+0.000000+0.000000 rotation=1 normalized-zpos=0 color-encoding=ITU-R BT.601 YCbCr color-range=YCbCr limited range plane[66]: plane-5 crtc=(null) fb=0 crtc-pos=0x0+0+0 src-pos=0.000000x0.000000+0.000000+0.000000 rotation=1 normalized-zpos=0 color-encoding=ITU-R BT.601 YCbCr color-range=YCbCr limited range plane[73]: plane-6 crtc=(null) fb=0 crtc-pos=0x0+0+0 src-pos=0.000000x0.000000+0.000000+0.000000 rotation=1 normalized-zpos=0 color-encoding=ITU-R BT.601 YCbCr color-range=YCbCr limited range plane[80]: plane-7 crtc=crtc-0 fb=95 allocated by = gnome-shell refcount=1 format=AR24 little-endian (0x34325241) modifier=0x0 size=64x64 layers: size[0]=64x64 pitch[0]=256 offset[0]=0 obj[0]: name=0 refcount=3 start=00102f76 size=16384 imported=no crtc-pos=64x64+3452+1940 src-pos=64.000000x64.000000+0.000000+0.000000 rotation=1 normalized-zpos=1 color-encoding=ITU-R BT.601 YCbCr color-range=YCbCr limited range crtc[87]: crtc-0 enable=1 active=1 self_refresh_active=0 planes_changed=1 mode_changed=0 active_changed=0 connectors_changed=0 color_mgmt_changed=0 plane_mask=81 connector_mask=1 encoder_mask=1 mode: "3840x2160": 30 297000 3840 4016 4104 4400 2160 2168 2178 2250 0x40 0x5 connector[89]: HDMI-A-1 crtc=crtc-0 self_refresh_aware=0 root@raspberrypi4-64:/sys/kernel/debug/dri/0# cat name vc4 dev=gpu unique=gpu

root@raspberrypi4-64:~# cat /proc/cpuinfo processor : 0 BogoMIPS : 108.00 Features : fp asimd evtstrm crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd08 CPU revision : 3

processor : 1 BogoMIPS : 108.00 Features : fp asimd evtstrm crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd08 CPU revision : 3

processor : 2 BogoMIPS : 108.00 Features : fp asimd evtstrm crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd08 CPU revision : 3

processor : 3 BogoMIPS : 108.00 Features : fp asimd evtstrm crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd08 CPU revision : 3

Hardware : BCM2835 Revision : d03114 Serial : 1000000092da5122 Model : Raspberry Pi 4 Model B Rev 1.4

so want to confirm here: if Linux DRM vc4 driver(not sure why CPU is still bcm2835? should be bcm2711?) only support one HDMI port connected at the same time? i have no DSI display in hands now, not sure if is can support two CRTC/conntector when connecting one HDMI port and one DSI port at the same time? or any config can enable two HDMIs CRTC/Connector? thank you

angusto commented 3 years ago

below are DRM debug log of kernel, only one connector be detected:

root@raspberrypi4-64:/sys/kernel/debug/dri# dmesg | grep drm [ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 video=HDMI-A-1:3840x2160M@30,margin_left=48,margin_right=48,margin_top=48,margin_bottom=48 video=HDMI-A-2:1920x1080M@60,margin_left=48,margin_right=48,margin_top=48,margin_bottom=48 smsc95xx.macaddr=DC:A6:32:E5:89:8F vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait drm.debug=0xe [ 1.330718] [drm:vc4_fkms_create_screen] connector_init, display_num 2 [ 1.330775] [drm:drm_connector_init] cmdline mode for connector HDMI-A-1 3840x2160@30Hz [ 1.330989] vc4-drm gpu: bound fe600000.firmwarekms (ops vc4_fkms_ops) [ 1.334346] fb0: switching to vc4drmfb from simple [ 1.338976] [drm] Initialized vc4 0.0.0 20140616 for gpu on minor 0 [ 1.339024] [drm:drm_client_modeset_probe] [ 1.339052] [drm:drm_helper_probe_single_connector_modes] [CONNECTOR:89:HDMI-A-1] [ 1.339072] [drm:vc4_fkms_connector_detect] connector detect. [ 1.339089] [drm:drm_helper_probe_single_connector_modes] [CONNECTOR:89:HDMI-A-1] status updated from unknown to connected [ 1.369672] [drm:drm_add_display_info] Supported Monitor Refresh rate range is 0 Hz - 0 Hz [ 1.369687] [drm:drm_add_display_info] non_desktop set to 0 [ 1.369703] [drm:drm_add_display_info] HDMI: DVI dual 0, max TMDS clock 300000 kHz [ 1.369719] [drm:drm_add_display_info] HF-VSDB: max TMDS clock 600000 kHz [ 1.369733] [drm:drm_add_display_info] CEA VCDB 0x6b [ 1.369760] [drm:drm_add_edid_modes] ELD monitor HP Z27k G3 [ 1.369778] [drm:drm_add_edid_modes] HDMI: latency present 0 0, video latency 0 1, audio latency 32 0 [ 1.369792] [drm:drm_add_edid_modes] ELD size 32, SAD count 0 [ 1.369809] [drm:drm_add_display_info] Supported Monitor Refresh rate range is 0 Hz - 0 Hz [ 1.369823] [drm:drm_add_display_info] non_desktop set to 0 [ 1.369837] [drm:drm_add_display_info] HDMI: DVI dual 0, max TMDS clock 300000 kHz [ 1.369851] [drm:drm_add_display_info] HF-VSDB: max TMDS clock 600000 kHz [ 1.369866] [drm:drm_add_display_info] CEA VCDB 0x6b [ 1.370737] [drm:drm_mode_debug_printmodeline] Modeline "3840x2160": 60 533250 3840 3888 3920 4000 2160 2163 2168 2222 0x48 0x9 [ 1.370753] [drm:drm_mode_prune_invalid] Not using 3840x2160 mode: CLOCK_HIGH [ 1.370774] [drm:drm_mode_debug_printmodeline] Modeline "3840x2160": 60 594000 3840 4016 4104 4400 2160 2168 2178 2250 0x40 0x5 [ 1.370788] [drm:drm_mode_prune_invalid] Not using 3840x2160 mode: CLOCK_HIGH [ 1.370806] [drm:drm_mode_debug_printmodeline] Modeline "3840x2160": 60 593407 3840 4016 4104 4400 2160 2168 2178 2250 0x40 0x5 [ 1.370819] [drm:drm_mode_prune_invalid] Not using 3840x2160 mode: CLOCK_HIGH [ 1.370852] [drm:drm_helper_probe_single_connector_modes] [CONNECTOR:89:HDMI-A-1] probed modes : [ 1.370870] [drm:drm_mode_debug_printmodeline] Modeline "3840x2160": 30 297000 3840 4016 4104 4400 2160 2168 2178 2250 0x40 0x5 [ 1.370887] [drm:drm_mode_debug_printmodeline] Modeline "3840x2160": 30 296703 3840 4016 4104 4400 2160 2168 2178 2250 0x40 0x5 [ 1.370903] [drm:drm_mode_debug_printmodeline] Modeline "3840x2160": 30 262750 3840 3888 3920 4000 2160 2163 2168 2191 0x60 0x9 [ 1.370920] [drm:drm_mode_debug_printmodeline] Modeline "2560x1440": 60 241500 2560 2608 2640 2720 1440 1443 1448 1481 0x40 0x9 [ 1.370936] [drm:drm_mode_debug_printmodeline] Modeline "1920x1200": 60 154000 1920 1968 2000 2080 1200 1203 1209 1235 0x40 0x9 [ 1.370953] [drm:drm_mode_debug_printmodeline] Modeline "1920x1080": 60 148500 1920 2008 2052 2200 1080 1084 1089 1125 0x40 0x5 [ 1.370969] [drm:drm_mode_debug_printmodeline] Modeline "1920x1080": 60 148500 1920 2008 2052 2200 1080 1084 1089 1125 0x40 0x5 [ 1.370985] [drm:drm_mode_debug_printmodeline] Modeline "1920x1080": 60 148352 1920 2008 2052 2200 1080 1084 1089 1125 0x40 0x5 [ 1.371002] [drm:drm_mode_debug_printmodeline] Modeline "1920x1080i": 60 74250 1920 2008 2052 2200 1080 1084 1094 1125 0x40 0x15 [ 1.371018] [drm:drm_mode_debug_printmodeline] Modeline "1920x1080i": 60 74176 1920 2008 2052 2200 1080 1084 1094 1125 0x40 0x15 [ 1.371035] [drm:drm_mode_debug_printmodeline] Modeline "1920x1080": 50 148500 1920 2448 2492 2640 1080 1084 1089 1125 0x40 0x5 [ 1.371051] [drm:drm_mode_debug_printmodeline] Modeline "1920x1080i": 50 74250 1920 2448 2492 2640 1080 1084 1094 1125 0x40 0x15 [ 1.371068] [drm:drm_mode_debug_printmodeline] Modeline "1600x1200": 60 162000 1600 1664 1856 2160 1200 1201 1204 1250 0x40 0x5 [ 1.371084] [drm:drm_mode_debug_printmodeline] Modeline "1680x1050": 60 119000 1680 1728 1760 1840 1050 1053 1059 1080 0x40 0x9 [ 1.371101] [drm:drm_mode_debug_printmodeline] Modeline "1600x900": 60 108000 1600 1624 1704 1800 900 901 904 1000 0x40 0x5 [ 1.371117] [drm:drm_mode_debug_printmodeline] Modeline "1280x1024": 60 108000 1280 1328 1440 1688 1024 1025 1028 1066 0x40 0x5 [ 1.371134] [drm:drm_mode_debug_printmodeline] Modeline "1440x900": 60 88750 1440 1488 1520 1600 900 903 909 926 0x40 0x9 [ 1.371151] [drm:drm_mode_debug_printmodeline] Modeline "1280x800": 60 71000 1280 1328 1360 1440 800 803 809 823 0x40 0x9 [ 1.371167] [drm:drm_mode_debug_printmodeline] Modeline "1280x720": 60 74250 1280 1390 1430 1650 720 725 730 750 0x40 0x5 [ 1.371184] [drm:drm_mode_debug_printmodeline] Modeline "1280x720": 60 74176 1280 1390 1430 1650 720 725 730 750 0x40 0x5 [ 1.371200] [drm:drm_mode_debug_printmodeline] Modeline "1280x720": 50 74250 1280 1720 1760 1980 720 725 730 750 0x40 0x5 [ 1.371217] [drm:drm_mode_debug_printmodeline] Modeline "1024x768": 60 65000 1024 1048 1184 1344 768 771 777 806 0x40 0xa [ 1.371233] [drm:drm_mode_debug_printmodeline] Modeline "800x600": 60 40000 800 840 968 1056 600 601 605 628 0x40 0x5 [ 1.371250] [drm:drm_mode_debug_printmodeline] Modeline "720x576": 50 27000 720 732 796 864 576 581 586 625 0x40 0xa [ 1.371266] [drm:drm_mode_debug_printmodeline] Modeline "720x576": 50 27000 720 732 796 864 576 581 586 625 0x40 0xa [ 1.371283] [drm:drm_mode_debug_printmodeline] Modeline "720x576i": 50 13500 720 732 795 864 576 580 586 625 0x40 0x101a [ 1.371300] [drm:drm_mode_debug_printmodeline] Modeline "720x576i": 50 13500 720 732 795 864 576 580 586 625 0x40 0x101a [ 1.371316] [drm:drm_mode_debug_printmodeline] Modeline "720x480": 60 27027 720 736 798 858 480 489 495 525 0x40 0xa [ 1.371333] [drm:drm_mode_debug_printmodeline] Modeline "720x480": 60 27027 720 736 798 858 480 489 495 525 0x40 0xa [ 1.371349] [drm:drm_mode_debug_printmodeline] Modeline "720x480": 60 27000 720 736 798 858 480 489 495 525 0x40 0xa [ 1.371366] [drm:drm_mode_debug_printmodeline] Modeline "720x480": 60 27000 720 736 798 858 480 489 495 525 0x40 0xa [ 1.371382] [drm:drm_mode_debug_printmodeline] Modeline "720x480i": 60 13514 720 739 801 858 480 488 494 525 0x40 0x101a [ 1.371399] [drm:drm_mode_debug_printmodeline] Modeline "720x480i": 60 13514 720 739 801 858 480 488 494 525 0x40 0x101a [ 1.371415] [drm:drm_mode_debug_printmodeline] Modeline "720x480i": 60 13500 720 739 801 858 480 488 494 525 0x40 0x101a [ 1.371432] [drm:drm_mode_debug_printmodeline] Modeline "720x480i": 60 13500 720 739 801 858 480 488 494 525 0x40 0x101a [ 1.371448] [drm:drm_mode_debug_printmodeline] Modeline "640x480": 60 25200 640 656 752 800 480 490 492 525 0x40 0xa [ 1.371465] [drm:drm_mode_debug_printmodeline] Modeline "640x480": 60 25175 640 656 752 800 480 490 492 525 0x40 0xa [ 1.371481] [drm:drm_mode_debug_printmodeline] Modeline "640x480": 60 25175 640 656 752 800 480 490 492 525 0x40 0xa [ 1.371497] [drm:drm_mode_debug_printmodeline] Modeline "720x400": 70 28320 720 738 846 900 400 412 414 449 0x40 0x6 [ 1.371512] [drm:drm_client_modeset_probe] connector 89 enabled? yes [ 1.371531] [drm:drm_client_modeset_probe] Not using firmware configuration [ 1.371547] [drm:drm_client_modeset_probe] looking for cmdline mode on connector 89 [ 1.371561] [drm:drm_client_modeset_probe] found mode 3840x2160 [ 1.371575] [drm:drm_client_modeset_probe] picking CRTCs for 7680x7680 config [ 1.371593] [drm:drm_client_modeset_probe] desired mode 3840x2160 set on crtc 87 (0,0) [ 1.371621] vc4-drm gpu: [drm:__drm_fb_helper_initial_config_and_unlock] test CRTC 0 primary plane [ 1.371642] vc4-drm gpu: [drm:drm_fb_helper_generic_probe] surface width(3840), height(2160) and bpp(16) [ 1.383691] [drm:drm_mode_addfb2] [FB:96] [ 1.384487] [drm:vc4_fkms_connector_best_encoder] best_connector. [ 1.384505] [drm:vc4_fkms_connector_best_encoder] best_connector. [ 1.384539] [drm:vc4_crtc_atomic_check] [CRTC:87] crtc_atomic_check. [ 1.384589] [drm:vc4_crtc_mode_set_nofb] Setting mode for display num 2 mode name 3840x2160, clk 297000, h(disp 3840, start 4016, end 4104, total 4400, skew 0) v(disp 2160, start 2168, end 2178, total 2250, scan 0), vrefresh 30, par 2, flags 0x0005 [ 1.567863] [drm:vc4_crtc_atomic_flush] [CRTC:87] crtc_atomic_flush. [ 1.567877] [drm:vc4_crtc_enable] [CRTC:87] vblanks on. [ 1.567897] [drm:vc4_fkms_enable_vblank] [CRTC:87] enable_vblank. [ 1.568023] [drm:vc4_fkms_encoder_enable] Encoder_enable [ 1.592195] [drm:vc4_fkms_connector_best_encoder] best_connector. [ 1.592212] [drm:vc4_fkms_connector_best_encoder] best_connector. [ 1.592230] [drm:vc4_crtc_atomic_check] [CRTC:87] crtc_atomic_check. [ 1.592353] [drm:vc4_crtc_atomic_flush] [CRTC:87] crtc_atomic_flush. [ 1.658643] [drm:vc4_fkms_disable_vblank] [CRTC:87] disable_vblank. [ 1.675140] [drm:vc4_fkms_connector_best_encoder] best_connector. [ 1.675157] [drm:vc4_fkms_connector_best_encoder] best_connector. [ 1.675173] [drm:vc4_crtc_atomic_check] [CRTC:87] crtc_atomic_check. [ 1.675310] [drm:vc4_crtc_atomic_flush] [CRTC:87] crtc_atomic_flush. [ 1.675325] [drm:vc4_fkms_enable_vblank] [CRTC:87] enable_vblank. [ 1.725304] [drm:vc4_fkms_disable_vblank] [CRTC:87] disable_vblank. [ 1.740314] vc4-drm gpu: [drm] fb0: vc4drmfb frame buffer device [ 3.639465] systemd[1]: Condition check resulted in Load Kernel Module drm being skipped. [ 3.693102] [drm:vc4_fkms_connector_best_encoder] best_connector. [ 3.693123] [drm:vc4_fkms_connector_best_encoder] best_connector. [ 3.693150] [drm:vc4_crtc_atomic_check] [CRTC:87] crtc_atomic_check. [ 3.693343] [drm:vc4_crtc_atomic_flush] [CRTC:87] crtc_atomic_flush. [ 3.693362] [drm:vc4_fkms_enable_vblank] [CRTC:87] enable_vblank. [ 3.758664] [drm:vc4_fkms_disable_vblank] [CRTC:87] disable_vblank. [ 3.776047] [drm:vc4_fkms_connector_best_encoder] best_connector. [ 3.776070] [drm:vc4_fkms_connector_best_encoder] best_connector. [ 3.776098] [drm:vc4_crtc_atomic_check] [CRTC:87] crtc_atomic_check. [ 3.776266] [drm:vc4_crtc_atomic_flush] [CRTC:87] crtc_atomic_flush. [ 3.776282] [drm:vc4_fkms_enable_vblank] [CRTC:87] enable_vblank. [ 3.792182] vc4-drm gpu: [drm:drm_fb_helper_check_var] fb requested width/height/bpp can't fit in current fb request 3840x2160-16 (virtual 3840x4320) > 3840x2160-16 [ 3.825330] [drm:vc4_fkms_disable_vblank] [CRTC:87] disable_vblank. [ 4.816443] [drm] Initialized v3d 1.0.0 20180419 for fec00000.v3d on minor 1 [ 9.837020] [drm:drm_helper_probe_single_connector_modes] [CONNECTOR:89:HDMI-A-1] [ 9.837056] [drm:vc4_fkms_connector_detect] connector detect. [ 9.871256] [drm:drm_add_display_info] Supported Monitor Refresh rate range is 0 Hz - 0 Hz [ 9.871277] [drm:drm_add_display_info] non_desktop set to 0 [ 9.871295] [drm:drm_add_display_info] HDMI: DVI dual 0, max TMDS clock 300000 kHz [ 9.871312] [drm:drm_add_display_info] HF-VSDB: max TMDS clock 600000 kHz [ 9.871328] [drm:drm_add_display_info] CEA VCDB 0x6b [ 9.871364] [drm:drm_add_edid_modes] ELD monitor HP Z27k G3 [ 9.871384] [drm:drm_add_edid_modes] HDMI: latency present 0 0, video latency 0 1, audio latency 32 0 [ 9.871399] [drm:drm_add_edid_modes] ELD size 32, SAD count 0 [ 9.871416] [drm:drm_add_display_info] Supported Monitor Refresh rate range is 0 Hz - 0 Hz [ 9.871430] [drm:drm_add_display_info] non_desktop set to 0 [ 9.871445] [drm:drm_add_display_info] HDMI: DVI dual 0, max TMDS clock 300000 kHz [ 9.871460] [drm:drm_add_display_info] HF-VSDB: max TMDS clock 600000 kHz [ 9.871475] [drm:drm_add_display_info] CEA VCDB 0x6b [ 9.872369] [drm:drm_mode_debug_printmodeline] Modeline "3840x2160": 60 533250 3840 3888 3920 4000 2160 2163 2168 2222 0x48 0x9 [ 9.872385] [drm:drm_mode_prune_invalid] Not using 3840x2160 mode: CLOCK_HIGH [ 9.872404] [drm:drm_mode_debug_printmodeline] Modeline "3840x2160": 60 594000 3840 4016 4104 4400 2160 2168 2178 2250 0x40 0x5 [ 9.872418] [drm:drm_mode_prune_invalid] Not using 3840x2160 mode: CLOCK_HIGH [ 9.872436] [drm:drm_mode_debug_printmodeline] Modeline "3840x2160": 60 593407 3840 4016 4104 4400 2160 2168 2178 2250 0x40 0x5 [ 9.872449] [drm:drm_mode_prune_invalid] Not using 3840x2160 mode: CLOCK_HIGH

angusto commented 3 years ago

Did some checks and found the num_displays from firmware is always 1:

rpi_firmware_property(vc4->firmware,
                                    RPI_FIRMWARE_FRAMEBUFFER_GET_NUM_DISPLAYS,
                                    &num_displays, sizeof(u32));

maybe caused by the wrong firmware, anyone met the similar issue?

agherzan commented 2 years ago

Have you tried to reproduce on the current HEAD of master?

EDIT: Closing due to no activity.