This series adds audio bandwidth validation for HDMI TMDS mode. When the available hblank period cannot carry the required audio packets for a given sample rate and channel count, the corresponding frequencies are pruned from the ELD SADs before they reach the audio driver.
Sample rates are pruned rather than channel counts because compressed audio formats like Dolby Digital (AC-3) and DTS require a fixed channel configuration to decode. This improves on an earlier attempt which can be seen in [1] [1] https://lore.kernel.org/intel-gfx/[email protected]/ v2: - Use DIV64_U64_ROUND_UP() instead of DIV_ROUND_UP_ULL() to avoid do_div() truncating the 64-bit divisor to 32-bit, which caused audio_packets_line to be wildly inflated and all SADs to be pruned. - Guard intel_audio_hdmi_eld_compute_config() against HDMI FRL modes. Cc: Kai Vehmanen <[email protected]> Cc: Ankit Nautiyal <[email protected]> Cc: Ville Syrjälä <[email protected]> Cc: Vinod Govindapillai <[email protected]> Cc: Mitul Golani <[email protected]> Chaitanya Kumar Borah (2): drm/i915/hdmi: Move audio compute config after format selection drm/i915/audio: Prune ELD SADs based on HDMI audio bandwidth drivers/gpu/drm/i915/display/intel_audio.c | 149 +++++++++++++++++++++ drivers/gpu/drm/i915/display/intel_hdmi.c | 8 +- 2 files changed, 153 insertions(+), 4 deletions(-) -- 2.25.1
