Add support of external MIPI DSI display in VIM3 Android 9

@Parth Generally, it is caused by the wrong power on and power off timing. So you have to find the flicker pattern first, and then modify the code to verify it.
You can do the following and give feedback:
Connect your Mipi display and turn the machine on, then turn off the machine normally, wait for 5 minutes or more, and then turn the machine on to see if the screen is flashing?

@Parth How were you able to change the clock in the dtsi? Can it be any arbitrary number such as 56.666 MHz? What is the relationship between the pixel_clk and bit_rate_MAX clk?

Hello, here I use the TS101 MIPI screen on VIM3 as an example:

pixel_clk:
It needs to be configured according to actual needs. Calculation method of pixel_clk: pixel_clk = h_period * v_period *
frame_rate. pixel_clk can also directly set the frame rate value. frame_rate is generally 60HZ

bit_rate_max:
Please check the specification book to determine this value. If it is not provided, you need to follow the formula pclk * 3 * 8 = bit_rate *
lane_num (both 6bit and 8bit lcd are calculated according to 8bit)

The relevant h_period and h_period examples below have comments that you can use as a reference.

lcd_2{
			model_name = "TS101";
			interface = "mipi";
			basic_setting = <1920 1200 /*h_active, v_active*/
				2066 1229 /*h_period, v_period*/
				8 /*lcd_bits*/
				154 86>; /*screen_widht, screen_height*/
			lcd_timing = <4 23 0 /*hs_width, hs_bp, hs_pol*/
				4 14 0>; /*vs_width, vs_bp, vs_pol*/
			clk_attr = <0xff /*fr_adj_type(0=clk, 1=htotal, 2=vtotal)*/
				0 /*clk_ss_level */
				1 /*clk_auto_generate*/
				152346840>; /*pixel_clk(unit in Hz)*/
			mipi_attr = <4 /*lane_num*/
				1000 /*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)*/
1 Like

Thank you @xiong.zhang , I have set the Bit Rate to 1000 MHz and now am getting an image on my 480x480 mipi display (Model E40RC-FS1000). The image seems skewed / chopped (See image) do you have any idea what this could be due to? Maybe some of the other parameters? It looks to be the same colors as the login screen on boot. Also, can briefly make out the boot logo during U-Boot.

Hello, are you using the latest code? We have made vim3 compatible with multiple different MIPI screens through TP, so you have to check the relevant codes in these paths and modify them to the bootloader/ you need. Use git log --grep=LCD in uboot, system/core, hardware/amlogic/hwcomposer, hardware/interfaces to search for LCD or MIPI related submissions. The phenomenon in the following post should be similar to what you are encountering now. You can refer to it. Our VIM series is handled in this way.