From: Hans de Goede Date: Tue, 4 Jun 2024 19:16:31 +0000 (+0200) Subject: ply-device-manager: Add syspath_is_simpledrm () helper X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c3ff0338c80a831b2f0ea63a57e20c9013ddb52;p=thirdparty%2Fplymouth.git ply-device-manager: Add syspath_is_simpledrm () helper Add a helper to determine if a udev syspath is a simpledrm device. This is a preparation patch to for making simpledrm devices their own renderer-type. --- diff --git a/src/libply-splash-core/ply-device-manager.c b/src/libply-splash-core/ply-device-manager.c index d75ac6c5..4c48f606 100644 --- a/src/libply-splash-core/ply-device-manager.c +++ b/src/libply-splash-core/ply-device-manager.c @@ -340,10 +340,14 @@ remove_input_device_from_renderers (ply_device_manager_t *manager, } static bool -verify_drm_device (struct udev_device *device) +syspath_is_simpledrm (const char *syspath) { - const char *id_path; + return ply_string_has_suffix (syspath, "simple-framebuffer.0/drm/card0"); +} +static bool +verify_drm_device (struct udev_device *device) +{ /* * Simple-framebuffer devices driven by simpledrm lack information * like panel-rotation info and physical size, causing the splash @@ -352,8 +356,7 @@ verify_drm_device (struct udev_device *device) * To avoid this treat simpledrm devices as fbdev devices and only * use them after the timeout. */ - id_path = udev_device_get_property_value (device, "ID_PATH"); - if (!ply_string_has_prefix (id_path, "platform-simple-framebuffer")) + if (!syspath_is_simpledrm (udev_device_get_syspath (device))) return true; /* Not a SimpleDRM device */ /*