Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need udev_hwdb for wlroots >= 0.16 #1

Open
jbeich opened this issue Jun 24, 2022 · 9 comments
Open

Need udev_hwdb for wlroots >= 0.16 #1

jbeich opened this issue Jun 24, 2022 · 9 comments

Comments

@jbeich
Copy link
Contributor

jbeich commented Jun 24, 2022

In wlroots#3541 the hardcoded list of EDID manufacturers was replaced by udev_hwdb_new which is not implemented on FreeBSD:

libudev-devd/udev-hwdb.c

Lines 33 to 39 in a91c357

LIBUDEV_EXPORT struct udev_hwdb *
udev_hwdb_new(struct udev *udev)
{
TRC("(%p", udev);
UNIMPL();
return (NULL);
}

$ pkg install sway-devel
$ vidcontrol -s 1 </dev/ttyv0 # aka Ctrl+Alt+F1
$ if [ -z "$XDG_RUNTIME_DIR" ]; then export XDG_RUNTIME_DIR=/tmp; fi
$ seatd-launch sway
[...]
00:00:00.003 [ERROR] [wlr] [backend/drm/backend.c:187] udev_hwdb_new failed
[...]

CC @emersion @unrelentingtech

@emersion
Copy link

Oh. Since the CI build succeeded I just assumed it would be fine for FreeBSD.

Would something like this help? https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3446

@wulf7
Copy link
Owner

wulf7 commented Jun 26, 2022

struct udev_hwdb is stubbed in master branch now. Please test.

hwdb itself is not implemented yet though.

@jbeich
Copy link
Contributor Author

jbeich commented Jun 26, 2022

Would something like this help? https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3446

Sure. libudev-zero also doesn't implement hwdb. Obviously, the path to pnp.ids may need to be configurable (or derived from datadir) as hwdata doesn't have a .pc (pkg-config) file.

I was thinking there maybe more consumers but hard to finding anything portable to FreeBSD, not a FFI/interpose wrapper and doesn't already support pnp.ids. For example, emulators/nemu, graphics/colord (has pnp.ids fallback), x11/gnome-desktop can use udev_hwdb but the code is disabled on FreeBSD either in the port or the source.

struct udev_hwdb is stubbed in master branch now. Please test.

Doesn't help much: wlroots no longer shows the error but EDID manufacturer remains unexpanded (e.g., GSM instead of Goldstar Company Ltd). Affects wlr-output-management-unstable-v1 consumers like wdisplays (description), wlr-randr (description), kanshi (pattern matching), etc.

@illiliti
Copy link

Please do not implement udev_hwdb API. We should look into cross-platform approach instead of playing defensive by adding linux-specific and generally harmful APIs.

@wulf7
Copy link
Owner

wulf7 commented Jun 26, 2022

udev_hwdb looks like simple udev-oriented key-value database. The only linux-specific part is udev, not the code itself at least in eudev version: https://github.com/eudev-project/eudev/blob/master/src/libudev/libudev-hwdb.c

Are there any alternative solution?

@illiliti
Copy link

Are there any alternative solution?

https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3638

@wulf7
Copy link
Owner

wulf7 commented Jun 27, 2022

IMO best I can do is to extract hwdb-related code from udev/eudev in to separate udev-free library libhwdb which can be used as drop-in replacement of udev-hwdb

@illiliti
Copy link

I asked emersion yesterday about this idea and he said since format of hwdata is simple, the need for libhwdb is unnecessary.

@wulf7
Copy link
Owner

wulf7 commented Jul 14, 2022

I created whdb branch https://github.com/wulf7/libudev-devd/tree/hwdb which includes hwdb.bin parser imported from eudev.
The imported code is GPL-ed thus disabled by default. To enable it -Denable-gpl=true -Dwith-hwdb=/path/to/hwdb.bin options should be passed to meson at configure stage.

The code is only compile tested now. I have no intention to rewrite it to make it permissive licensed yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants