HDMI Resolutions testing

The HDMI VESA mode only support for VIM and not support for VIM2.
Thanks

1 Like

I built my ROM for VIM1 with VESA patch. My ROM work good, but it lost 800x480 resolution on my LCD (800x480) like your ROM. After that I modify the file OutputUiManager.java for full list of resolutions. And rebuilt my ROM again. New ROM has full list of resolutions.

I test my LCD (800x480), I put the 800x480 resolution, after reboot it work fine on naitive 800x480 resolution!!! But after second reboot, resolution is reset to the standard 1080p60Hz!!!
Resolution 1600x1200, 1024x768, 1360x768, 1366x768 good work after first reboot, and it is reset to the 1080p after reboot too.

Why?

At the same time, if I put the 800x600, 1280x800, 1280x1024, 1440x900, 1600x900 resolution, it work fine after first, second and any other reboot.

How to fix it? If you fix it, everything will be work perfectly!!!

Terry, thanks for the help!!!

Terry, please give me VESA patch for VIM2.

Thank you!

Terry and other guys are still on the Chinese National Holiday, will back at Oct 9.

1 Like

It only support for VIM(gxl) and don’t support for VIM2(gxm).

commit 7853d8e4f95d54ce4ff75dcfc94b2f88db6963ba
Author: Yi Zhou <yi.zhou@amlogic.com>
Date:   Wed Jun 28 13:00:24 2017 +0800

    PD#147458(146857): hdmitx: support several VESA modes.
    
    1) VESA Support mode lists:
    640x480p60hz,   800x600p60hz,   800x480p60hz,   852x480p60hz,
    854x480p60hz,   1024x600p60hz,  1024x768p60hz,  1152x864p75hz,
    1280x768p60hz,  1280x800p60hz,  1280x960p60hz,  1280x1024p60hz,
    1360x768p60hz,  1366x768p60hz,  1400x1050p60hz, 1440x900p60hz,
    1600x900p60hz,  1600x1200p60hz, 1680x1050p60hz, 1920x1200p60hz,
    2160x1200p90hz, 2560x1600p60hz
    
    (Only on gxl, the next 4 modes wait for the latest VESA Spec, TODO)
    1280x600p60h, 3440x1440p60hz, 2560x1440p60hz, 2560x1080p60hz
    
    2) Add SYSFS vesa_cap node:
    > # cat /sys/class/amhdmitx/amhdmitx/vesa_cap
    640x480p60hz
    800x600p60hz
    1024x768p60hz
    1152x864p75hz
    1280x800p60hz
    1280x960p60hz
    Duplicat cea_cap as disp_cap.
    
    3) Notice that the CharRate of 2560x1600p60hz is above 340Mbps.
    
    Change-Id: I1ba98c8a86180650954a043c9380ef888f0c6cec
    Signed-off-by: yi.zhou@amlogic.com <yi.zhou@amlogic.com>

You can try to add the env for VIM2. Maybe it has some issues.

diff --git a/kvim2/system.prop b/kvim2/system.prop
index 64b5d8a..85c4266 100644
--- a/kvim2/system.prop
+++ b/kvim2/system.prop
@@ -164,6 +164,82 @@ ubootenv.var.4k2ksmpte_x=
 ubootenv.var.4k2ksmpte_y=
 ubootenv.var.4k2ksmpte_w=
 ubootenv.var.4k2ksmpte_h=
+ubootenv.var.640x480p60hz_x=
+ubootenv.var.640x480p60hz_y=
+ubootenv.var.640x480p60hz_w=
+ubootenv.var.640x480p60hz_h=
+ubootenv.var.800x480p60hz_x=
+ubootenv.var.800x480p60hz_y=
+ubootenv.var.800x480p60hz_w=
+ubootenv.var.800x480p60hz_h=
+ubootenv.var.800x600p60hz_x=
+ubootenv.var.800x600p60hz_y=
+ubootenv.var.800x600p60hz_w=
+ubootenv.var.800x600p60hz_h=
+ubootenv.var.1024x600p60hz_x=
+ubootenv.var.1024x600p60hz_y=
+ubootenv.var.1024x600p60hz_w=
+ubootenv.var.1024x600p60hz_h=
+ubootenv.var.1280x600p60hz_x=
+ubootenv.var.1280x600p60hz_y=
+ubootenv.var.1280x600p60hz_w=
+ubootenv.var.1280x600p60hz_h=
+ubootenv.var.1024x768p60hz_x=
+ubootenv.var.1024x768p60hz_y=
+ubootenv.var.1024x768p60hz_w=
+ubootenv.var.1024x768p60hz_h=
+ubootenv.var.1360x768p60hz_x=
+ubootenv.var.1360x768p60hz_y=
+ubootenv.var.1360x768p60hz_w=
+ubootenv.var.1360x768p60hz_h=
+ubootenv.var.1366x768p60hz_x=
+ubootenv.var.1366x768p60hz_y=
+ubootenv.var.1366x768p60hz_w=
+ubootenv.var.1366x768p60hz_h=
+ubootenv.var.1280x800p60hz_x=
+ubootenv.var.1280x800p60hz_y=
+ubootenv.var.1280x800p60hz_w=
+ubootenv.var.1280x800p60hz_h=
+ubootenv.var.1440x900p60hz_x=
+ubootenv.var.1440x900p60hz_y=
+ubootenv.var.1440x900p60hz_w=
+ubootenv.var.1440x900p60hz_h=
+ubootenv.var.1600x900p60hz_x=
+ubootenv.var.1600x900p60hz_y=
+ubootenv.var.1600x900p60hz_w=
+ubootenv.var.1600x900p60hz_h=
+ubootenv.var.2560x1080p60hz_x=
+ubootenv.var.2560x1080p60hz_y=
+ubootenv.var.2560x1080p60hz_w=
+ubootenv.var.2560x1080p60hz_h=
+ubootenv.var.1680x1050p60hz_x=
+ubootenv.var.1680x1050p60hz_y=
+ubootenv.var.1680x1050p60hz_w=
+ubootenv.var.1680x1050p60hz_h=
+ubootenv.var.1280x1024p60hz_x=
+ubootenv.var.1280x1024p60hz_y=
+ubootenv.var.1280x1024p60hz_w=
+ubootenv.var.1280x1024p60hz_h=
+ubootenv.var.1600x1200p60hz_x=
+ubootenv.var.1600x1200p60hz_y=
+ubootenv.var.1600x1200p60hz_w=
+ubootenv.var.1600x1200p60hz_h=
+ubootenv.var.1920x1200p60hz_x=
+ubootenv.var.1920x1200p60hz_y=
+ubootenv.var.1920x1200p60hz_w=
+ubootenv.var.1920x1200p60hz_h=
+ubootenv.var.2560x1440p60hz_x=
+ubootenv.var.2560x1440p60hz_y=
+ubootenv.var.2560x1440p60hz_w=
+ubootenv.var.2560x1440p60hz_h=
+ubootenv.var.3440x1440p60hz_x=
+ubootenv.var.3440x1440p60hz_y=
+ubootenv.var.3440x1440p60hz_w=
+ubootenv.var.3440x1440p60hz_h=
+ubootenv.var.2560x1600p60hz_x=
+ubootenv.var.2560x1600p60hz_y=
+ubootenv.var.2560x1600p60hz_w=
+ubootenv.var.2560x1600p60hz_h=
 ubootenv.var.digitaudiooutput=
 ubootenv.var.defaulttvfrequency=
 ubootenv.var.has.accelerometer=

You can have a try by this Patch

1 Like

New screen resolutions are added and enabled on VIM2, but it has twitches image after reboot. I tried without applying the patch to change the scale in the file measong.cfg (1080p → 720p), the effect is the same - the image twitches. Bug is here!

This patch to apply after the Vesa patch?

Thank you!

Yes, one patch is for u-boot, you need to build uboot again.

1 Like

I built ROM again with new patch (with full list resolutions) and tested it. Screen resolution is reset to the standard 1080p60Hz after second reboot, again.

It remains to fix the bug with resetting to the default resolution (with image twitches on VIM2) and everything will work great!

Thank you, Terry. You are doing a great job!!!

You need to modify the file vendor/amlogic/frameworks/services/systemcontrol/DisplayMode.cpp

diff --git a/services/systemcontrol/DisplayMode.cpp b/services/systemcontrol/DisplayMode.cpp
index 8c3ca24..a416859 100644
--- a/services/systemcontrol/DisplayMode.cpp
+++ b/services/systemcontrol/DisplayMode.cpp
@@ -863,6 +863,47 @@ void DisplayMode::filterHdmiMode(char* mode, hdmi_data_t* data) {
                return;
         #endif
     }
+
+    if (!strncmp(data->ubootenv_hdmimode, "640x480", 7)) {
+        strcpy(mode, data->ubootenv_hdmimode);
+        return;
+    } else if (!strncmp(data->ubootenv_hdmimode, "800x480", 7)) {
+        strcpy(mode, data->ubootenv_hdmimode);
+        return;
+    } else if (!strncmp(data->ubootenv_hdmimode, "800x600", 7)) {
+        strcpy(mode, data->ubootenv_hdmimode);
+        return;
+    } else if (!strncmp(data->ubootenv_hdmimode, "1024x600", 8)) {
+        strcpy(mode, data->ubootenv_hdmimode);
+        return;
+    } else if (!strncmp(data->ubootenv_hdmimode, "1024x768", 8)) {
+        strcpy(mode, data->ubootenv_hdmimode);
+        return;
+    } else if (!strncmp(data->ubootenv_hdmimode, "1280x800", 8)) {
+        strcpy(mode, data->ubootenv_hdmimode);
+        return;
+    } else if (!strncmp(data->ubootenv_hdmimode, "1280x1024", 9)) {
+        strcpy(mode, data->ubootenv_hdmimode);
+        return;
+    } else if (!strncmp(data->ubootenv_hdmimode, "1360x768", 8)) {
+        strcpy(mode, data->ubootenv_hdmimode);
+        return;
+    } else if (!strncmp(data->ubootenv_hdmimode, "1366x768", 8)) {
+        strcpy(mode, data->ubootenv_hdmimode);
+        return;
+    } else if (!strncmp(data->ubootenv_hdmimode, "1440x900", 8)) {
+        strcpy(mode, data->ubootenv_hdmimode);
+        return;
+    } else if (!strncmp(data->ubootenv_hdmimode, "1600x900", 8)) {
+        strcpy(mode, data->ubootenv_hdmimode);
+        return;
+    } else if (!strncmp(data->ubootenv_hdmimode, "1600x1200", 8)) {
+        strcpy(mode, data->ubootenv_hdmimode);
+        return;
+    } else if (!strncmp(data->ubootenv_hdmimode, "1920x1200", 9)) {
+        strcpy(mode, data->ubootenv_hdmimode);
+        return;
+    }
     //old mode is not support in this TV, so switch to best mode.
 #ifdef USE_BEST_MODE
     getBestHdmiMode(mode, data);
@@ -1416,7 +1457,7 @@ void DisplayMode::setOsdMouse(int x, int y, int w, int h) {
         pSysWrite->writeSysfs(DISPLAY_FB1_SCALE, "0");
     }
 
-    if (strstr(cur_mode, "480")) {
+    if (!strncmp(cur_mode, "480", 3)) {
         strcpy(keyValue, strstr(cur_mode, MODE_480P_PREFIX) ? MODE_480P_PREFIX : MODE_480I_PREFIX);
     } else if (strstr(cur_mode, "576")) {
         strcpy(keyValue, strstr(cur_mode, MODE_576P_PREFIX) ? MODE_576P_PREFIX : MODE_576I_PREFIX);
@@ -1473,7 +1514,7 @@ void DisplayMode::getPosition(const char* curMode, int *position) {
     char ubootvar[100] = {0};
     int defaultWidth = 0;
     int defaultHeight = 0;
-    if (strstr(curMode, "480")) {
+    if (!strncmp(curMode, "480", 3)) {
         strcpy(keyValue, strstr(curMode, MODE_480P_PREFIX) ? MODE_480P_PREFIX : MODE_480I_PREFIX);
         defaultWidth = FULL_WIDTH_480;
         defaultHeight = FULL_HEIGHT_480;
@@ -1580,7 +1621,7 @@ void DisplayMode::setPosition(int left, int top, int width, int height) {
 
     char keyValue[20] = {0};
     char ubootvar[100] = {0};
-    if (strstr(curMode, "480")) {
+    if (!strncmp(curMode, "480", 3)) {
         strcpy(keyValue, strstr(curMode, MODE_480P_PREFIX) ? MODE_480P_PREFIX : MODE_480I_PREFIX);
     } else if (strstr(curMode, "576")) {
         strcpy(keyValue, strstr(curMode, MODE_576P_PREFIX) ? MODE_576P_PREFIX : MODE_576I_PREFIX);

1 Like

Do I need to deactivate this patch before?

No, It is not need to deactivate that patch.

1 Like

I tried your last patch. It does work!!! All resolutions work with “full list HDMI” patch!
Only 800x480 has a bug. It does not work on full screen. I got this trouble after first VESA patch. You probably remember it.

It look like 720x576… What do you think about?
1111

Please provide the logcat for me.

adb shell logcat -s SystemControl
1 Like

It is realy 720, but 720x480, not 720x576!!!

My log:

10-12 15:38:40.045 4093 7156 I SystemControl: [ubootenv] update_bootenv_varible name [ubootenv.var.is.bestmode]: value [false]
10-12 15:38:40.247 4093 4211 I SystemControl: hdcp_tx 2.2 & 1.4 stop hdcp pwr
10-12 15:38:40.291 4093 4211 I SystemControl: hdcp_tx pthread exit id = 533324624976, (null) done
10-12 15:38:40.291 4093 4211 I SystemControl: get color attr from ubootenv.var.800x480p60hz_deepcolor When is not best mode
10-12 15:38:40.312 4093 4211 I SystemControl: get hdmi color attribute : [444,8bit], outputmode is: [800x480p60hz] , and support color list is: [rgb,8bit]
10-12 15:38:40.312 4093 4211 I SystemControl: set DeepcolorAttr value is different from attr sysfs value
10-12 15:38:40.399 4093 4211 I SystemControl: setMboxOutputMode colorAttribute = 444,8bit
10-12 15:38:40.399 4093 4211 I SystemControl: [ubootenv] update_bootenv_varible name [ubootenv.var.800x480p60hz_deepcolor]: value [444,8bit]
10-12 15:38:40.399 4093 4211 I SystemControl: [ubootenv] update_bootenv_varible name [ubootenv.var.colorattribute]: value [444,8bit]
10-12 15:38:40.402 4093 4211 I SystemControl: [ubootenv] Save ubootenv to /dev/block/env succeed!
10-12 15:38:40.716 4093 4211 I SystemControl: setMboxOutputMode cvbsMode = 0
10-12 15:38:40.852 4093 7157 I SystemControl: hdcp_tx thread loop entry
10-12 15:38:40.852 4093 4211 I SystemControl: hdcp_tx, create hdcp thread id = 533324624976 done
10-12 15:38:40.853 4093 7157 I SystemControl: hdcp_tx key:00
10-12 15:38:40.876 4093 4211 I SystemControl: set osd mouse x:0 y:0 w:720 h:480
10-12 15:38:40.910 4093 4211 I SystemControl: [ubootenv] update_bootenv_varible name [ubootenv.var.800x480p60hz_x]: value [0]
10-12 15:38:40.910 4093 4211 I SystemControl: [ubootenv] update_bootenv_varible name [ubootenv.var.800x480p60hz_y]: value [0]
10-12 15:38:40.910 4093 4211 I SystemControl: [ubootenv] update_bootenv_varible name [ubootenv.var.800x480p60hz_w]: value [720]
10-12 15:38:40.910 4093 4211 I SystemControl: [ubootenv] update_bootenv_varible name [ubootenv.var.800x480p60hz_h]: value [480]
10-12 15:38:40.910 4093 4211 I SystemControl: [ubootenv] update_bootenv_varible name [ubootenv.var.outputmode]: value [800x480p60hz]
10-12 15:38:40.912 4093 4211 I SystemControl: [ubootenv] Save ubootenv to /dev/block/env succeed!
10-12 15:38:40.912 4093 4211 I SystemControl: [ubootenv] update_bootenv_varible name [ubootenv.var.hdmimode]: value [800x480p60hz]
10-12 15:38:40.914 4093 4211 I SystemControl: [ubootenv] Save ubootenv to /dev/block/env succeed!
10-12 15:38:40.914 4093 4211 I SystemControl: set output mode:800x480p60hz done

Full log with all resolutions I sent on your email.

I think you forgot to modify the file vendor/amlogic/frameworks/services/systemcontrol/DisplayMode.cpp

diff --git a/services/systemcontrol/DisplayMode.cpp b/services/systemcontrol/DisplayMode.cpp
index 8c3ca24..a416859 100644
--- a/services/systemcontrol/DisplayMode.cpp
+++ b/services/systemcontrol/DisplayMode.cpp
@@ -1416,7 +1457,7 @@ void DisplayMode::setOsdMouse(int x, int y, int w, int h) {
         pSysWrite->writeSysfs(DISPLAY_FB1_SCALE, "0");
     }
 
-    if (strstr(cur_mode, "480")) {
+    if (!strncmp(cur_mode, "480", 3)) {
         strcpy(keyValue, strstr(cur_mode, MODE_480P_PREFIX) ? MODE_480P_PREFIX : MODE_480I_PREFIX);
     } else if (strstr(cur_mode, "576")) {
         strcpy(keyValue, strstr(cur_mode, MODE_576P_PREFIX) ? MODE_576P_PREFIX : MODE_576I_PREFIX);
@@ -1473,7 +1514,7 @@ void DisplayMode::getPosition(const char* curMode, int *position) {
     char ubootvar[100] = {0};
     int defaultWidth = 0;
     int defaultHeight = 0;
-    if (strstr(curMode, "480")) {
+    if (!strncmp(curMode, "480", 3)) {
         strcpy(keyValue, strstr(curMode, MODE_480P_PREFIX) ? MODE_480P_PREFIX : MODE_480I_PREFIX);
         defaultWidth = FULL_WIDTH_480;
         defaultHeight = FULL_HEIGHT_480;
@@ -1580,7 +1621,7 @@ void DisplayMode::setPosition(int left, int top, int width, int height) {
 
     char keyValue[20] = {0};
     char ubootvar[100] = {0};
-    if (strstr(curMode, "480")) {
+    if (!strncmp(curMode, "480", 3)) {
         strcpy(keyValue, strstr(curMode, MODE_480P_PREFIX) ? MODE_480P_PREFIX : MODE_480I_PREFIX);
     } else if (strstr(curMode, "576")) {
         strcpy(keyValue, strstr(curMode, MODE_576P_PREFIX) ? MODE_576P_PREFIX : MODE_576I_PREFIX);
1 Like

I checked it. I did this modifications.
But my source code (VIM1) still have:

if (strstr(mDefaultUI, “480”)) {

I modif it:

if (!strncmp(mDefaultUI, “480”, 3))

And it does work!!!

Thank you, terry!!!
We have naitive resolutions now!!! It is cool!!!

We need VESA patch for VIM2. Please give it.

1 Like

I still don’t test it on VIM2. I will check it in few days. Maybe something such as config of PLL register need to be fixuped by amlogic. We need more time to push it.
Thanks.

1 Like