[rk3288][Android7.1]重启后无法显示kernel logo

问题描述

系统重启后可以显示uboot logo, kernel logo 无法显示

问题分析

在kernel中添加log,各个参数值如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[gyl] setup_initial_state:496 mode->hdisplay = 720
[gyl] setup_initial_state:497 mode->vdisplay = 1280
[gyl] setup_initial_state:498 mode->crtc_hsync_end 726
[gyl] setup_initial_state:499 mode->crtc_vsync_end 1299
[gyl] setup_initial_state:500 mode->vrefresh = 76
[gyl] setup_initial_state:501 mode->flags = 2147483654d
[gyl] setup_initial_state:502
[gyl] setup_initial_state:503 set->hdisplay = 720
[gyl] setup_initial_state:504 set->vdisplay = 1280
[gyl] setup_initial_state:505 set->crtc_hsync_end = 726
[gyl] setup_initial_state:506 set->crtc_vsync_end = 1299
[gyl] setup_initial_state:507 set->vrefresh = 76
[gyl] setup_initial_state:508 set->flags = 6d
[gyl] show_loader_logo:772

其中mode->flags = 2147483654d 明显存在异常,根据代码只有所有参数与uboot里的配置相同时才能正常显示。

1
2
3
4
5
6
7
8
9
10
11
12
list_for_each_entry(mode, &connector->modes, head) {
if (mode->hdisplay == set->hdisplay &&
mode->vdisplay == set->vdisplay &&
mode->crtc_hsync_end == set->crtc_hsync_end &&
mode->crtc_vsync_end == set->crtc_vsync_end &&
drm_mode_vrefresh(mode) == set->vrefresh &&
mode->flags == set->flags) {
found = 1;
match = 1;
break;
}
}

解决方法

  • 这些参数可在dts中配置,kernel的代码中会读取这些参数

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20

    if (!of_property_read_u32(route, "video,hdisplay", &val))
    set->hdisplay = val;

    if (!of_property_read_u32(route, "video,vdisplay", &val))
    set->vdisplay = val;

    if (!of_property_read_u32(route, "video,crtc_hsync_end", &val))
    set->crtc_hsync_end = val;

    if (!of_property_read_u32(route, "video,crtc_vsync_end", &val))
    set->crtc_vsync_end = val;

    if (!of_property_read_u32(route, "video,vrefresh", &val))
    set->vrefresh = val;

    if (!of_property_read_u32(route, "video,flags", &val))
    set->flags = val;

    ......
  • android 5.1代码中没有对flags进行判断,最简单的修改方式就是去掉flags的判断。


## patch

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/kernel/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/kernel/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index c24c6d9..28e4e38 100644 (file)
--- a/kernel/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/kernel/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -494,8 +494,7 @@ static int setup_initial_state(struct drm_device *drm_dev,
mode->vdisplay == set->vdisplay &&
mode->crtc_hsync_end == set->crtc_hsync_end &&
mode->crtc_vsync_end == set->crtc_vsync_end &&
- drm_mode_vrefresh(mode) == set->vrefresh &&
- mode->flags == set->flags) {
+ drm_mode_vrefresh(mode) == set->vrefresh) {
found = 1;
match = 1;
break;
您的支持将鼓励我继续创作!