All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [oe] [meta-oe][PATCHv2] kmscon: treat platform display controllers as primary GPUs
       [not found] <18D97A56FA04FDE1.2498962@lists.openembedded.org>
@ 2026-09-28 12:03 ` Markus Volk
  0 siblings, 0 replies; only message in thread
From: Markus Volk @ 2026-09-28 12:03 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 6108 bytes --]

v2: I tested all the previous issues again on actual hardware. The RPi 
won't boot without the patch, but it does with it. The Intel ARC is 
behaving normally and is no longer flooding the journal.

On Mon, Sep 28 2026 at 14:00:16 +02:00:00, Markus Volk via 
lists.openembedded.org <f_l_k=t-online.de@lists.openembedded.org> wrote:
> kmscon only counted a GPU as primary when its PCI parent had boot_vga
> set, so with gpus=primary it ignored vc4 on the Raspberry Pi 4 and 
> never
> showed a terminal. Treat DRM devices on the platform bus as primary,
> except for the firmware framebuffer drivers. Tested on a Raspberry Pi 
> 4
> booting through EDK2.
> 
> AI-Generated: Uses Claude Code (Claude Opus 5.5)
> Signed-off-by: Markus Volk <f_l_k@t-online.de 
> <mailto:f_l_k@t-online.de>>
> ---
>  ...-display-controllers-as-primary-GPUs.patch | 84 
> +++++++++++++++++++
>  .../recipes-graphics/kmscon/kmscon_10.0.1.bb  |  5 +-
>  2 files changed, 88 insertions(+), 1 deletion(-)
>  create mode 100644 
> meta-oe/recipes-graphics/kmscon/kmscon/0002-uterm_monitor-treat-platform-display-controllers-as-primary-GPUs.patch
> 
> 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/0002-uterm_monitor-treat-platform-display-controllers-as-primary-GPUs.patch
> new file mode 100644
> index 0000000000..c85607783c
> --- /dev/null
> +++ 
> b/meta-oe/recipes-graphics/kmscon/kmscon/0002-uterm_monitor-treat-platform-display-controllers-as-primary-GPUs.patch
> @@ -0,0 +1,84 @@
> +From d321a1572a12d760ddade294f4e7eabe57d555d1 Mon Sep 17 00:00:00 
> 2001
> +From: Markus Volk <f_l_k@t-online.de <mailto: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
> +
> +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
> +devices without a PCI parent, so with gpus=primary kmscon ignored the
> +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.
> +
> +Upstream-Status: Pending
> +
> +AI-Generated: Uses Claude Code (Claude Opus 5.5)
> +---
> + src/uterm_monitor.c | 29 ++++++++++++++++++++++++++---
> + 1 file changed, 26 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:
> + 	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 bool is_drm_primary(struct uterm_monitor *mon, struct 
> udev_device *dev, const char *node,
> ++			   int fd)
> + {
> + 	struct udev_device *pci;
> + 	const char *id;
> ++	char *name;
> ++	bool res;
> +
> + 	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
> + 			log_debug("DRM device %s is primary PCI GPU", node);
> + 			return true;
> + 		}
> ++		return false;
> + 	}
> +
> +-	return false;
> ++	/*
> ++	 * 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.
> ++	 */
> ++	if (!udev_device_get_parent_with_subsystem_devtype(dev, 
> "platform", NULL))
> ++		return false;
> ++
> ++	name = get_drm_name(fd);
> ++	if (!name)
> ++		return false;
> ++
> ++	res = strcmp(name, "simpledrm") && strcmp(name, "efidrm") && 
> strcmp(name, "vesadrm") &&
> ++	      strcmp(name, "ofdrm");
> ++	if (res)
> ++		log_debug("DRM device %s is primary platform GPU (%s)", node, 
> name);
> ++	free(name);
> ++	return res;
> + }
> +
> + /*
> +@@ -334,7 +357,7 @@ static unsigned int get_drm_flags(struct 
> uterm_monitor *mon, struct udev_device
> + 		return flags;
> + 	}
> +
> +-	if (is_drm_primary(mon, dev, node))
> ++	if (is_drm_primary(mon, dev, node, fd))
> + 		flags |= UTERM_MONITOR_PRIMARY;
> + 	if (is_drm_usb(mon, node, fd))
> + 		flags |= UTERM_MONITOR_AUX;
> +--
> +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.1.bb
> index c5cfd527d5..0336649551 100644
> --- a/meta-oe/recipes-graphics/kmscon/kmscon_10.0.1.bb
> +++ b/meta-oe/recipes-graphics/kmscon/kmscon_10.0.1.bb
> @@ -23,7 +23,10 @@ DEPENDS = "\
>  SRC_URI = 
> "git://github.com/kmscon/kmscon;protocol=https;branch=main;tag=v${PV}"
>  SRCREV = "c9d0e23336c6bb7645a1f5f48a4a82f1d5a589d9"
> 
> -SRC_URI += 
> "file://0001-terminal-open-the-pty-only-once-a-display-is-attached.patch" 
> <file://0001-terminal-open-the-pty-only-once-a-display-is-attached.patch/>
> +SRC_URI += " \
> +    
> file://0001-terminal-open-the-pty-only-once-a-display-is-attached.patch 
> <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://0002-uterm_monitor-treat-platform-display-controllers-as-primary-gpus.patch/> 
> \
> +"
> 
>  inherit meson pkgconfig systemd
> 
> --
> 2.55.0
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#130433): 
> <https://lists.openembedded.org/g/openembedded-devel/message/130433>
> Mute This Topic: <https://lists.openembedded.org/mt/121469845/3618223>
> Group Owner: openembedded-devel+owner@lists.openembedded.org 
> <mailto:openembedded-devel+owner@lists.openembedded.org>
> Unsubscribe: 
> <https://lists.openembedded.org/g/openembedded-devel/unsub> 
> [f_l_k@t-online.de <mailto:f_l_k@t-online.de>]
> -=-=-=-=-=-=-=-=-=-=-=-
> 


[-- Attachment #2: Type: text/html, Size: 6360 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-28 12:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <18D97A56FA04FDE1.2498962@lists.openembedded.org>
2026-09-28 12:03 ` [oe] [meta-oe][PATCHv2] kmscon: treat platform display controllers as primary GPUs Markus Volk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.