mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-21 06:46:46 -04:00
backend/session: share is_drm_card implementation
This commit is contained in:
parent
ab2425e65f
commit
1e7867610c
5 changed files with 25 additions and 29 deletions
|
|
@ -20,19 +20,6 @@
|
|||
|
||||
#define WAIT_GPU_TIMEOUT 10000 // ms
|
||||
|
||||
static bool is_drm_card(const char *sysname) {
|
||||
const char prefix[] = DRM_PRIMARY_MINOR_NAME;
|
||||
if (strncmp(sysname, prefix, strlen(prefix)) != 0) {
|
||||
return false;
|
||||
}
|
||||
for (size_t i = strlen(prefix); sysname[i] != '\0'; i++) {
|
||||
if (sysname[i] < '0' || sysname[i] > '9') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static void read_udev_change_event(struct wlr_device_change_event *event,
|
||||
struct udev_device *udev_dev) {
|
||||
const char *hotplug = udev_device_get_property_value(udev_dev, "HOTPLUG");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue