经过一段时间的苦苦摸索,终于搞定了lubuntu下固定分辨率(自适应还在研究,后期会更新)和色深的修改(16位改成32位),现在来和大家分享一下研究成果,目前的修改是基于VGA显示的,HDMI的暂时还没研究
固定分辨率的修改:
第一步:
打开 ”kernel/drivers/video/rockchip/vga/sda7123_vga.c“ 找到如下代码(18行):
[mw_shl_code=c,false]
const struct fb_videomode sda7123_vga_mode[] = {
[/mw_shl_code]
第二步:
打开屏幕配置文件 ”kernel/arch/arm/boot/dts/lcd-box.dtsi“在最后面添加一份timing,里面的参数按照第一步源码里面的参数进行配置,一一对应即可。
第三步:
配置完成后修改”kernel/drivers/video/rockchip/vga/firefly_vga.c“
文件里面的宏定义(18行):#define DEFAULT_MODE 10(此值需要修改成对应的值,即第一步里面对应分辨率的下标值加1);
最后编译内核烧写即可;
修改色深为32位:
第一步:
打开“kernel/drivers/video/rockchip/rk_fb_box.c,跳到2300行作如下修改:
[mw_shl_code=c,false]
static struct fb_var_screeninfo def_var = {
/*
#if defined(CONFIG_LOGO_LINUX_BMP)
.red = {16, 8, 0},
.green = {8, 8, 0},
.blue = {0, 8, 0},
.transp = {0, 0, 0},
.nonstd = HAL_PIXEL_FORMAT_BGRA_8888,
*/
//modify by hongyin at 2016-04-06
#if 1
.red = {16, 8, 0},
.green = {8, 8, 0},
.blue = {0, 8, 0},
.transp = {0, 0, 0},
.nonstd = HAL_PIXEL_FORMAT_RGBX_8888,
.bits_per_pixel = 32,
#else
.red = {11, 5, 0},
.green = {5, 6, 0},
.blue = {0, 5, 0},
.transp = {0, 0, 0},
.nonstd = HAL_PIXEL_FORMAT_RGB_565, /* (ypos<<20+xpos<<8+format) format */
.bits_per_pixel = 16,
#endif
.grayscale = 0, /* (ysize<<20+xsize<<8) */
.activate = FB_ACTIVATE_NOW,
.accel_flags = 0,
.vmode = FB_VMODE_NONINTERLACED,
};
[/mw_shl_code]
然后跳到2850行左右注掉以下代码:
[mw_shl_code=c,false]
#if defined(CONFIG_LOGO_LINUX_BMP)
fbi->var.bits_per_pixel = 32;
#else
fbi->var.bits_per_pixel = 16;
#endif
[/mw_shl_code]
第二步:
打开“kernel/drivers/video/rockchip/lcdc/rk3288_lcdc.c”,调到2180行作如下修改:
[mw_shl_code=c,false]
case XBGR888:
case ABGR888:
fmt_cfg = 0;
win->swap_rb = 0;
win->fmt_10 = 0;
break;
[/mw_shl_code]
最后编译烧写,OK:victory:
原作者:hongyin
|