/* Sink EOTF is Bit map while infoframe is absolute values */ if (!is_eotf_supported(hdr_metadata->hdmi_metadata_type1.eotf,
connector->display_info.hdr_sink_metadata.hdmi_type1.eotf))
DRM_DEBUG_KMS("Unknown EOTF %d\n", hdr_metadata->hdmi_metadata_type1.eotf);
err = hdmi_drm_infoframe_init(frame); if (err < 0) return err;
frame->colorimetry = colorimetry_val & NORMAL_COLORIMETRY_MASK; /* * ToDo: Extend it for ACE formats as well. Modify the infoframe * structure and extend it in drivers/video/hdmi
*/
frame->extended_colorimetry = (colorimetry_val >> 2) &
EXTENDED_COLORIMETRY_MASK;
}
EXPORT_SYMBOL(drm_hdmi_avi_infoframe_colorimetry);
/** * drm_hdmi_avi_infoframe_bars() - fill the HDMI AVI infoframe * bar information * @frame: HDMI AVI infoframe * @conn_state: connector state
*/ void drm_hdmi_avi_infoframe_bars(struct hdmi_avi_infoframe *frame, conststruct drm_connector_state *conn_state)
{
frame->right_bar = conn_state->tv.margins.right;
frame->left_bar = conn_state->tv.margins.left;
frame->top_bar = conn_state->tv.margins.top;
frame->bottom_bar = conn_state->tv.margins.bottom;
}
EXPORT_SYMBOL(drm_hdmi_avi_infoframe_bars);
/** * drm_hdmi_avi_infoframe_content_type() - fill the HDMI AVI infoframe * content type information, based * on correspondent DRM property. * @frame: HDMI AVI infoframe * @conn_state: DRM display connector state *
*/ void drm_hdmi_avi_infoframe_content_type(struct hdmi_avi_infoframe *frame, conststruct drm_connector_state *conn_state)
{ switch (conn_state->content_type) { case DRM_MODE_CONTENT_TYPE_GRAPHICS:
frame->content_type = HDMI_CONTENT_TYPE_GRAPHICS; break; case DRM_MODE_CONTENT_TYPE_CINEMA:
frame->content_type = HDMI_CONTENT_TYPE_CINEMA; break; case DRM_MODE_CONTENT_TYPE_GAME:
frame->content_type = HDMI_CONTENT_TYPE_GAME; break; case DRM_MODE_CONTENT_TYPE_PHOTO:
frame->content_type = HDMI_CONTENT_TYPE_PHOTO; break; default: /* Graphics is the default(0) */
frame->content_type = HDMI_CONTENT_TYPE_GRAPHICS;
}
/** * drm_hdmi_compute_mode_clock() - Computes the TMDS Character Rate * @mode: Display mode to compute the clock for * @bpc: Bits per character * @fmt: Output Pixel Format used * * Returns the TMDS Character Rate for a given mode, bpc count and output format. * * RETURNS: * The TMDS Character Rate, in Hertz, or 0 on error.
*/ unsignedlonglong
drm_hdmi_compute_mode_clock(conststruct drm_display_mode *mode, unsignedint bpc, enum hdmi_colorspace fmt)
{ unsignedlonglong clock = mode->clock * 1000ULL; unsignedint vic = drm_match_cea_mode(mode);
/* * CTA-861-G Spec, section 5.4 - Color Coding and Quantization * mandates that VIC 1 always uses 8 bpc.
*/ if (vic == 1 && bpc != 8) return 0;
if (fmt == HDMI_COLORSPACE_YUV422) { /* * HDMI 1.0 Spec, section 6.5 - Pixel Encoding states that * YUV422 sends 24 bits over three channels, with Cb and Cr * components being sent on odd and even pixels, respectively. * * If fewer than 12 bpc are sent, data are left justified.
*/ if (bpc > 12) return 0;
/* * HDMI 1.0 Spec, section 6.5 - Pixel Encoding * specifies that YUV422 sends two 12-bits components over * three TMDS channels per pixel clock, which is equivalent to * three 8-bits components over three channels used by RGB as * far as the clock rate goes.
*/
bpc = 8;
}
/* * HDMI 2.0 Spec, Section 7.1 - YCbCr 4:2:0 Pixel Encoding * specifies that YUV420 encoding is carried at a TMDS Character Rate * equal to half the pixel clock rate.
*/ if (fmt == HDMI_COLORSPACE_YUV420)
clock = clock / 2;
if (mode->flags & DRM_MODE_FLAG_DBLCLK)
clock = clock * 2;
staticint drm_hdmi_acr_find_tmds_entry(unsignedlong tmds_clock_khz)
{ int i;
/* skip the "other" entry */ for (i = 1; i < ARRAY_SIZE(hdmi_acr_n_cts); i++) { if (hdmi_acr_n_cts[i].tmds_clock_khz == tmds_clock_khz) return i;
}
return 0;
}
/** * drm_hdmi_acr_get_n_cts() - get N and CTS values for Audio Clock Regeneration * * @tmds_char_rate: TMDS clock (char rate) as used by the HDMI connector * @sample_rate: audio sample rate * @out_n: a pointer to write the N value * @out_cts: a pointer to write the CTS value * * Get the N and CTS values (either by calculating them or by returning data * from the tables. This follows the HDMI 1.4b Section 7.2 "Audio Sample Clock * Capture and Regeneration". * * Note, @sample_rate corresponds to the Fs value, see sections 7.2.4 - 7.2.6 * on how to select Fs for non-L-PCM formats.
*/ void
drm_hdmi_acr_get_n_cts(unsignedlonglong tmds_char_rate, unsignedint sample_rate, unsignedint *out_n, unsignedint *out_cts)
{ /* be a bit more tolerant, especially for the 1.001 entries */ unsignedlong tmds_clock_khz = DIV_ROUND_CLOSEST_ULL(tmds_char_rate, 1000); conststruct drm_hdmi_acr_n_cts_entry *entry; unsignedint n, cts, mult; int tmds_idx;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.