|
|
b9a929 |
From eb40956898e35121525e253305f6d40b45cfbf23 Mon Sep 17 00:00:00 2001
|
|
|
b9a929 |
From: Hans de Goede <hdegoede@redhat.com>
|
|
|
b9a929 |
Date: Mon, 28 Feb 2022 16:36:58 +0100
|
|
|
b9a929 |
Subject: [PATCH 6/6] ply-device-manager: verify_add_or_change(): Move
|
|
|
b9a929 |
local_console_is_text check
|
|
|
b9a929 |
|
|
|
b9a929 |
Move the local_console_is_text check outside of the
|
|
|
b9a929 |
"if (subsytem == SUBSYSTEM_DRM)" block.
|
|
|
b9a929 |
|
|
|
b9a929 |
This check is equally relevant for SUBSYSTEM_FRAME_BUFFER.
|
|
|
b9a929 |
|
|
|
b9a929 |
Note by itself this is a no-op since verify_add_or_change() *always*
|
|
|
b9a929 |
returns false for SUBSYSTEM_FRAME_BUFFER devices.
|
|
|
b9a929 |
|
|
|
b9a929 |
This is a preparation patch for making verify_add_or_change() not
|
|
|
b9a929 |
return false when manager->device_timeout_elapsed is set.
|
|
|
b9a929 |
|
|
|
b9a929 |
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
b9a929 |
---
|
|
|
b9a929 |
src/libply-splash-core/ply-device-manager.c | 11 +++++------
|
|
|
b9a929 |
1 file changed, 5 insertions(+), 6 deletions(-)
|
|
|
b9a929 |
|
|
|
b9a929 |
diff --git a/src/libply-splash-core/ply-device-manager.c b/src/libply-splash-core/ply-device-manager.c
|
|
|
b9a929 |
index bff4982..29b26fc 100644
|
|
|
b9a929 |
--- a/src/libply-splash-core/ply-device-manager.c
|
|
|
b9a929 |
+++ b/src/libply-splash-core/ply-device-manager.c
|
|
|
b9a929 |
@@ -287,60 +287,64 @@ verify_drm_device (struct udev_device *device)
|
|
|
b9a929 |
if (ply_kernel_command_line_has_argument ("nomodeset"))
|
|
|
b9a929 |
return true;
|
|
|
b9a929 |
|
|
|
b9a929 |
/*
|
|
|
b9a929 |
* Some firmwares leave the panel black at boot. Allow enabling SimpleDRM
|
|
|
b9a929 |
* use from the cmdline to show something to the user ASAP.
|
|
|
b9a929 |
*/
|
|
|
b9a929 |
if (ply_kernel_command_line_has_argument ("plymouth.use-simpledrm"))
|
|
|
b9a929 |
return true;
|
|
|
b9a929 |
|
|
|
b9a929 |
return false;
|
|
|
b9a929 |
}
|
|
|
b9a929 |
|
|
|
b9a929 |
static bool
|
|
|
b9a929 |
create_devices_for_udev_device (ply_device_manager_t *manager,
|
|
|
b9a929 |
struct udev_device *device)
|
|
|
b9a929 |
{
|
|
|
b9a929 |
const char *device_path;
|
|
|
b9a929 |
bool created = false;
|
|
|
b9a929 |
|
|
|
b9a929 |
device_path = udev_device_get_devnode (device);
|
|
|
b9a929 |
|
|
|
b9a929 |
if (device_path != NULL) {
|
|
|
b9a929 |
const char *subsystem;
|
|
|
b9a929 |
ply_renderer_type_t renderer_type = PLY_RENDERER_TYPE_NONE;
|
|
|
b9a929 |
|
|
|
b9a929 |
subsystem = udev_device_get_subsystem (device);
|
|
|
b9a929 |
ply_trace ("device subsystem is %s", subsystem);
|
|
|
b9a929 |
|
|
|
b9a929 |
if (strcmp (subsystem, SUBSYSTEM_DRM) == 0) {
|
|
|
b9a929 |
+ if (!manager->device_timeout_elapsed && !verify_drm_device (device)) {
|
|
|
b9a929 |
+ ply_trace ("ignoring since we only handle SimpleDRM devices after timeout");
|
|
|
b9a929 |
+ return false;
|
|
|
b9a929 |
+ }
|
|
|
b9a929 |
ply_trace ("found DRM device %s", device_path);
|
|
|
b9a929 |
renderer_type = PLY_RENDERER_TYPE_DRM;
|
|
|
b9a929 |
} else if (strcmp (subsystem, SUBSYSTEM_FRAME_BUFFER) == 0) {
|
|
|
b9a929 |
ply_trace ("found frame buffer device %s", device_path);
|
|
|
b9a929 |
if (!fb_device_has_drm_device (manager, device))
|
|
|
b9a929 |
renderer_type = PLY_RENDERER_TYPE_FRAME_BUFFER;
|
|
|
b9a929 |
else
|
|
|
b9a929 |
ply_trace ("ignoring, since there's a DRM device associated with it");
|
|
|
b9a929 |
}
|
|
|
b9a929 |
|
|
|
b9a929 |
if (renderer_type != PLY_RENDERER_TYPE_NONE) {
|
|
|
b9a929 |
ply_terminal_t *terminal = NULL;
|
|
|
b9a929 |
|
|
|
b9a929 |
if (!manager->local_console_managed) {
|
|
|
b9a929 |
terminal = manager->local_console_terminal;
|
|
|
b9a929 |
}
|
|
|
b9a929 |
|
|
|
b9a929 |
created = create_devices_for_terminal_and_renderer_type (manager,
|
|
|
b9a929 |
device_path,
|
|
|
b9a929 |
terminal,
|
|
|
b9a929 |
renderer_type);
|
|
|
b9a929 |
if (created) {
|
|
|
b9a929 |
if (renderer_type == PLY_RENDERER_TYPE_DRM)
|
|
|
b9a929 |
manager->found_drm_device = 1;
|
|
|
b9a929 |
if (renderer_type == PLY_RENDERER_TYPE_FRAME_BUFFER)
|
|
|
b9a929 |
manager->found_fb_device = 1;
|
|
|
b9a929 |
}
|
|
|
b9a929 |
}
|
|
|
b9a929 |
}
|
|
|
b9a929 |
|
|
|
b9a929 |
@@ -430,66 +434,61 @@ on_drm_udev_add_or_change (ply_device_manager_t *manager,
|
|
|
b9a929 |
|
|
|
b9a929 |
/* Renderer exists, bail if this is not a change event */
|
|
|
b9a929 |
if (strcmp (action, "change"))
|
|
|
b9a929 |
return;
|
|
|
b9a929 |
|
|
|
b9a929 |
changed = ply_renderer_handle_change_event (renderer);
|
|
|
b9a929 |
if (changed) {
|
|
|
b9a929 |
free_displays_for_renderer (manager, renderer);
|
|
|
b9a929 |
create_pixel_displays_for_renderer (manager, renderer);
|
|
|
b9a929 |
}
|
|
|
b9a929 |
}
|
|
|
b9a929 |
|
|
|
b9a929 |
static bool
|
|
|
b9a929 |
verify_add_or_change (ply_device_manager_t *manager,
|
|
|
b9a929 |
const char *action,
|
|
|
b9a929 |
const char *device_path,
|
|
|
b9a929 |
struct udev_device *device)
|
|
|
b9a929 |
{
|
|
|
b9a929 |
const char *subsystem = udev_device_get_subsystem (device);
|
|
|
b9a929 |
|
|
|
b9a929 |
if (strcmp (action, "add") && strcmp (action, "change"))
|
|
|
b9a929 |
return false;
|
|
|
b9a929 |
|
|
|
b9a929 |
if (manager->local_console_managed && manager->local_console_is_text) {
|
|
|
b9a929 |
ply_trace ("ignoring since we're already using text splash for local console");
|
|
|
b9a929 |
return false;
|
|
|
b9a929 |
}
|
|
|
b9a929 |
|
|
|
b9a929 |
subsystem = udev_device_get_subsystem (device);
|
|
|
b9a929 |
|
|
|
b9a929 |
- if (strcmp (subsystem, SUBSYSTEM_DRM) == 0) {
|
|
|
b9a929 |
- if (!verify_drm_device (device)) {
|
|
|
b9a929 |
- ply_trace ("ignoring since we only handle SimpleDRM devices after timeout");
|
|
|
b9a929 |
- return false;
|
|
|
b9a929 |
- }
|
|
|
b9a929 |
- } else {
|
|
|
b9a929 |
+ if (strcmp (subsystem, SUBSYSTEM_DRM)) {
|
|
|
b9a929 |
ply_trace ("ignoring since we only handle subsystem %s devices after timeout", subsystem);
|
|
|
b9a929 |
return false;
|
|
|
b9a929 |
}
|
|
|
b9a929 |
|
|
|
b9a929 |
return true;
|
|
|
b9a929 |
}
|
|
|
b9a929 |
|
|
|
b9a929 |
static bool
|
|
|
b9a929 |
duplicate_device_path (ply_list_t *events, const char *device_path)
|
|
|
b9a929 |
{
|
|
|
b9a929 |
struct udev_device *device;
|
|
|
b9a929 |
ply_list_node_t *node;
|
|
|
b9a929 |
|
|
|
b9a929 |
for (node = ply_list_get_first_node (events);
|
|
|
b9a929 |
node; node = ply_list_get_next_node (events, node)) {
|
|
|
b9a929 |
device = ply_list_node_get_data (node);
|
|
|
b9a929 |
|
|
|
b9a929 |
if (strcmp (udev_device_get_devnode (device), device_path) == 0)
|
|
|
b9a929 |
return true;
|
|
|
b9a929 |
}
|
|
|
b9a929 |
|
|
|
b9a929 |
return false;
|
|
|
b9a929 |
}
|
|
|
b9a929 |
|
|
|
b9a929 |
static void
|
|
|
b9a929 |
process_udev_add_or_change_events (ply_device_manager_t *manager, ply_list_t *events)
|
|
|
b9a929 |
{
|
|
|
b9a929 |
const char *action, *device_path;
|
|
|
b9a929 |
struct udev_device *device;
|
|
|
b9a929 |
ply_list_node_t *node;
|
|
|
b9a929 |
--
|
|
|
b9a929 |
2.37.0.rc1
|
|
|
b9a929 |
|