背景

  • Platform: IMX6Q
  • OS: Linux-QT5
  • Kernel: 4.1.15

需求

因项目需求,需要在imx6Q-Linux(QT)上实现双屏同显(LVDS+HDMI)
QT:5.8
LVDS(1280*800)
HDMI(此方法只支持1280*720,因为LVDS屏为1280*800,所以做720P不需要进行缩放或拉伸)

方法

  1. 修改DTS的HDMI对应的fb的配置
    mode_str ="1280x720M@60";
  2. 修改fb的驱动(drivers/video/fbdev/mxc/mxc_ipuv3_fb.c):
    //mxcfb_set_par函数, 处理mxcfb_unmap_video_memory:
    if(strcmp("DISP3 BG", fbi->fix.id) == 0){
    	for (i = 0; i < num_registered_fb; i++) {
    		if(strcmp("DISP4 BG", registered_fb[i]->fix.id) == 0)
    		{
    			break; 
    		}
    		//mxc_fbi = ((struct mxcfb_info *)(registered_fb[i]->par));
    
    	}
    	dev_info(fbi->device, "DISP3 BG map\n");
    	fbi->screen_base = registered_fb[i]->screen_base;
    	//fbi->fix = registered_fb[i]->fix;
    	fbi->fix.smem_start = registered_fb[i]->fix.smem_start;
    	fbi->var.yres = registered_fb[i]->var.yres;
    	fbi->var.yres_virtual = registered_fb[i]->var.yres_virtual;
    	fbi->fix.smem_len = registered_fb[i]->fix.smem_len;
    	//fbi->var.yoffset = 80;
    }
    else{
    	dev_info(fbi->device, "DISP4 BG map\n");
    	if (!fbi->fix.smem_start || (mem_len > fbi->fix.smem_len)) {
    		if (fbi->fix.smem_start)
    			mxcfb_unmap_video_memory(fbi);
    
    		if (mxcfb_map_video_memory(fbi) < 0)
    			return -ENOMEM;
    	}
    }
    /*zdd*/
    /*
    if (!fbi->fix.smem_start || (mem_len > fbi->fix.smem_len)) {
    	
    	if (fbi->fix.smem_start)
    		mxcfb_unmap_video_memory(fbi);
    
    	if (mxcfb_map_video_memory(fbi) < 0)
    		return -ENOMEM;
    }*/
  3. 在启动脚本(如)添加:
    export QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER=1