mirror of https://gitee.com/openkylin/linux.git
drm_edid_to_eld: check for CEA data blocks only from structure revision 3 on
CEA datablocks are only defined from revision 3 onwards. Only check for them if the revision says so. Signed-of-by: Christian Schmidt <schmidt@digadd.de> Tested-by: James Cloos <cloos@jhcloos.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
54ac76f851
commit
a0ab734d62
|
@ -1474,26 +1474,29 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid)
|
||||||
eld[18] = edid->prod_code[0];
|
eld[18] = edid->prod_code[0];
|
||||||
eld[19] = edid->prod_code[1];
|
eld[19] = edid->prod_code[1];
|
||||||
|
|
||||||
for (db = cea + 4; db < cea + cea[2]; db += dbl + 1) {
|
if (cea[1] >= 3)
|
||||||
dbl = db[0] & 0x1f;
|
for (db = cea + 4; db < cea + cea[2]; db += dbl + 1) {
|
||||||
|
dbl = db[0] & 0x1f;
|
||||||
switch ((db[0] & 0xe0) >> 5) {
|
|
||||||
case AUDIO_BLOCK: /* Audio Data Block, contains SADs */
|
switch ((db[0] & 0xe0) >> 5) {
|
||||||
sad_count = dbl / 3;
|
case AUDIO_BLOCK:
|
||||||
memcpy(eld + 20 + mnl, &db[1], dbl);
|
/* Audio Data Block, contains SADs */
|
||||||
break;
|
sad_count = dbl / 3;
|
||||||
case SPEAKER_BLOCK: /* Speaker Allocation Data Block */
|
memcpy(eld + 20 + mnl, &db[1], dbl);
|
||||||
eld[7] = db[1];
|
break;
|
||||||
break;
|
case SPEAKER_BLOCK:
|
||||||
case VENDOR_BLOCK:
|
/* Speaker Allocation Data Block */
|
||||||
/* HDMI Vendor-Specific Data Block */
|
eld[7] = db[1];
|
||||||
if (db[1] == 0x03 && db[2] == 0x0c && db[3] == 0)
|
break;
|
||||||
parse_hdmi_vsdb(connector, db);
|
case VENDOR_BLOCK:
|
||||||
break;
|
/* HDMI Vendor-Specific Data Block */
|
||||||
default:
|
if (db[1] == 0x03 && db[2] == 0x0c && db[3] == 0)
|
||||||
break;
|
parse_hdmi_vsdb(connector, db);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
eld[5] |= sad_count << 4;
|
eld[5] |= sad_count << 4;
|
||||||
eld[2] = (20 + mnl + sad_count * 3 + 3) / 4;
|
eld[2] = (20 + mnl + sad_count * 3 + 3) / 4;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue