Skip to content

Commit b0ad847

Browse files
yueshuck_zhang
authored andcommitted
drm/edid: detect whether an HDMI sink supports SCDC
Parse the CEA extension according to CEA-861-B to find an HF-VSDB as defined in HDMI 2.0, section 10.3.2 "HDMI Forum Vendor Specific Data Block" and checks if the SCDC_Present bit (bit 7 of byte 6) is set. Change-Id: I71926d018b42f3b38ea8334752ca4efb21493106 Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
1 parent 3d5080c commit b0ad847

1 file changed

Lines changed: 42 additions & 1 deletion

File tree

drivers/gpu/drm/drm_edid.c

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,13 @@ static const struct drm_display_mode edid_4k_modes[] = {
10141014
2160, 2168, 2178, 2250, 0,
10151015
DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
10161016
.vrefresh = 24, },
1017-
/* 5 - 3840x2160@60Hz */
1017+
/* 5 - 3840x2160@50Hz */
1018+
{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000,
1019+
3840, 4896, 4984, 5280, 0,
1020+
2160, 2168, 2178, 2250, 0,
1021+
DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1022+
.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1023+
/* 6 - 3840x2160@60Hz */
10181024
{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000,
10191025
3840, 4016, 4104, 4400, 0,
10201026
2160, 2168, 2178, 2250, 0,
@@ -3556,6 +3562,41 @@ bool drm_detect_hdmi_monitor(struct edid *edid)
35563562
}
35573563
EXPORT_SYMBOL(drm_detect_hdmi_monitor);
35583564

3565+
/**
3566+
* drm_detect_hdmi_scdc - detect whether an HDMI sink supports SCDC
3567+
* @edid: sink EDID information
3568+
*
3569+
* Parse the CEA extension according to CEA-861-B to find an HF-VSDB as
3570+
* defined in HDMI 2.0, section 10.3.2 "HDMI Forum Vendor Specific Data
3571+
* Block" and checks if the SCDC_Present bit (bit 7 of byte 6) is set.
3572+
*
3573+
* Returns:
3574+
* True if the sink supports SCDC, false otherwise.
3575+
*/
3576+
bool drm_detect_hdmi_scdc(struct edid *edid)
3577+
{
3578+
unsigned int start, end, i;
3579+
const u8 *cea;
3580+
3581+
cea = drm_find_cea_extension(edid);
3582+
if (!cea)
3583+
return false;
3584+
3585+
if (cea_db_offsets(cea, &start, &end))
3586+
return false;
3587+
3588+
for_each_cea_db(cea, i, start, end) {
3589+
if (cea_db_is_hdmi_hf_vsdb(&cea[i])) {
3590+
if (cea[i + 6] & 0x80){
3591+
return true;
3592+
}
3593+
}
3594+
}
3595+
3596+
return false;
3597+
}
3598+
EXPORT_SYMBOL(drm_detect_hdmi_scdc);
3599+
35593600
/**
35603601
* drm_detect_monitor_audio - check monitor audio capability
35613602
* @edid: EDID block to scan

0 commit comments

Comments
 (0)