Adding Waveshare35c LCD support in dietpi-config and dietpi-set_hardware
The current code for the Waveshare32 was duplicated and modified to support the very similar Waveshare35c model. I only have the hardware to test on a RPi, and so I was unable to test these changes on any other hardware configurations.
I also needed to modify the framebuffer identifier in dietpi-set_hardware to be /dev/fb0 instead of the /dev/fb1 that's set in the same Waveshare32 code. I have no idea why there was this discrepancy, and I did not make a similar change to the equivalent odroids code, because I could not test to see if that was required - so, this might be an area for improvement and for someone with more knowledge than I to scrutinize.
Many thanks.
Three thinks:
- Does this work with KMS/DRM enabled?
/boot/dietpi/func/dietpi-set_hardware rpi-opengl vc4-kms-v3d - Is the X11 config to use
fbdevreally required?rm /etc/X11/xorg.conf.d/99-waveshare35c_xorg.conf. Especially I am not sure whether the framebuffer device is always the same,/dev/fb0vs/dev/fb1, or whether it depends on other attached displays. More importantly on RPi 4 and 5 there can be two HDMI framebuffers, which would make the DSI display/dev/fb2. X11 might fall back automatically tofbdevif KMS does not work. - In how far does it work if you do not setup the display at all but only add
display_auto_detect=1to/boot/config.txt? There are some generic DSI display overlays, auto-selected by the bootloader in this case, compatible with KMS/DRM driver. So probably this can make vast parts of the individual setup obsolete.
Waveshare themselves use /dev/fb1 as well btw, but this could have changed as their configs are all very outdated and created for ancient kernel versions (same as ours): https://github.com/waveshareteam/LCD-show/blob/master/usr/share/X11/xorg.conf.d/99-fbturbo.conf
It however seems to contradict the cmdline entry fbcon=map:10, also matching the one used by Waveshare 🤔: https://github.com/waveshareteam/LCD-show/blob/master/cmdline.txt
So in any case well worth it to test everything with modern kernel, drivers and settings, and reduce things to a minimum.