As we plan to add audio BW calculation in i915,
intel_audio_compute_config() would need the final output_format
and pipe_bpp to correctly determine audio bandwidth constraints.

Move the intel_audio_compute_config() call to after
intel_hdmi_compute_formats() returns, ensuring the audio
configuration is computed with the final parameters.

Signed-off-by: Chaitanya Kumar Borah <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_hdmi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c 
b/drivers/gpu/drm/i915/display/intel_hdmi.c
index 8a019d3574df..6b0b7e6cda36 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -2399,10 +2399,6 @@ int intel_hdmi_compute_config(struct intel_encoder 
*encoder,
        if (!intel_link_bw_compute_pipe_bpp(pipe_config))
                return -EINVAL;
 
-       pipe_config->has_audio =
-               intel_hdmi_has_audio(encoder, pipe_config, conn_state) &&
-               intel_audio_compute_config(encoder, pipe_config, conn_state);
-
        /*
         * Try to respect downstream TMDS clock limits first, if
         * that fails assume the user might know something we don't.
@@ -2417,6 +2413,10 @@ int intel_hdmi_compute_config(struct intel_encoder 
*encoder,
                return ret;
        }
 
+       pipe_config->has_audio =
+               intel_hdmi_has_audio(encoder, pipe_config, conn_state) &&
+               intel_audio_compute_config(encoder, pipe_config, conn_state);
+
        ret = intel_pfit_compute_config(pipe_config, conn_state);
        if (ret)
                return ret;
-- 
2.25.1

Reply via email to