From 1e0c53f7116d1a3520f88b5fb7c098d6fa95feef Mon Sep 17 00:00:00 2001 From: Qubot <1445788683@qq.com> Date: Thu, 9 Jan 2025 11:22:41 +0800 Subject: [PATCH] add 8inch 800x1280 hdmi panel 8.8inch 480x1920 hdmi panel support --- .../homlet/VendorServiceAdapter.cpp | 2 ++ .../display/include/hardware/sunxi_display2.h | 2 ++ .../include/platform/platform-universal.h | 2 ++ .../video/sunxi/disp2/disp/de/disp_display.c | 16 ++++++++++++++++ .../sunxi/disp2/hdmi2/hdmi_core/api/edid.c | 2 ++ .../sunxi/disp2/hdmi2/hdmi_core/api/phy.c | 4 ++++ .../sunxi/disp2/hdmi2/hdmi_core/hdmi_core.c | 2 ++ .../sunxi/disp2/hdmi2/hdmi_core/hdmi_core.h | 2 ++ .../u-boot-2018/include/sunxi_display2.h | 2 ++ .../h618/configs/m4berry/linux-5.4/board.dts | 8 ++++---- .../chips/h618/configs/m4berry/uboot-board.dts | 4 ++-- .../fbdev/sunxi/disp2/disp/de/disp_display.c | 16 ++++++++++++++++ .../fbdev/sunxi/disp2/disp/de/disp_rtwb.c | 18 ++++++++++++++++++ .../sunxi/disp2/hdmi2/hdmi_core/api/edid.c | 2 ++ .../sunxi/disp2/hdmi2/hdmi_core/api/phy.c | 4 ++++ .../sunxi/disp2/hdmi2/hdmi_core/hdmi_core.c | 2 ++ .../sunxi/disp2/hdmi2/hdmi_core/hdmi_core.h | 2 ++ .../linux-5.4/include/video/sunxi_display2.h | 2 ++ packages/apps/Settings/res/values/custom.xml | 4 ++++ 19 files changed, 90 insertions(+), 6 deletions(-) diff --git a/hardware/aw/display/hwc-hal/vendorservice/homlet/VendorServiceAdapter.cpp b/hardware/aw/display/hwc-hal/vendorservice/homlet/VendorServiceAdapter.cpp index 07cbba78a7..5104f47c9c 100644 --- a/hardware/aw/display/hwc-hal/vendorservice/homlet/VendorServiceAdapter.cpp +++ b/hardware/aw/display/hwc-hal/vendorservice/homlet/VendorServiceAdapter.cpp @@ -64,6 +64,8 @@ static const SunxiModeInfo _modeInfos[] = { {DISP_TV_MOD_720P_60HZ_3D_FP, 1280, 720, 60}, {DISP_TV_MOD_800_480P_60HZ, 800, 480, 60}, + {DISP_TV_MOD_800_1280P_60HZ, 800, 1280, 60}, + {DISP_TV_MOD_480_1920P_60HZ, 480, 1920, 60}, {DISP_TV_MOD_1024_600P_60HZ, 1024, 600, 60}, {DISP_TV_MOD_1440_2560P_60HZ, 1440, 2560, 60}, {DISP_TV_MOD_2560_1440P_60HZ, 2560, 1440, 60}, diff --git a/hardware/aw/display/include/hardware/sunxi_display2.h b/hardware/aw/display/include/hardware/sunxi_display2.h index bcd54660d9..6560c718c2 100644 --- a/hardware/aw/display/include/hardware/sunxi_display2.h +++ b/hardware/aw/display/include/hardware/sunxi_display2.h @@ -242,6 +242,8 @@ enum disp_tv_mode DISP_TV_MOD_640_480P_60HZ = 0x2c, DISP_TV_MOD_960_544P_60HZ = 0x2d, DISP_TV_MOD_1920_1200P_60HZ = 0x2e, + DISP_TV_MOD_800_1280P_60HZ = 0x2f, + DISP_TV_MOD_480_1920P_60HZ = 0x30, DISP_TV_MOD_1280_1024P_60HZ = 0x41, DISP_TV_MOD_1024_768P_60HZ = 0x42, DISP_TV_MOD_900_540P_60HZ = 0x43, diff --git a/hardware/aw/display/libdisplayd/include/platform/platform-universal.h b/hardware/aw/display/libdisplayd/include/platform/platform-universal.h index 9e03de2885..6bf8145603 100644 --- a/hardware/aw/display/libdisplayd/include/platform/platform-universal.h +++ b/hardware/aw/display/libdisplayd/include/platform/platform-universal.h @@ -49,6 +49,8 @@ const int _hdmi_supported_modes[] = { DISP_TV_MOD_1024_600P_60HZ, DISP_TV_MOD_1080_1920P_60HZ, DISP_TV_MOD_1280_800P_60HZ, + DISP_TV_MOD_800_1280P_60HZ, + DISP_TV_MOD_480_1920P_60HZ, DISP_TV_MOD_1440_2560P_60HZ, DISP_TV_MOD_1920_720P_60HZ, DISP_TV_MOD_1920_1200P_60HZ, diff --git a/longan/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/disp/de/disp_display.c b/longan/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/disp/de/disp_display.c index 57d73368c3..f87b4a177c 100644 --- a/longan/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/disp/de/disp_display.c +++ b/longan/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/disp/de/disp_display.c @@ -941,6 +941,14 @@ s32 bsp_disp_get_screen_width_from_output_type(u32 disp, u32 output_type, u32 ou width = 1280; height = 800; break; + case DISP_TV_MOD_800_1280P_60HZ: + width = 800; + height = 1280; + break; + case DISP_TV_MOD_480_1920P_60HZ: + width = 480; + height = 1920; + break; case DISP_TV_MOD_1920_720P_60HZ: width = 1920; height = 720; @@ -1101,6 +1109,14 @@ s32 bsp_disp_get_screen_height_from_output_type(u32 disp, u32 output_type, u32 o width = 1280; height = 800; break; + case DISP_TV_MOD_800_1280P_60HZ: + width = 800; + height = 1280; + break; + case DISP_TV_MOD_480_1920P_60HZ: + width = 480; + height = 1920; + break; case DISP_TV_MOD_1920_720P_60HZ: width = 1920; height = 720; diff --git a/longan/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/hdmi2/hdmi_core/api/edid.c b/longan/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/hdmi2/hdmi_core/api/edid.c index b11d53579f..40a93be504 100644 --- a/longan/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/hdmi2/hdmi_core/api/edid.c +++ b/longan/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/hdmi2/hdmi_core/api/edid.c @@ -160,6 +160,8 @@ static supported_dtd_t _dtd[] = { {60000, {0x208, 0, 0, 0, 96200, 0, 1920, 212, 0, 16, 120, 32, 1, 720, 32, 0, 9, 10, 12, 1} }, {60000, {0x209, 0, 0, 0, 154000, 0, 1920, 160, 0, 16, 48, 32, 1, 1200, 35, 0, 9, 3, 6, 1} }, {60000, {0x20a, 0, 0, 0, 297000, 0, 2560, 420, 0, 16, 120, 32, 0, 1600, 52, 0, 9, 32, 10, 0} }, + {60000, {0x20b, 0, 0, 0, 60000, 0, 800, 32, 0, 9, 18, 2, 0, 1280, 163, 0, 16, 70, 79, 0} }, + {60000, {0x20c, 0, 0, 0, 66300, 0, 480, 90, 0, 1, 30, 30, 1, 1920, 26, 0, 4, 12, 8, 1} }, {0.0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, }; diff --git a/longan/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/hdmi2/hdmi_core/api/phy.c b/longan/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/hdmi2/hdmi_core/api/phy.c index 2afab48342..f8e1e7cd30 100644 --- a/longan/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/hdmi2/hdmi_core/api/phy.c +++ b/longan/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/hdmi2/hdmi_core/api/phy.c @@ -957,6 +957,10 @@ static u32 phy301_get_freq(u32 pClk) else if (((pClk >= 59336) && (pClk <= 59346)) || ((pClk >= 59395) && (pClk <= 59405))) return 59400; + else if (pClk == 60000) + return 59400; + else if (pClk == 66300) + return 59400; else if (pClk == 65000) return 65000; else if (pClk == 68250) diff --git a/longan/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/hdmi2/hdmi_core/hdmi_core.c b/longan/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/hdmi2/hdmi_core/hdmi_core.c index 3a31abcc58..2ffb8232fa 100644 --- a/longan/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/hdmi2/hdmi_core/hdmi_core.c +++ b/longan/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/hdmi2/hdmi_core/hdmi_core.c @@ -59,6 +59,8 @@ static struct disp_hdmi_mode hdmi_mode_tbl[] = { {DISP_TV_MOD_960_544P_60HZ, HDMI_VIC_960x544P60, }, {DISP_TV_MOD_1024_600P_60HZ, HDMI_VIC_1024x600P60, }, {DISP_TV_MOD_1280_800P_60HZ, HDMI_VIC_1280x800P60, }, + {DISP_TV_MOD_800_1280P_60HZ, HDMI_VIC_800x1280P60, }, + {DISP_TV_MOD_480_1920P_60HZ, HDMI_VIC_480x1920P60, }, {DISP_TV_MOD_1920_720P_60HZ, HDMI_VIC_1920x720P60, }, {DISP_TV_MOD_1920_1200P_60HZ, HDMI_VIC_1920x1200P60, }, {DISP_TV_MOD_2560_1600P_60HZ, HDMI_VIC_2560x1600P60, }, diff --git a/longan/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/hdmi2/hdmi_core/hdmi_core.h b/longan/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/hdmi2/hdmi_core/hdmi_core.h index 36a1d8d544..e70194bdd5 100644 --- a/longan/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/hdmi2/hdmi_core/hdmi_core.h +++ b/longan/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/hdmi2/hdmi_core/hdmi_core.h @@ -139,6 +139,8 @@ enum HDMI_VIC { HDMI_VIC_1024x600P60, HDMI_VIC_960x544P60, HDMI_VIC_1280x800P60, + HDMI_VIC_800x1280P60, + HDMI_VIC_480x1920P60, HDMI_VIC_1920x720P60, HDMI_VIC_1920x1200P60, HDMI_VIC_2560x1600P60, diff --git a/longan/brandy/brandy-2.0/u-boot-2018/include/sunxi_display2.h b/longan/brandy/brandy-2.0/u-boot-2018/include/sunxi_display2.h index 3730ad0404..6b19263498 100755 --- a/longan/brandy/brandy-2.0/u-boot-2018/include/sunxi_display2.h +++ b/longan/brandy/brandy-2.0/u-boot-2018/include/sunxi_display2.h @@ -246,6 +246,8 @@ enum disp_tv_mode DISP_TV_MOD_640_480P_60HZ = 0x2c, DISP_TV_MOD_960_544P_60HZ = 0x2d, DISP_TV_MOD_1920_1200P_60HZ = 0x2e, + DISP_TV_MOD_800_1280P_60HZ = 0x2f, + DISP_TV_MOD_480_1920P_60HZ = 0x30, DISP_TV_MOD_1280_1024P_60HZ = 0x41, DISP_TV_MOD_1024_768P_60HZ = 0x42, DISP_TV_MOD_900_540P_60HZ = 0x43, diff --git a/longan/device/config/chips/h618/configs/m4berry/linux-5.4/board.dts b/longan/device/config/chips/h618/configs/m4berry/linux-5.4/board.dts index 578be5a19f..02dee403d7 100644 --- a/longan/device/config/chips/h618/configs/m4berry/linux-5.4/board.dts +++ b/longan/device/config/chips/h618/configs/m4berry/linux-5.4/board.dts @@ -989,7 +989,7 @@ * screenx_output_mode (used for hdmi output, 0:480i 1:576i 2:480p 3:576p 4:720p50) * (5:720p60 6:1080i50 7:1080i60 8:1080p24 9:1080p50 10:1080p60 11:pal 14:ntsc) * (38: 2560x1440p60 39:1440x2560p60 40:1080x1920p60 41: 800x480p60 42:1024x600p60) - * (43: 1280x800p60 44:640x480p60 45:960x544p60 46: 1920x1200p60 68:1920x720p60) + * (43: 1280x800p60 44:640x480p60 45:960x544p60 46: 1920x1200p60 47: 800x1280p60 48: 480x1920p60 68:1920x720p60) * (69: 2560x1600p60) */ &disp { @@ -1032,8 +1032,8 @@ hdmi_mode_check = <1>; fb0_format = <0>; - fb0_width = <1280>; - fb0_height = <720>; + fb0_width = <480>; + fb0_height = <1920>; fb1_format = <0>; fb1_width = <0>; @@ -1358,4 +1358,4 @@ ahub3_codec: soundcard-mach,codec { }; }; -/* audio dirver module -> END */ +/* audio dirver module -> END */ \ No newline at end of file diff --git a/longan/device/config/chips/h618/configs/m4berry/uboot-board.dts b/longan/device/config/chips/h618/configs/m4berry/uboot-board.dts index 5d59d1e021..0ae152edc1 100644 --- a/longan/device/config/chips/h618/configs/m4berry/uboot-board.dts +++ b/longan/device/config/chips/h618/configs/m4berry/uboot-board.dts @@ -519,8 +519,8 @@ hdmi_mode_check = <1>; fb0_format = <0>; - fb0_width = <1280>; - fb0_height = <720>; + fb0_width = <480>; + fb0_height = <1920>; fb1_format = <0>; fb1_width = <0>; diff --git a/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/de/disp_display.c b/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/de/disp_display.c index d6a6a6e463..b40fa65c1a 100644 --- a/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/de/disp_display.c +++ b/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/de/disp_display.c @@ -1197,6 +1197,14 @@ s32 bsp_disp_get_screen_width_from_output_type(u32 disp, u32 output_type, width = 1280; height = 800; break; + case DISP_TV_MOD_800_1280P_60HZ: + width = 800; + height = 1280; + break; + case DISP_TV_MOD_480_1920P_60HZ: + width = 480; + height = 1920; + break; case DISP_TV_MOD_1920_720P_60HZ: width = 1920; height = 720; @@ -1358,6 +1366,14 @@ s32 bsp_disp_get_screen_height_from_output_type(u32 disp, u32 output_type, width = 1280; height = 800; break; + case DISP_TV_MOD_800_1280P_60HZ: + width = 800; + height = 1280; + break; + case DISP_TV_MOD_480_1920P_60HZ: + width = 480; + height = 1920; + break; case DISP_TV_MOD_1920_720P_60HZ: width = 1920; height = 720; diff --git a/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/de/disp_rtwb.c b/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/de/disp_rtwb.c index d97d177fcd..8297d1b76d 100644 --- a/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/de/disp_rtwb.c +++ b/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/de/disp_rtwb.c @@ -343,6 +343,24 @@ static struct disp_rtwb_timings video_timing[] = { .trd_mode = 0, .fps = 60, }, + { + .tv_mode = DISP_TV_MOD_800_1280P_60HZ, + .pixel_repeat = 0, + .x_res = 800, + .y_res = 1280, + .b_interlace = 0, + .trd_mode = 0, + .fps = 60, + }, + { + .tv_mode = DISP_TV_MOD_480_1920P_60HZ, + .pixel_repeat = 0, + .x_res = 480, + .y_res = 1920, + .b_interlace = 0, + .trd_mode = 0, + .fps = 60, + }, { .tv_mode = DISP_TV_MOD_1920_720P_60HZ, .pixel_repeat = 0, diff --git a/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/hdmi2/hdmi_core/api/edid.c b/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/hdmi2/hdmi_core/api/edid.c index 6380b1b1b2..1bcdb9b158 100644 --- a/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/hdmi2/hdmi_core/api/edid.c +++ b/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/hdmi2/hdmi_core/api/edid.c @@ -161,6 +161,8 @@ static supported_dtd_t _dtd[] = { {60000, {0x208, 0, 0, 0, 96200, 0, 1920, 212, 0, 16, 120, 32, 1, 720, 32, 0, 9, 10, 12, 1} }, {60000, {0x209, 0, 0, 0, 154000, 0, 1920, 160, 0, 16, 48, 32, 1, 1200, 35, 0, 9, 3, 6, 1} }, {60000, {0x20a, 0, 0, 0, 297000, 0, 2560, 420, 0, 16, 120, 32, 0, 1600, 52, 0, 9, 32, 10, 0} }, + {60000, {0x20b, 0, 0, 0, 60000, 0, 800, 32, 0, 9, 18, 2, 0, 1280, 163, 0, 16, 70, 79, 0} }, + {60000, {0x20c, 0, 0, 0, 66300, 0, 480, 90, 0, 1, 30, 30, 1, 1920, 26, 0, 4, 12, 8, 1} }, {0.0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, }; diff --git a/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/hdmi2/hdmi_core/api/phy.c b/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/hdmi2/hdmi_core/api/phy.c index 1635bd170c..bc88d76fc3 100644 --- a/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/hdmi2/hdmi_core/api/phy.c +++ b/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/hdmi2/hdmi_core/api/phy.c @@ -1112,6 +1112,10 @@ static u32 phy301_get_freq(u32 pClk) return 65000; else if (pClk == 68250) return 68250; + else if (pClk == 60000) + return 59400; + else if (pClk == 66300) + return 59400; else if (pClk == 71000) return 71000; else if (pClk == 72000) diff --git a/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/hdmi2/hdmi_core/hdmi_core.c b/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/hdmi2/hdmi_core/hdmi_core.c index 67b7fde44b..5b144390f2 100644 --- a/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/hdmi2/hdmi_core/hdmi_core.c +++ b/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/hdmi2/hdmi_core/hdmi_core.c @@ -68,6 +68,8 @@ static struct disp_hdmi_mode hdmi_mode_tbl[] = { {DISP_TV_MOD_960_544P_60HZ, HDMI_VIC_960x544P60, }, {DISP_TV_MOD_1024_600P_60HZ, HDMI_VIC_1024x600P60, }, {DISP_TV_MOD_1280_800P_60HZ, HDMI_VIC_1280x800P60, }, + {DISP_TV_MOD_800_1280P_60HZ, HDMI_VIC_800x1280P60, }, + {DISP_TV_MOD_480_1920P_60HZ, HDMI_VIC_480x1920P60, }, {DISP_TV_MOD_1920_720P_60HZ, HDMI_VIC_1920x720P60, }, {DISP_TV_MOD_1920_1200P_60HZ, HDMI_VIC_1920x1200P60, }, {DISP_TV_MOD_2560_1600P_60HZ, HDMI_VIC_2560x1600P60, }, diff --git a/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/hdmi2/hdmi_core/hdmi_core.h b/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/hdmi2/hdmi_core/hdmi_core.h index 91d3ca8e8f..c6dbd87bff 100644 --- a/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/hdmi2/hdmi_core/hdmi_core.h +++ b/longan/kernel/linux-5.4/drivers/video/fbdev/sunxi/disp2/hdmi2/hdmi_core/hdmi_core.h @@ -141,6 +141,8 @@ enum HDMI_VIC { HDMI_VIC_1024x600P60, HDMI_VIC_960x544P60, HDMI_VIC_1280x800P60, + HDMI_VIC_800x1280P60, + HDMI_VIC_480x1920P60, HDMI_VIC_1920x720P60, HDMI_VIC_1920x1200P60, HDMI_VIC_2560x1600P60, diff --git a/longan/kernel/linux-5.4/include/video/sunxi_display2.h b/longan/kernel/linux-5.4/include/video/sunxi_display2.h index 279bba9333..187062db01 100644 --- a/longan/kernel/linux-5.4/include/video/sunxi_display2.h +++ b/longan/kernel/linux-5.4/include/video/sunxi_display2.h @@ -237,6 +237,8 @@ enum disp_tv_mode { DISP_TV_MOD_640_480P_60HZ = 0x2c, DISP_TV_MOD_960_544P_60HZ = 0x2d, DISP_TV_MOD_1920_1200P_60HZ = 0x2e, + DISP_TV_MOD_800_1280P_60HZ = 0x2f, + DISP_TV_MOD_480_1920P_60HZ = 0x30, DISP_TV_MOD_1280_1024P_60HZ = 0x41, DISP_TV_MOD_1024_768P_60HZ = 0x42, DISP_TV_MOD_900_540P_60HZ = 0x43, diff --git a/packages/apps/Settings/res/values/custom.xml b/packages/apps/Settings/res/values/custom.xml index ef00054339..c3adc1b417 100644 --- a/packages/apps/Settings/res/values/custom.xml +++ b/packages/apps/Settings/res/values/custom.xml @@ -23,6 +23,8 @@ HDMI 1024x600 60Hz HDMI 1080x1920 60Hz HDMI 1280x800 60Hz + HDMI 800x1280 60Hz + HDMI 480x1920 60Hz HDMI 1440x2560 60Hz HDMI 1920x720 60Hz HDMI 1920x1200 60Hz @@ -43,6 +45,8 @@ 39 68 46 + 47 + 48 38 69