-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forcing /dev/fbN assignments for DRM cards #5660
Conversation
Add a flag custom_fb_num to denote that the client has requested a specific fbdev node number via node. Signed-off-by: Dave Stevenson <[email protected]>
For situations where there are multiple DRM cards in a system, add a query of DT for "drm_fb" designations for cards to set their preferred /dev/fbN designation. Signed-off-by: Dave Stevenson <[email protected]>
Adds dtparam overrides to the base Pi5 DT such that vc4, DSI0, DSI1, or DPI can be requested to be /dev/fb[012]. No override is specified by default, so the order will be based on probe order (aka semi-random). Any device that doesn't have an override specified will be placed above all specified overrides. Having an fb1 or fb2 override but no fb0 one will result in no console via fbcon. Signed-off-by: Dave Stevenson <[email protected]>
Looks good to me - nice use of the new "assign a literal path string" feature. Feel free to merge when the auto-builds have completed. |
See: raspberrypi/linux#5661 kernel: Swap DT aliases from underscore to hyphen See: raspberrypi/linux#5662 kernel: Add DT aliases to map to DRM card names See: raspberrypi/linux#5629 kernel: Forcing /dev/fbN assignments for DRM cards See: raspberrypi/linux#5660 kernel: dts: bcm2712: Use the new model name See: https://forums.raspberrypi.com/viewtopic.php?p=2146474#p2146474
See: raspberrypi/linux#5661 kernel: Swap DT aliases from underscore to hyphen See: raspberrypi/linux#5662 kernel: Add DT aliases to map to DRM card names See: raspberrypi/linux#5629 kernel: Forcing /dev/fbN assignments for DRM cards See: raspberrypi/linux#5660 kernel: dts: bcm2712: Use the new model name See: https://forums.raspberrypi.com/viewtopic.php?p=2146474#p2146474
Is there a variant of this for Pi 4B which I could test? Sometimes my tinydrm SPI display shows up as /dev/fb0, sometimes as /dev/fb1. HDMI is attached as well, so I get the bootup log randomly on HDMI or SPI display. |
That's exactly the situation we have on Pi5 with DSI, DPI, or the VEC being separate cards. I hadn't added it for Pi0-4 as it's only going to be SPI type displays that have the potential to cause grief, and the main niggle with this override is that if the card assigned fb0 doesn't load correctly, you end up with no console. Can I ask which SPI display you're using? Once the SPI display overlays are tidied up some more, I'll add an override to them, and for Pi0-4. The main issue I have is with regard testing as I only have about 5 SPI displays (piscreen, pitft35-resistive, the 2 in tinydrm-overlay, and I think I have one other in my parts drawer at home). |
Understood. I'm using tinydrm.
Hardware: Waveshare 2.0 inch 240x320 display with ST7789V controller.
I have a bunch of other SPI display models here, but the ST7789V display is the one attached right now, so any immediate tests will target that one. Willing to test other displays later this week. |
This is where I'm a little lost over TinyDRM display specific drivers vs mipi-dbi-spi firmware files. Also note that currently mipi-dbi-spi is not registered in Mesa as a kmsro driver, so Wayfire currently barfs on it due to falling back to software rendering. It needs the equivalent of https://gitlab.freedesktop.org/mesa/mesa/-/commit/8cfc17bdda31a381bfbaadc75f0d34dada0e8c91 (as does ili9486) - unless someone beats me to it, I'll be making a PR to Mesa with the relevant change soon.
I may take you up on that. The main niggle with the panel specific drivers is noting that many of them have the opposite sense for the reset line, so it's not necessarily a trivial conversion of the overlay. Just for you - #5675. |
Following on from #5629 for DRM device naming, add the option of forcing the mapping of /dev/fbN to particular DRM cards.
In a similar way to I2C etc, it looks for the highest numbered alias, and unassigned devices will be put beyond that number on the normal first-come, first-served basis.
If you assign something to fb1 but nothing to fb0, then you won't get a console unless you also use
fbcon=map=<1>
in the kernel command line.Aliases only created for Pi5 as that's the one we hit this with more with DSI (x2), DPI, and VEC all being separate cards, but we could add it for the SPI display overlays and Pi0-4 as well. The SPI overlays are currently largely using fbdev drivers rather than DRM ones. I am working on a new tinydrm overlay to use mimic the fbtft overlay but using the TinyDRM drivers, but it's only got 2 drivers working at present.
(There is also panel-mipi-dbi which takes a firmware file to configure an SPI display, but AFAIK there is no repository yet of those firmware files to make it useful).