About add a new panel for Vim3

Hi Xiong:

Right now, I feel I am so close to success.

the screen seems split into two parts.

(the following picture is the Android Google’s loading animation)

I have modified the following sections:

1.mesong12b_skt-panel.dtsi

Details
		lcd_1{
			model_name = "Andrew_Test";
			interface = "mipi";
			basic_setting = <576 1280 /*h_active, v_active*/
		    636 1452 /*h_period, v_period*/
				8 /*lcd_bits*/
				69 152>; /*screen_widht, screen_height*/
			lcd_timing = <2 20 0 /*hs_width, hs_bp, hs_pol*/
				8 22 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*/
				84000000>; /*pixel_clk(unit in Hz)*/
			mipi_attr = <4 /*lane_num*/
				300 /*bit_rate_max(MHz)*/
				0 /*factor(*100, default 0 for auto)*/
				1 /*operation_mode_init(0=video, 1=command)*/
				0 /*operation_mode_display(0=video, 1=command)*/
				2 /*
				   *video_mode_type
				   *(0=sync_pulse,1=sync_event,2=burst)
				   */
				1 /*clk_always_hs(0=disable,1=enable)*/
				0>; /*phy_switch(0=auto,1=standard,2=slow)*/

			/* dsi_init: data_type, num, data... */
		

2.HwcConfig.cpp

Details

Modify 1

//hdmi and lcd
#define LCD_HWC_PRIMARY_FRAMEBUFFER_WIDTH   576
#define LCD_HWC_PRIMARY_FRAMEBUFFER_HEIGHT  1280
#define HWC_EXTEND_FRAMEBUFFER_WIDTH        1920
#define HWC_EXTEND_FRAMEBUFFER_HEIGHT       1080
#define LCD_HWC_DISPLAY_NUM                 2
#define LCD_HWC_PRIMARY_CONNECTOR_TYPE      "panel"
#define HWC_EXTEND_CONNECTOR_TYPE           "hdmi-only"
#define HWC_PIPELINE                        "dual"

Modify 2

          if (isLcdExist() == 1) {
              property_get("sys.lcd.reverse", value, "0");
              if(atoi(value) == 2) {//TS101 UI resolution size
                  width = 576;
                  height = 1280;
              } else {//old_TS050 or new_TS050 UI resolution size
                  //width = LCD_HWC_PRIMARY_FRAMEBUFFER_WIDTH;
                  //height = LCD_HWC_PRIMARY_FRAMEBUFFER_HEIGHT;
                  width  = 576;
                  height = 1280;
              }
          } else {
             width  = HWC_PRIMARY_FRAMEBUFFER_WIDTH;
             height = HWC_PRIMARY_FRAMEBUFFER_HEIGHT;
          }

3.SurfaceFlingerConfigs.cpp

Details
    if (exist == 1) {
        specified = true;
        property_get("sys.lcd.reverse", val2, "0");
        if(atoi(val2) == 2) {
            orientation = 0;//TS101 no need to rotate
        } else {
            //orientation = 270;//old_TS050 or new_TS050 itself is a vertical screen so need to rotate 270
            orientation = 0;
        }
    } else {
#ifdef PRIMARY_DISPLAY_ORIENTATION
        specified = true;
        orientation = PRIMARY_DISPLAY_ORIENTATION;
#endif
    }

4.kvim3.h

Details
#define CONFIG_DUAL_LOGO \
    "setenv outputmode 1080p60hz;setenv display_layer osd0;"\
    "vout output $outputmode;osd open;osd clear;imgread pic logo bootup $loadaddr;bmp display $bootup_offset;bmp scale;"\
    "if test ${khadas_mipi_id} = 2; then "\
        "setenv fb_width 576; setenv fb_height 1280;"\
        "setenv display_width 576;setenv display_height 1280;"\
        "setenv outputmode2 ${ts101_output};setenv display_layer viu2_osd0;"\
        "vout2 prepare ${outputmode2};osd open;osd clear;imgread pic logo bootup $loadaddr;bmp display $bootup_offset;bmp scale;vout2 output ${outputmode2};"\
    "else "\
        "setenv fb_width 576;setenv fb_height 1280;"\
        "setenv display_width 576;setenv display_height 1280;"\
        "setenv outputmode2 ${ts050_output};setenv display_layer viu2_osd0;"\
        "vout2 prepare ${outputmode2};osd open;osd clear;imgread pic logo bootup_rotate_secondary $loadaddr;bmp display $bootup_rotate_secondary_offset;bmp scale;vout2 output ${outputmode2};"\
    "fi;"\
    "\0"\

/* buffer rotate for portrait screen */
#define CONFIG_SINGLE_LOGO \
    "setenv display_layer osd0;"\
    "if test ${khadas_mipi_id} = 2; then "\
        "setenv outputmode ${ts101_output};"\
        "setenv fb_width 576; setenv fb_height 1280;"\
        "setenv display_width 576;setenv display_height 1280;"\
        "vout output $outputmode;osd open;osd clear;imgread pic logo bootup $loadaddr;bmp display $bootup_offset;bmp scale;"\
    "else "\
        "setenv outputmode ${ts050_output};"\
        "setenv fb_width 576; setenv fb_height 1280;"\
        "setenv display_width 576;setenv display_height 1280;"\
        "vout output $outputmode;osd open;osd clear;imgread pic logo bootup_rotate $loadaddr;bmp display $bootup_rotate_offset;bmp scale;"\
    "fi;"\
    "\0"\

I also checked the FPC and the LCD function works fine in LCD Bist mode. (Bist mode enter by modifying .dtsi DDI initial code)

Bist_mode

according to your experience, is there are parts maybe I missing?

Hi Xiong:

It’s happy to tell you that I had success bringing up the LCD.

I adjust the bit_rate_max from “300” to “600” then the screen is normal.

I appreciate your help ~