2560x1440 Resolution

Post Reply
toffler19
Posts: 7
Joined: Sat Dec 21, 2019 3:07 pm
languages_spoken: english Spanish
ODROIDs: C2 N2
Has thanked: 5 times
Been thanked: 1 time
Contact:

2560x1440 Resolution

Unread post by toffler19 » Mon Jan 06, 2020 7:48 am

Anyone having this problem with this resolution or knows how to solve it. Other resolutions work fine but this one. My monitor is px276 2560x1440. I tried with another touch monitor 1024x600 and I have the same problem with 2560x1440 resolution.
Attachments
IMG_20200105_153714.jpg
IMG_20200105_153714.jpg (600.16 KiB) Viewed 402 times
IMG_20200105_153721.jpg
IMG_20200105_153721.jpg (264.84 KiB) Viewed 402 times
IMG_20200105_153730.jpg
IMG_20200105_153730.jpg (266.32 KiB) Viewed 402 times
IMG_20200105_153732.jpg
IMG_20200105_153732.jpg (658.58 KiB) Viewed 402 times
These users thanked the author toffler19 for the post:
milesian (Mon Jan 06, 2020 10:15 am)

milesian
Posts: 20
Joined: Fri Nov 10, 2017 6:52 am
languages_spoken: english
ODROIDs: xu4
Has thanked: 27 times
Been thanked: 1 time
Contact:

Re: 2560x1440 Resolution

Unread post by milesian » Mon Jan 06, 2020 10:15 am

Exact same problem here with my Dell monitor at same native resolution as OP's. Would very much appreciate a fix.

User avatar
odroid
Site Admin
Posts: 33043
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 296 times
Been thanked: 417 times
Contact:

Re: 2560x1440 Resolution

Unread post by odroid » Mon Jan 06, 2020 10:22 am

There will be an Android update in a few days to fix the QHD resolution issue.
These users thanked the author odroid for the post:
milesian (Thu Jan 09, 2020 1:25 pm)

joy
Posts: 993
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 39 times
Been thanked: 94 times
Contact:

Re: 2560x1440 Resolution

Unread post by joy » Thu Jan 09, 2020 4:27 pm

@toffler19
Sorry for late update.
We have been trying to fix this issue but, no result so far.
Please wait for a couple of days more.
These users thanked the author joy for the post:
toffler19 (Sun Jan 12, 2020 9:56 am)

joy
Posts: 993
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 39 times
Been thanked: 94 times
Contact:

Re: 2560x1440 Resolution

Unread post by joy » Fri Jan 10, 2020 8:03 am

@toffler19, @milesian,
Here is one update.

This issue with 2560x1440 is related to two kind of problems.
1. OSD display shift with higher resolutions over 1920x1080 default setup
2. Crashed display caused by (1) hdmi output? (2) osd layer setting mismatch? (have no idea about actual cause so far.)

I made a kernel patch to fix the 1st issue (osd display shift issue) and confirmed it fixes the issue.

Code: Select all

diff --git a/drivers/amlogic/media/osd/osd_hw.c b/drivers/amlogic/media/osd/osd_hw.c
index dd9c968..e455b9f 100644
--- a/drivers/amlogic/media/osd/osd_hw.c
+++ b/drivers/amlogic/media/osd/osd_hw.c
@@ -6701,6 +6701,9 @@
 	struct layer_blend_reg_s *blend_reg;
 	u32 width, height;
 	u32 src_height;
+#ifdef CONFIG_ARCH_MESON64_ODROID_COMMON
+	u32 dst_width, dst_height;
+#endif
 	u32 workaround_line = osd_hw.workaround_line;
 	u32 output_index = 0;
 
@@ -6835,6 +6838,35 @@
 		osd_set_dummy_data(index, 0);
 	else
 		osd_set_dummy_data(index, 0xff);
+
+#ifdef CONFIG_ARCH_MESON64_ODROID_COMMON
+	/* Adjust free_scale option based on dst axis */
+	dst_width = osd_hw.free_dst_data[index].x_end -
+		osd_hw.free_dst_data[index].x_start + 1;
+	dst_height = osd_hw.free_dst_data[index].y_end -
+		osd_hw.free_dst_data[index].y_start + 1;
+
+	if (dst_width > 1920)
+		osd_hw.free_scale[index].h_enable = 1;
+	else
+		osd_hw.free_scale[index].h_enable = 0;
+
+	if (dst_height < 2160)
+		osd_hw.free_scale[index].v_enable = 0;
+	else
+		osd_hw.free_scale[index].v_enable = 1;
+
+	osd_hw.free_scale_enable[index] =
+		(((osd_hw.free_scale[index].h_enable << 16) & 0xffff0000)
+		| (osd_hw.free_scale[index].v_enable & 0xffff));
+	osd_hw.free_scale_mode[index] = 1;
+
+	osd_log_dbg2(MODULE_BLEND, "h_enable %d v_enable %d, free_scale 0x%x\n",
+		osd_hw.free_scale[index].h_enable,
+		osd_hw.free_scale[index].v_enable,
+		osd_hw.free_scale_enable[index]);
+#endif /* CONFIG_ARCH_MESON64_ODROID_COMMON */
+
 	osd_log_dbg2(MODULE_BLEND, "osd%d:free_src_data:%d,%d,%d,%d\n",
 		index,
 		osd_hw.free_src_data[index].x_start,
For the 2nd one, still looking into where the root cause is.
So please wait for a couple of days more.
These users thanked the author joy for the post (total 2):
milesian (Fri Jan 10, 2020 8:24 am) • toffler19 (Sun Jan 12, 2020 9:56 am)

joy
Posts: 993
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 39 times
Been thanked: 94 times
Contact:

Re: 2560x1440 Resolution

Unread post by joy » Tue Jan 14, 2020 11:25 pm

Hi @toffler19, @milesian,
I have one more update to fix the crashed display issue in case of 2560x1440.

As I've checked, it looks Android fb size of native 2560x1440 is not available.
I've tried to fix this issue in kernel driver side to keep the existing condition of android fb size 2560x1440, but I can't.
On the other hand, with size limitation of 1920x1080 (actual value is 2560x1080), Android display works OK.
I think this issue is not related to hdmi or kernel osd driver because there is no issue on Ubuntu.

So my solution is....
With 2560x1440 / 2560x1600 resolution, Android fb will be limited to 1920x1080.
->> hdmi resolution 2560x1080 -> android fb 2560x1080
->> hdmi resolution 2560x1440 -> android fb 1920x1080 (scale-up)
->> hdmi resolution 2560x1600 -> android fb 1920x1080 (scale-up)
Sorry. I don't have much knowledge about Android GUI logic so I can't explain it technically. :(

Anyway, I made the following patches and it can fix the crashed and shifted display issue.
We need to check if there is any side effect and discuss more internally.
I will share the status soon. :)

If you want, please check the patches.

1. Kernel osd driver

Code: Select all

diff --git a/drivers/amlogic/media/osd/osd_hw.c b/drivers/amlogic/media/osd/osd_hw.c
index fa5d356..e95c7f9 100644
--- a/drivers/amlogic/media/osd/osd_hw.c
+++ b/drivers/amlogic/media/osd/osd_hw.c
@@ -6846,15 +6846,21 @@
 	dst_height = osd_hw.free_dst_data[index].y_end -
 		osd_hw.free_dst_data[index].y_start + 1;
 
+	/*
+	 * On Android, higher framebuffer size over 1920x1080
+	 * will be limited to 1920x1080
+	 * and osd driver needs to scale the size
+	 * to fit in actual hdmi output resolution.
+	 */
 	if (dst_width > 1920)
 		osd_hw.free_scale[index].h_enable = 1;
 	else
 		osd_hw.free_scale[index].h_enable = 0;
 
-	if (dst_height < 2160)
-		osd_hw.free_scale[index].v_enable = 0;
-	else
+	if (dst_height > 1080)
 		osd_hw.free_scale[index].v_enable = 1;
+	else
+		osd_hw.free_scale[index].v_enable = 0;
 
 	osd_hw.free_scale_enable[index] =
 		(((osd_hw.free_scale[index].h_enable << 16) & 0xffff0000)
2. Android hwcomposer

Code: Select all

diff --git a/common/hwc/HwcDisplayPipe.cpp b/common/hwc/HwcDisplayPipe.cpp
index aad7f66..5532b77 100644
--- a/common/hwc/HwcDisplayPipe.cpp
+++ b/common/hwc/HwcDisplayPipe.cpp
@@ -68,9 +68,11 @@
             fbW = calibrateCoordinates[2];
             fbH = calibrateCoordinates[3];
         }
-        if (fbW >= 3840)
+        /* limit fb width to 1920 in case of higher fb height than 1080 */
+        if ((fbW >= 1920) && (fbH > 1080))
             fbW = 1920;
-        if (fbH >= 2160)
+        /* limit fb height to size 1080 */
+        if (fbH >= 1080)
             fbH = 1080;
 #else
         HwcConfig::getFramebufferSize (hwcId, fbW, fbH);
These users thanked the author joy for the post (total 2):
milesian (Tue Jan 14, 2020 11:41 pm) • toffler19 (Sat Jan 18, 2020 7:56 am)

toffler19
Posts: 7
Joined: Sat Dec 21, 2019 3:07 pm
languages_spoken: english Spanish
ODROIDs: C2 N2
Has thanked: 5 times
Been thanked: 1 time
Contact:

Re: 2560x1440 Resolution

Unread post by toffler19 » Sat Jan 18, 2020 7:56 am

sorry I'm a noob on the subject. how would I apply these patches?

joy
Posts: 993
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 39 times
Been thanked: 94 times
Contact:

Re: 2560x1440 Resolution

Unread post by joy » Sat Jan 18, 2020 11:09 am

Hi @toffler19,

[1] Updated patches

Before we talk about instructions to apply patches, please check an attachment, "20200115_2560x1440_test_2.zip".
A part of android hwcomposer patch has been adjusted once we put various tests to confirm side-effects.
It's a final version and will be included in a next Android release. :)

[2] Update boot.img and android hwcomposer

If you want to apply those patches before new Android release, you need to update boot.img and android hwcomposer.
- android/common : kernel part of boot.img
- android/hardware/amlogic/hwcomposer : /vendor/lib/hw/hwcomposer.odroidn2.so

Do you have a build environment for Android full source code?
https://wiki.odroid.com/odroid-n2/softw ... ource_code
If so, I will share detailed instructions to build boot.img and hwcomposer.

Or I can provide the boot.img and hwcomposer.odroidn2.so which include those patches.
You can just replace binaries on your N2 using fastboot and adb utils.
For that, I need the information which android version (release date, too) you're using.
Attachments
20200115_2560x1440_test_2.zip
(1.21 KiB) Downloaded 6 times

joy
Posts: 993
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 39 times
Been thanked: 94 times
Contact:

Re: 2560x1440 Resolution

Unread post by joy » Mon Jan 20, 2020 11:13 am

Hi @toffler19,

Here is an update guide.
If you need more information, please let me know.

1. boot.img

(1) Build kernel Image.gz
- Apply the kernel patch, 0001_n2_kernel_2560x1440_20200115.diff
- Build kernle Image.gz again
https://wiki.odroid.com/odroid-n2/softw ... nel#kernel

(2) Update boot.img with the updated Image.gz
- Install abootimg package on your host PC

Code: Select all

$ sudo apt-get insall abootimg
- Make a new folder, N2_bootimg and copy boot.img from update images.
You can get boot.img from fastboot update section of this wiki page.
https://wiki.odroid.com/odroid-n2/os_im ... e_20200110

Code: Select all

$ mkdir N2_bootimg
$ cd N2_bootimg
$ cp boot.img ./
- Extract images from the existing boot.img

Code: Select all

$ abootimg -x boot.img
- Replace zImage with Image.gz

Code: Select all

$ cp ${kernel_folder}/arch/arm64/boot/Image.gz  ./N2_bootimg/Image.gz
- Make a new boot.img

Code: Select all

$ abootimg --create boot_new.img -f bootimg.cfg -k Image.gz -r initrd.img
$ file boot_new.img
boot_new.img: Android bootimg, kernel (0x1080000), ramdisk (0x1000000), page size: 2048, cmdline (root=/dev/system rootfstype=ext4 init=/sbin/init)
(3) Update boot.img using fastboot
https://wiki.odroid.com/odroid-n2/softw ... and_kernel

Code: Select all

$ fastboot flash boot boot_new.img
2. hwcomposer
- Apply the patch, 0002_n2_hwcomposer_2560x1440_20200115.diff in ${android_path}/hardware/amlogic/hwcomposer/.
- Build hwcomposer

Code: Select all

$ cd ${android_path}
$ mmm ./hardware/amlogic/hwcomposer/
- Make the filesystem as rw on your N2 android.

Code: Select all

$ sudo mount -o remount,rw /vendor
- Replace hwcomposer.

Code: Select all

$ adb push out/target/product/odroidn2/vendor/lib/hw/hwcomposer.odroidn2.so   /vendor/lib/hw/hwcomposer.odroidn2.so
- Then, reboot n2 system.

Post Reply

Return to “Android”

Who is online

Users browsing this forum: sshock and 0 guests