Skip to content
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

DietPi-Display | New tool to control console display modes and rotation (beta) #7390

Open
MichaIng opened this issue Feb 9, 2025 · 3 comments

Comments

@MichaIng
Copy link
Owner

MichaIng commented Feb 9, 2025

To allow controlling console display modes, rotation and more in a generic way on every modern hardware, we added a new script which uses the KMS/DRM sysfs and video kernel command-line parameter to do so. Both is not perfectly documented, and there are open questions and issues, hence for now it is in beta phase: https://github.com/MichaIng/DietPi/blob/dev/dietpi/dietpi-display

General video parameter documentation: https://docs.kernel.org/fb/modedb.html
We can further add reflection, refresh rate and margins, probably other options.

Also, we plan to shift most options from the dietpi-config display menu into this new script. The RPi camera module options will be probably moved elsewhere, some others are obsolete with the new kernel and will be removed. However, for now the dietpi-config menu remains untouched.

Issues/Questions:

  • /sys/class/drm/*/modes theoretically contains a list of supported modes. However, at least with my HDMI screen, if I select a smaller resolution, all larger resolutions (respectively all above in the list) are hidden. So changing back to a larger resolution only works when either resetting the settings (removing the kernel command-line parameter) in between, or setting it manually.
  • At first I though /sys/class/drm/*/modes is always shows the current mode at the top, but it does not. In above mentioned case, it just cut away all above modes. So the question is how to get the current mode without using further tools like fbset and similar.
  • At least on my NanoPi M6, Linux provides only a single framebuffer, even of the DSI display + HDMI screen are attached. Hence both screens shot the same console output, attached to the same console device tty. This seems to have the implication that displays cannot be rotated independently either. As fast as I use both screens, rotating the DSI LCD does not work anymore. This is restored once the HDMI display is disabled. Would be interesting to find out whether/how to enable multi-display functionality, with a dedicated framebuffer for a different tty on each screen. On Raspberry Pi 4 and 5 there should be two framebuffers possible, but I did not test this yet. In case, mapping console devices to DRM devices might be a nice feature to add.
@InnovoDeveloper
Copy link

InnovoDeveloper commented Feb 10, 2025

Just tried the dietpi-display (Just and FYI, I had to reboot after installing the update to get dietpi-display to work). Howerver i am getting this error. Not sure if I missed a step.

uname -r> 6.1.84-vendor-rk35xx

running the image from the vendor gives me a desktop on the attached panel.

[FAILED] No DRM device has been found │ │ │ │ A DRM device could not be found on your system. Please assure the display is properly attached and working, and your │ │ kernel supports DRM. │ │ │ │ <Ok>

@MichaIng
Copy link
Owner Author

@InnovoDeveloper which SBC is it? And you say attacked panel, so I guess no HDMI screen, but a DSI LCD or similar? It is possible that at least for this display, no KMS/DRM is used, and hence it cannot be controlled via dietpi-display and the respective APIs.

@InnovoDeveloper
Copy link

It's the NanoPi M6 with the case built in display. https://wiki.friendlyelec.com/wiki/index.php/NanoPi_M6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants