libdrm-2.4.112

编译

这个版本使用了meson进行构建、ninja进行编译 ;

安装meson

编译

 报错如上,查看meson.build文件,

我们的meson版本不正确, 查阅发现apt安装的版本过低;

安装meson

sudo apt-get install python3 python3-pip ninja-build

pip3 install --user meson

很奈斯

继续编译

 

发现报错,重启,又报错,

看来 之前没有安装py-3.7,重新安装

卸载自带的python3和python3.6导致重启后系统异常

用ubuntu18镜像重启,进livecd,编辑 /etc/resolv.conf,加入以下

nameserver 8.8.8.8

nameserver 8.8.4.4

切到系统盘 chroot  xxxx

apt install ubuntu-desktop

又报permission denied,但是重新安装发现只需要0B,直接重启试试, 可以进桌面了,但是网络无法使用了,没有网络设备

ifconfig ens33 up

netplan命令无法使用,重新进livecd安装

permission denied这个问题请使用手动mount到mnt目录解决;

卸载ubuntu-desktop,然后重装,又报下面的错误了

但愿只是个日志的记录;重启netplan可以使用,ubuntu界面也正常,但是 还是没有网络设备,再进livecd,对比安装包,apt list --installed | grep network

加装这两项 ,无效,又出现 no read/write access to /var/lib/plan

对比正常的系统

少了一样东西, 再次对比

 

 

 进livecd重装,好了,牛逼;

切换python版本

update-alternatives --display python    //查看当前的系统配置

apt list --installed | grep python    //查看所有安装的python版本

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1    //添加版本配置

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2    //添加版本配置

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 3    //添加版本配置

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 4    //添加版本配置

sudo update-alternatives --config python    //选择版本

选择版本的时候发现,自动选择的是priority高的

修改python3.6的优先级为300,让系统自带的python3.6在系统起来的时候可以正常被选择,

如果需要删除某个版本配置,使用以下命令

sudo update-alternatives --remove python /usr/bin/python2.7

好了,牛逼;

继续编译

meson build \
 --prefix=vexpress/rootfs \
 --cross-file=cross_file.txt \
 -D amdgpu=false \
 -D cairo-tests=false \
 -D etnaviv=false \
 -D exynos=true \
 -D freedreno=false \
 -D freedreno-kgsl=false \
 -D install-test-programs=true \
 -D intel=false \
 -D libkms=false \
 -D man-pages=false \
 -D nouveau=false \
 -D omap=false \
 -D radeon=false \
 -D tegra=false \
 -D udev=false \
 -D valgrind=false \
 -D vc4=false \
 -D vmwgfx=false

上面的命令报错,

 删除libkms试试,又报错,

 重新安装python3试试,已安装呀;重新安装python3-pip,再遍,没有报错了,

meson build \
 --prefix=vexpress/rootfs \
 --cross-file=cross_file.txt \
 -D amdgpu=false \
 -D cairo-tests=false \
 -D etnaviv=false \
 -D exynos=true \
 -D freedreno=false \
 -D freedreno-kgsl=false \
 -D install-test-programs=true \
 -D intel=false \
 -D man-pages=false \
 -D nouveau=false \
 -D omap=false \
 -D radeon=false \
 -D tegra=false \
 -D udev=false \
 -D valgrind=false \
 -D vc4=false \
 -D vmwgfx=false


The Meson build system
Version: 0.61.5
Source dir: vexpress/test/libdrm-2.4.112
Build dir: vexpress/test/libdrm-2.4.112/build
Build type: cross build
Project name: libdrm
Project version: 2.4.112
C compiler for the host machine: arm-linux-gnueabi-gcc (gcc 7.3.0 "arm-linux-gnueabi-gcc (Ubuntu/Linaro 7.                                                               3.0-16ubuntu3) 7.3.0")
C linker for the host machine: arm-linux-gnueabi-gcc ld.bfd 2.30
C compiler for the build machine: cc (gcc 7.3.0 "cc (Ubuntu 7.3.0-16ubuntu3) 7.3.0")
C linker for the build machine: cc ld.bfd 2.30
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: arm
Host machine cpu: armv7
Target machine cpu family: arm
Target machine cpu: armv7
Run-time dependency threads found: YES
Program symbols-check.py found: YES (/usr/bin/python3 vexpress/test/libdrm-2.4.112/symbols-chec                                                               k.py)
Program nm found: YES (/usr/bin/nm)
Program python3 found: YES (/usr/bin/python3)
Found Pkg-config: NO
Found CMake: NO
Run-time dependency atomic_ops found: NO (tried pkgconfig and cmake)
Checking if "Intel Atomics" : links: YES
Checking for function "dlsym" : NO
Library dl found: YES
Checking for function "clock_gettime" : YES
Library m found: YES
Check usable header "sys/select.h" : YES
Check usable header "alloca.h" : YES
Header <sys/sysmacros.h> has symbol "major" : YES
Header <sys/sysmacros.h> has symbol "minor" : YES
Header <sys/sysmacros.h> has symbol "makedev" : YES
Header <sys/mkdev.h> has symbol "major" : NO
Checking for function "open_memstream" : YES
Compiler for C supports arguments -Wsign-compare: YES
Compiler for C supports arguments -Werror=undef: YES
Compiler for C supports arguments -Werror=implicit-function-declaration: YES
Compiler for C supports arguments -Wpointer-arith: YES
Compiler for C supports arguments -Wwrite-strings: YES
Compiler for C supports arguments -Wstrict-prototypes: YES
Compiler for C supports arguments -Wmissing-prototypes: YES
Compiler for C supports arguments -Wmissing-declarations: YES
Compiler for C supports arguments -Wnested-externs: YES
Compiler for C supports arguments -Wpacked: YES
Compiler for C supports arguments -Wswitch-enum: YES
Compiler for C supports arguments -Wmissing-format-attribute: YES
Compiler for C supports arguments -Wstrict-aliasing=2: YES
Compiler for C supports arguments -Winit-self: YES
Compiler for C supports arguments -Winline: YES
Compiler for C supports arguments -Wshadow: YES
Compiler for C supports arguments -Wdeclaration-after-statement: YES
Compiler for C supports arguments -Wold-style-definition: YES
Compiler for C supports arguments -Wno-unused-parameter: YES
Compiler for C supports arguments -Wno-attributes: YES
Compiler for C supports arguments -Wno-long-long: YES
Compiler for C supports arguments -Wno-missing-field-initializers: YES
Run-time dependency pciaccess found: NO (tried pkgconfig and cmake)
Run-time dependency cunit found: NO (tried pkgconfig and cmake)
Program rst2man rst2man.py found: NO
Compiler for C supports function attribute visibility:hidden: YES
Configuring config.h using configuration
Build targets in project: 14
NOTICE: Future-deprecated features used:
 * 0.55.0: {'ExternalProgram.path'}

libdrm 2.4.112

    Intel                : False
    Radeon               : False
    AMDGPU               : False
    Nouveau              : False
    vmwgfx               : False
    OMAP                 : False
    Freedreno            : False
    Freedreon-kgsl       : False
    Tegra                : False
    Etnaviv              : False
    EXYNOS               : True
    VC4                  : False

  User defined options
    Cross files          : cross_file.txt
    prefix               : vexpress/rootfs
    amdgpu               : false
    cairo-tests          : false
    etnaviv              : false
    exynos               : true
    freedreno            : false
    freedreno-kgsl       : false
    install-test-programs: true
    intel                : false
    man-pages            : false
    nouveau              : false
    omap                 : false
    radeon               : false
    tegra                : false
    udev                 : false
    valgrind             : false
    vc4                  : false
    vmwgfx               : false

Found ninja-1.8.2 at /usr/bin/ninja
NOTICE: You are using Python 3.6 which is EOL. Starting with v0.62.0, Meson will require Python 3.7 or new                                                               er

 好的,牛逼;去看下输出目录,没有 ,还需要 执行ninja编译,meson只是构建;编译完成,再看下rootfs/lib,

 

 modetest也是重新安装了,且库都是存在的,启动vexpress试一下,

没有设备?正常应该是检测到pl111,需要核对下代码,先找下这个报错,从报错的地方开始找,

跟踪报错

 

 

发现是上面的drm_server_info==NULL, 然后这个drmOpenByName又失败,需要找找vexpress有没有正确编译进pl111驱动,参考网上帖子,配置出现报错,

vexpress配置探究

 查看发现pl111驱动也是这个名字,导致前面的驱动注册之后,这个注册不上;

查看makefile,发现很扯淡,

 为了快速解决,先看下高版本的内核有没有变动,

4.19和4.20.17对比,好像没啥区别,

4.19和 5.19.17对比, 变了一堆,我giao~,

 看看5.0.1的差距是不是小一些,

看来需要找个不冲突的版本了,参考网上别人用的,5.14.3,果然是干掉的,

就撅腚是你了~

使用vexpress_defconfig配置,不做任何修改,直接编译,然后发现又报错了,

pl111 deactived

查找代码,在这里,

 需要确认什么地方吧mux_motherboard置为false了,同时需要 确认为什么被置为false,

 但是继续看其他的日志,也没有问题,总之被加载了,但是modetest还是无法使用呀,/dev/dri下也没有设备,查看panel-arm-versatile.c并没有被编译,查看makefile,

想办法给他加上,

编译之后还是不行,查看这个文件的compatible,

 

发现只在versatile-ab.dts里面有配置,现在有两个选择,

1.把这个植到我们使用的dts中

2.找ab.dts用的是哪个defconfig

我们优先用2方式,省的多折腾,发现没有使用这个文件的,而且dts也不是在defconfig中指定的,dts文件夹中有很多dtb,这个是怎么来的?

尝试使用1但是无从下手,那么就使用versatile的配置编译试试吧,换上dtb,不行,启动都启动不了,看来versatile不是vexpress,这里需要更改 -M versatileab -m 256M,启动后kernel panic,后续再探究

在pl111_versatile.c中加上dump_stack,看下pl111_vexpress_clcd_init()的调用栈,没啥用,

注意到vexpress-v2p-ca9.dts中有clcd@10020000,对端port是dvi_bridge_in_ct,在vexpress-v2m.dtsi中找到dvi-transmitter@39,匹配的驱动是"sil,sii9022-tpi", "sil,sii9022",查找这两个是否有存在的,只有下面的驱动可以匹配,

 这个文件被编译了,找下驱动日志,加上enter和finish

驱动是正常加载的,查看日志,有几处错误,

can't create /proc/sys/kernel/hotplug: nonexistent directory

Device Drivers > Generic Driver Options > Support for uevent helper  打开这个选项

mounting debugfs on /sys/kernel/debug failed: No such file or directory

Kernel hacking > Generic Kernel Debugging Instruments > Debug Filesystem  打开这个选项

Failed to initialize '/bus@4000000/motherboard/iofpga@7,00000000/timer@12000': -22

这个我也没有搜集到解决方法;

上述全部打开之后dri下还是没有设备,

换arm-linux-gnueabihf-工具链

换上hf的工具链编译,无法启动,替换的编译结果有:

linux-5.14.3

busybox---->rootfs.ext4

libdrm-2.4.112

启动出现kernel panic;还需要替换lib,

cp -par /usr/arm-linux-gnueabihf/lib/* ./lib

启动成功了,但是结果还是一样,看来需要跟踪下代码了,

跟踪drm设备注册接口

感觉之前定位的方向都不对,现在直接跟踪drm_dev_register()这个函数,发现pl111_drv.c中probe调用了,直接加打印,

发现这个地方压根没有打印,看下这个probe有没有进来,全加上,一步步跟,

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值