RGB引脚排列

需要确认rgb的对应pin的mapping,在TRM的 13.3.3中。

于是我们打开Errata

则需要按照这个表格接各个信号。

RGB565和RGB888的区别:

图来自http://alfredoer.com/wp-content/uploads/2015/01/RGB888convertToRGB565.png

相关的内核配置

https://github.com/torvalds/linux/blob/v5.4/Documentation/devicetree/bindings/display/tilcdc/tilcdc.txt

- blue-and-red-wiring: Recognized values "straight" or "crossed".
This property deals with the LCDC revision 2 (found on AM335x)
color errata [1].
- "straight" indicates normal wiring that supports RGB565,
BGR888, and XBGR8888 color formats.
- "crossed" indicates wiring that has blue and red wires
crossed. This setup supports BGR565, RGB888 and XRGB8888
formats.
- If the property is not present or its value is not recognized
the legacy mode is assumed. This configuration supports RGB565,
RGB888 and XRGB8888 formats. However, depending on wiring, the red
and blue colors are swapped in either 16 or 24-bit color modes.

我们设备树中默认配置是blue-and-red-wiring = "crossed", 即支持RGB888的格式,

如果要修改RGB565格式, 需要配置blue-and-red-wiring = "straight", 但修改为RGB565后会发现系统启动qt程序报错. 

root@phyboard-wega-am335x-1:~# /usr/share/phytec-qtdemo/phytec-qtdemo
Unable to query physical screen size, defaulting to 100 dpi.
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
PVR:(Error): WSEGL_CreateWindowDrawable: Couldn't set CRTC: Invalid argument [0, ]
EGL Error : Could not create the egl surface: error = 0x3003

这个错误可以通过/etc/powervr.ini增加DefaultPixelFormat的配置解决:

[default]
#WindowSystem=libpvrws_WAYLAND.so
DefaultPixelFormat=RGB565

修改后重启系统即可启动qt程序.

设备树配置

我们显示部分的配置都位于am335x-phytec-lcd.dtsi这个文件中。

其中timing的配置请参考 设备树中的LCD液晶屏修改方法/LCD display timings in device tree

AM335x默认为PCLK下降沿采样,而我们的设备树默认为上升沿采样,该设置位于

am335x-phytec-lcd.dtsi中的 invert-pxl-clk

	panel-info {
		ac-bias = <255>;
		ac-bias-intrpt = <0>;
		dma-burst-sz = <16>;
		bpp = <32>;
		fdd = <0x80>;
		sync-edge = <0>;
		sync-ctrl = <1>;
		raster-order = <0>;
		fifo-th = <0>;
		invert-pxl-clk;
		};

也可以通过在屏幕的timing中加入

timing4: ETM0700G0EDH6_WEGA {
							pixelclk-active = <1>;

来修改。

转LVDS信息

关于怎样接LVDS的参考电路及注意事项,请参考:

RGB/并口 转 LVDS 信息 / Guide on how to convert from RGB/parallel to LVDS

分辨率限制

LCD接口受CPU带宽影响,达不到标称的分辨率,一般认为最大1366x768@60,主要由两个方面因素

  • LCD屏幕的像素时钟频率
  • 使用的是24/32位还是16位颜色

上面两个因素是影响带宽的主要因素,而在系统层面也是可以做优化,我们已经将这个优化试试在PD17版本之后的bootloader中。

参考:http://software-dl.ti.com/processor-sdk-linux/esd/docs/latest/linux/Foundational_Components/Kernel/Kernel_Drivers/Display/LCDC.html 中的LCDC memory bandwidth issues 一节。


  • No labels