plymouth/plymouth-only_use_fb_for_cirrus_bochs.patch
Cliff Zhao 9f6962d28a Accepting request 1031462 from home:qzhao:branches:Base:System
- Update to version 22.02.122+94.4bd41a3:
  * plugins: label-freetype: Fixes calculation of line width.
  * plugins: label-freetype: Fix font alignment.
  * populate-initrd: Install label-freetype plugin into initrd if available.
  * plugins: Add FreeType-based label plugin.
  * ply-label: Don't crash if label plugin fails.
  * details: Don't replay boot buffer on serial consoles.
  * main: Add "reload" command.
  * ply-device-manager: Add plymouth.force-frame-buffer-on-boot parameter, allow to choose force framebuffer mode.
  * systemd: Add mkinitcpio support to plymouth-switch-root-initramfs.service.
  * Rebase plymouth-only_use_fb_for_cirrus_bochs.patch: for build success.
  * Rebase plymouth-watermark-config.patch: for build success.
  * Drop 0001-Add-label-ft-plugin.patch: for already merged by upstream.
  * Drop 0002-Install-label-ft-plugin-into-initrd-if-available.patch: for already merged by upstream.
  * Drop 0003-fix_null_deref.patch for already merged by upstream.
  * Drop 0004-label-ft-fix-alignment.patch: for already merged by upstream.

OBS-URL: https://build.opensuse.org/request/show/1031462
OBS-URL: https://build.opensuse.org/package/show/Base:System/plymouth?expand=0&rev=354
2022-10-27 07:31:15 +00:00

51 lines
2.9 KiB
Diff

From: Fabian Vogt <fvogt@suse.com>
Subject: force fb for cirrus and bochs, force drm otherwise
References: bsc#888590, bsc#980750
DRM does not work well with cirrus and bochs (no display) but the framebuffer driver
prevents DRM drivers from loading.
As we need to support cirrus for libvirt and bochs for QEMU, we cannot just remove support for frame-buffer.
diff -Nura plymouth-22.02.122+94.4bd41a3/src/libply-splash-core/ply-device-manager.c plymouth-22.02.122+94.4bd41a3_new/src/libply-splash-core/ply-device-manager.c
--- plymouth-22.02.122+94.4bd41a3/src/libply-splash-core/ply-device-manager.c 2022-10-26 19:09:02.000000000 +0800
+++ plymouth-22.02.122+94.4bd41a3_new/src/libply-splash-core/ply-device-manager.c 2022-10-27 00:07:06.605777003 +0800
@@ -316,6 +316,18 @@
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) {
if (!manager->device_timeout_elapsed && !verify_drm_device (device)) {
ply_trace ("ignoring since we only handle SimpleDRM devices after timeout");
@@ -323,10 +335,18 @@
}
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 if (force_fb)
renderer_type = PLY_RENDERER_TYPE_FRAME_BUFFER;
else