07:27 tzimmermann: MoeIcenowy, if we use sysfb, we currently need PCI first (if there's any PCI) to make it work correctly.
07:27 tzimmermann: MoeIcenowy, are there systems that use sysfb without having PCI ?
07:31 MoeIcenowy: tzimmermann: initialization of PCI subsystem doesn't mean initialization of the PCI bus
07:32 MoeIcenowy: the bus controller could require more (e.g. clocks, resets, power domains, etc)
07:32 tzimmermann: yes, we need to enumerate and setup PCI devices first.
07:32 tzimmermann: then we do the sysfb thing
07:32 MoeIcenowy: tzimmermann: well Han implemented EFI GOP on TH1520 (and this is the reason for my "drm/verisilicon: disable the output before enabling it" patch)
07:33 MoeIcenowy: and U-Boot also implements EFI GOP with its display support
07:34 tzimmermann: MoeIcenowy, do these systems use DT?
07:34 MoeIcenowy: Yes
07:34 MoeIcenowy: they use EFI (including GOP)+DT
07:34 tzimmermann: then we'd likely get the framebuffer from the DT
07:34 MoeIcenowy: Will having a simple-framebuffer node suppress the probe of efi-framebuffer?
07:35 tzimmermann: yes, once the kernel sees the simple-framebuffer node, it disables sysfb
07:35 MoeIcenowy: (I have a EFI+DT device that explicitly declares simple-framebuffer in DTS, sc8280xp-huawei-gaokun3
07:36 tzimmermann: you should not be using sysfb on this systems
07:36 tzimmermann: see https://elixir.bootlin.com/linux/v7.3.1/source/drivers/of/platform.c#L593
07:37 MoeIcenowy: tzimmermann: but I think a handcrafted system can have no PCI, no DT but w/ sysfb
07:38 MoeIcenowy: let me try to craft such a system with qemu...
07:40 tzimmermann: MoeIcenowy, take a legacy vga on the isa bus. but i'm talking about practical limitations. vga-on-isa is not really a concern nowadays.
07:40 javierm: MoeIcenowy: your point then is that sysfb_init() and sysfb.c should remain in drivers/firmware/sysfb.c ?
07:41 MoeIcenowy: javierm: to be honest I am not sure
07:41 MoeIcenowy: maybe we can just declare EFI GOP is unsupported on PCI-less device?
07:41 javierm: MoeIcenowy: you talk about clock, resets, power domains, etc but that's only relevant for DT systems
07:41 MoeIcenowy: javierm: yes, if having a simple-framebuffer node could suppress EFI GOP, then it's good
07:41 tzimmermann: javierm, MoeIcenows, we can leave them there. the problem is the device_initcall() that triggers sysfb https://elixir.bootlin.com/linux/v7.3.1/source/drivers/firmware/sysfb.c#L225
07:41 javierm: because for EFI-GOP, that's all handled by the FW anyways
07:42 tzimmermann: we should replace this with an explicit call from the PCI subsys
07:42 tzimmermann: (or whatever other subsys provides a system framebuffer)
07:43 MoeIcenowy: tzimmermann: javierm: maybe one system is worth trying: RPi3 with EDK2
07:43 MoeIcenowy: although I got rid of all my RPi's
07:43 tzimmermann: but for now, only PCI seems relevant
07:43 tzimmermann: RPi3 provides DT, right?
07:43 MoeIcenowy: yes
07:43 MoeIcenowy: but it also provides ACPI
07:43 tzimmermann: does the edk2 replace the DT
07:43 tzimmermann: ?
07:44 javierm: tzimmermann: it can support either, DT or ACPI
07:44 MoeIcenowy: tzimmermann: I think currently few EFI firmwares patch DT with simple-framebuffer
07:45 MoeIcenowy: although I agree that this should be preferred behavior
07:45 javierm: MoeIcenowy: only coreboot + EFI payload provided a simple-framebufer + EFI-GOP table
07:45 javierm: at least that's the only one we have someone reported
07:46 tzimmermann: how does acpi relate to pci code in the kernel?
07:46 MoeIcenowy: tzimmermann: well it's just no DT
07:46 MoeIcenowy: tzimmermann: I checked the source of RPi EDK2, it explicitly removes simple-framebuffer node
07:46 MoeIcenowy: and didn't create a new one
07:47 MoeIcenowy: https://github.com/tianocore/edk2-platforms/blob/master/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c#L313
07:47 javierm: MoeIcenowy: sorry, I was wrong. It was coreboot + seabios. Commit ("67f488dff17e firmware: coreboot: Don't register a pdev if screen_info data is present")
07:48 javierm: MoeIcenowy: yeah, the FW should either provide a DT with simple-framebuffer or an EFI-GOP table
07:48 tzimmermann: MoeIcenowy, rpi3 edk2 looks correct
07:49 MoeIcenowy: tzimmermann: it removes simple-framebuffer from the RPi FW, and only passes the EFI GOP to the OS
07:49 MoeIcenowy: and RPi3 surely has no PCI
07:49 tzimmermann: yes, that's correct behavior
07:50 javierm: tzimmermann: but I think MoeIcenowy has a point though. On a system with no PCI-based graphics card, the FW can provide a EFI-GOP table with a system framebuffer
07:50 MoeIcenowy: then this creates "systems that use sysfb without having PCI"
07:50 MoeIcenowy: javierm: sure
07:50 javierm: MoeIcenowy: exactly. So in theory you could have a sysfb even without PCI
07:50 javierm: so sysfb_init() shouldn't depend on PCI
07:50 tzimmermann: we'd need to run sysfb_init() per arch, or by some other logic
07:50 javierm: to register the efi-framebuffer platform device
07:51 javierm: tzimmermann: maybe moving it to drivers/firmware/efi/sysfb_efi.c ?
07:51 javierm: that is, get rid of drivers/firmware/sysfb.c but keep the EFI bits there
07:52 tzimmermann: javierm, sysfb also handles vesa at least
07:52 javierm: tzimmermann: hmm, I thought that was done in x86 arch code
07:53 javierm: ah no, but I think that it did at some point before we unified it
07:53 tzimmermann: javierm, kind of. x86 only inits the screen_info data. sysfb_init() later creates the device
07:53 javierm: maybe that was wrong. We should had kept vesa on x86 arch code and move the efi bits to drivers/firmware/efi/
07:53 javierm: then DT/OF systems will register simple-framebuffer in their platform code
07:53 javierm: and coreboot has its own driver as well
07:54 javierm: MoeIcenowy: if we do that, do you have any remaining concern ?
07:55 MoeIcenowy: javierm: no concern
07:55 tzimmermann: javierm, but that doesn't easily solve the original problem: sysfb needs to run after PCI
07:55 tzimmermann: if we have PCI
07:55 MoeIcenowy: In fact I even kinda agree that sysfs on PCI-less system isn't supported
07:55 MoeIcenowy: although this may regress some users
07:55 MoeIcenowy: and requires the firmware to create a simple-framebuffer node
07:56 tzimmermann: javierm, the original problem was that efi+syfb ran before pci-generic-host, which then fell over
07:56 tzimmermann: IIRC
07:57 MoeIcenowy: I think sysfb not only needs to be run after PCI, it also needs to be run when no PCI device is deferred
07:57 MoeIcenowy: probe deferred
07:57 javierm: tzimmermann: sorry, I've to take my kids to school. I'll be back in ~40 mins
07:57 tzimmermann: :)
07:58 MoeIcenowy: BTW is simple-framebuffer documented to supress efi-framebuffer? I do think for embedded systems explicit simple-framebuffer nodes are good
07:58 MoeIcenowy: and firmware should start to craft them
08:01 tzimmermann: MoeIcenows, it's not documents as such.
08:01 tzimmermann: ideally there would only be on of them
08:02 tzimmermann: but with firmware implementing interfaces on top of oter interfaces, we get these duplications
08:03 tzimmermann: DT maintainers want DT to take precedence over sysfb
08:03 tzimmermann: IIRC
08:03 MoeIcenowy: tzimmermann: I think the problem is that EFI GOP cannot declare dependencies
08:03 MoeIcenowy: e.g. to keep the SoC's display clock active
08:03 MoeIcenowy: (Linux common clock framework by default disables all "unused" clocks at the end of kernel booting
08:04 MoeIcenowy: a simple-framebuffer node could have a clock property, then the driver would keep the clock enabled
08:04 tzimmermann: yes. efi-gop is really not well suited for typical soc, i think
08:05 MoeIcenowy: apple/allwinner/amlogic has simplefb nodes pre-filled with SoC resources in their SoC DTSI
08:05 tzimmermann: (we have clock and regulator code in simpledrm for these cases)
08:05 MoeIcenowy: and they expect the firmware to fill up these nodes instead of creating new ones
08:06 tzimmermann: how is that relevant to us?
08:07 MoeIcenowy: tzimmermann: I just think there's good reason for DT simplefb to take precedence over sysfb
08:07 MoeIcenowy: and proper SoCs should all create DT simplefb nodes
08:07 tzimmermann: sure, i'm not saying it's wrong
08:09 MoeIcenowy: In fact I wonder how many people rely on non-PCI efifb
08:09 MoeIcenowy: maybe this should be just declared bad to have
08:11 MoeIcenowy: and then the whole sysfb thing could be moved to x86 and pci only
08:22 MoeIcenowy: Oh I found that QEMU ramfb is a non-PCI thing that never has a DT node
08:31 MoeIcenowy: so dropped non-PCI efifb isn't an acceptable option
08:33 tzimmermann: MoeIcenowy, do you know how ramfb is being represented in sysfb?
08:34 MoeIcenowy: tzimmermann: it's a EFI GOP
08:34 MoeIcenowy: probed by OVMF
08:34 tzimmermann: i see
08:36 MoeIcenowy: On "hardware" side, it's just a piece of framebuffer memory, and the information is passed from qemu to ovmf via qemu fw_cfg
08:36 MoeIcenowy: the GOP DXE is at https://github.com/tianocore/edk2/blob/master/OvmfPkg/QemuRamfbDxe/QemuRamfb.c
08:37 tzimmermann: we would handle this from the efi side
08:38 tzimmermann: but it still leaves us with the pci dependency
08:49 MoeIcenowy: well maybe add some DT-specific code, waiting for DT devices with `device_type = "pci"` ?
08:51 MoeIcenowy: oh "pci" isn't declared in DT spec (although widely used), so this isn't usable
08:53 MoeIcenowy: well then how to ensure sysfb init happens after all possible PCI busses are probed?
08:59 MoeIcenowy: Oops sysfb_efi is already using for_each_node_by_type(node, "pci")
09:00 MoeIcenowy: and the sequence of probing pci then probing the sysfb platform device is enforced with a devlink
09:01 MoeIcenowy: so... maybe the best practice is just to let efifb acquire the memory at probe time instead of register time...
09:02 dolphin: agd5f: Do you have a magical ability to summon Christian to IRC?
09:06 MoeIcenowy: well efifb is already doing this
09:06 MoeIcenowy: maybe the key is just to kill SYSFB_SIMPLEFB ?
09:08 MoeIcenowy: or revert the changes of d391c58271072d0b0fad93c82018d495b2633448 to move that logic back to x86-only
09:09 jani: pinchartl: did you mean "I don't think IGT qualifies"? https://lore.kernel.org/r/20261116154931.GA1763340@killaraus.ideasonboard.com
09:09 javierm: MoeIcenowy, tzimmermann: I'm back and reading your chat log
09:10 pinchartl: jani: oops yes, sorry
09:10 tzimmermann: javierm, i've meanwhile sent out the patch to remove SYSFB_SIMPLEFB
09:11 pinchartl: jani: replies on the list
09:12 tzimmermann: MoeIcenowy, neither is it. we need to apply fixes after pci ran, but before we create the devices. this call: https://elixir.bootlin.com/linux/v7.3.1/source/drivers/firmware/sysfb.c#L153
09:13 tzimmermann: hence the idea of running sysfb from pci.
09:13 javierm: tzimmermann: cool, r-b. Related, I wonder how good the n64 support is :D I think that have a n64 somewhere in a box
09:13 tzimmermann: now the question is how to integrate the non-pci systems
09:14 tzimmermann: javierm, IIRC the n64 support needs the memory pack
09:15 javierm: tzimmermann: yes, we need to run sysfb after those fixup (that are for pci) but pci is not a requirement
09:16 MoeIcenowy: create a fake device for sysfb initialization, do the initialization in its probe callback, and create devlinks for this fake device? (don't know whether this works for non-dt systems)
09:17 tzimmermann: MoeIcenowy, c'mon. we'll also have to maintain it later on
09:18 MoeIcenowy: well, I think postponing a initcall isn't a real thing from start...
09:19 jani: pinchartl: thanks :)
09:20 tzimmermann: we could invoke the apply-fixups call from pci. later we could invoke device creation from the efi lib. and on non-efi x86 we'd need some special code to init vesa-framebuffer. would that work?
09:21 tzimmermann: we'd have to order efi and x86 setup with the pci code, though
09:24 MoeIcenowy: well the order of efi to pci could be problematic
09:25 tzimmermann: i need more time to think it through
09:28 MoeIcenowy: https://github.com/torvalds/linux/blob/master/drivers/firmware/efi/sysfb_efi.c#L389 sysfb_efi.c has some code to order efifb probing with pci, although only for OF devices, and the postponed thing is efifb probing instead of creation
09:30 MoeIcenowy: well, maybe just kill SYSFB_SIMPLEFB for now?
09:31 MoeIcenowy: the sysfb_efi.c order code is just incompatible with SYSFB_SIMPLEFB
09:33 javierm: MoeIcenowy: yeah, killing SYSFB_SIMPLEFB has merits on its own anyways
09:35 tzimmermann: MoeIcenowy, https://lore.kernel.org/dri-devel/20261117084514.367399-1-tzimmermann@suse.de/
09:37 MoeIcenowy: tzimmermann: thanks
09:38 tzimmermann: that simplifies matters slightly
09:41 javierm: tzimmermann: it also solves the issue reported because efidrm request the I/O memory resource at probe time, while sysfb_simple did at device registration time
09:41 javierm: but I guess it still depends on init call levels, link time, etc
09:41 javierm: so is still fragile
10:52 javierm: tzimmermann, MoeIcenowy: can something similar be done for acpi? Add a fwnode_link_add() like is done in DT?
10:52 javierm: I'm not that familiar with ACPI to know
10:53 MoeIcenowy: I'm not either, but I remember that PCI is declared as a special table of ACPI instead of a DSDT node
12:37 mlankhorst: airlied: No worries!
13:56 agd5f: dolphin, I can can ask him
13:57 dolphin: I think the RTT of ~1 year between patch reviews is causing some of the older discussion context to be lost
13:58 dolphin: So that might help :)
13:59 dolphin: (for reference, this is about the EU debug patches and userptr memory access)
15:04 orowith2os: EGL_EXT_swap_tearing_hint is in, if somebody wouldn't mind giving pointers on !44749
15:51 alyssa: dschuermann: what's the replacement for b2b16?
15:52 alyssa: i have a use case on jay, in that i have a problem but b2b16 might not in fact be the solution :p
15:59 alyssa: (lowering specific boolean phis to 16-bit and then optimizing out b2b16(b2b1(x)) sequences )
16:00 MoeIcenowy: javierm: oh it looks like there're PNP0A08 DSDT nodes for PCIe ECAM spaces, at least on my x86 PC (EPYC 7K62)
16:00 alyssa: I guess bcsel is fine
16:00 MoeIcenowy: although I don't know what would happen for legacy systems
16:02 alyssa: ok I misread things. yeah, bcsel is fine, nvm.
16:02 alyssa: thanks
16:05 javierm: MoeIcenowy: "PCI host bridges are PNP0A03 or PNP0A08 devices" according Documentation/PCI/acpi-info.rst so I guess that one could do the same that's done for OF ?
16:05 MoeIcenowy: javierm: I think so
16:05 javierm: I wouldn't dare to type that patch because I know nothing about ACPI :) but certainly it would be great if can be done
16:07 MoeIcenowy: javierm: BTW I think another concern of tzimmermann is that the PCI BAR could be rearranged by PCI subsystem
16:07 MoeIcenowy: this is what handled by screen_info_apply_fixups()
16:08 MoeIcenowy: the devlink facility currently only postpones the probe of efidrm
16:08 MoeIcenowy: not the creation of efi-framebuffer pdev
16:10 MoeIcenowy: (although I think PCI rearranging is a behavior by default disabled in Linux
16:13 javierm: MoeIcenowy: yes but I think that's OK because efidrm request the mem resource at probe time
16:13 javierm: https://elixir.bootlin.com/linux/v7.4-rc1/source/drivers/gpu/drm/sysfb/efidrm.c#L251
16:15 javierm: so by then the res->start should already be rearranged AFAIU
16:16 javierm: MoeIcenowy: and that's actually what was reported for sysfb_simple, that is done at platform device registration time
16:16 javierm: https://elixir.bootlin.com/linux/v7.4-rc1/source/drivers/firmware/sysfb_simplefb.c#L122
16:17 MoeIcenowy: javierm: is the address only saved into screen info?
16:18 javierm: MoeIcenowy: I think so, yes
16:18 MoeIcenowy: so no one rearranges it except screen_info_apply_fixups()
16:18 javierm: yeah
16:19 MoeIcenowy: well... maybe to have PCI subsystem call screen_info_apply_fixups() ?
16:21 javierm: MoeIcenowy: that's what tzimmermann kind of meant by saying to move sysfb_init() to PCI
16:21 javierm: because most of the quirks in sysfb_apply_efi_quirks() are also PCI related
16:21 MoeIcenowy: well this is reasonable
16:22 javierm: and same for sysfb_set_efifb_fwnode()
16:23 MoeIcenowy: then... as efidrm still accesses screen_info at probe time, this should be fine
16:23 MoeIcenowy: emmm lemme check vesadrm
16:23 javierm: exactlyu
16:23 MoeIcenowy: yes vesadrm has the same behavior
16:24 javierm: yeah, tzimmermann wrote both drivers so they share the same design
16:24 MoeIcenowy: and according to https://elixir.bootlin.com/linux/v7.4-rc1/source/drivers/video/screen_info_generic.c#L76 these two types are the only one with unhardcoded linear fb
16:26 javierm: MoeIcenowy: now, the thing is that if we move there then the {ega,vga,vesa,efi}-framebuffer devices won't be registered with PCI disabled
16:27 javierm: so I think the correct approach would be to split sysfb_init() in two: all the quirks to apply (from PCI) and the device registration (from device init call level)
16:32 jani: anyone with audio experience have comments on this: https://lore.kernel.org/r/20261105160240.2850042-1-kai.vehmanen@linux.intel.com ?
16:33 jani: "drm: Populate ELD Port_ID to identify audio endpoints"
16:50 tzimmermann: MoeIcenowy, the pci window being relocated is *the* concern :) that's why sysfb depends on pci
16:51 tzimmermann: MoeIcenowy, calling screen_info_apply_fixups is part of the solution, yes
16:53 tzimmermann: javierm, yes. we need to split. but we still need to guarantee order of operation
17:31 lumag_: lucaceresoli: we were discussing USB4 support with konradybcio_. We need to switch the DRM bridge chain between the DP altmode and the USB4/TBT (they are handled by different hardware blocks). This almost sounds like the bridge hotplug to me. WDYT?
22:12 orowith2os: daniels: can I bother you to help me with EGL stuff again? :P