3399 hdmi输出特殊分辨率
1.添加配置
drivers/gpu/drm/drm_edid.c
/* 106 - 3840x2160p@50Hz 64:27 */{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896,4984, 5280, 0, 2160, 2168, 2178, 2250, 0,DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },/* 107 - 3840x2160p@60Hz 64:27 */{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016,4104, 4400, 0, 2160, 2168, 2178, 2250, 0,DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, //在這里添加新的數(shù)據(jù)/* 108 - 1920x3240@60Hz 16:27 */{ DRM_MODE("1920x3240", DRM_MODE_TYPE_DRIVER, 410000, 1920, 1968,2000, 2160, 0, 3240, 3243, 3253, 3299, 0,DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, #define DRM_MODE(nm, t, c, hd, hss, hse, ht, hsk, vd, vss, vse, vt, vs, f) \.name = nm, .status = 0, .type = (t), .clock = (c), \.hdisplay = (hd), .hsync_start = (hss), .hsync_end = (hse), \.htotal = (ht), .hskew = (hsk), .vdisplay = (vd), \.vsync_start = (vss), .vsync_end = (vse), .vtotal = (vt), \.vscan = (vs), .flags = (f), \.base.type = DRM_MODE_OBJECT_MODE // DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 后面的參數(shù)依次是: // clock, hdisplay, hsync_start, hsync_end, htotal, skew, // vdisplay, vsync_start, vsync_end, vtotal, vscan, flags
比如需要改的分辨率是:
那么clock = 410000,
hdisplay = 1920
hsync_start = hdisplay + tHFP = 1920 + 48 = 1968
hsync_end = hsync_start + tHsync = 2000
htotal = hsync_end + tHBP = 2160
skew = 0
vdisplay = 3240
vsync_start = vdisplay + tVFP = 3240 + 3 = 3243
vsync_end = vsync_start + tVsync = 3253
vtotal = vsync_end + tVBP = 3299
vscan = 0
2.drivers/gpu/drm/rockchip/rockchip_drm_vop.c
vop_crtc_mode_valid函數(shù)
static enum drm_mode_status vop_crtc_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode,int output_type) //.../** Hdmi or DisplayPort request a Accurate clock.*/if (output_type == DRM_MODE_CONNECTOR_HDMIA ||output_type == DRM_MODE_CONNECTOR_DisplayPort)if ((clock != request_clock) && (strcmp(mode->name, "1920x3240") == 0))return MODE_CLOCK_RANGE;//...3.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};const u8 def_modes[1] = {108};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;//...4.虛擬機(jī)內(nèi)編譯
執(zhí)行make_kernel.sh獲取kernel.img和resource.img
5.將兩個img文件燒入到RK3399開發(fā)板內(nèi)
使用燒錄工具單獨(dú)燒錄kernel和resource就行
6.連接LCD屏,遠(yuǎn)程進(jìn)入RK3399環(huán)境內(nèi),輸入以下命令
cat /sys/class/drm/card0-HDMI-A-1/mode
看到特定分辨率即表示成功
附錄
HDMI輸出4K時,修改quant range
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
void *data)
hdmi->hdmi_quant_range = 2;
總結(jié)
以上是生活随笔為你收集整理的3399 hdmi输出特殊分辨率的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Facebook员工跳楼轻生——没有任何
- 下一篇: 机器学习基本思想