RK3288[android 7.1]调试笔记 移除u-boot层logo显示,保留kernel层logo显示

1 把uboot层logo的显示关闭
修改\u-boot\drivers\video\rockchip_display.c文件

dongsy@build-server-100:~/work/dsy/rk3288-Android-7.0/u-boot(edp-lvds)$ git diff drivers/video/rockchip_display.c
diff --git a/drivers/video/rockchip_display.c b/drivers/video/rockchip_display.
index f477b20..4adc346 100644
--- a/drivers/video/rockchip_display.c
+++ b/drivers/video/rockchip_display.c
@@ -1035,8 +1035,8 @@ void rockchip_show_logo(void)
                s->logo.mode = s->logo_mode;
                if (load_bmp_logo(&s->logo, s->ulogo_name))
                        printf("failed to display uboot logo\n");
-               else
-                       display_logo(s);
+               //else
+               //      display_logo(s);
                if (load_bmp_logo(&s->logo, s->klogo_name))
                        printf("failed to display kernel logo\n");
        }

2 如果logo显示不显,调用kernel logo显示函数
修改\kernel\drivers\gpu\drm\rockchip\rockchip_drm_drv.c文件

dongsy@build-server-100:~/work/dsy/rk3288-Android-7.0/kernel(edp_lvds)$ git diff drivers/gpu/drm/rockchip/rockchip_drm_drv.c
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index c24c6d9..0bf332c 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -474,13 +474,6 @@ static int setup_initial_state(struct drm_device *drm_dev,
 
        funcs = connector->helper_private;
        conn_state->best_encoder = funcs->best_encoder(connector);
-       if (funcs->loader_protect)
-               funcs->loader_protect(connector, true);
-       connector->loader_protect = true;
-       encoder_funcs = conn_state->best_encoder->helper_private;
-       if (encoder_funcs->loader_protect)
-               encoder_funcs->loader_protect(conn_state->best_encoder, true);
-       conn_state->best_encoder->loader_protect = true;
        num_modes = connector->funcs->fill_modes(connector, 4096, 4096);
        if (!num_modes) {
                dev_err(drm_dev->dev, "connector[%s] can't found any modes\n",
@@ -503,8 +496,24 @@ static int setup_initial_state(struct drm_device *drm_dev,
        }
 
        if (!found) {
-               ret = -EINVAL;
-               goto error_conn;
+               list_for_each_entry(mode, &connector->modes, head) {
+                       if (mode->type & DRM_MODE_TYPE_PREFERRED) {
+                               found = 1;
+                               break;
+                       }
+               }
+
+               if (!found) {
+                       mode = list_first_entry_or_null(&connector->modes,
+                                                       struct drm_display_mode,
+                                                       head);
+                       if (!mode) {
+                               dev_err(drm_dev->dev,
+                                       "failed to find available modes\n");
+                               ret = -EINVAL;
+                               goto error_conn;
+                       }
+               }
        }
 
        set->mode = mode;
@@ -517,7 +526,18 @@ static int setup_initial_state(struct drm_device *drm_dev,
        drm_mode_copy(&crtc_state->adjusted_mode, mode);
        if (!match || !is_crtc_enabled) {
                set->mode_changed = true;
+               connector->loader_protect = false;
+               conn_state->best_encoder->loader_protect = false;
        } else {
+               if (funcs->loader_protect)
+                       funcs->loader_protect(connector, true);
+               connector->loader_protect = true;
+               encoder_funcs = conn_state->best_encoder->helper_private;
+               if (encoder_funcs->loader_protect)
+                       encoder_funcs->loader_protect(conn_state->best_encoder,
+                                                     true);
+               conn_state->best_encoder->loader_protect = true;
+
                ret = drm_atomic_set_crtc_for_connector(conn_state, crtc);
                if (ret)
                        goto error_conn;
@@ -582,12 +602,16 @@ error_crtc:
        if (priv->crtc_funcs[pipe] && priv->crtc_funcs[pipe]->loader_protect)
                priv->crtc_funcs[pipe]->loader_protect(crtc, false);
 error_conn:
-       if (funcs->loader_protect)
-               funcs->loader_protect(connector, false);
-       connector->loader_protect = false;
-       if (encoder_funcs->loader_protect)
-               encoder_funcs->loader_protect(conn_state->best_encoder, false);
-       conn_state->best_encoder->loader_protect = false;
+       if (connector->loader_protect) {
+               if (funcs->loader_protect)
+                       funcs->loader_protect(connector, false);
+               connector->loader_protect = false;
+       }
+       if (conn_state->best_encoder->loader_protect) {
+               if (encoder_funcs->loader_protect)
+                       encoder_funcs->loader_protect(conn_state->best_encoder, false);
+               conn_state->best_encoder->loader_protect = false;
+       }
 
        return ret;
 }

你可能感兴趣的:(RK)