Panel硬件上对应屏幕本身。
https://elixir.bootlin.com/linux/latest/source/include/drm/drm_panel.h
Makefile
drm-$(CONFIG_DRM_PANEL) += drm_panel.o
drm_kms_helper-y:drm_panel_helper.o 没找到对应函数
drm_kms_helper-$(CONFIG_DRM_PANEL_BRIDGE) += bridge/panel.o
obj-y += panel/
drm_panel.c + drm_panel.h
void drm_panel_init(struct drm_panel *panel, struct device *dev,
const struct drm_panel_funcs *funcs,
int connector_type);
int drm_panel_add(struct drm_panel *panel);
void drm_panel_remove(struct drm_panel *panel);
int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector);
void drm_panel_detach(struct drm_panel *panel);
int drm_panel_prepare(struct drm_panel *panel);
int drm_panel_unprepare(struct drm_panel *panel);
int drm_panel_enable(struct drm_panel *panel);
int drm_panel_disable(struct drm_panel *panel);
int drm_panel_get_modes(struct drm_panel *panel, struct drm_connector *connector);
struct drm_panel *of_drm_find_panel(const struct device_node *np);
主要是对软件函数的最终实现。功能如函数名。
static LIST_HEAD(panel_list);//结合这个panel_list,可以知道panel是存在一个list里面,init,add,remove等等都
围绕这个list做操作;剩下的操作则是围绕着panel->funcs
bridge/panel.c
struct panel_bridge {
struct drm_bridge bridge;
struct drm_connector connector;
struct drm_panel *panel;
u32 connector_type;
};
这个结构体包含了从主芯片出来的所有硬件抽象
代码包含一些获取结构体的container_of的封装
struct panel_bridge *drm_bridge_to_panel_bridge
struct panel_bridge *drm_connector_to_panel_bridge
获取mode模式
static const struct drm_connector_helper_funcs
panel_bridge_connector_helper_funcs = {
.get_modes = panel_bridge_connector_get_modes,
};
panel_