Android 屏幕参数

https://source.android.google.cn/devices/architecture/dto

Posted by LXG on July 15, 2021

U盘修改屏幕参数

设备树叠加层

显示硬件篇

屏幕接口类型

  1. LVDS: Low-Voltage Differential Signaling
  2. Dual LVDS
  3. MIPI: Mobile Industry Processor Interface
  4. HDMI: High Definition Multimedia Interface

rk3288 dts

kernel/arch/arm/boot/dts/rk3288-*.dts


&lvds_panel {
	status = "okay";
	compatible ="simple-panel";
	backlight = <&backlight>;
	bus-format = <MEDIA_BUS_FMT_RGB888_1X24>;
	enable-gpios = <&gpio7 2 GPIO_ACTIVE_HIGH>;
	enable-delay-ms = <10>;
	power-supply = <&vcc_lcd>;
	rockchip,data-mapping = "vesa";
	rockchip,data-width = <24>;
	rockchip,output = "duallvds";


	display-timings {
		native-mode = <&timing0>;
		timing0: timing0 {
			clock-frequency = <148500000>;
			hactive = <1920>;
			vactive = <1080>;
			hback-porch = <30>;
			hfront-porch = <220>;
			vback-porch = <10>;
			vfront-porch = <25>;
			hsync-len = <30>;
			vsync-len = <10>;
			hsync-active = <0>;
			vsync-active = <0>;
			de-active = <0>;
			pixelclk-active = <0>;
		};
	};
};

参数解释


status:okay  状态
compatible:simple-panel  与 lvds panel 驱动进行匹配
backlight:  &backlight 引用背光节点, panel 驱动会解析并对背光进行控制
enable-gpios:  &gpio7 3 GPIO_ACTIVE_HIGH 屏的 enable 脚的 gpio 配置,参考原理图。
enable-delay-ms: 10  开启背光之前的延时,参考屏规格书
rockchip,data-mapping: vesa or jeida LVDS 信号的两种编码方式 
rockchip,data-width:18 or 24 or 30 LVDS 的数据位, RGB 三个分量都是 6bit 的填 18,RGB 三个分量都是 8bit 的填 24,RGB 三个分量都是 10bit 的填 30。
rockchip,output:  lvds or duallvds 双通道 LVDS, 目前只有 rk3288 支持
clock-frequency:dclk 频率,单位为 Hz,一般屏的规格书中有,也可以通过公式计算:H*V(包括同步信号)*fps
Hactive:水平有效像素
Vactive:垂直有效像素

U盘参数


# 0 - DSI; 1 - eDP; 2 - LVDS;
panel-type = 2;

# panel info
unprepare-delay-ms = 100;
enable-delay-ms = 100;
disable-delay-ms = 100;
prepare-delay-ms = 100;
reset-delay-ms = 100;
init-delay-ms = 100;
width-mm = 100;
height-mm = 100;

# panel timing
clock-frequency = 148500000;
hactive = 1920;
vactive = 1080;
hback-porch = 30;
hfront-porch = 220;
vback-porch = 10;
vfront-porch = 25;
hsync-len = 30;
vsync-len = 10;
hsync-active = 0;
vsync-active = 0;
de-active = 0;
pixelclk-active = 0;

## rockchip_display.c

u-boot/drivers/video/rockchip_display.c

```c

enum {
	PANEL_TYPE_DSI,
	PANEL_TYPE_EDP,
	PANEL_TYPE_LVDS,
};

lcdparamservice.c


#define LCD_PARAMETE_FILE_PATH         "busybox find  /mnt/media_rw/ -name wif_rk_parameters"
#define OEM_PARTITIOM_NODE_PATH         "/dev/block/platform/ff0f0000.dwmmc/by-name/oem"
/*#define OEM_PARTITIOM_NODE_PATH         "data/oem"*/

/*#define RKNAND_GET_VENDOR_SECTOR0       _IOW('v', 16, unsigned int)*/
/*#define RKNAND_STORE_VENDOR_SECTOR0     _IOW('v', 17, unsigned int)*/


#define RKNAND_SYS_STORGAE_DATA_LEN 512  //oem size
/*#define VENDOR_SECTOR_OP_TAG        0x444E4556 // "VEND"*/

#define POLY    0xEDB88320L              //CRC stand
#define CONFIG_NUM  26

char *key[CONFIG_NUM] =
{
	"panel-type",

	"unprepare-delay-ms",
	"enable-delay-ms",
	"disable-delay-ms",
	"prepare-delay-ms",
	"reset-delay-ms",
	"init-delay-ms",
	"width-mm",
	"height-mm",

	"clock-frequency",
	"hactive",
	"hfront-porch",
	"hsync-len",
	"hback-porch",
	"vactive",
	"vfront-porch",
	"vsync-len",
	"vback-porch",
	"hsync-active",
	"vsync-active",
	"de-active",
	"pixelclk-active",

	"dsi,flags", 
	"dsi,format",
	"dsi,lanes",
	"panel-init-sequence"
};

MIPI

mipi_creen_parma

mipi_creen_driver


&dsi0 {
	status = "okay";
	rockchip,lane-rate = <600>;

	panel: panel {
		compatible = "simple-panel-dsi";
		reg = <0>;
		backlight = <&backlight>;
		reset-gpios = <&gpio7 3 GPIO_ACTIVE_LOW>;
		dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_LPM)>;
		dsi,format = <MIPI_DSI_FMT_RGB888>;
		dsi,lanes = <4>;
		bus-format = <MEDIA_BUS_FMT_RBG888_1X24>;
		reset-delay-ms = <20>;
                init-delay-ms = <20>;
                enable-delay-ms = <20>;
                prepare-delay-ms = <20>;
                unprepare-delay-ms = <20>;
		status = "okay";
		panel-init-sequence = [
		39 00 03 F0 5A 5A
		39 00 03 F1 A5 A5
		39 00 03 F0 B4 4B
		39 00 03 C2 83 10
		39 00 0D B0 ba 98 ba 98 33 33 33 33 2a 00 84 00
		39 00 09 B1 93 94 02 89 2a 01 84 01
		39 00 12 B7 01 01 09 11 0D 15 19 0D 21 1D 00 00 20 00 02 ff 3c
		39 00 07 BD 4E 0E 4B 4B 20 1A
		39 00 06 B8 24 01 30 34 55
		39 00 06 C7 05 23 6B 49 00
		39 00 09 C6 00 00 FF 00 00 FF 00 00
		39 00 04 C3 22 61 04
		39 00 17 B3 1C 1C 05 05 07 07 1D 1D 23 03 22 22 03 13 13 11 11 0F 0F 0D 0D 00
		39 00 17 B4 1C 1C 04 04 06 06 1D 1D 23 03 22 22 03 12 12 10 10 0E 0E 0C 0C 00
		39 00 04 d0 07 ff ff 
		39 00 05 D2 63 0B 08 88
		39 00 27 C8 7E 60 52 45 42 32 37 22 3C 3B 3B 5B 4B 54 47 44 37 25 0C 7C 62 52 46 42 32 37 22 3B 3B 3A 5B 4B 54 47 44 37 25 0C
                05 78 01 11
                05 32 01 29
		];
		panel-exit-sequence=[
		05 78 01 28
		05 78 01 10
		];
		disp_timings: display-timings {
			native-mode = <&timing0>;

			timing0: timing0 {
				clock-frequency = <87000000>;
				hactive = <800>;
				vactive = <1280>;
				hback-porch = <80>;
				hfront-porch = <80>;
				vback-porch = <24>;
				vfront-porch = <16>;
				hsync-len = <20>;
				vsync-len = <8>;
				hsync-active = <0>;
				vsync-active = <0>;
				de-active = <0>;
				pixelclk-active = <0>;
			};
		};
	};
};

&route_dsi0 {
	status = "okay";
};