1.问题背景:
am5728+lt8718+显示屏(MIPI DPI)
linux版本:4.9.69
当前三基色,红、绿、蓝测试显示屏颜色正确。
应用程序使用QT UI调用系统接口,设置颜色是添加了透明度参数,显示屏的颜色与实际的颜色不匹配。
2.问题描述:
当前做了一下linux驱动修改,但是还是不正确。请教,ARGB透明度参数驱动中怎么修改?
3.修改驱动测试:
1.将drivers/vedio/fbdev/omap2/omapfb/omapfb-main.c中的 fb_mode_to_dss_mode()函数
case 32:
dssmode = OMAP_DSS_COLOR_RGB24U;
break;
改为:
case 32:
dssmode = OMAP_DSS_COLOR_ARGB32;
break;
2.将drivers/vedio/fbdev/omap2/omapfb/omapfb-main.c中的 _setcolreg()函数
case OMAPFB_COLOR_RGB24U: if (r != 0) break; printk("%s regno:%d\n", __func__, regno); if (regno < 16) { u32 pal; pal = ((red >> (16 - var->red.length)) << var->red.offset) | ((green >> (16 - var->green.length)) << var->green.offset) | (blue >> (16 - var->blue.length)); ((u32 *)(fbi->pseudo_palette))[regno] = pal; } break;
改为:
case OMAPFB_COLOR_RGB24U: case OMAPFB_COLOR_ARGB32: if (r != 0) break; printk("%s regno:%d\n", __func__, regno); if (regno < 16) { u32 pal; pal = ((transp >> (16 - var->transp.length)) << var->transp.offset) | ((red >> (16 - var->red.length)) << var->red.offset) | ((green >> (16 - var->green.length)) << var->green.offset) | (blue >> (16 - var->blue.length)); ((u32 *)(fbi->pseudo_palette))[regno] = pal; } break;