This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing resolution for console
#1
Hi everybody!

Did anybody have any success with changing resolution on boot console which appears before starting X?
I tried 'fbset' but it fails (like desired resolution mode does not exist). As I checked - there is only 4k resolution of my tv.

The problem is that tinkerOS does not work properly with 4k tvs outside of X11, so I want to try to change resolution.
Reply
#2
Hi.

You can try to set resolution manually - see http://tinkerboarding.co.uk/forum/thread-262.html.
You are probably affected by the video selector problem (see http://tinkerboarding.co.uk/forum/thread...tml#pid323 or https://github.com/rockchip-linux/kernel/issues/10). You can try append "drm.debug=0x4" to linux boot cmdline (/boot/extlinux/extlinux.conf) and check output from "# dmesg" after boot for "drm_mode_prune_invalid" to discover why your monitor modes are incompatible with linux drm:
Code:
# dmesg | grep drm:
[    3.450328] [drm:drm_mode_debug_printmodeline] Modeline 81:"1280x1024" 60 108000 1280 1328 1440 1688 1024 1025 1028 1066 0x48 0x5
[    3.450335] [drm:drm_mode_prune_invalid] Not using 1280x1024 mode: VIRTUAL_X
[    3.450351] [drm:drm_mode_debug_printmodeline] Modeline 83:"640x480" 0 31500 640 656 720 840 480 481 484 500 0x40 0xa
[    3.450358] [drm:drm_mode_prune_invalid] Not using 640x480 mode: CLOCK_RANGE
[    3.450372] [drm:drm_mode_debug_printmodeline] Modeline 84:"640x480" 0 31500 640 664 704 832 480 489 491 520 0x40 0xa
[    3.450378] [drm:drm_mode_prune_invalid] Not using 640x480 mode: CLOCK_RANGE
[    3.450391] [drm:drm_mode_debug_printmodeline] Modeline 85:"640x480" 0 25200 640 656 752 800 480 490 492 525 0x40 0xa
[    3.450398] [drm:drm_mode_prune_invalid] Not using 640x480 mode: CLOCK_RANGE
[    3.450411] [drm:drm_mode_debug_printmodeline] Modeline 86:"720x400" 0 28320 720 738 846 900 400 412 414 449 0x40 0x6
[    3.450417] [drm:drm_mode_prune_invalid] Not using 720x400 mode: CLOCK_RANGE
[    3.450431] [drm:drm_mode_debug_printmodeline] Modeline 87:"1280x1024" 0 135000 1280 1296 1440 1688 1024 1025 1028 1066 0x40 0x5
[    3.450437] [drm:drm_mode_prune_invalid] Not using 1280x1024 mode: VIRTUAL_X
[    3.450451] [drm:drm_mode_debug_printmodeline] Modeline 88:"1024x768" 0 78800 1024 1040 1136 1312 768 769 772 800 0x40 0x5
[    3.450457] [drm:drm_mode_prune_invalid] Not using 1024x768 mode: CLOCK_RANGE
[    3.450471] [drm:drm_mode_debug_printmodeline] Modeline 89:"1024x768" 0 75000 1024 1048 1184 1328 768 771 777 806 0x40 0xa
[    3.450477] [drm:drm_mode_prune_invalid] Not using 1024x768 mode: CLOCK_RANGE
[    3.450491] [drm:drm_mode_debug_printmodeline] Modeline 90:"1024x768" 0 65000 1024 1048 1184 1344 768 771 777 806 0x40 0xa
[    3.450497] [drm:drm_mode_prune_invalid] Not using 1024x768 mode: CLOCK_RANGE
[    3.450511] [drm:drm_mode_debug_printmodeline] Modeline 91:"832x624" 0 57284 832 864 928 1152 624 625 628 667 0x40 0xa
[    3.450517] [drm:drm_mode_prune_invalid] Not using 832x624 mode: CLOCK_RANGE
[    3.450531] [drm:drm_mode_debug_printmodeline] Modeline 94:"1152x864" 0 108000 1152 1216 1344 1600 864 865 868 900 0x40 0x5
[    3.450537] [drm:drm_mode_prune_invalid] Not using 1152x864 mode: VIRTUAL_X

You can also decode "EDID" from your monitor manually to check supported resolution. For example: get EDID in hex format and paste output to http://www.edidreader.com/ (or other tool).
Code:
# od -t x1 -An /sys/devices/platform/display-subsystem/drm/card0/card0-HDMI-A-1/edid
00 ff ff ff ff ff ff 00 22 f0 93 26 01 01 01 01
34 13 01 03 80 26 1e 78 ee ee 95 a3 54 4c 99 26
0f 50 54 ad ef 80 81 80 01 01 01 01 01 01 01 01
01 01 01 01 01 01 30 2a 00 98 51 00 2a 40 30 70
13 00 7c 2c 11 00 00 1e 00 00 00 fd 00 30 4c 18
53 0e 00 0a 20 20 20 20 20 20 00 00 00 fc 00 48
50 20 4c 50 31 39 36 35 0a 20 20 20 00 00 00 ff
00 43 4e 34 39 35 32 30 32 59 43 0a 20 20 00 31
I left this community in Aug 2017 due to ASUS bad product quality and ASUS community support that did not match my expectation.  Sad
Reply
#3
Bug 
Hello.

Rockchip and ASUS are ignoring (maybe all based on rk3288 as phased-out chip - Rockchip focuses on ROCK64 as currently best supported rk3328 device to spread market adoption Sad ) or unable to resolve this issue over 3 month.
I found manual workaround (for TinkerOS 1.6-1.8 and rockchip-linux ~release-20170417 to ~release-20170705) to get preferred resolution with modify DeviceTree.

Follow the steps:
  1. find exact pixel frequency for preferred resolution
  2. find PLL allowed frequency
  3. change NPLL ("new pll") fixed frequency in binary DeviceTree ("/boot/rk3288-miniarm.dtb")

Step A: find exact pixel frequency for preferred resolution
option 1 - append "drm.debug=0x4" and reboot:
Code:
# ### append "drm.debug=0x4" to linux startup to get following
# cat /boot/extlinux/extlinux.conf
label kernel-4.4
   kernel /zImage
   fdt /rk3288-miniarm.dtb
   append  earlyprintk console=ttyS1,115200n8 console=tty1 root=/dev/mmcblk0p2 rw init=/sbin/init drm.debug=0x4
# reboot
# dmesg | awk '/drm:drm_mode_debug_printmodeline/ {print $5, $7}' | sort -u
100:"640x480" 25175
...
102:"1280x1024" 135000
...
96:"1280x1024" 108000
...
99:"640x480" 31500
Chosen resolution 1280x1024@60 -> 108000 kHZ.

option 2 - decode EDID:
Code:
# od -t x1 -An /sys/devices/platform/display-subsystem/drm/card0/card0-HDMI-A-1/edid
00 ff ff ff ff ff ff 00 22 f0 93 26 01 01 01 01
34 13 01 03 80 26 1e 78 ee ee 95 a3 54 4c 99 26
0f 50 54 ad ef 80 81 80 01 01 01 01 01 01 01 01
01 01 01 01 01 01 30 2a 00 98 51 00 2a 40 30 70
13 00 7c 2c 11 00 00 1e 00 00 00 fd 00 30 4c 18
53 0e 00 0a 20 20 20 20 20 20 00 00 00 fc 00 48
50 20 4c 50 31 39 36 35 0a 20 20 20 00 00 00 ff
00 43 4e 34 39 35 32 30 32 59 43 0a 20 20 00 31
Decode EDID online and check with VESA DMT or CEA standards timing. From VESA DMT standard and "EDID Timing Bitmap" or "EDID Detailed Timing Descriptor" - "1280 x 1024 @ 60 Hz" -> 108000 kHZ.

Step B: find PLL allowed frequency
The NPLL ("new pll") can be programmed to fixed frequency by rk3288_pll_rates. Oneliner bash script helps find PLL frequency that is multiple of requested pixel frequency.
Code:
# echo -n "Enter pixel freqency (in kHz): "; read freq; let freq=freq*1000; echo "Compatible PLL frequnces"; for pll in 2208000000 2184000000 2160000000 2136000000 2112000000 2088000000 2064000000 2040000000 2016000000 1992000000 1968000000 1944000000 1920000000 1896000000 1872000000 1848000000 1824000000 1800000000 1776000000 1752000000 1728000000 1704000000 1680000000 1656000000 1632000000 1608000000 1560000000 1512000000 1488000000 1464000000 1440000000 1416000000 1392000000 1368000000 1344000000 1320000000 1296000000 1272000000 1248000000 1224000000 1200000000 1188000000 1176000000 1128000000 1104000000 1008000000 912000000 891000000 888000000 816000000 798000000 792000000 768000000 742500000 696000000 600000000 594000000 552000000 504000000 500000000 456000000 408000000 400000000 384000000 360000000 312000000 300000000 297000000 252000000 216000000 148500000 126000000 48000000; do let rest=pll%freq; if ((rest == 0)); then printf "0x%x (%d)\n" $pll $pll; fi; done

Enter pixel freqency (in kHz): 108000
Compatible PLL frequnces
0x80befc00 (2160000000)
0x73df1600 (1944000000)
0x66ff3000 (1728000000)
0x5a1f4a00 (1512000000)
0x4d3f6400 (1296000000)
0x46cf7100 (1188000000)
0xcdfe600 (216000000)
Now choose (probably lowest one) frequency for NPLL = 0xcdfe600 (216000000).

Step C: change NPLL ("new pll") fixed frequency in binary DeviceTree ("/boot/rk3288-miniarm.dtb")
option 1 - update source DTS and recompile kernel
- open source arch/arm/boot/dts/rk3288.dtsi
- find clock-controller (cru) for rockchip-linux (or for TinkerOS variant of kernel) and replace NPLL in assigned-clock-rates from 500000000 to 216000000 (on 2nd or 5th position kernel depended).
- recompile kernel (see other post) and copy arch/arm/boot/dts/rk3288-miniarm.dtb to /boot on bootable MMC and reboot

option 2 - decompile DTB, update, compile DTS
Code:
# apt-get install device-tree-compiler
# cd /boot
# dtc -i dtb rk3288-miniarm.dtb > orig.dts
# cp orig.dts new.dts
# vi new.dts
# ### find "assigned-clock-rates" for "clock-controller" 0x1dcd6500 -> 0xcdfe600
# ### 2nd position in rockchip-linux/kernel, 5th position in tinkeros_debian_kernel release 1.8
# ### check with diff
# diff -u orig.dts new.dts
--- orig.dts    2017-07-10 16:08:17.000000000 +0000
+++ new.dts    2017-07-10 13:50:31.000000000 +0000
@@ -1120,7 +1120,7 @@
        #clock-cells = <0x1>;
        #reset-cells = <0x1>;
        assigned-clocks = <0x7 0x4 0x7 0x5 0x7 0xd1 0x7 0x1dd 0x7 0x16a 0x7 0xd2 0x7 0x1de 0x7 0x16b>;
-        assigned-clock-rates = <0x2367b880 0x1dcd6500 0x11e1a300 0x8f0d180 0x47868c0 0x11e1a300 0x8f0d180 0x47868c0>;
+        assigned-clock-rates = <0x2367b880 0xcdfe600 0x11e1a300 0x8f0d180 0x47868c0 0x11e1a300 0x8f0d180 0x47868c0>;
        linux,phandle = <0x7>;
        phandle = <0x7>;
    };
# dtc -i dts new.dts > rk3288-miniarm.dtb
# reboot

You can check "PLL" and "CLK" assignments in kernel runtime with "less /sys/kernel/debug/clk/clk_summary". Search for "pll_npll" and "dclk_vop0".
Now the resolution for boot console and X is set to requested 1280x1024 @ 60. There is no need to add additional data to command line linux options or to xorg.conf or run xrandr or fbset because EDID mode is validated and accepted by kernel DRM/FB.
There is also side effect "sclk_gpu" clock (mali) cannot use this "NPLL" as source (request for 100/200/300/400/600 MHZ) - it uses "GPLL" now (eg. 99/198/.../594 MHZ).

Happy hacking !
I left this community in Aug 2017 due to ASUS bad product quality and ASUS community support that did not match my expectation.  Sad
Reply
#4
Now there is partially working patch from rockchip - see issue comments.
I left this community in Aug 2017 due to ASUS bad product quality and ASUS community support that did not match my expectation.  Sad
Reply
#5
(07-11-2017, 07:42 AM)mcerveny Wrote: Now there is partially working patch from rockchip - see issue comments.

 Yes patch is working. But after kernel compile I lost the Wifi connection. Is there someone like me who's faced this problem before?

 Best
Reply
#6
Device tree compiler hand hack isn't working for 2.04. Trying to force 1080p@60 for boot console/run level 3 (no x11)
Mcerveney is there an updated dtc hand hack that works for 2.04? My Denon doesn't work with tinker OS 2.04 forced 4k mode I really just want 1080p on boot console (no x11).
Thanks ahead of time!
Reply
#7
(02-15-2018, 08:19 PM)nuker311 Wrote: Device tree compiler hand hack isn't working for 2.04. Trying to force 1080p@60 for boot console/run level 3 (no x11)
Mcerveney is there an updated dtc hand hack that works for 2.04?  My Denon doesn't work with tinker OS 2.04 forced 4k mode I really just want 1080p on boot console (no x11).
Thanks ahead of time!

i actually fixed my issue by merging parts of the files listed above from mcervney's post from the tinker-kernel branch.  4k is working through my Denon AVR now just fine.

would still like the ability to set the boot console frame buffer to 1080p though.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)