Miouyouyou / RockMyy

Build scripts and patches used to cross-compile 5.6-rcX kernels for RK3288 boards
MIT License
32 stars 8 forks source link

No display on kernel 4.17 #4

Closed Miouyouyou closed 6 years ago

Miouyouyou commented 6 years ago

Currently, on Tinkerboard systems (didn't test on a MiQi yet), the DRM cannot initialise the screen, throwing a "-12" error.

[    0.286298] rk_iommu ff930300.iommu: Failed to get clk 'aclk': -2
[    0.286638] rk_iommu: probe of ff930300.iommu failed with error -2
[    0.287025] rk_iommu ff940300.iommu: Failed to get clk 'aclk': -2
[    0.287299] rk_iommu: probe of ff940300.iommu failed with error -2
...
[    1.537347] rockchip-drm display-subsystem: Linked as a consumer to ff930000.vop
[    1.545693] rockchip-drm display-subsystem: Linked as a consumer to ff940000.vop
[    1.554665] rockchip-drm display-subsystem: Linked as a consumer to ff980000.hdmi
...
[    7.258289] rockchip-drm display-subsystem: master bind failed: -12
[    7.265388] rockchip-vop: probe of ff940000.vop failed with error -12

This leads to no initialized screens and, therefore, no graphical output, making RK3288 systems unusable with this kernel.

Not applying any DTS patch does not affect the issue.

The IOMMU issues are problematic though. The addresses shown are ones of the VOP MMU nodes, so this will be investigated first since it's highly plausible that these two problems are linked.

Miouyouyou commented 6 years ago

Okay, after applying the following patch, adapted from the one @JeffyCN posted on @mmind branch, I was able to add the appropriate clocks to the MMU drivers... Or so I thought. The system starts but the whole DRM system seems messed up.

However I reapplied all the DTS patches so I'll have to try with only the new one.

Anyway the current issue is that screen detection and use just takes forever and tends to throw errors like this :

[   41.502415] ------------[ cut here ]------------
[   41.507596] WARNING: CPU: 2 PID: 643 at drivers/gpu/drm/drm_atomic_helper.c:1351 drm_atomic_helper_wait_for_vblanks+0x1bc/0x1d4
[   41.520509] [CRTC:30:crtc-0] vblank wait timed out
[   41.525894] Modules linked in: bnep mali_kbase r8723bs(C) rockchip_rga dw_hdmi_cec v4l2_mem2mem videobuf2_dma_sg rk_crypto
[   41.538295] CPU: 2 PID: 643 Comm: Xorg Tainted: G         C        4.17.0-rc3-RockMyy-16Bits-Edition #1
[   41.548790] Hardware name: Rockchip (Device Tree)
[   41.554051] [<c010fdec>] (unwind_backtrace) from [<c010bf88>] (show_stack+0x10/0x14)
[   41.562706] [<c010bf88>] (show_stack) from [<c0c93450>] (dump_stack+0x70/0x8c)
[   41.570778] [<c0c93450>] (dump_stack) from [<c011f930>] (__warn+0xd4/0xf0)
[   41.578459] [<c011f930>] (__warn) from [<c011f980>] (warn_slowpath_fmt+0x34/0x44)
[   41.586822] [<c011f980>] (warn_slowpath_fmt) from [<c07219cc>] (drm_atomic_helper_wait_for_vblanks+0x1bc/0x1d4)
[   41.598098] [<c07219cc>] (drm_atomic_helper_wait_for_vblanks) from [<c07231bc>] (drm_atomic_helper_commit_tail_rpm+0x48/0x58)
[   41.610731] [<c07231bc>] (drm_atomic_helper_commit_tail_rpm) from [<c0723040>] (commit_tail+0x40/0x6c)
[   41.621131] [<c0723040>] (commit_tail) from [<c0723168>] (drm_atomic_helper_commit+0xf4/0x100)
[   41.630754] [<c0723168>] (drm_atomic_helper_commit) from [<c07235d8>] (drm_atomic_helper_set_config+0x58/0x7c)
[   41.641932] [<c07235d8>] (drm_atomic_helper_set_config) from [<c07317c4>] (__drm_mode_set_config_internal+0x3c/0xd0)
[   41.653692] [<c07317c4>] (__drm_mode_set_config_internal) from [<c0732040>] (drm_mode_setcrtc+0x3d0/0x464)
[   41.664482] [<c0732040>] (drm_mode_setcrtc) from [<c072d034>] (drm_ioctl+0x2a8/0x328)
[   41.673233] [<c072d034>] (drm_ioctl) from [<c023bb48>] (vfs_ioctl+0x20/0x38)
[   41.681108] [<c023bb48>] (vfs_ioctl) from [<c023bce8>] (do_vfs_ioctl+0x84/0x7fc)
[   41.689371] [<c023bce8>] (do_vfs_ioctl) from [<c023c4b0>] (ksys_ioctl+0x50/0x6c)
[   41.697634] [<c023c4b0>] (ksys_ioctl) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
[   41.706185] Exception stack(0xed31bfa8 to 0xed31bff0)
[   41.711825] bfa0:                   b6f7bce8 befa24d8 0000000a c06864a2 befa24d8 00000001
[   41.720961] bfc0: b6f7bce8 befa24d8 c06864a2 00000036 0000000a 00000000 0000002f 0000001e
[   41.730097] bfe0: b6e08060 befa24bc b6df1d23 b6bb0e06
[   41.735773] ---[ end trace f44c3e3ecff4675e ]---
[   52.198435] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:30:crtc-0] flip_done timed out
[   62.438424] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:39:HDMI-A-1] flip_done timed out
[   62.459535] rockchip-vop ff930000.vop: [drm:vop_crtc_atomic_flush] *ERROR* VOP vblank IRQ stuck for 10 ms
[   62.470235] ------------[ cut here ]------------
[   62.475383] WARNING: CPU: 2 PID: 643 at drivers/gpu/drm/rockchip/rockchip_drm_vop.c:1004 vop_crtc_atomic_flush+0x194/0x1f0
[   62.487721] Modules linked in: bnep mali_kbase r8723bs(C) rockchip_rga dw_hdmi_cec v4l2_mem2mem videobuf2_dma_sg rk_crypto
[   62.500079] CPU: 2 PID: 643 Comm: Xorg Tainted: G        WC        4.17.0-rc3-RockMyy-16Bits-Edition #1
[   62.510573] Hardware name: Rockchip (Device Tree)
[   62.515832] [<c010fdec>] (unwind_backtrace) from [<c010bf88>] (show_stack+0x10/0x14)
[   62.524477] [<c010bf88>] (show_stack) from [<c0c93450>] (dump_stack+0x70/0x8c)
[   62.532549] [<c0c93450>] (dump_stack) from [<c011f930>] (__warn+0xd4/0xf0)
[   62.540231] [<c011f930>] (__warn) from [<c011fa0c>] (warn_slowpath_null+0x38/0x44)
[   62.548689] [<c011fa0c>] (warn_slowpath_null) from [<c074eb3c>] (vop_crtc_atomic_flush+0x194/0x1f0)
[   62.558802] [<c074eb3c>] (vop_crtc_atomic_flush) from [<c0722f54>] (drm_atomic_helper_commit_planes+0x1d4/0x228)
[   62.570176] [<c0722f54>] (drm_atomic_helper_commit_planes) from [<c07231a8>] (drm_atomic_helper_commit_tail_rpm+0x34/0x58)
[   62.582518] [<c07231a8>] (drm_atomic_helper_commit_tail_rpm) from [<c0723040>] (commit_tail+0x40/0x6c)
[   62.592919] [<c0723040>] (commit_tail) from [<c0723168>] (drm_atomic_helper_commit+0xf4/0x100)
[   62.602542] [<c0723168>] (drm_atomic_helper_commit) from [<c073c720>] (drm_atomic_connector_commit_dpms+0xdc/0xe8)
[   62.614109] [<c073c720>] (drm_atomic_connector_commit_dpms) from [<c0741310>] (drm_mode_obj_set_property_ioctl+0xc8/0x210)
[   62.626452] [<c0741310>] (drm_mode_obj_set_property_ioctl) from [<c074014c>] (drm_mode_connector_property_set_ioctl+0x30/0x3c)
[   62.639184] [<c074014c>] (drm_mode_connector_property_set_ioctl) from [<c072d034>] (drm_ioctl+0x2a8/0x328)
[   62.649974] [<c072d034>] (drm_ioctl) from [<c023bb48>] (vfs_ioctl+0x20/0x38)
[   62.657850] [<c023bb48>] (vfs_ioctl) from [<c023bce8>] (do_vfs_ioctl+0x84/0x7fc)
[   62.666114] [<c023bce8>] (do_vfs_ioctl) from [<c023c4b0>] (ksys_ioctl+0x50/0x6c)
[   62.674377] [<c023c4b0>] (ksys_ioctl) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
[   62.682928] Exception stack(0xed31bfa8 to 0xed31bff0)
[   62.688568] bfa0:                   00000000 befa2528 0000000a c01064ab befa2528 92c1b500
[   62.697696] bfc0: 00000000 befa2528 c01064ab 00000036 00000001 0157b2dc 0151c350 0151cc68
[   62.706832] bfe0: b6e08060 befa250c b6df1d23 b6bb0e06
[   62.712462] ---[ end trace f44c3e3ecff4675f ]---
[   62.768411] ------------[ cut here ]------------
[   62.773582] WARNING: CPU: 2 PID: 643 at drivers/gpu/drm/drm_atomic_helper.c:1351 drm_atomic_helper_wait_for_vblanks+0x1bc/0x1d4
[   62.786420] [CRTC:30:crtc-0] vblank wait timed out
[   62.791780] Modules linked in: bnep mali_kbase r8723bs(C) rockchip_rga dw_hdmi_cec v4l2_mem2mem videobuf2_dma_sg rk_crypto
[   62.804146] CPU: 2 PID: 643 Comm: Xorg Tainted: G        WC        4.17.0-rc3-RockMyy-16Bits-Edition #1
[   62.814642] Hardware name: Rockchip (Device Tree)
[   62.819900] [<c010fdec>] (unwind_backtrace) from [<c010bf88>] (show_stack+0x10/0x14)
[   62.828552] [<c010bf88>] (show_stack) from [<c0c93450>] (dump_stack+0x70/0x8c)
[   62.836622] [<c0c93450>] (dump_stack) from [<c011f930>] (__warn+0xd4/0xf0)
[   62.844304] [<c011f930>] (__warn) from [<c011f980>] (warn_slowpath_fmt+0x34/0x44)
[   62.852668] [<c011f980>] (warn_slowpath_fmt) from [<c07219cc>] (drm_atomic_helper_wait_for_vblanks+0x1bc/0x1d4)
[   62.863943] [<c07219cc>] (drm_atomic_helper_wait_for_vblanks) from [<c07231bc>] (drm_atomic_helper_commit_tail_rpm+0x48/0x58)
[   62.876578] [<c07231bc>] (drm_atomic_helper_commit_tail_rpm) from [<c0723040>] (commit_tail+0x40/0x6c)
[   62.886977] [<c0723040>] (commit_tail) from [<c0723168>] (drm_atomic_helper_commit+0xf4/0x100)
[   62.896601] [<c0723168>] (drm_atomic_helper_commit) from [<c073c720>] (drm_atomic_connector_commit_dpms+0xdc/0xe8)
[   62.908167] [<c073c720>] (drm_atomic_connector_commit_dpms) from [<c0741310>] (drm_mode_obj_set_property_ioctl+0xc8/0x210)
[   62.920510] [<c0741310>] (drm_mode_obj_set_property_ioctl) from [<c074014c>] (drm_mode_connector_property_set_ioctl+0x30/0x3c)
[   62.933243] [<c074014c>] (drm_mode_connector_property_set_ioctl) from [<c072d034>] (drm_ioctl+0x2a8/0x328)
[   62.944033] [<c072d034>] (drm_ioctl) from [<c023bb48>] (vfs_ioctl+0x20/0x38)
[   62.951908] [<c023bb48>] (vfs_ioctl) from [<c023bce8>] (do_vfs_ioctl+0x84/0x7fc)
[   62.960171] [<c023bce8>] (do_vfs_ioctl) from [<c023c4b0>] (ksys_ioctl+0x50/0x6c)
[   62.968434] [<c023c4b0>] (ksys_ioctl) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
[   62.976986] Exception stack(0xed31bfa8 to 0xed31bff0)
[   62.982627] bfa0:                   00000000 befa2528 0000000a c01064ab befa2528 92c1b500
[   62.991763] bfc0: 00000000 befa2528 c01064ab 00000036 00000001 0157b2dc 0151c350 0151cc68
[   63.000899] bfe0: b6e08060 befa250c b6df1d23 b6bb0e06
[   63.006570] ---[ end trace f44c3e3ecff46760 ]---
[   73.190425] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:30:crtc-0] flip_done timed out
[   73.210876] rockchip-vop ff930000.vop: [drm:vop_crtc_atomic_flush] *ERROR* VOP vblank IRQ stuck for 10 ms
[   73.231643] rockchip-vop ff930000.vop: [drm:vop_crtc_atomic_flush] *ERROR* VOP vblank IRQ stuck for 10 ms
[   73.252597] rockchip-vop ff930000.vop: [drm:vop_crtc_atomic_flush] *ERROR* VOP vblank IRQ stuck for 10 ms
Miouyouyou commented 6 years ago

The full dmesg

dmesg.txt

JeffyCN commented 6 years ago

Hi Miouyouyou,

Thanks for your mail.

On 05/03/2018 04:26 AM, Miouyouyou wrote:

Okay, after applying the following patch from @JeffyCN on @mmind branch, I was able to add the appropriate clocks to the MMU drivers... Or so I thought. The system starts but the whole DRM system seems messed up.

However I reapplied all the DTS patches so I'll have to try with only the new one.

Anyway the current issue is that screen detection and use just takes forever and tends to throw errors like this :


[   41.502415] ------------[ cut here ]------------
[   41.507596] WARNING: CPU: 2 PID: 643 at drivers/gpu/drm/drm_atomic_helper.c:1351 drm_atomic_helper_wait_for_vblanks+0x1bc/0x1d4

this vblank hung looks like what we saw in: http://lists.infradead.org/pipermail/linux-rockchip/2018-April/020427.html

any chance my hack in that thread would help?

Hi Sandy,

any update about that irq patch?

[ 41.520509] [CRTC:30:crtc-0] vblank wait timed out [ 41.525894] Modules linked in: bnep mali_kbase r8723bs(C) rockchip_rga dw_hdmi_cec v4l2_mem2mem videobuf2_dma_sg rk_crypto [ 41.538295] CPU: 2 PID: 643 Comm: Xorg Tainted: G C 4.17.0-rc3-RockMyy-16Bits-Edition #1 [ 41.548790] Hardware name: Rockchip (Device Tree) [ 41.554051] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 41.562706] [] (show_stack) from [] (dump_stack+0x70/0x8c) [ 41.570778] [] (dump_stack) from [] (warn+0xd4/0xf0) [ 41.578459] [] (warn) from [] (warn_slowpath_fmt+0x34/0x44) [ 41.586822] [] (warn_slowpath_fmt) from [] (drm_atomic_helper_wait_for_vblanks+0x1bc/0x1d4) [ 41.598098] [] (drm_atomic_helper_wait_for_vblanks) from [] (drm_atomic_helper_commit_tail_rpm+0x48/0x58) [ 41.610731] [] (drm_atomic_helper_commit_tail_rpm) from [] (commit_tail+0x40/0x6c) [ 41.621131] [] (commit_tail) from [] (drm_atomic_helper_commit+0xf4/0x100) [ 41.630754] [] (drm_atomic_helper_commit) from [] (drm_atomic_helper_set_config+0x58/0x7c) [ 41.641932] [] (drm_atomic_helper_set_config) from [] (drm_mode_set_config_internal+0x3c/0xd0) [ 41.653692] [] (drm_mode_set_config_internal) from [] (drm_mode_setcrtc+0x3d0/0x464) [ 41.664482] [] (drm_mode_setcrtc) from [] (drm_ioctl+0x2a8/0x328) [ 41.673233] [] (drm_ioctl) from [] (vfs_ioctl+0x20/0x38) [ 41.681108] [] (vfs_ioctl) from [] (do_vfs_ioctl+0x84/0x7fc) [ 41.689371] [] (do_vfs_ioctl) from [] (ksys_ioctl+0x50/0x6c) [ 41.697634] [] (ksys_ioctl) from [] (ret_fast_syscall+0x0/0x54) [ 41.706185] Exception stack(0xed31bfa8 to 0xed31bff0) [ 41.711825] bfa0: b6f7bce8 befa24d8 0000000a c06864a2 befa24d8 00000001 [ 41.720961] bfc0: b6f7bce8 befa24d8 c06864a2 00000036 0000000a 00000000 0000002f 0000001e [ 41.730097] bfe0: b6e08060 befa24bc b6df1d23 b6bb0e06 [ 41.735773] ---[ end trace f44c3e3ecff4675e ]--- [ 52.198435] [drm:drm_atomic_helper_wait_for_dependencies] ERROR [CRTC:30:crtc-0] flip_done timed out [ 62.438424] [drm:drm_atomic_helper_wait_for_dependencies] ERROR [CONNECTOR:39:HDMI-A-1] flip_done timed out [ 62.459535] rockchip-vop ff930000.vop: [drm:vop_crtc_atomic_flush] ERROR VOP vblank IRQ stuck for 10 ms [ 62.470235] ------------[ cut here ]------------ [ 62.475383] WARNING: CPU: 2 PID: 643 at drivers/gpu/drm/rockchip/rockchip_drm_vop.c:1004 vop_crtc_atomic_flush+0x194/0x1f0 [ 62.487721] Modules linked in: bnep mali_kbase r8723bs(C) rockchip_rga dw_hdmi_cec v4l2_mem2mem videobuf2_dma_sg rk_crypto [ 62.500079] CPU: 2 PID: 643 Comm: Xorg Tainted: G WC 4.17.0-rc3-RockMyy-16Bits-Edition #1 [ 62.510573] Hardware name: Rockchip (Device Tree) [ 62.515832] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 62.524477] [] (show_stack) from [] (dump_stack+0x70/0x8c) [ 62.532549] [] (dump_stack) from [] (warn+0xd4/0xf0) [ 62.540231] [] (warn) from [] (warn_slowpath_null+0x38/0x44) [ 62.548689] [] (warn_slowpath_null) from [] (vop_crtc_atomic_flush+0x194/0x1f0) [ 62.558802] [] (vop_crtc_atomic_flush) from [] (drm_atomic_helper_commit_planes+0x1d4/0x228) [ 62.570176] [] (drm_atomic_helper_commit_planes) from [] (drm_atomic_helper_commit_tail_rpm+0x34/0x58) [ 62.582518] [] (drm_atomic_helper_commit_tail_rpm) from [] (commit_tail+0x40/0x6c) [ 62.592919] [] (commit_tail) from [] (drm_atomic_helper_commit+0xf4/0x100) [ 62.602542] [] (drm_atomic_helper_commit) from [] (drm_atomic_connector_commit_dpms+0xdc/0xe8) [ 62.614109] [] (drm_atomic_connector_commit_dpms) from [] (drm_mode_obj_set_property_ioctl+0xc8/0x210) [ 62.626452] [] (drm_mode_obj_set_property_ioctl) from [] (drm_mode_connector_property_set_ioctl+0x30/0x3c) [ 62.639184] [] (drm_mode_connector_property_set_ioctl) from [] (drm_ioctl+0x2a8/0x328) [ 62.649974] [] (drm_ioctl) from [] (vfs_ioctl+0x20/0x38) [ 62.657850] [] (vfs_ioctl) from [] (do_vfs_ioctl+0x84/0x7fc) [ 62.666114] [] (do_vfs_ioctl) from [] (ksys_ioctl+0x50/0x6c) [ 62.674377] [] (ksys_ioctl) from [] (ret_fast_syscall+0x0/0x54) [ 62.682928] Exception stack(0xed31bfa8 to 0xed31bff0) [ 62.688568] bfa0: 00000000 befa2528 0000000a c01064ab befa2528 92c1b500 [ 62.697696] bfc0: 00000000 befa2528 c01064ab 00000036 00000001 0157b2dc 0151c350 0151cc68 [ 62.706832] bfe0: b6e08060 befa250c b6df1d23 b6bb0e06 [ 62.712462] ---[ end trace f44c3e3ecff4675f ]--- [ 62.768411] ------------[ cut here ]------------ [ 62.773582] WARNING: CPU: 2 PID: 643 at drivers/gpu/drm/drm_atomic_helper.c:1351 drm_atomic_helper_wait_for_vblanks+0x1bc/0x1d4 [ 62.786420] [CRTC:30:crtc-0] vblank wait timed out [ 62.791780] Modules linked in: bnep mali_kbase r8723bs(C) rockchip_rga dw_hdmi_cec v4l2_mem2mem videobuf2_dma_sg rk_crypto [ 62.804146] CPU: 2 PID: 643 Comm: Xorg Tainted: G WC 4.17.0-rc3-RockMyy-16Bits-Edition #1 [ 62.814642] Hardware name: Rockchip (Device Tree) [ 62.819900] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 62.828552] [] (show_stack) from [] (dump_stack+0x70/0x8c) [ 62.836622] [] (dump_stack) from [] (warn+0xd4/0xf0) [ 62.844304] [] (warn) from [] (warn_slowpath_fmt+0x34/0x44) [ 62.852668] [] (warn_slowpath_fmt) from [] (drm_atomic_helper_wait_for_vblanks+0x1bc/0x1d4) [ 62.863943] [] (drm_atomic_helper_wait_for_vblanks) from [] (drm_atomic_helper_commit_tail_rpm+0x48/0x58) [ 62.876578] [] (drm_atomic_helper_commit_tail_rpm) from [] (commit_tail+0x40/0x6c) [ 62.886977] [] (commit_tail) from [] (drm_atomic_helper_commit+0xf4/0x100) [ 62.896601] [] (drm_atomic_helper_commit) from [] (drm_atomic_connector_commit_dpms+0xdc/0xe8) [ 62.908167] [] (drm_atomic_connector_commit_dpms) from [] (drm_mode_obj_set_property_ioctl+0xc8/0x210) [ 62.920510] [] (drm_mode_obj_set_property_ioctl) from [] (drm_mode_connector_property_set_ioctl+0x30/0x3c) [ 62.933243] [] (drm_mode_connector_property_set_ioctl) from [] (drm_ioctl+0x2a8/0x328) [ 62.944033] [] (drm_ioctl) from [] (vfs_ioctl+0x20/0x38) [ 62.951908] [] (vfs_ioctl) from [] (do_vfs_ioctl+0x84/0x7fc) [ 62.960171] [] (do_vfs_ioctl) from [] (ksys_ioctl+0x50/0x6c) [ 62.968434] [] (ksys_ioctl) from [] (ret_fast_syscall+0x0/0x54) [ 62.976986] Exception stack(0xed31bfa8 to 0xed31bff0) [ 62.982627] bfa0: 00000000 befa2528 0000000a c01064ab befa2528 92c1b500 [ 62.991763] bfc0: 00000000 befa2528 c01064ab 00000036 00000001 0157b2dc 0151c350 0151cc68 [ 63.000899] bfe0: b6e08060 befa250c b6df1d23 b6bb0e06 [ 63.006570] ---[ end trace f44c3e3ecff46760 ]--- [ 73.190425] [drm:drm_atomic_helper_wait_for_dependencies] ERROR [CRTC:30:crtc-0] flip_done timed out [ 73.210876] rockchip-vop ff930000.vop: [drm:vop_crtc_atomic_flush] ERROR VOP vblank IRQ stuck for 10 ms [ 73.231643] rockchip-vop ff930000.vop: [drm:vop_crtc_atomic_flush] ERROR VOP vblank IRQ stuck for 10 ms [ 73.252597] rockchip-vop ff930000.vop: [drm:vop_crtc_atomic_flush] ERROR VOP vblank IRQ stuck for 10 ms

Miouyouyou commented 6 years ago

Alright, this fixed the issue !

I'll push this new patch adaptation, along with the rest tonight.

Thanks again !

Miouyouyou commented 6 years ago

The adapted patch is here : https://github.com/Miouyouyou/RockMyy/blob/master/patches/kernel/v4.17/0007-drivers-drm-rockchip-Enable-IRQ-on-unbind.patch

JeffyCN commented 6 years ago

Hi Miouyouyou, Please use the attachment patch and test.

From: JeffyChen Date: 2018-05-03 11:36 To: Miouyouyou/RockMyy; Miouyouyou/RockMyy CC: Mention; Huang Jiachai; Heiko Stuebner Subject: Re: [Miouyouyou/RockMyy] No display on kernel 4.17 (#4) Hi Miouyouyou,

Thanks for your mail.

On 05/03/2018 04:26 AM, Miouyouyou wrote:

Okay, after applying the following patch from @JeffyCN on @mmind branch, I was able to add the appropriate clocks to the MMU drivers... Or so I thought. The system starts but the whole DRM system seems messed up.

However I reapplied all the DTS patches so I'll have to try with only the new one.

Anyway the current issue is that screen detection and use just takes forever and tends to throw errors like this :


[   41.502415] ------------[ cut here ]------------
[   41.507596] WARNING: CPU: 2 PID: 643 at drivers/gpu/drm/drm_atomic_helper.c:1351 drm_atomic_helper_wait_for_vblanks+0x1bc/0x1d4

this vblank hung looks like what we saw in: http://lists.infradead.org/pipermail/linux-rockchip/2018-April/020427.html

any chance my hack in that thread would help?

Hi Sandy,

any update about that irq patch?

[ 41.520509] [CRTC:30:crtc-0] vblank wait timed out [ 41.525894] Modules linked in: bnep mali_kbase r8723bs(C) rockchip_rga dw_hdmi_cec v4l2_mem2mem videobuf2_dma_sg rk_crypto [ 41.538295] CPU: 2 PID: 643 Comm: Xorg Tainted: G C 4.17.0-rc3-RockMyy-16Bits-Edition #1 [ 41.548790] Hardware name: Rockchip (Device Tree) [ 41.554051] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 41.562706] [] (show_stack) from [] (dump_stack+0x70/0x8c) [ 41.570778] [] (dump_stack) from [] (warn+0xd4/0xf0) [ 41.578459] [] (warn) from [] (warn_slowpath_fmt+0x34/0x44) [ 41.586822] [] (warn_slowpath_fmt) from [] (drm_atomic_helper_wait_for_vblanks+0x1bc/0x1d4) [ 41.598098] [] (drm_atomic_helper_wait_for_vblanks) from [] (drm_atomic_helper_commit_tail_rpm+0x48/0x58) [ 41.610731] [] (drm_atomic_helper_commit_tail_rpm) from [] (commit_tail+0x40/0x6c) [ 41.621131] [] (commit_tail) from [] (drm_atomic_helper_commit+0xf4/0x100) [ 41.630754] [] (drm_atomic_helper_commit) from [] (drm_atomic_helper_set_config+0x58/0x7c) [ 41.641932] [] (drm_atomic_helper_set_config) from [] (drm_mode_set_config_internal+0x3c/0xd0) [ 41.653692] [] (drm_mode_set_config_internal) from [] (drm_mode_setcrtc+0x3d0/0x464) [ 41.664482] [] (drm_mode_setcrtc) from [] (drm_ioctl+0x2a8/0x328) [ 41.673233] [] (drm_ioctl) from [] (vfs_ioctl+0x20/0x38) [ 41.681108] [] (vfs_ioctl) from [] (do_vfs_ioctl+0x84/0x7fc) [ 41.689371] [] (do_vfs_ioctl) from [] (ksys_ioctl+0x50/0x6c) [ 41.697634] [] (ksys_ioctl) from [] (ret_fast_syscall+0x0/0x54) [ 41.706185] Exception stack(0xed31bfa8 to 0xed31bff0) [ 41.711825] bfa0: b6f7bce8 befa24d8 0000000a c06864a2 befa24d8 00000001 [ 41.720961] bfc0: b6f7bce8 befa24d8 c06864a2 00000036 0000000a 00000000 0000002f 0000001e [ 41.730097] bfe0: b6e08060 befa24bc b6df1d23 b6bb0e06 [ 41.735773] ---[ end trace f44c3e3ecff4675e ]--- [ 52.198435] [drm:drm_atomic_helper_wait_for_dependencies] ERROR [CRTC:30:crtc-0] flip_done timed out [ 62.438424] [drm:drm_atomic_helper_wait_for_dependencies] ERROR [CONNECTOR:39:HDMI-A-1] flip_done timed out [ 62.459535] rockchip-vop ff930000.vop: [drm:vop_crtc_atomic_flush] ERROR VOP vblank IRQ stuck for 10 ms [ 62.470235] ------------[ cut here ]------------ [ 62.475383] WARNING: CPU: 2 PID: 643 at drivers/gpu/drm/rockchip/rockchip_drm_vop.c:1004 vop_crtc_atomic_flush+0x194/0x1f0 [ 62.487721] Modules linked in: bnep mali_kbase r8723bs(C) rockchip_rga dw_hdmi_cec v4l2_mem2mem videobuf2_dma_sg rk_crypto [ 62.500079] CPU: 2 PID: 643 Comm: Xorg Tainted: G WC 4.17.0-rc3-RockMyy-16Bits-Edition #1 [ 62.510573] Hardware name: Rockchip (Device Tree) [ 62.515832] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 62.524477] [] (show_stack) from [] (dump_stack+0x70/0x8c) [ 62.532549] [] (dump_stack) from [] (warn+0xd4/0xf0) [ 62.540231] [] (warn) from [] (warn_slowpath_null+0x38/0x44) [ 62.548689] [] (warn_slowpath_null) from [] (vop_crtc_atomic_flush+0x194/0x1f0) [ 62.558802] [] (vop_crtc_atomic_flush) from [] (drm_atomic_helper_commit_planes+0x1d4/0x228) [ 62.570176] [] (drm_atomic_helper_commit_planes) from [] (drm_atomic_helper_commit_tail_rpm+0x34/0x58) [ 62.582518] [] (drm_atomic_helper_commit_tail_rpm) from [] (commit_tail+0x40/0x6c) [ 62.592919] [] (commit_tail) from [] (drm_atomic_helper_commit+0xf4/0x100) [ 62.602542] [] (drm_atomic_helper_commit) from [] (drm_atomic_connector_commit_dpms+0xdc/0xe8) [ 62.614109] [] (drm_atomic_connector_commit_dpms) from [] (drm_mode_obj_set_property_ioctl+0xc8/0x210) [ 62.626452] [] (drm_mode_obj_set_property_ioctl) from [] (drm_mode_connector_property_set_ioctl+0x30/0x3c) [ 62.639184] [] (drm_mode_connector_property_set_ioctl) from [] (drm_ioctl+0x2a8/0x328) [ 62.649974] [] (drm_ioctl) from [] (vfs_ioctl+0x20/0x38) [ 62.657850] [] (vfs_ioctl) from [] (do_vfs_ioctl+0x84/0x7fc) [ 62.666114] [] (do_vfs_ioctl) from [] (ksys_ioctl+0x50/0x6c) [ 62.674377] [] (ksys_ioctl) from [] (ret_fast_syscall+0x0/0x54) [ 62.682928] Exception stack(0xed31bfa8 to 0xed31bff0) [ 62.688568] bfa0: 00000000 befa2528 0000000a c01064ab befa2528 92c1b500 [ 62.697696] bfc0: 00000000 befa2528 c01064ab 00000036 00000001 0157b2dc 0151c350 0151cc68 [ 62.706832] bfe0: b6e08060 befa250c b6df1d23 b6bb0e06 [ 62.712462] ---[ end trace f44c3e3ecff4675f ]--- [ 62.768411] ------------[ cut here ]------------ [ 62.773582] WARNING: CPU: 2 PID: 643 at drivers/gpu/drm/drm_atomic_helper.c:1351 drm_atomic_helper_wait_for_vblanks+0x1bc/0x1d4 [ 62.786420] [CRTC:30:crtc-0] vblank wait timed out [ 62.791780] Modules linked in: bnep mali_kbase r8723bs(C) rockchip_rga dw_hdmi_cec v4l2_mem2mem videobuf2_dma_sg rk_crypto [ 62.804146] CPU: 2 PID: 643 Comm: Xorg Tainted: G WC 4.17.0-rc3-RockMyy-16Bits-Edition #1 [ 62.814642] Hardware name: Rockchip (Device Tree) [ 62.819900] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 62.828552] [] (show_stack) from [] (dump_stack+0x70/0x8c) [ 62.836622] [] (dump_stack) from [] (warn+0xd4/0xf0) [ 62.844304] [] (warn) from [] (warn_slowpath_fmt+0x34/0x44) [ 62.852668] [] (warn_slowpath_fmt) from [] (drm_atomic_helper_wait_for_vblanks+0x1bc/0x1d4) [ 62.863943] [] (drm_atomic_helper_wait_for_vblanks) from [] (drm_atomic_helper_commit_tail_rpm+0x48/0x58) [ 62.876578] [] (drm_atomic_helper_commit_tail_rpm) from [] (commit_tail+0x40/0x6c) [ 62.886977] [] (commit_tail) from [] (drm_atomic_helper_commit+0xf4/0x100) [ 62.896601] [] (drm_atomic_helper_commit) from [] (drm_atomic_connector_commit_dpms+0xdc/0xe8) [ 62.908167] [] (drm_atomic_connector_commit_dpms) from [] (drm_mode_obj_set_property_ioctl+0xc8/0x210) [ 62.920510] [] (drm_mode_obj_set_property_ioctl) from [] (drm_mode_connector_property_set_ioctl+0x30/0x3c) [ 62.933243] [] (drm_mode_connector_property_set_ioctl) from [] (drm_ioctl+0x2a8/0x328) [ 62.944033] [] (drm_ioctl) from [] (vfs_ioctl+0x20/0x38) [ 62.951908] [] (vfs_ioctl) from [] (do_vfs_ioctl+0x84/0x7fc) [ 62.960171] [] (do_vfs_ioctl) from [] (ksys_ioctl+0x50/0x6c) [ 62.968434] [] (ksys_ioctl) from [] (ret_fast_syscall+0x0/0x54) [ 62.976986] Exception stack(0xed31bfa8 to 0xed31bff0) [ 62.982627] bfa0: 00000000 befa2528 0000000a c01064ab befa2528 92c1b500 [ 62.991763] bfc0: 00000000 befa2528 c01064ab 00000036 00000001 0157b2dc 0151c350 0151cc68 [ 63.000899] bfe0: b6e08060 befa250c b6df1d23 b6bb0e06 [ 63.006570] ---[ end trace f44c3e3ecff46760 ]--- [ 73.190425] [drm:drm_atomic_helper_wait_for_dependencies] ERROR [CRTC:30:crtc-0] flip_done timed out [ 73.210876] rockchip-vop ff930000.vop: [drm:vop_crtc_atomic_flush] ERROR VOP vblank IRQ stuck for 10 ms [ 73.231643] rockchip-vop ff930000.vop: [drm:vop_crtc_atomic_flush] ERROR VOP vblank IRQ stuck for 10 ms [ 73.252597] rockchip-vop ff930000.vop: [drm:vop_crtc_atomic_flush] ERROR VOP vblank IRQ stuck for 10 ms

JyuHo commented 6 years ago

Hi Myy, I wanted to know if you think it is possible to extract the vulkan drivers that are present in Firefly and integrate them into the rockchip drivers for TB? Oh and by the way you do a great job for MiQi and TB

Miouyouyou commented 6 years ago

Okay, I'm receiving the notifications by mail but when I'm answering them, they're not displayed here...

Anyway, you mean the Firefly drivers provided by ARM ? ( https://developer.arm.com/products/software/mali-drivers/user-space )

There's indeed Vulkan symbols in the FBDEV driver ( https://community.arm.com/graphics/f/discussions/8470/mali-and-vulkan-on-linux-fbdev ) and there's seems to be some way of using these drivers with the Direct Rendering Manager. But I never tried using them at the moment. I'll give it a try this week-end, if I understand how to create a simple Vulkan example.

I think ARM has some Vulkan demos but I wonder if they can use the DRM subsystem...

JyuHo commented 6 years ago

In fact I will want to move the extract die inject them in the wayland drivers present on the git of rockchip. I am currently doing retropie on TB with 3 other people. So if we could use vulkan to improve performance on compatible emulators it would be great. The base is made from ambian stretch. And yes I speak well of the drivers made by arm. Sorry for my English, I'm French and do not practice much language

Le sam. 12 mai 2018 à 15:25, Miouyouyou notifications@github.com a écrit :

Okay, I'm receiving the notifications by mail but when I'm answering them, they're not displayed here...

Anyway, you mean the Firefly drivers provided by ARM ? ( https://developer.arm.com/products/software/mali-drivers/user-space )

There's indeed Vulkan symbols in the FBDEV driver ( https://community.arm.com/graphics/f/discussions/8470/mali-and-vulkan-on-linux-fbdev ) and there's seems to be some way of using these drivers with the Direct Rendering Manager. But I never tried using them at the moment. I'll give it a try this week-end, if I understand how to create a simple Vulkan example.

I think ARM has some Vulkan demos but I wonder if they can use the DRM subsystem...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Miouyouyou/RockMyy/issues/4#issuecomment-388555067, or mute the thread https://github.com/notifications/unsubscribe-auth/Aj26xA5i_6KWt9o9JW85dEjrFEttJ509ks5txuK5gaJpZM4TwBDJ .

Miouyouyou commented 6 years ago

Ok, on va le faire en français alors.

Extraire certaines fonctions de la bibliothèque pour l'incorporer dans une autre, c'est beaucoup trop complexe. Je ne connais pas d'outils permettant d'effectuer ça correctement et simplement. La bibliothèque a beau être "dynamique", les appels internes à la bibliothèque se font par des références statiques (Genre adresse_de_base+offset). S'amuser à changer les offset statiques à l'éditeur hexa, c'est gore. Sans compter que cela sera certainement vu comme de l'ingénierie inverse.

Donc le mieux reste d'essayer d'utiliser les pilotes tels quels.

Si ça fonctionne, il est toujours possible d'aller quémander une bibliothèque mise à jour sur https://arm.community.com . Ils feront la gueule et répondront que c'est au constructeur du chip (qui doit les payer pour obtenir une licence d'utilisation de leurs pilotes) de fournir les pilotes optimisés pour leurs architecture. Cela étant, ils ont tendance ensuite à fournir un pilote dans les mois qui suivent, en cachette. Bref, ils sont ronchons mais ils aident un minimum quand on insiste un peu.

En ce qui concerne Rockchip, je doute qu'ils aient une licence Mali leur permettant de fournir Vulkan. Ça me parait être aussi simple que ça.

Maintenant, je ne connais pas le niveau de performances et de finition du pilote Vulkan pour Firefly. Vous aurez peut être de meilleurs performances en exploitant au maximum GLES 3.1. Cela dit, j'essayerais de tester, si je trouve un exemple... "simple" pour Vulkan.

JyuHo commented 6 years ago

Oui c'est bien plus facile en français. Effectivement demander à ARM directement semble pas mal comme solution. Surtout que Rockchip a déjà des pilotes en place (grave à la bourre par rapport à ce qu'il y a au niveau kernel). Et clairement passer par MESA est juste pas possible car ça n'exploite pas le gpu comme il le faudrait. En tout cas un grand merci à toi pour les pistes que tu m'as donné. J'aurais une dernière chose mais rien à voir avec le Gpu 😀. Tu bosses pas mal sur le bluetooth en ce moment de ce que j'ai pu lire. Vous arrivez à avancer avec la team Armbian ? Ah et si t'es intéressé par des emulateurs fonctionnel sous TB avec retropie on a pas mal avancé sur la chose. Ppsspp, reicast etc. On a aussi un des dev de lakka dans l'équipe. Voilà voilà et encore merci

Le sam. 12 mai 2018 à 19:31, Miouyouyou notifications@github.com a écrit :

Ok, on va le faire en français alors.

Extraire certaines fonctions de la bibliothèque pour l'incorporer dans une autre, c'est beaucoup trop complexe. Je ne ocnnais pas d'outils permettant d'effectuer ça correctement et simplement. La bibliothèque a beau être "dynamique", les appels internes à la bibliothèque se font par des références statiques (Genre adresse_de_base+offset). S'amuser à changer les offset statiques à l'éditeur hexa, c'est gore. Sans compter que cela sera certainement vu comme de l'ingénierie inverse.

Donc le mieux reste d'essayer d'utiliser les pilotes tels quels.

Si ça fonctionne, il est toujours possible d'aller quémander une bibliothèque mise à jour sur https://arm.community.com . Ils feront la gueule et répondront que c'est au constructeur du chip (qui doit les payer pour obtenir une licence d'utilisation de leurs pilotes) de fournir les pilotes optimisés pour leurs architecture. Cela étant, ils ont tendance ensuite à fournir un pilote dans les mois qui suivent, en cachette. Bref, ils sont ronchons mais ils aident un minimum quand on insiste un peu.

En ce qui concerne Rockchip, je doute qu'ils aient une licence Mali leur permettant de fournir Vulkan. Ça me parait être aussi simple que ça.

Maintenant, je ne connais pas le niveau de performances et de finition du pilote Vulkan pour Firefly. Vous aurez peut être de meilleurs performances en exploitant au maximum GLES 3.1. Cela dit, j'essayerais de tester, si je trouve un exemple... "simple" pour Vulkan.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Miouyouyou/RockMyy/issues/4#issuecomment-388570644, or mute the thread https://github.com/notifications/unsubscribe-auth/Aj26xJ5iMBFUZwgUXrX2G-c-oHA1oKjLks5txxxdgaJpZM4TwBDJ .

Miouyouyou commented 6 years ago

Pour le Bluetooth, je n'arrive toujours pas à saisir réellement le fonctionnement du pilote, étant donné la façon dont c'est segmenté (entre le périphérique, les protocoles de communication, les programmes tiers nécessaires pour activer le périphérique, ...). Il semblerait que le pilote de Rockchip ne fait que jouer avec certains GPIO, mais essayer d'exporter ces GPIO via des fonctions d'export fournis par les pilotes de GPIO me renvoie très souvent "EBUSY" (occupé). Ensuite @TonyMac32 semble avoir réussi à communiquer avec le Bluetooth une fois les GPIO activés correctement, c'est qui est quand même intéressant.

Le truc c'est qu'il faut soit le programme hcicontrol de Larry W. Finger, soit celui inclut dans les dernières versions de BlueZ pour réussir à communiquer avec le chip Bluetooth dans le protocol "qu'il comprend" et lui envoyer son firmware, afin qu'il se réveille et soit utilisable.

Bref, y'a de bonnes pistes mais c'est pas encore ça.

JyuHo commented 6 years ago

Oui c'est un sacré bazar le gpio en ce moment. Même pour la libc https://github.com/TinkerBoard/gpio_lib_c/commit/206993cde8ced4405146ab552dfab3b78163a340

Il y a pas mal de changement à priori. Du moins de nouvelles fonctions se débloquent. Je ne sais pas si ça peut te donner des pistes.

Le sam. 12 mai 2018 à 21:00, Miouyouyou notifications@github.com a écrit :

Pour le Bluetooth, je n'arrive toujours pas à saisir réellement le fonctionnement du pilote, étant donné la façon dont c'est segmenté (entre le périphérique, les protocoles de communication, les programmes tiers nécessaires pour activer le périphérique, ...). Il semblerait que le pilote de Rockchip ne fait que jouer avec certains GPIO, mais essayer d'exporter ces GPIO via des fonctions d'export fournis par les pilotes de GPIO me renvoie très souvent "EBUSY" (occupé). Ensuite @Tonymac32 https://github.com/Tonymac32 semble avoir réussi à communiquer avec le Bluetooth une fois les GPIO activés correctement, c'est qui est quand même intéressant.

Le truc c'est qu'il faut soit le programme hcicontrol de Larry W. Finger ou inclut dans les dernières versions de BlueZ pour réussir à communiquer avec le chip Bluetooth dans le protocol "qu'il comprend" et lui envoyer son firmware, afin qu'il se réveille et soit utilisable.

Bref, y'a de bonnes pistes mais c'est pas encore ça.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Miouyouyou/RockMyy/issues/4#issuecomment-388575949, or mute the thread https://github.com/notifications/unsubscribe-auth/Aj26xB94IF2xJO7vKt0OSqSmh-PYPADpks5txzFcgaJpZM4TwBDJ .

Miouyouyou commented 6 years ago

Ok, je pense avoir réussi à le faire fonctionner. Voir : https://forum.armbian.com/topic/6668-asus-tinker-board-bluetooth/?tab=comments#comment-54173

En attendant, je vais faire une release sans les entrées du Bluetooth dans le DTS, puisque au mieux, elles servent à rien, au pire, elles rendent l'utilisation du Bluetooth impossible.

JyuHo commented 6 years ago

Pour quelqu'un qui n'utilise pas le bluetooth tu maîtrises plutôt bien ça mise en fonctionnement. Je sais pas si le lien que je t'ai envoyé à pu aider mais tu as avancé super vite sur le coup. Rien à voir avec le bluetooth mais avec ARM pour le coup. Tu pense que je devrais les solliciter en allant où sur leur site ? (du mal à discerner le bon endroit pour poster une demande)

Le sam. 12 mai 2018 à 22:56, Miouyouyou notifications@github.com a écrit :

Ok, je pense avoir réussi à le faire fonctionner. Voir : https://forum.armbian.com/topic/6668-asus-tinker-board-bluetooth/?tab=comments#comment-54173

En attendant, je vais faire une release sans les entrées du Bluetooth dans le DTS, puisque au mieux, elles servent à rien, au pire, elles rendent l'utilisation du Bluetooth impossible.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Miouyouyou/RockMyy/issues/4#issuecomment-388582329, or mute the thread https://github.com/notifications/unsubscribe-auth/Aj26xEgwZSKS6M4kt0nRlEeJv0xf7-M7ks5tx0xrgaJpZM4TwBDJ .

Miouyouyou commented 6 years ago

J'ai suivi les conseils de @TonyMac32 et j'ai viré l'entrée wireless-bluetooth dans le DTS, puis j'ai compris la différence entre "echo 139> export" et "export 139 > export". Dans le premier cas le kernel ignore la requête d'exportation du GPIO. Ensuite, après avoir testé plusieurs combinaisons de 1 et 0 sur les GPIO de Reset, Wake et Wake_Host_IRQ, j'ai découvert comment reset le chip Bluetooth mais ça fonctionnait toujours pas... hciattach_rtk restait bloqué au 99%. Je me suis dis qu'il fallait peut être jouer avec le GPIO du RTS de la sortie UART0 (/dev/ttyS0). Et... ça a fonctionné !

À noter que les GPIO du Bluetooth sont principalement internes. Certaines PINS sont externes, mais d'autres nécessitent de lire le Datasheet ou les entrées DTS, lorsqu'elles sont présentes, pour les exporter et jouer avec (matériellement, elles sont rattachées aux boules de soudure du CPU, donc pas moyen de les titiller).

Concernant les requêtes pour des pilotes, le mieux reste la section "Graphics & Multimedia" du site. En sachant que tu peux être sur que la première réponse sera très ronchonne. Dans le pire des cas, je ferais une requête dans la semaine.

JyuHo commented 6 years ago

Oui pour les GPIO du bluetooth elle ne sont pas accessible comme les 'PIN'. pour l'UART0 effectivement il est rattaché au ttyS0 sur la TB et heureusement qu'il ne s'amuse pas à le bouger. M'enfin le script de lwfinger aller chercher le bon tout seul ce qui facilite le portage entre les SBC du même chip. Du coup si tout ce passe bien et que @Tonymac32 https://github.com/Tonymac32 arrive à intègrer tout ça, on peut espérer un support dans les prochaines release du mainline Armbian?

Pour ARM, j'ai fait suite à un post sur lequel tu étais déjà intervenu pour le support de Vulkan. Donc avec de la chance tu seras peut-être alerter de ce qu'il va se dire. Dans tout les cas je te remet le lien si tu veux jeter un oeil dessus

https://community.arm.com/graphics/f/discussions/7281/are-the-vulkan-drivers-compatible-with-mali-t764-gpu/22166#22166

De ton côté tu n'as jamais chercher à obtenir des drivers avec le support de Vulkan? Et clairement je ne suis pas contre un appui de ta part pour réussir à obtenir des pilotes correct avec Vulkan.

Si tu es interressé par certain 'truc' qui tourne autour des émulateurs fait le moi savoir. Le dev de Lakka m'aime bien et me refile pas mal de sources si besoin ;)

Le 12 mai 2018 à 23:22, Miouyouyou notifications@github.com a écrit :

J'ai suivi les conseils de @Tonymac32 https://github.com/Tonymac32 et j'ai viré l'entrée wireless-bluetooth dans le DTS, puis j'ai compris la différence entre "echo 139> export" et "export 139 > export". Dans le premier cas le kernel ignore la requête d'exportation du GPIO. Ensuite, après avoir testé plusieurs combinaisons de 1 et 0 sur les GPIO de Reset, Wake et Wake_Host_IRQ, j'ai découvert comment reset le chip Bluetooth mais ça fonctionnait toujours pas... hciattach_rtk restait bloqué au 99%. Je me suis dis qu'il fallait peut être jouer avec le GPIO du RTS de la sortie UART0 (/dev/ttyS0). Et... ça a fonctionné !

À noter que les GPIO du Bluetooth sont principalement internes. Certaines PINS sont externes, mais d'autres nécessitent de lire le Datasheet http://rockchip.fr/RK3288%20datasheet%20V1.0.pdf ou les entrées DTS https://github.com/rockchip-linux/kernel/blob/release-4.4/arch/arm/boot/dts/rk3288-miniarm.dts#L55, lorsqu'elles sont présentes, pour les exporter et jouer avec (matériellement, elles sont rattachées aux boules de soudure du CPU, donc pas moyen de les titiller).

Concernant les requêtes pour des pilotes, le mieux reste la section "Graphics & Multimedia" du site. En sachant que tu peux être sur que la première réponse sera très ronchonne. Dans le pire des cas, je ferais une requête dans la semaine.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Miouyouyou/RockMyy/issues/4#issuecomment-388583888, or mute the thread https://github.com/notifications/unsubscribe-auth/Aj26xOiVopK6FWgAQPyOXjXQti3sduS7ks5tx1KkgaJpZM4TwBDJ .

Miouyouyou commented 6 years ago

Oui, si tout se passe bien, cela pourrait bien être prise en charge par défaut sous Armbian.

Pour ARM, je ferais une nouvelle requête, une fois que j'aurais réussi à faire fonctionner un test basique, en utilisant les pilotes fbdev avec un buffer généré via GBM... si possible !

Le truc c'est que dans le contexte actuel, avec les pilotes fbdev (et avec toute transposition), il faut se taper un code de ce genre :

    extern VkBool32 ModeMatchesMyCriteria(const VkDisplayModePropertiesKHR *m);
    extern VkInstance instance;
    extern VkPhysicalDevice physDevice;
    extern VkSurfaceKHR surface;

    uint32_t displayCount, planeCount, i, j, k;
    VkDisplayPropertiesKHR* pDisplayProps;
    VkDisplayPlanePropertiesKHR* pPlaneProps;
    VkDisplayModeKHR myMode = VK_NULL_HANDLE;
    VkDisplayKHR myDisplay = VK_NULL_HANDLE;
    uint32_t bestPlane = UINT32_MAX;
    VkDisplayPlaneAlphaFlagBitsKHR alphaMode = 0;
    PFN_vkGetPhysicalDeviceDisplayPropertiesKHR pfnGetPhysicalDeviceDisplayPropertiesKHR;
    PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR pfnGetPhysicalDeviceDisplayPlanePropertiesKHR;
    PFN_vkGetDisplayModePropertiesKHR pfnGetDisplayModePropertiesKHR;
    PFN_vkGetDisplayPlaneCapabilitiesKHR pfnGetDisplayPlaneCapabilitiesKHR;
    PFN_vkGetDisplayPlaneSupportedDisplaysKHR pfnGetDisplayPlaneSupportedDisplaysKHR;
    PFN_vkCreateDisplayPlaneSurfaceKHR pfnCreateDisplayPlaneSurfaceKHR;

    pfnGetPhysicalDeviceDisplayPropertiesKHR =
        (PFN_vkGetPhysicalDeviceDisplayPropertiesKHR)
        vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceDisplayPropertiesKHR");
    pfnGetPhysicalDeviceDisplayPlanePropertiesKHR =
        (PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR)
        vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceDisplayPlanePropertiesKHR");
    pfnGetDisplayModePropertiesKHR =
        (PFN_vkGetDisplayModePropertiesKHR)
        vkGetInstanceProcAddr(instance, "vkGetDisplayModePropertiesKHR");
    pfnGetDisplayPlaneCapabilitiesKHR =
        (PFN_vkGetDisplayPlaneCapabilitiesKHR)
        vkGetInstanceProcAddr(instance, "vkGetDisplayPlaneCapabilitiesKHR");
    pfnGetDisplayPlaneSupportedDisplaysKHR =
        (PFN_vkGetDisplayPlaneSupportedDisplaysKHR)
        vkGetInstanceProcAddr(instance, "vkGetDisplayPlaneSupportedDisplaysKHR");
    pfnCreateDisplayPlaneSurfaceKHR =
        (PFN_vkCreateDisplayPlaneSurfaceKHR)
        vkGetInstanceProcAddr(instance, "vkCreateDisplayPlaneSurfaceKHR");

    // Get a list of displays on a physical device
    displayCount = 0;
    pfnGetPhysicalDeviceDisplayPropertiesKHR(physDevice, &displayCount, NULL);

    pDisplayProps = (VkDisplayPropertiesKHR*)malloc(sizeof(VkDisplayPropertiesKHR) * displayCount);
    pfnGetPhysicalDeviceDisplayPropertiesKHR(physDevice, &displayCount, pDisplayProps);

    // Get a list of display planes on a physical device
    planeCount = 0;
    pfnGetPhysicalDeviceDisplayPlanePropertiesKHR(physDevice, &planeCount, NULL);
    pPlaneProps = (VkDisplayPlanePropertiesKHR*)malloc(sizeof(VkDisplayPlanePropertiesKHR) * planeCount);
    pfnGetPhysicalDeviceDisplayPlanePropertiesKHR(physDevice, &planeCount, pPlaneProps);

    // Get the list of pModes each display supports
    for (i = 0; i < displayCount; ++i)
    {
        VkDisplayKHR display = pDisplayProps[i].display;
        VkDisplayModePropertiesKHR* pModes;
        uint32_t modeCount;

        vkGetDisplayModePropertiesKHR(physDevice, display, &modeCount, NULL);

        pModes = (VkDisplayModePropertiesKHR*)malloc(sizeof(VkDisplayModePropertiesKHR) * modeCount);
        vkGetDisplayModePropertiesKHR(physDevice, display, &modeCount, pModes);

        myMode = VK_NULL_HANDLE;
        for (j = 0; j < modeCount; ++j)
        {
            const VkDisplayModePropertiesKHR* mode = &pModes[i];

            if (ModeMatchesMyCriteria(mode))
            {
                myMode = mode->displayMode;
                break;
            }
        }

        free(pModes);

        // If there are no useable pModes found then check the next display.
        if (myMode == VK_NULL_HANDLE)
            continue;

        // Find a plane that matches these criteria, in order of preference:
        // -Is compatible with the chosen display + mode.
        // -Isn't currently bound to another display.
        // -Supports per-pixel alpha, if possible.
        for (j = 0; j < planeCount; ++j)
        {
            uint32_t supportedCount = 0;
            VkDisplayKHR* pSupportedDisplays;
            VkDisplayPlaneCapabilitiesKHR planeCaps;
            // See if the plane is compatible with the current display.
            pfnGetDisplayPlaneSupportedDisplaysKHR(physDevice, j, &supportedCount, NULL);

            // Plane doesn't support any displays.  This might happen on a card
            // that has a fixed mapping between planes and connectors when no
            // displays are currently attached to this plane's conector, for
            // example.
            if (supportedCount == 0)
                continue;

            pSupportedDisplays = (VkDisplayKHR*)malloc(sizeof(VkDisplayKHR) * supportedCount);
            pfnGetDisplayPlaneSupportedDisplaysKHR(physDevice, j, &supportedCount, pSupportedDisplays);

            for (k = 0; k < supportedCount; ++k)
                if (pSupportedDisplays[k] == display) {
                    // If no supported plane has yet been found, this is
                    // currently the best available plane.
                    if (bestPlane == UINT32_MAX)
                        bestPlane = j;
                    break;
                }

            // If the plane can't be used with the chosen display, keep looking.
            // Each display must have at least one compatible plane.
            if (k == supportedCount)
                continue;

            // If the plane passed the above test and is currently bound to the
            // desired display, or is not in use, it is the best plane found so
            // far.
            if ((pPlaneProps[j].currentDisplay == VK_NULL_HANDLE) &&
                (pPlaneProps[j].currentDisplay == display))
                bestPlane = j;
            else
                continue;

            pfnGetDisplayPlaneCapabilitiesKHR(physDevice, myMode, j, &planeCaps);

            // Prefer a plane that supports per-pixel alpha.
            if (planeCaps.supportedAlpha & VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR)
            {
                // This is the perfect plane for the given criteria.  Use it.
                bestPlane = j;
                alphaMode = VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR;
                break;
            }
        }
    }

    free(pDisplayProps);

    if (myDisplay == VK_NULL_HANDLE || myMode == VK_NULL_HANDLE) {
        // No suitable display + mode could be found.  Abort.
        abort();
    } else {
        // Success.  Create a VkSurfaceKHR object for this plane.
        const VkDisplaySurfaceCreateInfoKHR createInfo =
        {
            VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR,  // sType
            NULL,                                               // pNext
            0,                                                  // flags
            myMode,                                             // displayMode
            bestPlane,                                          // planeIndex
            pPlaneProps[bestPlane].currentStackIndex,           // planeStackIndex
            VK_SURFACE_TRANSFORM_IDENTITY_KHR,                  // transform
            1.0f,                                               // globalAlpha
            alphaMode,                                          // alphaMode
            ...
        }

        pfnCreateDisplayPlaneSurfaceKHR(instance, &createInfo, NULL, &surface);
    }

... Donc il me faut bien une bonne journée pour commencer à attaquer ça.

JyuHo commented 6 years ago

Oui je comprend. J'ai essayer juste pas curiosité de faire le VulkaLayerTest sous mesa-vulkan avec la TB. juste le fait de faire le build m'a pris la tête. mais en tout cas sous mesa-vulkan-driver avec la libvulkan1 et dev il n'y a que 2 test de failed sur 392. Les driver r14 de rockchip sont soit wayland ou fbdev exact?

Et pour les test prend ton temps. Ma femme rale en ce moment car je passe mes journée à faire du support pour résoudre les soucis de tout le monde sous Armbian-Retropie mdr.

2018-05-13 1:24 GMT+02:00 Miouyouyou notifications@github.com:

Oui, si tout se passe bien, cela pourrait bien être prise en charge par défaut sous Armbian.

Pour ARM, je ferais une nouvelle requête, une fois que j'aurais réussi à faire fonctionner un test basique, en utilisant les pilotes fbdev avec un buffer généré via GBM... si possible !

Le truc c'est que dans le contexte actuel, avec les pilotes fbdev (et avec toute transposition), il faut se taper un code de ce genre :

extern VkBool32 ModeMatchesMyCriteria(const VkDisplayModePropertiesKHR *m);
extern VkInstance instance;
extern VkPhysicalDevice physDevice;
extern VkSurfaceKHR surface;

uint32_t displayCount, planeCount, i, j, k;
VkDisplayPropertiesKHR* pDisplayProps;
VkDisplayPlanePropertiesKHR* pPlaneProps;
VkDisplayModeKHR myMode = VK_NULL_HANDLE;
VkDisplayKHR myDisplay = VK_NULL_HANDLE;
uint32_t bestPlane = UINT32_MAX;
VkDisplayPlaneAlphaFlagBitsKHR alphaMode = 0;
PFN_vkGetPhysicalDeviceDisplayPropertiesKHR pfnGetPhysicalDeviceDisplayPropertiesKHR;
PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR pfnGetPhysicalDeviceDisplayPlanePropertiesKHR;
PFN_vkGetDisplayModePropertiesKHR pfnGetDisplayModePropertiesKHR;
PFN_vkGetDisplayPlaneCapabilitiesKHR pfnGetDisplayPlaneCapabilitiesKHR;
PFN_vkGetDisplayPlaneSupportedDisplaysKHR pfnGetDisplayPlaneSupportedDisplaysKHR;
PFN_vkCreateDisplayPlaneSurfaceKHR pfnCreateDisplayPlaneSurfaceKHR;

pfnGetPhysicalDeviceDisplayPropertiesKHR =
    (PFN_vkGetPhysicalDeviceDisplayPropertiesKHR)
    vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceDisplayPropertiesKHR");
pfnGetPhysicalDeviceDisplayPlanePropertiesKHR =
    (PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR)
    vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceDisplayPlanePropertiesKHR");
pfnGetDisplayModePropertiesKHR =
    (PFN_vkGetDisplayModePropertiesKHR)
    vkGetInstanceProcAddr(instance, "vkGetDisplayModePropertiesKHR");
pfnGetDisplayPlaneCapabilitiesKHR =
    (PFN_vkGetDisplayPlaneCapabilitiesKHR)
    vkGetInstanceProcAddr(instance, "vkGetDisplayPlaneCapabilitiesKHR");
pfnGetDisplayPlaneSupportedDisplaysKHR =
    (PFN_vkGetDisplayPlaneSupportedDisplaysKHR)
    vkGetInstanceProcAddr(instance, "vkGetDisplayPlaneSupportedDisplaysKHR");
pfnCreateDisplayPlaneSurfaceKHR =
    (PFN_vkCreateDisplayPlaneSurfaceKHR)
    vkGetInstanceProcAddr(instance, "vkCreateDisplayPlaneSurfaceKHR");

// Get a list of displays on a physical device
displayCount = 0;
pfnGetPhysicalDeviceDisplayPropertiesKHR(physDevice, &displayCount, NULL);

pDisplayProps = (VkDisplayPropertiesKHR*)malloc(sizeof(VkDisplayPropertiesKHR) * displayCount);
pfnGetPhysicalDeviceDisplayPropertiesKHR(physDevice, &displayCount, pDisplayProps);

// Get a list of display planes on a physical device
planeCount = 0;
pfnGetPhysicalDeviceDisplayPlanePropertiesKHR(physDevice, &planeCount, NULL);
pPlaneProps = (VkDisplayPlanePropertiesKHR*)malloc(sizeof(VkDisplayPlanePropertiesKHR) * planeCount);
pfnGetPhysicalDeviceDisplayPlanePropertiesKHR(physDevice, &planeCount, pPlaneProps);

// Get the list of pModes each display supports
for (i = 0; i < displayCount; ++i)
{
    VkDisplayKHR display = pDisplayProps[i].display;
    VkDisplayModePropertiesKHR* pModes;
    uint32_t modeCount;

    vkGetDisplayModePropertiesKHR(physDevice, display, &modeCount, NULL);

    pModes = (VkDisplayModePropertiesKHR*)malloc(sizeof(VkDisplayModePropertiesKHR) * modeCount);
    vkGetDisplayModePropertiesKHR(physDevice, display, &modeCount, pModes);

    myMode = VK_NULL_HANDLE;
    for (j = 0; j < modeCount; ++j)
    {
        const VkDisplayModePropertiesKHR* mode = &pModes[i];

        if (ModeMatchesMyCriteria(mode))
        {
            myMode = mode->displayMode;
            break;
        }
    }

    free(pModes);

    // If there are no useable pModes found then check the next display.
    if (myMode == VK_NULL_HANDLE)
        continue;

    // Find a plane that matches these criteria, in order of preference:
    // -Is compatible with the chosen display + mode.
    // -Isn't currently bound to another display.
    // -Supports per-pixel alpha, if possible.
    for (j = 0; j < planeCount; ++j)
    {
        uint32_t supportedCount = 0;
        VkDisplayKHR* pSupportedDisplays;
        VkDisplayPlaneCapabilitiesKHR planeCaps;
        // See if the plane is compatible with the current display.
        pfnGetDisplayPlaneSupportedDisplaysKHR(physDevice, j, &supportedCount, NULL);

        // Plane doesn't support any displays.  This might happen on a card
        // that has a fixed mapping between planes and connectors when no
        // displays are currently attached to this plane's conector, for
        // example.
        if (supportedCount == 0)
            continue;

        pSupportedDisplays = (VkDisplayKHR*)malloc(sizeof(VkDisplayKHR) * supportedCount);
        pfnGetDisplayPlaneSupportedDisplaysKHR(physDevice, j, &supportedCount, pSupportedDisplays);

        for (k = 0; k < supportedCount; ++k)
            if (pSupportedDisplays[k] == display) {
                // If no supported plane has yet been found, this is
                // currently the best available plane.
                if (bestPlane == UINT32_MAX)
                    bestPlane = j;
                break;
            }

        // If the plane can't be used with the chosen display, keep looking.
        // Each display must have at least one compatible plane.
        if (k == supportedCount)
            continue;

        // If the plane passed the above test and is currently bound to the
        // desired display, or is not in use, it is the best plane found so
        // far.
        if ((pPlaneProps[j].currentDisplay == VK_NULL_HANDLE) &&
            (pPlaneProps[j].currentDisplay == display))
            bestPlane = j;
        else
            continue;

        pfnGetDisplayPlaneCapabilitiesKHR(physDevice, myMode, j, &planeCaps);

        // Prefer a plane that supports per-pixel alpha.
        if (planeCaps.supportedAlpha & VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR)
        {
            // This is the perfect plane for the given criteria.  Use it.
            bestPlane = j;
            alphaMode = VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR;
            break;
        }
    }
}

free(pDisplayProps);

if (myDisplay == VK_NULL_HANDLE || myMode == VK_NULL_HANDLE) {
    // No suitable display + mode could be found.  Abort.
    abort();
} else {
    // Success.  Create a VkSurfaceKHR object for this plane.
    const VkDisplaySurfaceCreateInfoKHR createInfo =
    {
        VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR,  // sType
        NULL,                                               // pNext
        0,                                                  // flags
        myMode,                                             // displayMode
        bestPlane,                                          // planeIndex
        pPlaneProps[bestPlane].currentStackIndex,           // planeStackIndex
        VK_SURFACE_TRANSFORM_IDENTITY_KHR,                  // transform
        1.0f,                                               // globalAlpha
        alphaMode,                                          // alphaMode
        ...
    }

    pfnCreateDisplayPlaneSurfaceKHR(instance, &createInfo, NULL, &surface);
}

... Donc il me faut bien une bonne journée pour commencer à attaquer ça.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Miouyouyou/RockMyy/issues/4#issuecomment-388590106, or mute the thread https://github.com/notifications/unsubscribe-auth/Aj26xIm6028TcsXV3DDckR7s0aThmg87ks5tx28zgaJpZM4TwBDJ .