[BPI-R2] Hdmi in uboot and linux

I’ve never used it, but I’ve found:https://www.kernel.org/doc/html/v4.11/admin-guide/dynamic-debug-howto.html CONFIG_DYNAMIC_DEBUG should activate dev-dbg.

Yes, debug=7 is enabled. I didn’t found anything suspicious, but I’ll upload uart output next time when l boot 4.14

No, problem is only on 4.14

mhm, but i reboot my 4.14 many times…so something added after seems to prevent it

This problem defenetly appeared after hdmi patches was ported. It probably also affects wifi/bt.

Wifi has newer version of watchdog (drivers/watchdog/mtk_wdt.c)…maybe this conflicts?

Try to use the original from 4.14,compile without wifi-driver and try to reboot

Try to use predefined templates a top of the page. There are most of resolutions in these templates.

mhm…option is already set in defconfig…will try again with debug=7 and drm.debug=0x7

grep 'CONFIG_DYNAMIC_DEBUG' arch/arm/configs/*fwu_defconfig
CONFIG_DYNAMIC_DEBUG=y
800x600@60Hz => HSYNC of 37.88kHz
1024x768@60Hz=> HSYNC of 48.36kHz

same values used by rpi in my screens above…but it seems that these are not used by fbdev/drm-driver on r2

found messages in debugfs…but placeholder are not filled:

drivers/gpu/drm/mediatek/mtk_hdmi.c:1382 [mediatek_drm_hdmi]mtk_hdmi_bridge_mode_set =_ "hsync_start:%d,hsync_end:%d, htotal:%d"          

log with dmesg and debug-fs-messages for drm: 4.16-hdmi-1024x768@60_debug.txt (75,7 KB)

So looks like approximately value of hsync can be calculated as: vsync * vert-res * 1.05

after adding #define DEBUG in mtk_hdmi.c:

[13:28] root@bpi-r2:~# dmesg |grep -i sync                                                                                                             
[    2.959897] mediatek-drm-hdmi 14015000.hdmi: hsync_start:1048,hsync_end:1184, htotal:1344                                                           
[    2.959909] mediatek-drm-hdmi 14015000.hdmi: vsync_start:771, vsync_end:777, vtotal:806  

still 1024x768@60…full dmesg: 4.16-hdmi-1024x768@60_debug.txt (74,6 KB)

i have created branch 4.16-hdmi+wlan for testing if the reboot-issue also occour in 4.16 => reboot works here…so it should be nothing wifi-driver-related

What is your actual hsync frequency when using 1024x768@60? Lines 406 and 488 looks suspicious (sorry, can’t insert, I’m writing from smartphone)

it seems 67.5kHz, but i don’t know if that info is from uboot…becuase my screen goes off and does not go on after that (check signal cable)…maybe vga-adapter blocks incorect signal

405: [    3.022383] [drm:drm_calc_timestamping_constants] crtc 34: hwmode: htotal 1344, vtotal 806, vdisplay 768                                            
406: [    3.022392] [drm:drm_calc_timestamping_constants] crtc 34: clock 65000 kHz framedur 16665600 linedur 20676                                          

487: [    9.335294] [drm:drm_calc_timestamping_constants] crtc 34: hwmode: htotal 1344, vtotal 806, vdisplay 768                                            
488: [    9.335304] [drm:drm_calc_timestamping_constants] crtc 34: clock 65000 kHz framedur 16665600 linedur 20676                                          
489: [    9.335331] [drm:drm_vblank_enable] enabling vblank on crtc 0, ret: 0

btw. xserver also does not work here (see process running but screen stays in standby)… @Ryder.Lee

edit: after killing x-server, i got the fb-console…and also can start xserver again…

IMG_20180530_143922_small IMG_20180530_144210_sm

Is there anything useful in dmesg?

BTW, have you tried to run same video config on 4.4 bsp kernel?

Have not looked in it and did not tried with 4.4…but i can reproduce it…after reboot monitor-standby,also after starting x-server, after killing this the first time monitor goes on and virtualconsole is visible

I will make a log later…currently out of home

i don’t know why it works before multiple time also with reboot after killing xserver…i have tried it again and now it does not work anymore with 4.16 :frowning:

but i have tried with 4.4, and have same behaviour…

i have no DEBUG-Flag in 4.4, but this errors came up after killing xserver the first time:

[   65.763056] mtk-iommu 10205000.mmsys_iommu: fault type=0x5 iova=0x300000 pa=0x0 larb=0 port=0                                                     
[   65.763167] mtk-iommu 10205000.mmsys_iommu: fault type=0x5 iova=0x301000 pa=0x0 larb=0 port=0                                                     
[   65.763212] mtk-iommu 10205000.mmsys_iommu: fault type=0x5 iova=0x304000 pa=0x0 larb=0 port=0                                                     
[   65.763308] mtk-iommu 10205000.mmsys_iommu: fault type=0x5 iova=0x300000 pa=0x0 larb=0 port=0                                                     
[   65.764035] mtk-iommu 10205000.mmsys_iommu: fault type=0x5 iova=0x301000 pa=0x0 larb=0 port=0                                                     
[   65.764065] mtk-iommu 10205000.mmsys_iommu: fault type=0x5 iova=0x302000 pa=0x0 larb=0 port=0                                                     
[   65.764094] mtk-iommu 10205000.mmsys_iommu: fault type=0x5 iova=0x304000 pa=0x0 larb=0 port=0                                                     
[   65.764123] mtk-iommu 10205000.mmsys_iommu: fault type=0x5 iova=0x305000 pa=0x0 larb=0 port=0                                                     
[   65.764153] mtk-iommu 10205000.mmsys_iommu: fault type=0x5 iova=0x307000 pa=0x0 larb=0 port=0                                                     
[   65.764182] mtk-iommu 10205000.mmsys_iommu: fault type=0x5 iova=0x308000 pa=0x0 larb=0 port=0

@DeadMeat hdmi is working in 4.14? for kernelcrash in wifi-driver did you reset mtk_wdt.c? Maybe this causes watchdog-crash…looks like same crash as here: R2 internal Wifi/BT (MT6625L) - Kernel 4.14.x/4.16

Hi, Frank, As for me there are no problems with hdmi in 4.14 - it’s works same way as in 4.16.

No progress with mtk_wdt.c/wifi/broken reboot for today. :frowning:

I see your last commit…you’ve removed wifi-driver as i suggested…

Which image do you use as base for testing? Are the wmt-tools available? I ask because you have no changes in files used by wifi-driver. Have you same crash with default main-kernel on same system?

i created 4.14-hdmi also in my repo and merged your commits into it for testing…

I’m using 2018-03-29-ubuntu-16.04-mate-desktop-bpi-r2-sd-emmc

I’m not shure

pi@bpi-iot-ros-ai:~$ aptitude search wmt
p   wmtemp                                                                                                         - WM dock applet displaying lm_sensors temperature values
p   wmtime                                                                                                         - Window Maker dockapp that displays the time and date
p   wmtop                                                                                                          - dockapp that displays 3 top memory or CPU using processes
p   wmtv                                                                                                           - Dockable video4linux TV player for WindowMaker

Only on hdmi-patched 4.14.

wmt-tools are not available via apt…these are compiled additionally but in latest official images they should be in /usr/bin (wmt_loader, wmt_loopback, stp_uart_launcher).

i have included wifi-driver in my build…will try it…it will crash if i try to enable wifi-driver, same procedure does not crash with 4.14-main (.44), so it’s a change with the hdmi-driver, hdmi itself works at least with 1080p, nice work… now we have to look why wifi crash => wifi-thread

it seems that you removed the wifi-related dts(i)-nodes…bpi-r2.dts.diff (2,4 KB) mt7623.dtsi.diff (3,5 KB) => fixed in my repo ( https://github.com/frank-w/BPI-R2-4.14/tree/4.14-hdmi ) by applying these 2 patches with -R

have you simply copied dts/dtsi from 4.16 to 4.14?

reverted dts(i) to 4.14-main, removed hdmi-related nodes and readded them from 4.16…works so far. here the full log (including bootloader+ wifi-init): 4.14-hdmi wlan.txt (115,7 KB)

also cleaned defconfig…only thing to do is fix warnings:

drivers/gpu/drm/mediatek/mtk_drm_drv.c:172:15: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  .main_path = mt2701_mtk_ddp_main,
               ^
drivers/gpu/drm/mediatek/mtk_drm_drv.c:174:14: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  .ext_path = mt2701_mtk_ddp_ext,
              ^
drivers/gpu/drm/mediatek/mtk_drm_drv.c:180:15: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  .main_path = mt8173_mtk_ddp_main,
               ^
In file included from ./include/linux/cdev.h:8:0,
                 from ./include/drm/drmP.h:36,
                 from drivers/gpu/drm/mediatek/mtk_dpi.c:14:
drivers/gpu/drm/mediatek/mtk_dpi.c: In function 'mtk_dpi_probe':
./include/linux/device.h:1346:36: warning: 'bridge_node' may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg)
                                    ^
drivers/gpu/drm/mediatek/mtk_dpi.c:731:27: note: 'bridge_node' was declared here
  struct device_node *ep, *bridge_node;
                           ^
In file included from drivers/gpu/drm/mediatek/mtk_drm_fbdev.c:14:0:
drivers/gpu/drm/mediatek/mtk_drm_fbdev.c: In function 'mtk_fbdev_probe':
./include/drm/drmP.h:175:2: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized]
  drm_dev_printk(dev, KERN_ERR, DRM_UT_NONE, __func__, " *ERROR*",\
  ^
drivers/gpu/drm/mediatek/mtk_drm_fbdev.c:61:6: note: 'err' was declared here
  int err;
      ^

fixed the warnings in my repo…