HDMI Resolutions testing

Yes, Terry will provide the source code then.

1 Like

Hi Gouwa,

  • 1440x900
  • HDMI -> DVI
  • 19 inch Dell E198WFP
  • Android

I thought you will give us new rom version, i went back to Nougat on eMMC, i don’t want to erase Android once again, i’ll wait for Ubuntu SD card installation, so i give up.

Speaking for myself, I need an Android rom, not source.

Same here, need ROM.

Hi,davemf
You can follow below steps to add support for custom(800x480,1024x768,1280x800) defaultUI
This is only for android mmallow
##steps
1). Download the patch

The file add-support-for-custom-defaultUI.patch is android patch
The file hdmi_custom_resolution.patch is kernel patch

2). Apply the patch

$ cp add-support-for-custom-defaultUI.patch <path-to-your-project>/vendor/amlogic/frameworks
$ cd  <path-to-your-project>/vendor/amlogic/frameworks
$ git apply add-support-for-custom-defaultUI.patch
$ cp hdmi_custom_resolution.patch  <path-to-your-project>/common
$ cd <path-to-your-project>/common
$ git apply hdmi_custom_resolution.patch

3). Modify the file ‘device/khadas/kvim/files/mesondisplay.cfg’

  • 1024x768 UI
--   MBOX meson8m2 1080p
++   MBOX meson8m2 1024x768
  • 1280x800 UI
--   MBOX meson8m2 1080p
++   MBOX meson8m2 1280x800
  • 800x480 UI
--   MBOX meson8m2 1080p
++   MBOX meson8m2 800x480

4). Rebuild your Rom

$ make installclean -j8
$ make otapackage -j8
4 Likes

Hi, terry!
I rebuilt my firmware, and checked new resolutions (1280800 and 800480).

shell@Vim:/ $ su
root@Vim:/ # wm size
Physical size: 1280x800
root@Vim:/ # dumpsys display | grep mBaseDisplayInfo
mBaseDisplayInfo=DisplayInfo{“Встроенный экран”, uniqueId “local:0”, app 128 0 x 800, real 1280 x 800, largest app 1280 x 800, smallest app 1280 x 800, mode 1, defaultMode 1, modes [{id=1, width=1280, height=800, fps=60.000004}], colorTr ansformId 1, defaultColorTransformId 1, supportedColorTransforms [{id=1, colorTr ansform=-22}], rotation 0, density 240 (160.157 x 160.0) dpi, layerStack 0, appV syncOff -5500000, presDeadline 17666666, type BUILT_IN, state ON, FLAG_SECURE, F LAG_SUPPORTS_PROTECTED_BUFFERS}
root@Vim:/ # dumpsys display | grep mBaseDisplayInfo
root@Vim:/ #
shell@Vim:/ $ su
root@Vim:/ # wm size
Physical size: 800x480
root@Vim:/ # dumpsys display | grep mBaseDisplayInfo
mBaseDisplayInfo=DisplayInfo{“Встроенный экран”, uniqueId “local:0”, app 800 x 480, real 800 x 480, largest app 800 x 480, smallest app 800 x 480, mode 1, defaultMode 1, modes [{id=1, width=800, height=480, fps=60.000004}], colorTransformId 1, defaultColorTransformId 1, supportedColorTransforms [{id=1, colorTransform=-22}], rotation 0, density 240 (160.0 x 160.421) dpi, layerStack 0, appVsyncOff -5500000, presDeadline 17666666, type BUILT_IN, state ON, FLAG_SECURE, FLAG_SUPPORTS_PROTECTED_BUFFERS}
root@Vim:/ #

Kernel work is fine!
But Android does not have the new resolution in the setting.


The video driver generates the correct resolution, but the android gives you selected resolution in the settings. Thus, we get that the resolution of the android (19201080 or 1280720) scale in the resolution of the video driver (1280*800).
Display shows the resolution that gives Android, not the kernel.
In order to obtain real resolution it is necessary that the android was given the required resolution too.

Hi, terry.
The new resolutions does not appear in my old project on geekbox too. After I started using the VIC from 1280x720x50 and 1920x1080x50 for new resolutions, new resolutions immediately appeared in Android settings.

It is necessary to set PLL CLK and other CLK when select the custom resolution HDMI output. I put the question to amlogic because I don’t understand the register of CLK, but need to wait for it.
I list the question in this post and hope some people can give me some advices.

##The question list:

##1. How to add the configuration for custom resolution ?

##2. How to set the P_HHI_HDMI_PLL_CNTL register ?

##3. Is it necessary to reset the P_HHI_HDMI_PLL_CNTL3 register for custom resolution ?

2 Likes

Will there be the new resolutions in Android, if the new resolution to add this file “hw_clk.c”? Will that be enough?

This is the most basic for custom resolution hdmi output.

It is not enough and need to modify the other source code.
If you want to try to add the custom resolution . You can follow below steps
##Steps
1).Apply above patch(hdmi_custom_resolution.patch)
2).Add the clk settings for custom resolution by yourself
3).Flash the new Rom
4).select the custom resolution hdmi ouput

$ adb shell
$ adb root
$ cd /sys/class/display
$ echo custom-resolution > mode

Notice:
custom-resolution:
640x480p60hz ,800x480p60hz , 800x600p60hz, 1024x768p60hz , 1024x600p60hz 1280x800p60hz , 1280x1024p60hz, 1360x768p60hz, 1366x768p60hz, 1440x900p60hz, 1600x900p60hz, 1680x1050p60hz, 1920x1200p60hz, 2560x1440p60hz, 2560x1600p60hz, 2560x1080p60hz

I think you need to add these in the CLK, not create a new CLK:
1.static struct hw_enc_clk_val_group setting_enc_clk_va

static struct hw_enc_clk_val_group setting_enc_clk_val = {
{{HDMI_720x480i60_16x9,
HDMI_720x576i50_16x9,
HDMI_VIC_END},
4320000, 4, 4, 1, VID_PLL_DIV_5, 1, 2, -1, 2},
{{HDMI_720x576p50_16x9,
HDMI_720x480p60_16x9,
HDMIV_800x480p60hz,
HDMI_VIC_END},
4320000, 4, 4, 1, VID_PLL_DIV_5, 1, 2, 1, -1},
{{HDMI_1280x720p50_16x9,
HDMI_1280x720p60_16x9,
HDMIV_1024x768p60hz,
HDMIV_1280x800p60hz,
HDMI_VIC_END},
2970000, 4, 1, 1, VID_PLL_DIV_5, 1, 2, 1, -1},
{{HDMI_1920x1080i60_16x9,
HDMI_1920x1080i50_16x9,
HDMI_VIC_END},
2970000, 4, 1, 1, VID_PLL_DIV_5, 1, 2, 1, -1},
{{HDMI_1920x1080p60_16x9,
HDMI_1920x1080p50_16x9,
HDMI_VIC_END},
2970000, 1, 2, 2, VID_PLL_DIV_5, 1, 1, 1, -1},
{{HDMI_1920x1080p30_16x9,
HDMI_1920x1080p24_16x9,
HDMI_1920x1080p25_16x9,
HDMI_VIC_END},

2 don’t touch “static void set_gxl_hpll_clk_out”

3 static void set_hpll_sspll

static void set_hpll_sspll(enum hdmi_vic vic)
{
switch (get_cpu_type()) {
case MESON_CPU_MAJOR_ID_GXBB:
break;
case MESON_CPU_MAJOR_ID_GXTVBB:
break;
case MESON_CPU_MAJOR_ID_GXL:
case MESON_CPU_MAJOR_ID_GXM:
switch (vic) {
case HDMI_1920x1080p60_16x9:
case HDMI_1920x1080p50_16x9:
hd_write_reg(P_HHI_HDMI_PLL_CNTL3, 0x868b48c4);
break;
case HDMI_1280x720p60_16x9:
case HDMI_1280x720p50_16x9:
case HDMIV_1024x768p60hz,
case HDMIV_1280x800p60hz,
case HDMI_1920x1080i60_16x9:
case HDMI_1920x1080i50_16x9:
hd_write_reg(P_HHI_HDMI_PLL_CNTL3, 0x864348c4);
break;

I did it yesterday. “mesondisplay.cfg” works is fine.

I’ll try it.

But, How to add new resolutions on android settings?

You need to check the corret clk parameter firstly. :slight_smile:

Do you mean CLK on hw_clk.c file? Or not?

Yes, three point that i listed on above.

I checked it. My fixes do not work.

Standart resolutions - display is work:

root@Vim:/sys/class/display # echo 1080p60hz > mode
root@Vim:/sys/class/display # echo 1080i60hz > mode
root@Vim:/sys/class/display # echo 720p60hz > mode
root@Vim:/sys/class/display # echo 720p50hz > mode
root@Vim:/sys/class/display # echo 480p60hz > mode

Standart resolutions - display does not work “not support resolution”, like custom resolutions:

root@Vim:/sys/class/display # echo 1080p24hz > mode
root@Vim:/sys/class/display # echo 1080p25hz > mode
root@Vim:/sys/class/display # echo 1080p30hz > mode

Why it (1080p24hz, 1080p25hz, 1080p30hz) does not work? It appear in the file “hw_clk.c”.

Hi,davemf
Don’t contorl the mode node directly.
You can apply the patch [settings-menu-for-custom-resolution.patch] (http://www.mediafire.com/file/xwckrm8t7kitypo/settings-menu-for-custom-resolution.patch) follow below command

$ cp settings-menu-for-custom-resolution.patch <path-to-your-project>/packages/apps/Settings
$ cd <path-to-your-project>/packages/apps/Settings
$ git apply settings-menu-for-custom-resolution.patch

After do that, you can control the hdmi output by settings menu.

1 Like

I checked it. Custom resolutions was added on android’s settings.
But, my display says “HDMI - no support”, when I select custom resolution… :sweat:

Firstly,You need to verify which custom resolution of your monitor support.
Sencondly,You need to add clk settings of the custom resolution in kernel and test it.
Thanks.