STRUCT DRM_PANEL_FUNCS(9)
π struct drm_panel_funcs(9) β the Kernel API Manual, but make it make sense
okay so bestie, this is your whole cheat sheet for struct drm_panel_funcs β it's the ops struct for "perform operations on a given panel" β¨ From the Kernel API Manual, no cap. Scroll responsibly. π«Ά
β¨ SYNOPSIS β¨
Here's the whole vibe, exactly as written β every member, every signature, don't @ me:
struct drm_panel_funcs {
int (*prepare)(struct drm_panel *panel);
int (*enable)(struct drm_panel *panel);
int (*disable)(struct drm_panel *panel);
int (*unprepare)(struct drm_panel *panel);
int (*get_modes)(struct drm_panel *panel, struct drm_connector
*connector);
enum drm_panel_orientation (*get_orientation)(struct drm_panel
*panel);
int (*get_timings)(struct drm_panel *panel, unsigned int
num_timings, struct display_timing *timings);
void (*debugfs_init)(struct drm_panel *panel, struct dentry *root);
};
π Members π
These are the individual little guys. Let's do a vibe check on each one, one at a time, no skipping. π
prepareβ Turn on panel and perform set up.
This function is optional. πΈ
enableβ Enable panel (turn on back light, etc.).
This function is optional. πΈ
disableβ Disable panel (turn off back light, etc.).
This function is optional. πΈ
unprepareβ Turn off panel.
This function is optional. πΈ
get_modesβ Add modes to the connector that the panel is attached to and returns the number of modes added.
This function is mandatory. π₯ Not optional, bestie. Like, you have to implement this one.
get_orientationβ Return the panel orientation set by device tree or EDID.
This function is optional. πΈ
get_timingsβ Copy display timings into the provided array and return the number of display timings available.
This function is optional. πΈ
debugfs_initβ Allows panels to create panels-specific debugfs files.
(yes, it really says "panels-specific" β I'm just the messenger π)
π Description π
okay bestie here's the actual story time, because the ordering here is literally the whole point and it's giving choreography π
The .prepare function is typically called before the display controller starts to transmit video data. Panel drivers can use this to turn the panel on and wait for it to become ready. If additional configuration is required (via a control bus such as I2C, SPI or DSI for example) this is a good time to do that. β¨
After the display controller has started transmitting video data, it's safe to call the .enable function. This will typically enable the backlight to make the image on screen visible. Some panels require a certain amount of time or frames before the image is displayed. This function is responsible for taking this into account before enabling the backlight to avoid visual glitches. π (the glitches are the villain, the waiting is the hero)
Before stopping video transmission from the display controller it can be necessary to turn off the panel to avoid visual glitches. This is done in the .disable function. Analogously to .enable this typically involves turning off the backlight and waiting for some time to make sure no image is visible on the panel. It is then safe for the display controller to cease transmission of video data. π¦
To save power when no video data is transmitted, a driver can power down the panel. This is the job of the .unprepare function. π
Backlight can be handled automatically if configured using drm_panel_of_backlight or drm_panel_dp_aux_backlight. Then the driver does not need to implement the functionality to enable/disable backlight. π«Ά (free real estate, fr fr)
π SEE ALSO π
Go touch these, bestie β they're in the kernel file ./include/drm/drm_panel.h:
struct drm_panel(9)devm_drm_panel_alloc(9)
lowkey reminding you:get_modesis the only mandatory one, everything else is optional, but the order of.prepareβ.enableβ.disableβ.unprepareis not a suggestion, it's the whole plot. π
and that's a wrap, bestie π§π this little love letter lives in ./include/drm and it's stamped October 2026 β go slay your panel driver, mwah! πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms