Hardware & Kernel DRM Driver for RPI DSI Displays.
Note: This repository is still under development. Feel free to open issues if you have any questions or suggestions.
Simplified Chinese(简体中文)
Compared from SPI/DPI panels,DSI panels has taken these advantages:
- High refresh rate(~60fps)
- Easy to wire
- Consume less gpio resources
- Low power consumption
Due to the circuit design of Raspberry Pi boards, RPi 4b on-board DSI connector only routes out 2 DSI lanes, with a maximum resolution of 720p.
If you want to drive a panel with more than 2 lanes, you may need to consider the compute module or RPi 5.
You must enable DRM
first in order to use this driver.
In Raspberry Pi OS
releases after 2022-1-28
, DRM
is enabled by default.
Old releases of RPiOS may not support DRM
,so use latest version of RPiOS is recommended.
*Note: this tutorial and code only keep compatibility with latest RPiOS. If you are using old RPiOS, you are on your own.
Check for kernel headers:
ls /lib/modules/`uname -r`/build
If not, install it:
sudo apt install linux-headers-rpi-v8 # for arm64,armv7 users install linux-headers-rpi-v7
Install make
and dtc
:
sudo apt install make device-tree-compiler
Clone:
git clone https://github.com/CNflysky/RPI_DSI_Displays
cd RPI_DSI_Displays/src
Compile driver:
make
Move panel-rpi-dsi-displays.ko
into /lib/modules
:
sudo cp panel-rpi-dsi-displays.ko /lib/modules/`uname -r`/kernel/drivers/gpu/drm/panel
sudo depmod
Compile device tree overlay:
dtc -I dts -O dtb -o vc4-kms-dsi-rpidisp.dtbo vc4-kms-dsi-rpidisp.dts
Move to /boot/firmware/overlays
:
sudo cp vc4-kms-dsi-rpidisp.dtbo /boot/firmware/overlays
Edit /boot/firmware/config.txt
, add these two lines:
ignore_lcd=1
dtoverlay=vc4-kms-dsi-rpidisp
Reboot.
If you want to get adapters,take a look at adapters
directory.
You can view it on OSHWHub too:Link(Chinese version only)
vc4-kms-dsi-rpidisp.dts
:
panel:panel@0 {
compatible = "wlk,w280bf036i";
status = "okay";
reg = <0>;
// reset-gpios = <&gpio 44 0>;
reset-gpios = <&gpio 46 0>; // fix me
backlight = <&panel_backlight>;
rotation = <0>; // Rotation: [0, 90, 180, 270]
...
}
Here
Translated from my blog,may not 100% accurate.
Part Number | Diagonal | Resolution | Interface | Connector | TP | Note |
---|---|---|---|---|---|---|
W280BF036I | 2.8 Inch | VGA(480x640) | DSI 1 Lane | 24p Connector | None |