feat(libdisplay-info): EDID 解析 —— wlroots 的闸门 - #307
Merged
Conversation
wlroots 0.18.2 的 backend/drm/meson.build 用 required: 'drm' in backends 声明
libdisplay-info,而 DRM 后端是真硬件上的合成器用的那个。加上这个包之后,wlroots
需要的东西索引里全有了——wayland-server/client/protocols/scanner/egl、libdrm、
pixman、xkbcommon、libinput、libudev、libseat、egl、glesv2、gbm。
Form B(fork)因为 pnp-id-table.c 是生成的:2583 行,把每个 PNP 厂商 ID 映到
厂商名。而上游 meson 找不到 hwdata 时会回落到**构建机器的**
/usr/share/hwdata/pnp.ids。实测:宿主那份与 hwdata v0.410 差 35 行,生成的表差
15 行(2568 vs 2583)——不钉版的话,同一个包在不同机器上编译,
di_info_get_make 给不同答案。fork 钉 v0.410,输入与输出一起签进仓,CI 重跑并 diff。
故意不做模块层:消费者是 wlroots(C),而公共面是 74 个函数 / ~360 个结构。
设计文档自己的规则——模块层是 fork 的结果,不是 fork 的理由。
⚠ C++ 消费者必须自己包 extern "C":七个公共头一个都没有,链接报
undefined reference to di_info_get_make(di_info const*),指着消费者而原因在
上游的头。和 compat.libseat 同一处境,写进了描述符。
测试内联一份真实 Acer P1276 的 EDID(不从 store 里按相对路径取——那会把测试
绑死在 mcpp 的目录布局上),期望值全部取自上游自己的 .ref:
make = Acer Technologies ← ACR 经生成表解析,即这个 fork 存在的理由
model = P1276
EDID version 1.3 pnp id ACR, product 0x1616 (=5654)
10 项断言全过。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
wlroots 0.18.2 的
backend/drm/meson.build用required: 'drm' in backends声明libdisplay-info,而 DRM 后端是真硬件上的合成器用的那个。加上这个包之后,wlroots 需要的东西索引里全有了 —— wayland-server/client/protocols/scanner/egl、libdrm、pixman、xkbcommon、libinput、libudev、libseat、egl、glesv2、gbm。
配套 fork:mcpplibs/libdisplay-info(新建,CI 绿)。
为什么是 fork,以及输入为什么必须钉版
pnp-id-table.c是生成的:2583 行,把每个 PNP 厂商 ID 映到厂商名。而上游 meson 找不到 hwdata 时回落到构建机器的/usr/share/hwdata/pnp.ids。实测:宿主那份与 hwdata v0.410 差 35 行,生成的表差 15 行(2568 vs 2583)。不钉版的话,同一个包在不同机器上编译,
di_info_get_make给不同答案 —— 和 libevdev 那次内核头是同一个坑。fork 钉 v0.410,输入与输出一起签进仓,CI 重跑并 diff。
故意不做模块层:消费者是 wlroots(C),公共面 74 个函数 / ~360 个结构。设计文档自己的规则 —— 模块层是 fork 的结果,不是 fork 的理由。
⚠ C++ 消费者必须自己包
extern "C"七个公共头一个
extern "C"都没有。链接报:指着消费者,而原因在上游的头。和
compat.libseat同一处境,已写进描述符。测试
内联一份真实 Acer P1276 的 EDID —— 不从 store 里按相对路径取,那会把测试绑死在 mcpp 的目录布局上。期望值全部取自上游自己的
.ref:只改了
pkgs/、tests/examples/和根mcpp.toml的 members 列表。