Lines Matching +full:hdmi +full:- +full:connector

1 // SPDX-License-Identifier: MIT
18 * drm_hdmi_infoframe_set_hdr_metadata() - fill an HDMI DRM infoframe with
20 * @frame: HDMI DRM infoframe
21 * @conn_state: Connector state containing HDR metadata
28 struct drm_connector *connector; in drm_hdmi_infoframe_set_hdr_metadata() local
33 return -EINVAL; in drm_hdmi_infoframe_set_hdr_metadata()
35 connector = conn_state->connector; in drm_hdmi_infoframe_set_hdr_metadata()
37 if (!conn_state->hdr_output_metadata) in drm_hdmi_infoframe_set_hdr_metadata()
38 return -EINVAL; in drm_hdmi_infoframe_set_hdr_metadata()
40 hdr_metadata = conn_state->hdr_output_metadata->data; in drm_hdmi_infoframe_set_hdr_metadata()
42 if (!hdr_metadata || !connector) in drm_hdmi_infoframe_set_hdr_metadata()
43 return -EINVAL; in drm_hdmi_infoframe_set_hdr_metadata()
46 if (!is_eotf_supported(hdr_metadata->hdmi_metadata_type1.eotf, in drm_hdmi_infoframe_set_hdr_metadata()
47 connector->hdr_sink_metadata.hdmi_type1.eotf)) in drm_hdmi_infoframe_set_hdr_metadata()
48 DRM_DEBUG_KMS("Unknown EOTF %d\n", hdr_metadata->hdmi_metadata_type1.eotf); in drm_hdmi_infoframe_set_hdr_metadata()
54 frame->eotf = hdr_metadata->hdmi_metadata_type1.eotf; in drm_hdmi_infoframe_set_hdr_metadata()
55 frame->metadata_type = hdr_metadata->hdmi_metadata_type1.metadata_type; in drm_hdmi_infoframe_set_hdr_metadata()
57 BUILD_BUG_ON(sizeof(frame->display_primaries) != in drm_hdmi_infoframe_set_hdr_metadata()
58 sizeof(hdr_metadata->hdmi_metadata_type1.display_primaries)); in drm_hdmi_infoframe_set_hdr_metadata()
59 BUILD_BUG_ON(sizeof(frame->white_point) != in drm_hdmi_infoframe_set_hdr_metadata()
60 sizeof(hdr_metadata->hdmi_metadata_type1.white_point)); in drm_hdmi_infoframe_set_hdr_metadata()
62 memcpy(&frame->display_primaries, in drm_hdmi_infoframe_set_hdr_metadata()
63 &hdr_metadata->hdmi_metadata_type1.display_primaries, in drm_hdmi_infoframe_set_hdr_metadata()
64 sizeof(frame->display_primaries)); in drm_hdmi_infoframe_set_hdr_metadata()
66 memcpy(&frame->white_point, in drm_hdmi_infoframe_set_hdr_metadata()
67 &hdr_metadata->hdmi_metadata_type1.white_point, in drm_hdmi_infoframe_set_hdr_metadata()
68 sizeof(frame->white_point)); in drm_hdmi_infoframe_set_hdr_metadata()
70 frame->max_display_mastering_luminance = in drm_hdmi_infoframe_set_hdr_metadata()
71 hdr_metadata->hdmi_metadata_type1.max_display_mastering_luminance; in drm_hdmi_infoframe_set_hdr_metadata()
72 frame->min_display_mastering_luminance = in drm_hdmi_infoframe_set_hdr_metadata()
73 hdr_metadata->hdmi_metadata_type1.min_display_mastering_luminance; in drm_hdmi_infoframe_set_hdr_metadata()
74 frame->max_fall = hdr_metadata->hdmi_metadata_type1.max_fall; in drm_hdmi_infoframe_set_hdr_metadata()
75 frame->max_cll = hdr_metadata->hdmi_metadata_type1.max_cll; in drm_hdmi_infoframe_set_hdr_metadata()
81 /* HDMI Colorspace Spec Definitions */
124 * drm_hdmi_avi_infoframe_colorimetry() - fill the HDMI AVI infoframe
126 * @frame: HDMI AVI infoframe
127 * @conn_state: connector state
133 u32 colorimetry_index = conn_state->colorspace & FULL_COLORIMETRY_MASK; in drm_hdmi_avi_infoframe_colorimetry()
140 frame->colorimetry = colorimetry_val & NORMAL_COLORIMETRY_MASK; in drm_hdmi_avi_infoframe_colorimetry()
143 * structure and extend it in drivers/video/hdmi in drm_hdmi_avi_infoframe_colorimetry()
145 frame->extended_colorimetry = (colorimetry_val >> 2) & in drm_hdmi_avi_infoframe_colorimetry()
151 * drm_hdmi_avi_infoframe_bars() - fill the HDMI AVI infoframe
153 * @frame: HDMI AVI infoframe
154 * @conn_state: connector state
159 frame->right_bar = conn_state->tv.margins.right; in drm_hdmi_avi_infoframe_bars()
160 frame->left_bar = conn_state->tv.margins.left; in drm_hdmi_avi_infoframe_bars()
161 frame->top_bar = conn_state->tv.margins.top; in drm_hdmi_avi_infoframe_bars()
162 frame->bottom_bar = conn_state->tv.margins.bottom; in drm_hdmi_avi_infoframe_bars()
167 * drm_hdmi_avi_infoframe_content_type() - fill the HDMI AVI infoframe
170 * @frame: HDMI AVI infoframe
171 * @conn_state: DRM display connector state
177 switch (conn_state->content_type) { in drm_hdmi_avi_infoframe_content_type()
179 frame->content_type = HDMI_CONTENT_TYPE_GRAPHICS; in drm_hdmi_avi_infoframe_content_type()
182 frame->content_type = HDMI_CONTENT_TYPE_CINEMA; in drm_hdmi_avi_infoframe_content_type()
185 frame->content_type = HDMI_CONTENT_TYPE_GAME; in drm_hdmi_avi_infoframe_content_type()
188 frame->content_type = HDMI_CONTENT_TYPE_PHOTO; in drm_hdmi_avi_infoframe_content_type()
192 frame->content_type = HDMI_CONTENT_TYPE_GRAPHICS; in drm_hdmi_avi_infoframe_content_type()
195 frame->itc = conn_state->content_type != DRM_MODE_CONTENT_TYPE_NO_DATA; in drm_hdmi_avi_infoframe_content_type()
200 * drm_hdmi_compute_mode_clock() - Computes the TMDS Character Rate
214 unsigned long long clock = mode->clock * 1000ULL; in drm_hdmi_compute_mode_clock()
218 * CTA-861-G Spec, section 5.4 - Color Coding and Quantization in drm_hdmi_compute_mode_clock()
226 * HDMI 1.0 Spec, section 6.5 - Pixel Encoding states that in drm_hdmi_compute_mode_clock()
236 * HDMI 1.0 Spec, section 6.5 - Pixel Encoding in drm_hdmi_compute_mode_clock()
237 * specifies that YUV422 sends two 12-bits components over in drm_hdmi_compute_mode_clock()
239 * three 8-bits components over three channels used by RGB as in drm_hdmi_compute_mode_clock()
246 * HDMI 2.0 Spec, Section 7.1 - YCbCr 4:2:0 Pixel Encoding in drm_hdmi_compute_mode_clock()
253 if (mode->flags & DRM_MODE_FLAG_DBLCLK) in drm_hdmi_compute_mode_clock()