SHA256
1
0
forked from pool/plymouth
plymouth/plymouth-only_use_fb_for_cirrus_bochs.patch

39 lines
2.4 KiB
Diff
Raw Normal View History

diff -Nura plymouth-0.9.5~git20220412.e960111/src/libply-splash-core/ply-device-manager.c plymouth-0.9.5~git20220412.e960111_new/src/libply-splash-core/ply-device-manager.c
--- plymouth-0.9.5~git20220412.e960111/src/libply-splash-core/ply-device-manager.c 2022-04-15 16:39:24.000000000 +0800
+++ plymouth-0.9.5~git20220412.e960111_new/src/libply-splash-core/ply-device-manager.c 2022-04-18 16:33:00.126364096 +0800
@@ -279,13 +279,33 @@
subsystem = udev_device_get_subsystem (device);
ply_trace ("device subsystem is %s", subsystem);
+ const char *card_vendor = udev_device_get_sysattr_value (device, "device/vendor");
+ const char *card_device = udev_device_get_sysattr_value (device, "device/device");
+ bool use_fb = false;
+ if (card_vendor) {
+ /* Cirrus */
+ if (strcmp ("0x1013", card_vendor) == 0)
+ use_fb = true;
+ /* "Technical Corp", also used by bochs */
+ else if (strcmp ("0x1234", card_vendor) == 0)
+ use_fb = strcmp("0x1111", card_device) == 0;
+ }
+
if (strcmp (subsystem, SUBSYSTEM_DRM) == 0) {
ply_trace ("found DRM device %s", device_path);
renderer_type = PLY_RENDERER_TYPE_DRM;
+ if (use_fb) {
+ ply_trace ("forcing use of framebuffer for cirrusdrmfb");
+ renderer_type = PLY_RENDERER_TYPE_NONE;
+ }
} else if (strcmp (subsystem, SUBSYSTEM_FRAME_BUFFER) == 0) {
ply_trace ("found frame buffer device %s", device_path);
- if (!fb_device_has_drm_device (manager, device))
+ if (use_fb) {
renderer_type = PLY_RENDERER_TYPE_FRAME_BUFFER;
+ }
+ else if (!fb_device_has_drm_device (manager, device)) {
+ ply_trace ("avoiding use of framebuffer to not block DRM drivers from working");
+ }
else
ply_trace ("ignoring, since there's a DRM device associated with it");
}