Add support of external MIPI DSI display in VIM3 Android 9


I want to interface my mipi dsi display with VIM3. I have interfaced my display with Edge-V and I got it working. But when I connect it with VIM3 then even backlight is not getting on.
So, what changes I need to do in the VIM3 Android 9 SDK to turn it on.

I have made few changes in the DTS file to get it working for Khadas Edge-V.
But It is not working for VIM3.

Hi @Parth !,
Well for starters, assuming you have a proper powersupply, and you have a proper device connection…
you can give insight as to see whether the display is compatible, It might require the specific peripheral drivers, and also should have a supported resolution…

please note the differences in the amlogic and rockchip dtb’s

Please make you have ensured all these in your diagnostic checklist…

hello, you are trying the same power supply on Edge and vim3, it will be more correct, they have the same power connection, and check the connection between the display and your board


But How would I find compatible driver for my display? I have used ‘simple-panel-dsi’ in Edge-V.
But in VIM3 I have used ‘mesong12b_skt-panel.dtsi’ which contains “amlogic, lcd-g12b”.

My Khadas Edge-V dsi entry:

&dsi {
status = “okay”;
rockchip,lane-rate = <440>; //1000 --> 600 -->490
dsi_panel: panel@0 {
status = “okay”;
compatible = “simple-panel-dsi”;
reg = <0>;
backlight = <&backlight>;
reset-gpios = <&gpio4 RK_PD4 GPIO_ACTIVE_HIGH>; /* GPIO4_D4 /
enable-gpios = <&gpio4 RK_PD5 GPIO_ACTIVE_HIGH>; /
GPIO4_D5 */
// pinctrl-names = “default”;
// pinctrl-0 = <&lcd_reset_gpio>, <&lcd_enable_gpio>;
reset-delay-ms = <10>;
enable-delay-ms = <60>;
prepare-delay-ms = <60>;
unprepare-delay-ms = <60>;
disable-delay-ms = <60>;

	dsi,format = <MIPI_DSI_FMT_RGB888>;
    dsi,lanes  = <4>;
    panel-init-sequence = [
	panel-exit-sequence = [

    disp_timings: display-timings {
        native-mode = <&timing0>;
        timing0: timing0 {
            clock-frequency = <66000000>;
            hactive = <1280>; /* default 1080, but afbdc must 16 align */
            hfront-porch = <60>;
            hback-porch = <10>;
            hsync-len = <20>; 
            vactive = <800>;
            vfront-porch = <8>;
            vback-porch = <2>;
            vsync-len = <3>;
            hsync-active = <0>;
            vsync-active = <0>;
            de-active = <0>;
            pixelclk-active = <0>;


I want to set these parameters in VIM3.

1 Like


I am getting 12V on backlight pin but backlight is not turning on.

Does everything work well for HDMI? Check, please

I know that MIPI-DSI is a standard connection, perhaps it is using different pinout connection ?
Ok, so if your parameters for the LCD functioning are correct, try implementing it the touchscreen.dtsi file, just modify it and see if there is any result…

you can ask @Archangel1235 for some help, but please provide the display model or where you bought it from…

Thanx. I did the same thing. I modified the ‘mesong12b_skt-panel.dtsi’ file but still my backlight is not turning on. As I said ‘khadas display’ is working with the same parameters but mine is not.

would you like to see my touchscreen.dtsi file?

sure, send it, I can try but I need to know the display and where you bought it…

Yes, I checked on HDMI.
Everything works well on HDMI.

are you talking about an LED? then it’s very strange

Yes, I am talking about backlight LED of my mipi dsi display.

this means that there is no connection between the display and the board, check it probably with the other side, look carefully

@Parth It is not recommended to keep connecting and disconnecting the FPC, but can you check that it works on the Edge once more ? give us some photos, it is easier…

What’s the resolution of your MIPI display? You need to modify the dts file on kernel.

In addition, you need to check the variable lcd_exist=1 on cmdline

kvim3:/ # cat /proc/cmdline                                                    
init=/init console=ttyS0,115200 no_console_suspend earlycon=aml-uart,0xff803000 ramoops.pstore_en=1 ramoops.record_size=0x8000 ramoops.console_size=0x4000 hdr_policy=0 hdr_priority= otg_device=1 reboot_mode_android=normal logo=osd0,loaded,0x3d800000 fb_width=1920 fb_height=1080 vout2=,enable vout=576cvbs,enable panel_type=lcd_1 lcd_ctrl=0x00000083 hdmitx=,444,8bit hdmimode=1080p60hz hdmichecksum=0x00000000 dolby_vision_on=0 frac_rate_policy=1 hdmi_read_edid=1 cvbsmode=576cvbs osd_reverse=0 video_reverse=0 irq_check_en=0 androidboot.selinux=permissive androidboot.firstboot=0 jtag=disable wol_enable=0 spi_state=0 fusb302_state=1 hwver=VIM3.V12 factory_mac=c8:63:14:70:ca:06 lcd_exist=1 androidboot.hardware=amlogic androidboot.bootloader= androidboot.serialno=c8631470ca06 mac=c8:63:14:70:ca:06 androidboot.mac=c8:63:14:70:ca:06 ro rootwait skip_initramfs androidboot.dtbo_idx=0 --cmdline root=/dev/mmcblk0p18 buildvariant=userdebug

1 Like

I have checked lcd_exit parameter.

  1. In my MIPI DSI display --> lcd_exist = 0
  2. With khadas display --> lcd_exist = 1

I haven’t changed anything apart from the display.

bootloader/uboot$ git diff
diff --git a/board/khadas/kvim3/kvim3.c b/board/khadas/kvim3/kvim3.c
old mode 100644
new mode 100755
index 2583af7..3d14c96
--- a/board/khadas/kvim3/kvim3.c
+++ b/board/khadas/kvim3/kvim3.c
@@ -633,7 +633,8 @@ void board_lcd_detect(void)
     u8 mask = 0, value = 0;
     int ret = 0;
+setenv_ulong("lcd_exist", 1);
     // detect RESET pin
     // if the LCD is connected, the RESET pin will be plll high
     // if the LCD is not connected, the RESET pin will be low

I made the changes you suggested and my backlight led is on now.
But my display does not show anything. So, I will work on my dts file and will let you know the result.

hello @Terry

I am sharing my dts entry.

model_name = “TS050”;
interface = “mipi”;
basic_setting = <1280 800 /*1080 1920 /h_active, v_active/
1280 800 /h_period, v_period/
8 /lcd_bits/
64 118>; /screen_widht, screen_height/
lcd_timing = <20 10 0 /hs_width, hs_bp, hs_pol/
3 7 0>; /vs_width, vs_bp, vs_pol/
clk_attr = <0 /fr_adj_type(0=clk, 1=htotal, 2=vtotal)/
0 /*clk_ss_level */
1 /clk_auto_generate/
66000000>; /pixel_clk(unit in Hz)/
mipi_attr = <4 /lane_num/
440 /bit_rate_max(MHz)/
0 /factor(100, default 0 for auto)/
0 /operation_mode_init(0=video, 1=command)/
0 /operation_mode_display(0=video, 1=command)/
1 /

1 /clk_always_hs(0=disable,1=enable)/
0>; /phy_switch(0=auto,1=standard,2=slow)/

		/* dsi_init: data_type, num, data... */
		dsi_init_on = <
			>;   /*ending*/
		dsi_init_off = <
			>;    /*ending*/

		extern_init = <0xff>; /*0xff for invalid*/

		/* power step: type, index, value, delay(ms) */
		power_on_step = <
			>; /*ending*/
		power_off_step = <
			>; /*ending*/
		backlight_index = <0>;

I have changed the parameters according to my display but that has not turn up my display.
Though after making lcd_exist equal to 1 my display’s backlight led gets turn on. But, so far nothing comes up on the display.

You need to update the lcd parameter on dts file by yourself.
In addition, you don’t forget to modify following files

  • hardware/amlogic/hwcomposer/common/hwc/HwcConfig.cpp
diff --git a/common/hwc/HwcConfig.cpp b/common/hwc/HwcConfig.cpp
index 95ddd8d..d690564 100644
--- a/common/hwc/HwcConfig.cpp
+++ b/common/hwc/HwcConfig.cpp
@@ -20,8 +20,8 @@
 #define HWC_DISPLAY_NUM                     1
 //hdmi and lcd
 #define LCD_HWC_DISPLAY_NUM                 2

  • hardware/interfaces/configstore/1.1/default/SurfaceFlingerConfigs.cpp
diff --git a/configstore/1.1/default/SurfaceFlingerConfigs.cpp b/configstore/1.1/default/SurfaceFlingerConfigs.cpp
index d1d011c..5a328d6 100644
--- a/configstore/1.1/default/SurfaceFlingerConfigs.cpp
+++ b/configstore/1.1/default/SurfaceFlingerConfigs.cpp
@@ -164,7 +164,7 @@ Return<void> SurfaceFlingerConfigs::primaryDisplayOrientation(
     int exist = atoi(val) ;
     if (exist == 1) {
         specified = true;
-        orientation = 270;
+        orientation = 0;
     } else {
         specified = true;