Buildroot显示kernel logo

发布时间:2024年01月23日

buildroot开机时DSI屏幕变成跟uart一样输出log,现在想显示logo?

1、failed to show loader logo?

[    2.467479]  mmcblk1: p1 p2 p3 p4 p5 p6 p7 p8 p9
[    2.468827] rockchip-drm display-subsystem: can't not find any loader display
[    2.468859] rockchip-drm display-subsystem: failed to show loader logo
[    2.472110] rockchip-vop ff8f0000.vop: [drm:vop_crtc_atomic_enable] Update mode to 1024x600p75, type: 16
[    2.472439] dw-mipi-dsi ff960000.dsi: [drm:dw_mipi_dsi_encoder_enable] final DSI-Link bandwidth: 504 x 4 Mbps
[    2.474823] panel_simple_prepare p->prepared=1
[    2.474828] sn65dsi84_is_connected  sn65dsi84 connect = 0
[    2.474834] panel_simple_enable p->enabled=1

static void show_loader_logo(struct drm_device *drm_dev)?

添加打印看看情况

@@ -993,21 +993,27 @@ static void show_loader_logo(struct drm_device *drm_dev)
        state->acquire_ctx = mode_config->acquire_ctx;

        for_each_child_of_node(root, route) {
-               if (!of_device_is_available(route))
+               if (!of_device_is_available(route)) {
+                       dev_warn(drm_dev->dev, "route->name=%s not available, route->type=%s, route->full_name=%s\n", route->name, route->type, route->full_name);
                        continue;
+               }

                set = of_parse_display_resource(drm_dev, route);
-               if (!set)
+               if (!set) {
+                       dev_warn(drm_dev->dev, "route->name=%s not set\n", route->name);
                        continue;
+               }

                if (setup_initial_state(drm_dev, state, set)) {
                        drm_framebuffer_put(set->fb);
                        INIT_LIST_HEAD(&set->head);
                        list_add_tail(&set->head, &mode_unset_list);
+                       dev_warn(drm_dev->dev, "route->name=%s add to mode_unset_list\n", route->name);
                        continue;
                }
                INIT_LIST_HEAD(&set->head);
                list_add_tail(&set->head, &mode_set_list);
+               dev_warn(drm_dev->dev, "route->name=%s add to mode_set_list\n", route->name);
        }

        /*
@@ -1020,6 +1026,7 @@ static void show_loader_logo(struct drm_device *drm_dev)

                list_for_each_entry_safe(set, tmp_set, &mode_set_list, head) {
                        if (set->crtc == unset->crtc) {
+                               dev_warn(drm_dev->dev, "find_used_crtc:%s\n", set->crtc->name);
                                find_used_crtc = 1;
                                continue;
                        }
@@ -1031,6 +1038,7 @@ static void show_loader_logo(struct drm_device *drm_dev)
                        struct rockchip_drm_private *priv =
                                                        drm_dev->dev_private;

+                       dev_warn(drm_dev->dev, "unset crtc:%s\n", crtc->name);
                        if (unset->hdisplay && unset->vdisplay) {
                                if (priv->crtc_funcs[pipe] &&
                                    priv->crtc_funcs[pipe]->loader_protect)

?加了打印后就有了这些输出,不过还是没看到kernel的logo,继续查找Console: switching

?2、Console: switching

[    2.443211] rockchip-drm display-subsystem: route->name=route-dsi add to mode_set_list
[    2.467159] Freeing drm_logo memory: 260K
[    2.482948] Console: switching to colour frame buffer device 128x37
[    2.497465] usb 3-1: New USB device found, idVendor=05e3, idProduct=06Populating /dev using udev: 10, bcdDevice=93.11
[    2.497480] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.497492] usb 3-1: Product: USB2.1 Hub
[    2.497502] usb 3-1: Manufacturer:
[    2.502957] rockchip-drm display-subsystem: fb0:  frame buffer device

?添加dump_stack()查看调用过程

+++ b/drivers/tty/vt/vt.c
@@ -3562,6 +3562,8 @@ static int do_bind_con_driver(const struct consw *csw, int first, int last,
                        clear_buffer_attributes(vc);
        }

+       dump_stack();
+
        pr_info("Console: switching ");
[    2.452309] Freeing drm_logo memory: 260K
[    2.468135] CPU: 4 PID: 43 Comm: kworker/4:1 Not tainted 4.19.193 #17
[    2.468138] Hardware name: ASUS Tinker Board 2Populating /dev using udev: /2S (DT)
[    2.468152] Workqueue: events deferred_probe_work_func
[    2.468156] Call trace:
[    2.468163]  dump_backtrace+0x0/0x188
[    2.468167]  show_stack+0x24/0x30
[    2.468173]  dump_stack+0x8c/0xb4
[    2.468179]  do_bind_con_driver+0x140/0x2f4
[    2.468182]  do_take_over_console+0x194/0x1d8
[    2.468186]  do_fbcon_takeover+0x78/0xe0
[    2.468189]  fbcon_event_notify+0x458/0x898
[    2.468194]  notifier_call_chain+0x70/0x90
[    2.468197]  __blocking_notifier_call_chain+0x58/0x84
[    2.468201]  blocking_notifier_call_chain+0x3c/0x4c
[    2.468206]  fb_notifier_call_chain+0x30/0x3c
[    2.468209]  register_framebuffer+0x2b4/0x2ec
[    2.468214]  __drm_fb_helper_initial_config_and_unlock+0x2b8/0x360
[    2.468218]  drm_fb_helper_initial_config+0x3c/0x50
[    2.468223]  rockchip_drm_fbdev_init+0xf0/0x120
[    2.468227]  rockchip_drm_bind+0x550/0x1958
[    2.468232]  try_to_bring_up_master+0x224/0x270
[    2.468235]  component_add+0xe4/0x13c
[    2.468238]  cdn_dp_probe+0x1b0/0x1c0
[    2.468242]  platform_drv_probe+0x58/0xa4
[    2.468245]  really_probe+0x2a8/0x3a4
[    2.468248]  driver_probe_device+0x124/0x134
[    2.468251]  __device_attach_driver+0xc8/0x100
[    2.468254]  bus_for_each_drv+0xb0/0xd4
[    2.468257]  __device_attach+0xdc/0x16c
[    2.468260]  device_initial_probe+0x24/0x30
[    2.468262]  bus_probe_device+0x38/0x98
[    2.468265]  deferred_probe_work_func+0xb8/0xcc
[    2.468269]  process_one_work+0x200/0x330
[    2.468272]  worker_thread+0x258/0x2fc
[    2.468275]  kthread+0x120/0x130
[    2.468279]  ret_from_fork+0x10/0x18
[    2.468281] Console: switching to colour frame buffer device 128x37

从rockchip_drm_bind分析,刚好执行完show_loader_logo后就到rockchip_drm_fbdev_init?

?

执行到nb->notifier_call(nb, val, v);也就是fbcon_event_notify(struct notifier_block *self, unsigned long action, void *data)?

kernel/drivers/video/fbdev/core/Makefile有CONFIG_FRAMEBUFFER_CONSOLE宏用来编译fbcon.o的,直接屏蔽

@@ -796,4 +796,4 @@ CONFIG_VT=y
 CONFIG_DUMMY_CONSOLE=y
 CONFIG_DUMMY_CONSOLE_COLUMNS=80
 CONFIG_DUMMY_CONSOLE_ROWS=25
-CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE is not set

?3、正常显示

buildroot显示kernel logo

文章来源:https://blog.csdn.net/ZOIpuus/article/details/135764462
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。