|
@@ -4334,12 +4334,14 @@ EXPORT_SYMBOL(drm_set_preferred_mode);
|
|
|
* data from a DRM display mode
|
|
|
* @frame: HDMI AVI infoframe
|
|
|
* @mode: DRM display mode
|
|
|
+ * @is_hdmi2_sink: Sink is HDMI 2.0 compliant
|
|
|
*
|
|
|
* Return: 0 on success or a negative error code on failure.
|
|
|
*/
|
|
|
int
|
|
|
drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
|
|
|
- const struct drm_display_mode *mode)
|
|
|
+ const struct drm_display_mode *mode,
|
|
|
+ bool is_hdmi2_sink)
|
|
|
{
|
|
|
int err;
|
|
|
|
|
@@ -4355,6 +4357,28 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
|
|
|
|
|
|
frame->video_code = drm_match_cea_mode(mode);
|
|
|
|
|
|
+ /*
|
|
|
+ * HDMI 1.4 VIC range: 1 <= VIC <= 64 (CEA-861-D) but
|
|
|
+ * HDMI 2.0 VIC range: 1 <= VIC <= 107 (CEA-861-F). So we
|
|
|
+ * have to make sure we dont break HDMI 1.4 sinks.
|
|
|
+ */
|
|
|
+ if (!is_hdmi2_sink && frame->video_code > 64)
|
|
|
+ frame->video_code = 0;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * HDMI spec says if a mode is found in HDMI 1.4b 4K modes
|
|
|
+ * we should send its VIC in vendor infoframes, else send the
|
|
|
+ * VIC in AVI infoframes. Lets check if this mode is present in
|
|
|
+ * HDMI 1.4b 4K modes
|
|
|
+ */
|
|
|
+ if (frame->video_code) {
|
|
|
+ u8 vendor_if_vic = drm_match_hdmi_mode(mode);
|
|
|
+ bool is_s3d = mode->flags & DRM_MODE_FLAG_3D_MASK;
|
|
|
+
|
|
|
+ if (drm_valid_hdmi_vic(vendor_if_vic) && !is_s3d)
|
|
|
+ frame->video_code = 0;
|
|
|
+ }
|
|
|
+
|
|
|
frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE;
|
|
|
|
|
|
/*
|