这里以Rockchip平台为例,Rockchip平台lcd timing常见参数配置如下:
disp_timings: display-timings {
native-mode = <&timing0>;
timing0: timing0 {
clock-frequency = <31000000>;
hactive = <480>;
vactive = <854>;
hback-porch = <24>;
hfront-porch = <72>;
vback-porch = <10>;
vfront-porch = <12>;
hsync-len = <24>;
vsync-len = <2>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
};
};
常规参数
其中以下参数根据屏的规格书填写:
hactive = <480>; // 分辨率-宽
vactive = <854>; // 分辨率-高
hback-porch = <24>; // 行可视范围前肩
hfront-porch = <72>; // 行可视范围后肩
vback-porch = <10>; // 帧可视前肩
vfront-porch = <12>; // 帧可视后肩
hsync-len = <24>; // 行同步肪冲宽度
vsync-len = <2>; // 场同步脉冲宽度
以下参数表示对应信号的有效电平,默认为低电平(0):
hsync-active = <0>; // 行同步信号
vsync-active = <0>; // 场同步信号
de-active = <0>; // de信号
pixelclk-active = <0>; // clk信号
clock-frequency 的计算方法
已知下面参数:
- fps: 屏幕刷新率(默认:60帧)
- htotal: hactive + hback-porch + hfront-porch + hsync-len
- vtotal: vactive + hfront-porch + vfront-porch + vsync-len
求clock-frequency公式如下:
htotal * vtotal * fps = clock-frequency
按照上面参考参数计算如下:
(480 + 24 + 72 + 24) x (854 + 10 + 12 + 2) x 60 = 31608000
计算出来的准确值为31608000,我们取整:
clock-frequency = <31000000>;
dsi_hs_clk 的计算方法
100 + ((htotal * vtotal * fps) * 3 * 8 / lanes)