mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-25 22:25:58 +01:00
backend/session: use DRM_PRIMARY_MINOR_NAME
Instead of hardcoding the string "card", use DRM_PRIMARY_MINOR_NAME. Some systems may use another prefix, e.g. OpenBSD uses "drm" instead.
This commit is contained in:
parent
fb933d3204
commit
72ee196efa
1 changed files with 2 additions and 2 deletions
|
@ -127,7 +127,7 @@ static void libseat_session_finish(struct wlr_session *session) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool is_drm_card(const char *sysname) {
|
static bool is_drm_card(const char *sysname) {
|
||||||
const char prefix[] = "card";
|
const char prefix[] = DRM_PRIMARY_MINOR_NAME;
|
||||||
if (strncmp(sysname, prefix, strlen(prefix)) != 0) {
|
if (strncmp(sysname, prefix, strlen(prefix)) != 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -395,7 +395,7 @@ static struct udev_enumerate *enumerate_drm_cards(struct udev *udev) {
|
||||||
}
|
}
|
||||||
|
|
||||||
udev_enumerate_add_match_subsystem(en, "drm");
|
udev_enumerate_add_match_subsystem(en, "drm");
|
||||||
udev_enumerate_add_match_sysname(en, "card[0-9]*");
|
udev_enumerate_add_match_sysname(en, DRM_PRIMARY_MINOR_NAME "[0-9]*");
|
||||||
|
|
||||||
if (udev_enumerate_scan_devices(en) != 0) {
|
if (udev_enumerate_scan_devices(en) != 0) {
|
||||||
wlr_log(WLR_ERROR, "udev_enumerate_scan_devices failed");
|
wlr_log(WLR_ERROR, "udev_enumerate_scan_devices failed");
|
||||||
|
|
Loading…
Reference in a new issue