1001-device_manager-ignore-drm-devices-when-kernel-modese.patch 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. Index: plymouth-0.9.5/src/main.c
  2. ===================================================================
  3. --- plymouth-0.9.5/src/main.c
  4. +++ plymouth-0.9.5/src/main.c 2020-10-01 21:11:15.353670757 +0200
  5. @@ -2263,6 +2263,11 @@
  6. (getenv ("DISPLAY") != NULL))
  7. device_manager_flags |= PLY_DEVICE_MANAGER_FLAGS_IGNORE_UDEV;
  8. + if (ply_kernel_command_line_has_argument ("nokmsboot") ||
  9. + ply_kernel_command_line_has_argument ("nomodeset"))
  10. + device_manager_flags |= PLY_DEVICE_MANAGER_FLAGS_KMS_DISABLED;
  11. +
  12. +
  13. if (!plymouth_should_show_default_splash (&state)) {
  14. /* don't bother listening for udev events or setting up a graphical renderer
  15. * if we're forcing details */
  16. Index: plymouth-0.9.5/src/libply-splash-core/ply-device-manager.c
  17. ===================================================================
  18. --- plymouth-0.9.5/src/libply-splash-core/ply-device-manager.c
  19. +++ plymouth-0.9.5/src/libply-splash-core/ply-device-manager.c 2020-10-01 21:09:30.090117000 +0200
  20. @@ -219,6 +219,9 @@
  21. const char *id_path;
  22. bool has_drm_device = false;
  23. + if (manager->flags & PLY_DEVICE_MANAGER_FLAGS_KMS_DISABLED)
  24. + return false;
  25. +
  26. /* We want to see if the framebuffer is associated with a DRM-capable
  27. * graphics card, if it is, we'll use the DRM device */
  28. card_matches = udev_enumerate_new (manager->udev_context);
  29. @@ -276,7 +279,11 @@
  30. if (subsystem != NULL && strcmp (subsystem, SUBSYSTEM_DRM) == 0) {
  31. ply_trace ("found DRM device %s", device_path);
  32. - renderer_type = PLY_RENDERER_TYPE_DRM;
  33. + if (!(manager->flags & PLY_DEVICE_MANAGER_FLAGS_KMS_DISABLED))
  34. + renderer_type = PLY_RENDERER_TYPE_DRM;
  35. + else
  36. + ply_trace ("ignoring, since kernel modesetting is disabled");
  37. +
  38. } else if (strcmp (subsystem, SUBSYSTEM_FRAME_BUFFER) == 0) {
  39. ply_trace ("found frame buffer device %s", device_path);
  40. if (!fb_device_has_drm_device (manager, device))
  41. @@ -433,11 +440,17 @@
  42. return;
  43. if (strcmp (action, "add") == 0 || strcmp (action, "change") == 0) {
  44. + const char *preferred_subsystem;
  45. const char *subsystem;
  46. + if (manager->flags & PLY_DEVICE_MANAGER_FLAGS_KMS_DISABLED)
  47. + preferred_subsystem = SUBSYSTEM_FRAME_BUFFER;
  48. + else
  49. + preferred_subsystem = SUBSYSTEM_DRM;
  50. +
  51. subsystem = udev_device_get_subsystem (device);
  52. - if (strcmp (subsystem, SUBSYSTEM_DRM) == 0) {
  53. + if (strcmp (subsystem, preferred_subsystem) == 0) {
  54. if (manager->local_console_managed && manager->local_console_is_text)
  55. ply_trace ("ignoring since we're already using text splash for local console");
  56. else
  57. Index: plymouth-0.9.5/src/libply-splash-core/ply-device-manager.h
  58. ===================================================================
  59. --- plymouth-0.9.5/src/libply-splash-core/ply-device-manager.h
  60. +++ plymouth-0.9.5/src/libply-splash-core/ply-device-manager.h 2020-10-01 21:10:10.643535253 +0200
  61. @@ -32,7 +32,8 @@
  62. PLY_DEVICE_MANAGER_FLAGS_NONE = 0,
  63. PLY_DEVICE_MANAGER_FLAGS_IGNORE_SERIAL_CONSOLES = 1 << 0,
  64. PLY_DEVICE_MANAGER_FLAGS_IGNORE_UDEV = 1 << 1,
  65. - PLY_DEVICE_MANAGER_FLAGS_SKIP_RENDERERS = 1 << 2
  66. + PLY_DEVICE_MANAGER_FLAGS_SKIP_RENDERERS = 1 << 2,
  67. + PLY_DEVICE_MANAGER_FLAGS_KMS_DISABLED = 1 << 3
  68. } ply_device_manager_flags_t;
  69. typedef struct _ply_device_manager ply_device_manager_t;