diff mbox series

[meta-oe,2/2] kmscon: upgrade 10.0.1 -> 10.0.4

Message ID 20261007141233.4288-2-f_l_k@t-online.de
State New
Headers show
Series [meta-oe,1/2] libtsm: upgrade 4.7.1 -> 4.8.0 | expand

Commit Message

Markus Volk Oct. 7, 2026, 2:12 p.m. UTC
Drop the pty patch, the problem is fixed upstream since 10.0.2.
Refresh the platform GPU patch to the version submitted upstream,
which also excludes USB displays from the primary GPUs. Backport the
libseat build fix, 10.0.4 does not build with libseat otherwise.
Tested on a Raspberry Pi 4 with gpus=primary.

License-Update: COPYING now states that the Unifont font is licensed
under OFL-1.1 instead of GPL, drops the third-party notices for the
dbus-loop, wcwidth and vt.c code and updates the path of the htable
code to src/shl/htable.

AI-Generated: Uses Claude Code (Claude Opus 5.5)
Signed-off-by: Markus Volk <f_l_k@t-online.de>
---
 ...-pty-only-once-a-display-is-attached.patch | 64 -------------------
 ...display-controllers-as-primary-GPUs.patch} | 44 ++++++++-----
 ...x-build-error-due-to-logging-changes.patch | 32 ++++++++++
 .../{kmscon_10.0.1.bb => kmscon_10.0.4.bb}    |  8 +--
 4 files changed, 63 insertions(+), 85 deletions(-)
 delete mode 100644 meta-oe/recipes-graphics/kmscon/kmscon/0001-terminal-open-the-pty-only-once-a-display-is-attached.patch
 rename meta-oe/recipes-graphics/kmscon/kmscon/{0002-uterm_monitor-treat-platform-display-controllers-as-primary-GPUs.patch => 0001-uterm-treat-platform-display-controllers-as-primary-GPUs.patch} (58%)
 create mode 100644 meta-oe/recipes-graphics/kmscon/kmscon/0002-vt_libseat-Fix-build-error-due-to-logging-changes.patch
 rename meta-oe/recipes-graphics/kmscon/{kmscon_10.0.1.bb => kmscon_10.0.4.bb} (89%)
diff mbox series

Patch

diff --git a/meta-oe/recipes-graphics/kmscon/kmscon/0001-terminal-open-the-pty-only-once-a-display-is-attached.patch b/meta-oe/recipes-graphics/kmscon/kmscon/0001-terminal-open-the-pty-only-once-a-display-is-attached.patch
deleted file mode 100644
index 68f2ccc157..0000000000
--- a/meta-oe/recipes-graphics/kmscon/kmscon/0001-terminal-open-the-pty-only-once-a-display-is-attached.patch
+++ /dev/null
@@ -1,64 +0,0 @@ 
-From c63a880187db708b50d25c37b6fc1e24ed68492a Mon Sep 17 00:00:00 2001
-From: Markus Volk <f_l_k@t-online.de>
-Date: Fri, 18 Sep 2026 21:52:35 +0200
-Subject: [PATCH] terminal: open the pty only once a display is attached
-
-The session type handed to the child (TERM_SESSION_TYPE=kms or fb) is
-decided in terminal_open() from the displays attached at that moment.
-On a real VT the first session is activated as soon as the seat wakes
-up, which happens before the DRM display has finished probing, so the
-login is spawned with TERM_SESSION_TYPE=fb even though the terminal
-ends up on a KMS display a few hundred milliseconds later.
-
-Session managers such as uwsm rely on that variable to decide whether
-they have to ask kmscon to release the display before starting a
-compositor. With the wrong type the request is never sent, kmscon
-keeps DRM master, and the compositor fails to open the device until it
-gives up.
-
-Defer opening the pty until the first display has been added to the
-terminal, and open it from terminal_add_display() when the terminal is
-already awake at that point.
-
-Upstream-Status: Pending
-
-AI-Generated: Uses Claude Code (Claude Opus 5)
-Signed-off-by: Markus Volk <f_l_k@t-online.de>
----
- src/kmscon_terminal.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/src/kmscon_terminal.c b/src/kmscon_terminal.c
-index 15b00b4..42b6cd9 100644
---- a/src/kmscon_terminal.c
-+++ b/src/kmscon_terminal.c
-@@ -107,6 +107,7 @@ struct kmscon_terminal {
- #define BLINK_TIMER_NS (500 * 1000 * 1000)
- 
- static int font_set(struct kmscon_terminal *term);
-+static int terminal_open(struct kmscon_terminal *term);
- 
- static void coord_to_cell(struct kmscon_terminal *term, int32_t x, int32_t y, unsigned int *posx,
- 			  unsigned int *posy)
-@@ -726,6 +727,9 @@ int terminal_add_display(struct kmscon_terminal *term, struct display *disp)
- 	update_pointer_max_all(term);
- 	display_ref(scr->disp);
- 	do_redraw_screen(scr);
-+
-+	if (term->awake && !term->opened)
-+		terminal_open(term);
- 	return 0;
- 
- err_text:
-@@ -1124,7 +1128,7 @@ void terminal_activate(struct kmscon_terminal *term)
- {
- 	term->awake = true;
- 	ev_timer_enable(term->blink_timer);
--	if (!term->opened)
-+	if (!term->opened && !shl_dlist_empty(&term->screens))
- 		terminal_open(term);
- 	if (term->pointer.visible)
- 		hw_cursor_show(term, term->pointer.x, term->pointer.y);
--- 
-2.55.0
-
diff --git a/meta-oe/recipes-graphics/kmscon/kmscon/0002-uterm_monitor-treat-platform-display-controllers-as-primary-GPUs.patch b/meta-oe/recipes-graphics/kmscon/kmscon/0001-uterm-treat-platform-display-controllers-as-primary-GPUs.patch
similarity index 58%
rename from meta-oe/recipes-graphics/kmscon/kmscon/0002-uterm_monitor-treat-platform-display-controllers-as-primary-GPUs.patch
rename to meta-oe/recipes-graphics/kmscon/kmscon/0001-uterm-treat-platform-display-controllers-as-primary-GPUs.patch
index c85607783c..0cc3dd2f2f 100644
--- a/meta-oe/recipes-graphics/kmscon/kmscon/0002-uterm_monitor-treat-platform-display-controllers-as-primary-GPUs.patch
+++ b/meta-oe/recipes-graphics/kmscon/kmscon/0001-uterm-treat-platform-display-controllers-as-primary-GPUs.patch
@@ -1,8 +1,7 @@ 
-From d321a1572a12d760ddade294f4e7eabe57d555d1 Mon Sep 17 00:00:00 2001
+From 669d2d110a864331ed3a8bb8fd867efc9dd50306 Mon Sep 17 00:00:00 2001
 From: Markus Volk <f_l_k@t-online.de>
-Date: Sat, 26 Sep 2026 10:00:57 +0200
-Subject: [PATCH] uterm_monitor: treat platform display controllers as primary
- GPUs
+Date: Wed, 7 Oct 2026 13:09:58 +0200
+Subject: [PATCH] uterm: treat platform display controllers as primary GPUs
 
 A GPU only counted as primary when its PCI parent had boot_vga set.
 SoC display controllers such as vc4 on the Raspberry Pi are platform
@@ -11,25 +10,32 @@  only display in the system and never showed a terminal.
 
 Treat DRM devices on the platform bus as primary, except for the
 simpledrm, efidrm, vesadrm and ofdrm firmware framebuffers that only
-stand in until the native driver has loaded.
+stand in until the native driver has loaded. USB displays are excluded
+as well: on these systems the USB controller is a platform device too,
+so they would otherwise be taken as primary.
 
-Upstream-Status: Pending
+Tested on a Raspberry Pi 4 with --gpus=primary: before, card0 (vc4)
+was ignored as "no primary GPU"; now the terminal comes up on HDMI-A
+with the drm2d backend. The USB exclusion is not tested on hardware.
 
-AI-Generated: Uses Claude Code (Claude Opus 5.5)
+Upstream-Status: Submitted [https://github.com/kmscon/kmscon/pull/551]
+
+Assisted-By: Claude Opus 5.5
+Signed-off-by: Markus Volk <f_l_k@t-online.de>
 ---
- src/uterm_monitor.c | 29 ++++++++++++++++++++++++++---
- 1 file changed, 26 insertions(+), 3 deletions(-)
+ src/uterm/monitor.c | 33 ++++++++++++++++++++++++++++++---
+ 1 file changed, 30 insertions(+), 3 deletions(-)
 
-diff --git a/src/uterm_monitor.c b/src/uterm_monitor.c
-index d89bfa1..25ec91f 100644
---- a/src/uterm_monitor.c
-+++ b/src/uterm_monitor.c
-@@ -234,10 +234,15 @@ out_close:
+diff --git a/src/uterm/monitor.c b/src/uterm/monitor.c
+index 3d7d53e..44d5bf8 100644
+--- a/src/uterm/monitor.c
++++ b/src/uterm/monitor.c
+@@ -232,10 +232,15 @@ out_close:
  	return flags;
  }
  
 -static bool is_drm_primary(struct uterm_monitor *mon, struct udev_device *dev, const char *node)
-+static char *get_drm_name(int fd);
++static inline char *get_drm_name(int fd);
 +
 +static bool is_drm_primary(struct uterm_monitor *mon, struct udev_device *dev, const char *node,
 +			   int fd)
@@ -41,7 +47,7 @@  index d89bfa1..25ec91f 100644
  
  	pci = udev_device_get_parent_with_subsystem_devtype(dev, "pci", NULL);
  	if (pci) {
-@@ -246,9 +251,27 @@ static bool is_drm_primary(struct uterm_monitor *mon, struct udev_device *dev, c
+@@ -244,9 +249,31 @@ static bool is_drm_primary(struct uterm_monitor *mon, struct udev_device *dev, c
  			log_debug("DRM device %s is primary PCI GPU", node);
  			return true;
  		}
@@ -53,7 +59,11 @@  index d89bfa1..25ec91f 100644
 +	 * SoC display controllers are platform devices without a boot_vga
 +	 * attribute. Treat them as primary, except for the generic firmware
 +	 * framebuffer drivers that only stand in until the real driver loads.
++	 * USB displays sit below a platform USB controller on such systems,
++	 * but are never primary.
 +	 */
++	if (udev_device_get_parent_with_subsystem_devtype(dev, "usb", NULL))
++		return false;
 +	if (!udev_device_get_parent_with_subsystem_devtype(dev, "platform", NULL))
 +		return false;
 +
@@ -70,7 +80,7 @@  index d89bfa1..25ec91f 100644
  }
  
  /*
-@@ -334,7 +357,7 @@ static unsigned int get_drm_flags(struct uterm_monitor *mon, struct udev_device
+@@ -332,7 +359,7 @@ static unsigned int get_drm_flags(struct uterm_monitor *mon, struct udev_device
  		return flags;
  	}
  
diff --git a/meta-oe/recipes-graphics/kmscon/kmscon/0002-vt_libseat-Fix-build-error-due-to-logging-changes.patch b/meta-oe/recipes-graphics/kmscon/kmscon/0002-vt_libseat-Fix-build-error-due-to-logging-changes.patch
new file mode 100644
index 0000000000..63db2e5297
--- /dev/null
+++ b/meta-oe/recipes-graphics/kmscon/kmscon/0002-vt_libseat-Fix-build-error-due-to-logging-changes.patch
@@ -0,0 +1,32 @@ 
+From 153db63d679df719a99dd36505f9c2f55d9c59f6 Mon Sep 17 00:00:00 2001
+From: Jocelyn Falempe <jfalempe@redhat.com>
+Date: Mon, 28 Sep 2026 11:46:21 +0200
+Subject: [PATCH] vt_libseat: Fix build error due to logging changes
+
+Commit "efda2b5 log: Simplify logging, remove timestamp, and level for notice and info."
+changed the log_submit() arguments, and this was not updated in
+vt_libseat.c
+
+Upstream-Status: Backport [https://github.com/kmscon/kmscon/commit/153db63d679df719a99dd36505f9c2f55d9c59f6]
+
+Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
+---
+ src/uterm/vt_libseat.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/uterm/vt_libseat.c b/src/uterm/vt_libseat.c
+index 4f65c84..2097628 100644
+--- a/src/uterm/vt_libseat.c
++++ b/src/uterm/vt_libseat.c
+@@ -260,7 +260,7 @@ static enum log_severity log_level(enum libseat_log_level level)
+ 
+ static void log_libseat(enum libseat_log_level level, const char *fmt, va_list args)
+ {
+-	log_submit(LOG_DEFAULT, log_level(level), fmt, args);
++	log_submit(log_level(level), "libseat", fmt, args);
+ }
+ 
+ static void vt_libseat_input(struct input *input, struct input_key_event *ev, void *data)
+-- 
+2.55.0
+
diff --git a/meta-oe/recipes-graphics/kmscon/kmscon_10.0.1.bb b/meta-oe/recipes-graphics/kmscon/kmscon_10.0.4.bb
similarity index 89%
rename from meta-oe/recipes-graphics/kmscon/kmscon_10.0.1.bb
rename to meta-oe/recipes-graphics/kmscon/kmscon_10.0.4.bb
index 0336649551..400d9b5f59 100644
--- a/meta-oe/recipes-graphics/kmscon/kmscon_10.0.1.bb
+++ b/meta-oe/recipes-graphics/kmscon/kmscon_10.0.4.bb
@@ -11,7 +11,7 @@  CVE_PRODUCT = "kmscon"
 SECTION = "graphics"
 
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://COPYING;md5=6d4602d249f8a3401040238e98367d9e"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e88b340bd6389ec41d4cf634a770a771"
 
 DEPENDS = "\
     libtsm \
@@ -21,11 +21,11 @@  DEPENDS = "\
 "
 
 SRC_URI = "git://github.com/kmscon/kmscon;protocol=https;branch=main;tag=v${PV}"
-SRCREV = "c9d0e23336c6bb7645a1f5f48a4a82f1d5a589d9"
+SRCREV = "68fc8e1b2601e816e3a4ef95e3d8e700677509b9"
 
 SRC_URI += " \
-    file://0001-terminal-open-the-pty-only-once-a-display-is-attached.patch \
-    file://0002-uterm_monitor-treat-platform-display-controllers-as-primary-GPUs.patch \
+    file://0001-uterm-treat-platform-display-controllers-as-primary-GPUs.patch \
+    file://0002-vt_libseat-Fix-build-error-due-to-logging-changes.patch \
 "
 
 inherit meson pkgconfig systemd