[i.MX6Q][QNX Neutrino 6.6.0]调试笔记------LVDS显示配置

QNX提供给imx6-SebreSmart的BSP默认是HDMI显示的,我板子是LVDS接显示屏的,所以需要修改显示这块。从资料介绍来看,QNX是采用了一个OpenWF的API集,具体如何实现的不关心,这里只需要关心的是如何去配置LCD的参数和时序供OpenWF使用即可


OpenWF™是一个免版税,跨平台APIs,它提供了一个底层硬件抽象接口,利用组成成分和显示硬件合成窗口系统。当有新的显示器接入,只需要通过OpenwF的显示配置API(Wfdcfg Library)提供显示器的参数。Wfdcfg Library把显示器的属性和模式提供显示驱动和屏幕,交互图如下:

[i.MX6Q][QNX Neutrino 6.6.0]调试笔记------LVDS显示配置_第1张图片

整个配置过程其实就是生成一个wfdcfg函数库供OpenWF调用


1、修改源码

wfdcfg源码目录:QNX_BSP_sabresmart/src/hardware/wfd/imx6x/wfdcfg,在该目录已经有 imx6x-hdmi目录的存在,拷贝一份hdmi为lvds

$:cp imx6x-hdmi imx6x-lvds
$:cd imx6x-lvds
$:mv hdmi.c mylvds.c

根据自己LCD参数修改mylvds.c

static const struct mode modes[] = {
	// 1280x720 @ 60 Hz
	{
		.timing = {
			.pixel_clock_kHz =  74250,
			.hpixels = 1280, .hfp=110, .hsw= 40, .hbp=220,  // 1650 total
			.vlines  =  720, .vfp=  5, .vsw=  5, .vbp= 20,  //  750 total
			.flags = 0,
		},
	},
	{
		// marks end of list
		.timing = {.pixel_clock_kHz = 0},
	},
};

退出重新编译后,会在QNX_BSP_sabresmart\src\hardware\wfd\imx6x\wfdcfg\imx6x-lvds\nto\arm\dll.le.v7中生成一个wfdcfglibrary-----libwfdcfg-imx6x-lvds.so
libwfdcfg-imx6x-lvds.so拷贝到QNX_BSP_sabresmart\prebuilt\armle-v7\usr\lib\graphics\iMX6X

2、修改配置文件
QNX_BSP_sabresmart\prebuilt\armle-v7\usr\lib\graphics\iMX6X目录中有个graphics.conf的配置文件,可以配置LCD的模式、分辨率等等,其中的分辨率配置得在上面mylvds.c中支持
graphics.conf
begin khronos

  begin egl display 1
    egl-dlls = libGAL-gc320v0.so libEGL_viv.so
    glesv1-dlls = libGAL-gc320v0.so libEGL_viv.so libGLES_CM_viv.so
    glesv2-dlls = libGAL-gc320v0.so libEGL_viv.so libGLESv2_viv.so
    vg-dlls = libGAL-gc320v0.so libEGL_viv.so libOpenVG_viv.so
    glesv2-sc-dlls = libGLSLC.so

    # OpenVG emulated on the 3D hardware.  Runs on all known i.MX6 platforms except SoloLite.
    gpu-dlls = libGalcore-3dvg.so

  end egl display

  begin wfd device 1
   # 7" Chimei 1024x600 @60 display on LVDS0
   wfd-dlls = libwfdcfg-imx6x-lvds.so libimx6xCSCgamma-generic.so libWFDimx6x.so     # 其中这里添加刚刚生成的lvds库
   display-type = lvds0                                                              # 选择LVDS接口


# If you need IPU1 for capture, you can move WFD to IPU2 instead                     # IPU选择
   ipu-index = 1
   # ipu-index = 2

# Abort on vsync timeouts (used to detect PLL failure)
   vsync-failure-limit = 4

# GPU driver minimum memory pool sizes in MB (2..248)
   # gpu-contiguousMB   = 248
   gpu-contiguousMB   = 64      # recommended
   # gpu-contiguousMB   = 2     # minimum

   gpu-internalPoolMB = 6
   gpu-sharedPoolMB   = 2

   #gpu-pm-force-power-on = true

# Options to control what debug build of driver writes to slog
   debug-alloc = 0      # Logs memory allocations
   debug-cscgamma = 0   # Logs CSC/Gamma correction activity
   debug-idmac = 0      # Logs IDMAC parameters
   debug-isr = 0        # Logs IRQ statistics
   debug-pipeline = 0   # Logs pipeline activity
   debug-register = 0   # Logs register activity to tracelog (not slog!)
   debug-resize = 0     # Logs resizer (IPU IC PP) activity
   debug-trace = 0      # Logs entry into each WFD function
   debug-misc = 0       # Logs everything else

  end wfd device

end khronos

begin winmgr
  begin globals
    blit-config = gc320v0
    blits-logsize = 4096
  end globals

  begin display internal

    # Innolux display only
    video-mode = 1024 x 600 @ 60                                          # 适应LCD的分辨率

 end display

  begin class framebuffer
    display = internal
    pipeline = 2
    format = rgba8888                                                     # 显示格式,这个很关键,修改过这个参数,在后面吃过大亏
    usage = gc320v0
  end class

end winmgr

3、修改Buildfile
在Buildfile的Graphics support部分,添加lvds库文件
[search=../install/armle-v7/usr/lib/graphics/iMX6X] /usr/lib/graphics/iMX6X/libwfdcfg-imx6x-lvds.so=libwfdcfg-imx6x-lvds.so

在QNX_BSP根目录 make clean  然后 make,生成新的QNX-IFS,拷贝到SD卡中启动板子:
Welcome to QNX Neutrino Initial Program Loader for Freescale i.MX6Q Sabre-Smart (ARM Cortex-A9 MPCore)
SDMMC download...
load image done.
Found image               @ 0x18000008
Jumping to startup        @ 0x108068F8
SCU_CONFIG = 00005503, 4 cpus
L2 cache enabled
CPU0: L1 Icache: 1024x32
CPU0: L1 Dcache: 1024x32 WB
CPU0: VFP-d32 FPSID=41033094
CPU0: NEON MVFR0=10110222 MVFR1=01111111
CPU0: 412fc09a: Cortex A9 MPCore rev 10 792MHz

Detected i.MX6 Dual/Quad, revision Unknown Revision

PLL1 - System     : 792MHz
PLL2 - System Bus : 528MHz
PLL3 - OTG USB    : 480MHz
PLL4 - Audio      : 36MHz
PLL5 - Video      : 339MHz
PLL7 - Host USB   : 480MHz
PLL8 - Enet       : 50MHz
IPG clock     : 66000000Hz
IPG per clock : 66000000Hz
UART clock    : 80000000Hz
CSPI clock    : 60000000Hz
AHB clock     : 132000000Hz
AXI clock     : 264000000Hz
EMI_SLOW clock: 29333333Hz
DDR clock     : 528000000Hz
USDHC1 clock  : 198000000Hz
USDHC2 clock  : 198000000Hz
USDHC3 clock  : 198000000Hz
USDHC4 clock  : 198000000Hz
ENFC clock    : 24000000Hz

CPU1: L1 Icache: 1024x32
CPU1: L1 Dcache: 1024x32 WB
CPU1: VFP-d32 FPSID=41033094
CPU1: NEON MVFR0=10110222 MVFR1=01111111
CPU1: 412fc09a: Cortex A9 MPCore rev 10 792MHz
CPU2: L1 Icache: 1024x32
CPU2: L1 Dcache: 1024x32 WB
CPU2: VFP-d32 FPSID=41033094
CPU2: NEON MVFR0=10110222 MVFR1=01111111
CPU2: 412fc09a: Cortex A9 MPCore rev 10 792MHz
CPU3: L1 Icache: 1024x32
CPU3: L1 Dcache: 1024x32 WB
CPU3: VFP-d32 FPSID=41033094
CPU3: NEON MVFR0=10110222 MVFR1=01111111
CPU3: 412fc09a: Cortex A9 MPCore rev 10 792MHz
cpu_startnext: cpu1 -> fc411d58
cpu_startnext: cpu2 -> fc411d58
cpu_startnext: cpu3 -> fc411d58

System page at phys:10023000 user:fc410000 kern:fc410000
Starting next program at vfe054e3c
cpu_startnext: cpu0 -> fe054e3c
Welcome to QNX Neutrino 6.6.0 on the i.mx6 Smart-Device (ARM Cortex-A9 MPCore)
Starting watchdog...
 
Starting SD3 memory card driver...
Starting SD1 (microSD connector) memory card driver...
Unable to access "/dev/sd20" (2)
setting env variables.
Starting Screen Graphics...
Mempool Map addr range[28100000-2c700000]
Mempool Map paddr range[4b600000-4fc00000]
[Interrupt] Attached irqLine 41 with id 6.
[Interrupt] Attached irqLine 42 with id 7.
Attached resmgr to /dev/galcore with id:0.
done.
Launching devb-umass...
done
# 

从上面打印信息来看Screen已经启动OK了,运行OpenGL的测试程序gles2-gears,可以看到三个齿轮旋转,色差没什么都正常就说明Wfdcfg Library是OK了


你可能感兴趣的:([i.MX6Q][QNX Neutrino 6.6.0]调试笔记------LVDS显示配置)