环境 Ubuntu虚拟机做交叉编译环境 firefly3399pro-JD4核心板 + 配套Firefly底板 Linux-SDK官方 需求 固定HDMI不论显示器的大小,输出固定的分辨率 解决办法 kernel/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c static int dw_hdmi_connector_get_modes(struct drm_connector *connector) { struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi, connector); struct edid *edid; struct drm_display_mode *mode; //const u8 def_modes[6] = {4, 16, 31, 19, 17, 2}; //此处修改为自己要固定的分辨率vic。分辨率的结构体数组定义为在kernel/drivers/gpu/drm/drm_edid.c中定义的edid_cea_modes[]数组。 const u8 def_modes[1] = {1}; struct drm_display_info *info = &connector->display_info; struct hdr_static_metadata *metedata = &connector->display_info.hdmi.hdr_panel_metadata; int i, ret = 0; if (!hdmi->ddc) return 0; edid = drm_get_edid(connector, hdmi->ddc); /