Commit 23ebf8b9 authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Daniel Vetter

drm/edid: Move dvi_dual/max_tmds_clock parsing out from drm_edid_to_eld()

drm_edid_to_eld() is just mean to cook up the ELD for the audio driver,
so having it parse non-audio related stuff seems just wrong, and
potentially could lead to that information not being even filled out
if the function doesn't even get called. Let's move that stuff to the
place where we parse the color formats and whatnot from the CEA ext
block.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1475070703-6435-9-git-send-email-ville.syrjala@linux.intel.com
parent 011acce2
...@@ -3253,17 +3253,12 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode) ...@@ -3253,17 +3253,12 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
} }
static void static void
parse_hdmi_vsdb(struct drm_connector *connector, const u8 *db) drm_parse_hdmi_vsdb_audio(struct drm_connector *connector, const u8 *db)
{ {
struct drm_display_info *info = &connector->display_info;
u8 len = cea_db_payload_len(db); u8 len = cea_db_payload_len(db);
if (len >= 6) { if (len >= 6)
connector->eld[5] |= (db[6] >> 7) << 1; /* Supports_AI */ connector->eld[5] |= (db[6] >> 7) << 1; /* Supports_AI */
info->dvi_dual = db[6] & 1;
}
if (len >= 7)
info->max_tmds_clock = db[7] * 5000;
if (len >= 8) { if (len >= 8) {
connector->latency_present[0] = db[8] >> 7; connector->latency_present[0] = db[8] >> 7;
connector->latency_present[1] = (db[8] >> 6) & 1; connector->latency_present[1] = (db[8] >> 6) & 1;
...@@ -3277,15 +3272,11 @@ parse_hdmi_vsdb(struct drm_connector *connector, const u8 *db) ...@@ -3277,15 +3272,11 @@ parse_hdmi_vsdb(struct drm_connector *connector, const u8 *db)
if (len >= 12) if (len >= 12)
connector->audio_latency[1] = db[12]; connector->audio_latency[1] = db[12];
DRM_DEBUG_KMS("HDMI: DVI dual %d, " DRM_DEBUG_KMS("HDMI: latency present %d %d, "
"max TMDS clock %d, "
"latency present %d %d, "
"video latency %d %d, " "video latency %d %d, "
"audio latency %d %d\n", "audio latency %d %d\n",
info->dvi_dual, connector->latency_present[0],
info->max_tmds_clock, connector->latency_present[1],
(int) connector->latency_present[0],
(int) connector->latency_present[1],
connector->video_latency[0], connector->video_latency[0],
connector->video_latency[1], connector->video_latency[1],
connector->audio_latency[0], connector->audio_latency[0],
...@@ -3350,7 +3341,6 @@ EXPORT_SYMBOL(drm_edid_get_monitor_name); ...@@ -3350,7 +3341,6 @@ EXPORT_SYMBOL(drm_edid_get_monitor_name);
*/ */
void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid) void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid)
{ {
struct drm_display_info *info = &connector->display_info;
uint8_t *eld = connector->eld; uint8_t *eld = connector->eld;
u8 *cea; u8 *cea;
u8 *db; u8 *db;
...@@ -3367,9 +3357,6 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid) ...@@ -3367,9 +3357,6 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid)
connector->video_latency[1] = 0; connector->video_latency[1] = 0;
connector->audio_latency[1] = 0; connector->audio_latency[1] = 0;
info->max_tmds_clock = 0;
info->dvi_dual = false;
cea = drm_find_cea_extension(edid); cea = drm_find_cea_extension(edid);
if (!cea) { if (!cea) {
DRM_DEBUG_KMS("ELD: no CEA Extension found\n"); DRM_DEBUG_KMS("ELD: no CEA Extension found\n");
...@@ -3419,7 +3406,7 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid) ...@@ -3419,7 +3406,7 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid)
case VENDOR_BLOCK: case VENDOR_BLOCK:
/* HDMI Vendor-Specific Data Block */ /* HDMI Vendor-Specific Data Block */
if (cea_db_is_hdmi_vsdb(db)) if (cea_db_is_hdmi_vsdb(db))
parse_hdmi_vsdb(connector, db); drm_parse_hdmi_vsdb_audio(connector, db);
break; break;
default: default:
break; break;
...@@ -3800,6 +3787,25 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector, ...@@ -3800,6 +3787,25 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
} }
} }
static void
drm_parse_hdmi_vsdb_video(struct drm_connector *connector, const u8 *db)
{
struct drm_display_info *info = &connector->display_info;
u8 len = cea_db_payload_len(db);
if (len >= 6)
info->dvi_dual = db[6] & 1;
if (len >= 7)
info->max_tmds_clock = db[7] * 5000;
DRM_DEBUG_KMS("HDMI: DVI dual %d, "
"max TMDS clock %d kHz\n",
info->dvi_dual,
info->max_tmds_clock);
drm_parse_hdmi_deep_color_info(connector, db);
}
static void drm_parse_cea_ext(struct drm_connector *connector, static void drm_parse_cea_ext(struct drm_connector *connector,
struct edid *edid) struct edid *edid)
{ {
...@@ -3826,10 +3832,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector, ...@@ -3826,10 +3832,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
for_each_cea_db(edid_ext, i, start, end) { for_each_cea_db(edid_ext, i, start, end) {
const u8 *db = &edid_ext[i]; const u8 *db = &edid_ext[i];
if (!cea_db_is_hdmi_vsdb(db)) if (cea_db_is_hdmi_vsdb(db))
continue; drm_parse_hdmi_vsdb_video(connector, db);
drm_parse_hdmi_deep_color_info(connector, db);
} }
} }
...@@ -3845,6 +3849,8 @@ static void drm_add_display_info(struct drm_connector *connector, ...@@ -3845,6 +3849,8 @@ static void drm_add_display_info(struct drm_connector *connector,
info->bpc = 0; info->bpc = 0;
info->color_formats = 0; info->color_formats = 0;
info->cea_rev = 0; info->cea_rev = 0;
info->max_tmds_clock = 0;
info->dvi_dual = false;
if (edid->revision < 3) if (edid->revision < 3)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment