[BPI-R2] Hdmi in uboot and linux

have you reproduced the problem? is there a (inofficial) Patch? for clock there is v9…

The whole series is applied.

i see pull…but something seems missing/chaned. Have you tried get hdmi running? Some of the older series were not merged yet (at least dts-nodes for r2). See my repo.

test this fixup patch:https://patchwork.kernel.org/patch/10897215/

tested without the old fixups, no xserver

https://github.com/frank-w/BPI-R2-4.14/commits/5.1-hdmi-v10

should i add additional patches like here:

https://github.com/frank-w/BPI-R2-4.14/commits/5.1-hdmi

next patch "fix boot up for 720 and 480 but 1080 " conflicts with current hdmi-v10 (pos_div = 1; vs. 2 in mtk_hdmi_pll_set_rate)

do you test the patch in v5.1? Also , you should fix dpi node

dpi0: dpi@14014000 {
	compatible = "mediatek,mt7623-dpi",
		     "mediatek,mt2701-dpi";
	reg = <0 0x14014000 0 0x1000>;
	interrupts = <GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>;
	clocks = <&mmsys CLK_MM_DPI1_DIGL>,
		 <&mmsys CLK_MM_DPI1_ENGINE>,
		 <&apmixedsys CLK_APMIXED_TVDPLL>;
	clock-names = "pixel", "engine", "pll";
	status = "disabled";
};

Yes it is after the v10 patches of “make mt7623 clock stable”. I try the dpi0 patch…

-                        <&topckgen CLK_TOP_TVDPLL>;
+                        <&apmixedsys CLK_APMIXED_TVDPLL>;

should i add the other patches i applied before? how to deal with the pos_div?

with this change alone, it is same behaviour

root@bpi-r2-ubuntu:~# startx                                                    
                                                                                
                                                                                
X.Org X Server 1.19.6                                                           
Release Date: 2017-12-20                                                        
X Protocol Version 11, Revision 0                                               
Build Operating System: Linux 4.4.0-138-generic armv7l Ubuntu                   
Current Operating System: Linux bpi-r2-ubuntu 5.1.0-rc1-bpi-r2-hdmi-v10 #140 SMl
Kernel command line: board=bpi-r2 console=earlyprintk console=tty1 fbcon=map:0 7
Build Date: 25 October 2018  04:12:38PM                                         
xorg-server 2:1.19.6-1ubuntu4.2 (For technical support please see http://www.ub 
Current version of pixman: 0.34.0                                               
        Before reporting problems, check http://wiki.x.org                      
        to make sure that you have the latest version.                          
Markers: (--) probed, (**) from config file, (==) default setting,              
        (++) from command line, (!!) notice, (II) informational,                
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.           
(==) Log file: "/var/log/Xorg.0.log", Time: Mon Apr 15 08:17:26 2019            
(==) Using system config directory "/usr/share/X11/xorg.conf.d"                 
gbm: failed to open any driver (search paths /usr/lib/arm-linux-gnueabihf/dri:$)
gbm: Last dlopen error: /usr/lib/dri/mediatek_dri.so: cannot open shared objecty
failed to load driver: mediatek                                                 
EGL_MESA_drm_image required. 

no hdmi output. same system with another kernel (have currently only 4.19 installed) works with same messages.

there are too many branches. can you see any output in v4.19 and v5.1?

I mean this branch and I think it should work.

in 4.19-main/hdmi-v5 hdmi works. In 5.1-hdmi-v10 where i applied the above patch(es) it does not work (no error,no hdmi output on same system).I can try with my tv (1080p) maybe it’s again a resolution problem (my tft is 1280x1024) which works on 4.19

ok, 5.1-hdmi-v10 works with 1080p but not with 1280x1024…so it’s again the resolution-problem…5.0-hdmi definitely works with 1280x1024 on my tft (xserver)

btw. https://github.com/frank-w/BPI-R2-4.14/commit/7b03c27ed3e39349b8b0be55c990dadbf4dbac2a in 5.1-hdmi-v10 reverts the fix of 5.0-hdmi https://github.com/frank-w/BPI-R2-4.14/commit/c5034003def420c5ea028d6685df0de58d5893d2#diff-66dba70550f0e2aff3a74f2e952391de

have currently only applied the other 2 parts…

  • using different round rate for mt7623 is partially reverted or implemented in other way in v10 (make clock stable) “drm/mediatek: no change parent rate in round_rate() for mt2701 hdmi phy” / " drm/mediatek: make implementation of recalc_rate() to match the definition"

so i have addionally only added “fix boot up for 720 and 480 but 1080” without the change of pos_div => this seems to fix the Problem…i have now the xserver on my tft in 5.1-hdmi-v10

nice and now CK Hu’s framebuffer-patch also works :slight_smile: (stretched width was wrong cmdline)

:+1:

in my local branch i squashed the dts-fixes (from bibby and the one by you) together with the missing dts-commit (was a resend) and the “fixed 2 warnings” with “drm/mediatek: config component output by device node port” …will push it later so you can send it upstream (maybe after modification)

my local branch looks like this (much more readable):

ef8b6cebcc21 (HEAD -> 5.1-hdmi-v10) drm/mediatek: Add Mediatek framebuffer device
3a5d94704179 drm/mediatek: Implement gem prime vmap/vunmap function
c01551e0f860 [hdmi,defconfig] adding hdmi-options
3d72b35d4688 arm: dts: mt7623: add display subsystem related device nodes
176a2d716c5f fix boot up for 720 and 480 but 1080
f30d3fbc0e6e [hdmi] fix possible_crtcs
8cbd07f230dc drm/mediatek: config component output by device node port
bbd93e897e09 clk: mediatek: fix clk-gate flag setting
277bb62f8bb1 drm/mediatek: no change parent rate in round_rate() for mt2701 hdmi phy
2602ce3356c5 drm/mediatek: make implementation of recalc_rate() to match the definition
222b8d18147d drm/mediatek: using new factor for tvdpll in MT2701
7b03c27ed3e3 drm/mediatek: fix the rate and divder of hdmi phy for MT2701
4c2750fb9221 drm/mediatek: remove flag CLK_SET_RATE_PARENT for mt2701 hdmi phy to not propagate rate change to parent
1 Like

posted Patch-series based on 5.1-rc5:

https://patchwork.kernel.org/project/linux-mediatek/list/?series=106529

hope it will finally merged to 5.1

@Ryder.Lee have you seen CK Hu’s answer?

do you understand his idea? i see no part where the binding document needs to be changed…

is the problematic patch “drm/mediatek: fix possible_crtcs” and the others are ok?

to be honest…i don’t know what to change :wink:

@Ryder.Lee

i have replaced the problematic patch in this branch by 2 new (dynamic test for the right crtc) here https://github.com/frank-w/BPI-R2-4.14/commits/5.1-hdmi-test

still have no idea how to deal with the other (need change binding document)

any idea how to get basic hdmi to uboot?

have anyone X x 600 resolution working?

i have successful tested this display with native resolution (1024x600) and kernel 5.4-(merged)