From 6c6be9bcfa776346af49b6d89cb70150e36a1de7 Mon Sep 17 00:00:00 2001 From: Yi Zhou Date: Thu, 24 May 2018 16:42:38 +0800 Subject: [PATCH] hdmitx: add default edid in drm PD#158474: hdmitx: add default edid in drm Change-Id: Ia9faa12f00a5cd01550dea1f1fe136d99e697f87 Signed-off-by: Yi Zhou --- drivers/amlogic/drm/am_meson_hdmi.c | 35 ++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/drivers/amlogic/drm/am_meson_hdmi.c b/drivers/amlogic/drm/am_meson_hdmi.c index ef7e891c1652..4badabe6aca1 100644 --- a/drivers/amlogic/drm/am_meson_hdmi.c +++ b/drivers/amlogic/drm/am_meson_hdmi.c @@ -83,6 +83,25 @@ char *am_meson_hdmi_get_voutmode(struct drm_display_mode *mode) return NULL; } +static unsigned char default_edid[] = { + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x31, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x16, 0x01, 0x03, 0x6d, 0x32, 0x1c, 0x78, + 0xea, 0x5e, 0xc0, 0xa4, 0x59, 0x4a, 0x98, 0x25, + 0x20, 0x50, 0x54, 0x00, 0x00, 0x00, 0xd1, 0xc0, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x3a, + 0x80, 0x18, 0x71, 0x38, 0x2d, 0x40, 0x58, 0x2c, + 0x45, 0x00, 0xf4, 0x19, 0x11, 0x00, 0x00, 0x1e, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x4c, 0x69, 0x6e, + 0x75, 0x78, 0x20, 0x23, 0x30, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x3b, + 0x3d, 0x42, 0x44, 0x0f, 0x00, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0xfc, + 0x00, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x20, 0x46, + 0x48, 0x44, 0x0a, 0x20, 0x20, 0x20, 0x00, 0x05, +}; + int am_hdmi_tx_get_modes(struct drm_connector *connector) { struct am_hdmi_tx *am_hdmi = to_am_hdmi(connector); @@ -96,6 +115,12 @@ int am_hdmi_tx_get_modes(struct drm_connector *connector) drm_mode_connector_update_edid_property(connector, edid); count = drm_add_edid_modes(connector, edid); kfree(edid); + } else { + DRM_INFO("edid error and load default edid\n"); + drm_mode_connector_update_edid_property(connector, + (struct edid *)default_edid); + count = drm_add_edid_modes(connector, + (struct edid *)default_edid); } return count; } @@ -121,6 +146,7 @@ static enum drm_connector_status am_hdmi_connector_detect (struct drm_connector *connector, bool force) { struct am_hdmi_tx *am_hdmi = to_am_hdmi(connector); + /* HPD rising */ if (am_hdmi->hpd_flag == 1) { DRM_INFO("connector_status_connected\n"); @@ -148,6 +174,13 @@ static enum drm_connector_status am_hdmi_connector_detect return connector_status_unknown; } +static int +am_hdmi_probe_single_connector_modes(struct drm_connector *connector, + uint32_t maxX, uint32_t maxY) +{ + return drm_helper_probe_single_connector_modes(connector, 1920, 1080); +} + static void am_hdmi_connector_destroy(struct drm_connector *connector) { @@ -165,7 +198,7 @@ struct drm_connector_helper_funcs am_hdmi_connector_helper_funcs = { static const struct drm_connector_funcs am_hdmi_connector_funcs = { .dpms = drm_atomic_helper_connector_dpms, .detect = am_hdmi_connector_detect, - .fill_modes = drm_helper_probe_single_connector_modes, + .fill_modes = am_hdmi_probe_single_connector_modes, .destroy = am_hdmi_connector_destroy, .reset = drm_atomic_helper_connector_reset, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,