Skip to content

Commit b2e9e6a

Browse files
vsyrjalarodrigovivi
authored andcommitted
drm/i915: Fix VLV/CHV HDMI/DP audio enable
Despite what I claimed in commit c3c5dc1 ("drm/i915/audio: Do the vblank waits") the vblank interrupts are in fact not enabled yet when we do the audio enable sequence on VLV/CHV (all other platforms are fine). Reorder the enable sequence on VLV/CHV to match that of the other platforms so that the audio enable happens after the pipe has been enabled. Fixes: c3c5dc1 ("drm/i915/audio: Do the vblank waits") Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Jani Nikula <[email protected]> (cherry picked from commit a467a24) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent d4d4c6f commit b2e9e6a

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

drivers/gpu/drm/i915/display/g4x_dp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,8 +673,6 @@ static void intel_enable_dp(struct intel_atomic_state *state,
673673
intel_dp_pcon_dsc_configure(intel_dp, pipe_config);
674674
intel_dp_start_link_train(intel_dp, pipe_config);
675675
intel_dp_stop_link_train(intel_dp, pipe_config);
676-
677-
intel_audio_codec_enable(encoder, pipe_config, conn_state);
678676
}
679677

680678
static void g4x_enable_dp(struct intel_atomic_state *state,
@@ -683,6 +681,7 @@ static void g4x_enable_dp(struct intel_atomic_state *state,
683681
const struct drm_connector_state *conn_state)
684682
{
685683
intel_enable_dp(state, encoder, pipe_config, conn_state);
684+
intel_audio_codec_enable(encoder, pipe_config, conn_state);
686685
intel_edp_backlight_on(pipe_config, conn_state);
687686
}
688687

@@ -691,6 +690,7 @@ static void vlv_enable_dp(struct intel_atomic_state *state,
691690
const struct intel_crtc_state *pipe_config,
692691
const struct drm_connector_state *conn_state)
693692
{
693+
intel_audio_codec_enable(encoder, pipe_config, conn_state);
694694
intel_edp_backlight_on(pipe_config, conn_state);
695695
}
696696

drivers/gpu/drm/i915/display/g4x_hdmi.c

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,8 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder,
157157
&pipe_config->infoframes.hdmi);
158158
}
159159

160-
static void g4x_enable_hdmi(struct intel_atomic_state *state,
161-
struct intel_encoder *encoder,
162-
const struct intel_crtc_state *pipe_config,
163-
const struct drm_connector_state *conn_state)
160+
static void g4x_hdmi_enable_port(struct intel_encoder *encoder,
161+
const struct intel_crtc_state *pipe_config)
164162
{
165163
struct drm_device *dev = encoder->base.dev;
166164
struct drm_i915_private *dev_priv = to_i915(dev);
@@ -175,6 +173,16 @@ static void g4x_enable_hdmi(struct intel_atomic_state *state,
175173

176174
intel_de_write(dev_priv, intel_hdmi->hdmi_reg, temp);
177175
intel_de_posting_read(dev_priv, intel_hdmi->hdmi_reg);
176+
}
177+
178+
static void g4x_enable_hdmi(struct intel_atomic_state *state,
179+
struct intel_encoder *encoder,
180+
const struct intel_crtc_state *pipe_config,
181+
const struct drm_connector_state *conn_state)
182+
{
183+
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
184+
185+
g4x_hdmi_enable_port(encoder, pipe_config);
178186

179187
drm_WARN_ON(&dev_priv->drm, pipe_config->has_audio &&
180188
!pipe_config->has_hdmi_sink);
@@ -294,6 +302,11 @@ static void vlv_enable_hdmi(struct intel_atomic_state *state,
294302
const struct intel_crtc_state *pipe_config,
295303
const struct drm_connector_state *conn_state)
296304
{
305+
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
306+
307+
drm_WARN_ON(&dev_priv->drm, pipe_config->has_audio &&
308+
!pipe_config->has_hdmi_sink);
309+
intel_audio_codec_enable(encoder, pipe_config, conn_state);
297310
}
298311

299312
static void intel_disable_hdmi(struct intel_atomic_state *state,
@@ -415,7 +428,7 @@ static void vlv_hdmi_pre_enable(struct intel_atomic_state *state,
415428
pipe_config->has_infoframe,
416429
pipe_config, conn_state);
417430

418-
g4x_enable_hdmi(state, encoder, pipe_config, conn_state);
431+
g4x_hdmi_enable_port(encoder, pipe_config);
419432

420433
vlv_wait_port_ready(dev_priv, dig_port, 0x0);
421434
}
@@ -492,7 +505,7 @@ static void chv_hdmi_pre_enable(struct intel_atomic_state *state,
492505
pipe_config->has_infoframe,
493506
pipe_config, conn_state);
494507

495-
g4x_enable_hdmi(state, encoder, pipe_config, conn_state);
508+
g4x_hdmi_enable_port(encoder, pipe_config);
496509

497510
vlv_wait_port_ready(dev_priv, dig_port, 0x0);
498511

0 commit comments

Comments
 (0)