![]() |
RT-Thread RTOS
An open source embedded real-time operating system
|
simple-framebuffer) Implementation: **components/drivers/graphic/framebuffer/fb-simple.c**. Registers a **struct rt_graphic_device** from a fixed memory window described in device tree (Linux **simple-framebuffer** binding style).
width**, **height**, **stride**, **format** → internal **simplefb_format** (bits per pixel, RT graphic mode).ioremap** (or use physical) **reg** → **screen_base**, compute **screen_size**.rt_clk_array** prepare/enable; optional regulator **enable** array.rt_graphic_device** ops (set_pixel, get_pixel, draw_hline, etc.) and **rt_device_register**.Driver table maps string names (e.g. **r5g6b5**, **a8r8g8b8**, **x8r8g8b8**) to **rt_graphic_info** mode and bpp. Unknown **format** fails probe.
Disable clocks/regulators, unmap framebuffer memory, unregister graphic device.
| Topic | Guidance |
|---|---|
| Cache | CPU-accessible framebuffer RAM must use correct MMU cache attributes; if cacheable, maintain with **rt_hw_cpu_dcache_ops** — see Hardware cache (hwcache) |
| Stride | Must match hardware line pitch (bytes), not always width * bpp/8 |
| Primary display | Pair with Graphics (DM) / graphic_primary.c if multiple heads |
| No GPU | This is linear FB only—no command queue; use a SoC GPU driver if you need acceleration |
components/drivers/graphic/framebuffer/fb-simple.ccomponents/drivers/graphic/graphic.c