解决思路:跟据显示器判断,默认设置1080P60(目前最大只支持到1080P60),若较小尺寸,则按edid信息进行I2C配置
nct@nct-admin:/mnt/nctsdc2/RK3399System/RK3399-JD4-Android7.1/kernel/drivers$ git diff .
diff --git a/RK3399-JD4-Android7.1/kernel/drivers/gpu/drm/bridge/dw-hdmi.c b/RK3399-JD4-Android7.1/kernel/drivers/gpu/drm/bridge/dw-hdmi.c
index 835e78cca6..6f998cf7ea 100644
--- a/RK3399-JD4-Android7.1/kernel/drivers/gpu/drm/bridge/dw-hdmi.c
+++ b/RK3399-JD4-Android7.1/kernel/drivers/gpu/drm/bridge/dw-hdmi.c
[url=home.php?mod=space&uid=1999721]@@[/url] -2442,21 +2442,46 @@ dw_hdmi_connector_detect(struct drm_connector *connector, bool force)
static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
{
-
const u8 def_modes[6] = {4, 16, 31, 19, 17, 2};
-
-
const u8 def_modes[6] = {16, 4, 31, 19, 17, 2};
struct hdr_static_metadata *metedata =
&connector->display_info.hdmi.hdr_panel_metadata;
int i, ret = 0;
if (!hdmi->ddc)
return 0;
-
printk("Howard###hdmi, %s:\n", __FUNCTION__);
-
edid = drm_get_edid(connector, hdmi->ddc)
-
/**
-
-
-
if(edid) {
-
printk("Howard###hdmi, %s: %dX%d\n", __FUNCTION__, edid->width_cm, edid->height_cm);
-
}
-
if(edid->width_cm < edid->height_cm ){
-
isVertical = true
-
min = edid->width_cm
-
max = edid->height_cm
-
}else{
-
max = edid->width_cm
-
min = edid->height_cm
-
}
-
-
if(min > 27 && max > 48){
-
edid = NULL
-
}
-
if (edid) {
dev_dbg(hdmi->dev, "got edid: width[%d] x height[%d]\n",
edid->width_cm, edid->height_cm);
diff --git a/RK3399-JD4-Android7.1/kernel/drivers/video/rockchip/hdmi/rockchip-hdmi.h b/RK3399-JD4-Android7.1/kernel/drivers/video/rockchip/hdmi/rockchip-hdmi.h
index 08e1f9b47e..06f097f7a2 100644
--- a/RK3399-JD4-Android7.1/kernel/drivers/video/rockchip/hdmi/rockchip-hdmi.h
+++ b/RK3399-JD4-Android7.1/kernel/drivers/video/rockchip/hdmi/rockchip-hdmi.h
@@ -566,8 +566,9 @@ struct hdmi {
#define HDMI_AUTO_CONFIG false
/* HDMI default vide mode */
-#define HDMI_VIDEO_DEFAULT_MODE HDMI_1280X720P_60HZ
+//#define HDMI_VIDEO_DEFAULT_MODE HDMI_1280X720P_60HZ
+#define HDMI_VIDEO_DEFAULT_MODE HDMI_1920X1080P_60HZ
+
#define HDMI_VIDEO_DEFAULT_COLORMODE HDMI_COLOR_AUTO
#define HDMI_VIDEO_DEFAULT_COLORDEPTH 8
(END)
diff --git a/RK3399-JD4-Android7.1/kernel/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/RK3399-JD4-Android7.1/kernel/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
index e1f50de45c..7a3cb8fde5 100644
--- a/RK3399-JD4-Android7.1/kernel/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+++ b/RK3399-JD4-Android7.1/kernel/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
@@ -484,11 +484,14 @@ dw_hdmi_rockchip_mode_valid(struct drm_connector *connector,
- If sink max TMDS clock < 340MHz, we should check the mode pixel
- clock > 340MHz is YCbCr420 or not.
*/
+//@howard 20210604 disable
+#if 0
if (mode->clock > 340000 &&
connector->display_info.max_tmds_clock < 340000 &&
!drm_mode_is_420(&connector->display_info, mode))
return MODE_BAD;
+#endif
原作者:feier_yan
|