HDMI Resolutions testing


#83

Hi, Terry.
Do you have a solution for Vesa resolutions?


#84

So it’s turn out that using hdmi to vga adapter I can display the image correctly (previously I used HDMI to DVI cable). I have 1440x900 Dell monitor

(currently using Khadas Vim SCV2-ATV, but tested VIM_Nougat_V170901 and VIM_Ubuntu-mate-16.04_Linux-4.9_V170831 - everything was ok)


#85

Hi, terry!

I tested you Vesa patch.

My display is 800x480 naitive resolution.
Resolution 800x480 does not full screen before first reboot, and it is reset to the 1080p after reboot.
http://forum.khadas.com/uploads/default/original/1X/9b2ccc36020c783a8a2bb7c2d4d8bb716b006ced.JPG

Resolution 1600x1200, 1024x768, 1360x768, 1366x768 does full screen before first reboot, and it is reset to the 1080p after reboot. But it is not my native relolution.

Resolution 800x600, 1280x800, 1280x1024, 1440x900, 1600x900 work is perfect.

Please fix 800x480 :slight_smile:

Thank you!!!


#86

I have already updated the Patch for VESA mode. It include uboot patch and You need to rebuild the uboot.
Have a try.
Thanks.


#87

I see that, and my test with uboot patch too. uboot patch work is perfect


#88

Hi, terry!

I tested you ROW (Khadas VIM1 lite) again. It work good, but it lost 800x480 resolution on my LCD (800x480) and has 1280*800 resolution, though it should not. At the same time, you ROM has 1280x800 and works good on my LCD (1280x800).

Then I tested my ROM with you patch (Khadas VIM1 lite). My ROW works bad on all standard resolutions (720p, 480p) and VESA too, except 1080p. Uboot has good picture on all resolitions, but UI goes beyond the boundaries of the screen and the image twitches. After reboot the UI picture may come back to normal, or may continue to twitch. Every once in a while.

May be your patch is wrong, because you ROM works better? The only thing that, your ROM was build for VIM1, my ROM was build for VIM2.


#89

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


#91

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!!!


#92

Terry, please give me VESA patch for VIM2.

Thank you!


#93

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


#94

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=

#95

You can have a try by this Patch


#96

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!


#97

This patch to apply after the Vesa patch?

Thank you!


#98

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


#100

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.


#101

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!!!


#103

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);


#104

Do I need to deactivate this patch before?


#105

No, It is not need to deactivate that patch.