diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c index 13833a7a8f27d3b056756ae0d52ede90a2860207..30fb7c887ff006dcb0e3378443a08cd13a0e6bec 100644 --- a/drivers/gpu/drm/i915/display/intel_audio.c +++ b/drivers/gpu/drm/i915/display/intel_audio.c @@ -811,15 +811,13 @@ void intel_init_audio_hooks(struct drm_i915_private *dev_priv) } static int glk_force_audio_cdclk_commit(struct intel_atomic_state *state, + struct intel_crtc *crtc, bool enable) { - struct drm_i915_private *dev_priv = to_i915(state->base.dev); struct intel_cdclk_state *cdclk_state; - struct intel_crtc *crtc; int ret; /* need to hold at least one crtc lock for the global state */ - crtc = intel_get_crtc_for_pipe(dev_priv, PIPE_A); ret = drm_modeset_lock(&crtc->base.mutex, state->base.acquire_ctx); if (ret) return ret; @@ -843,8 +841,13 @@ static void glk_force_audio_cdclk(struct drm_i915_private *dev_priv, { struct drm_modeset_acquire_ctx ctx; struct drm_atomic_state *state; + struct intel_crtc *crtc; int ret; + crtc = intel_get_crtc_for_pipe(dev_priv, PIPE_A); + if (!crtc) + return; + drm_modeset_acquire_init(&ctx, 0); state = drm_atomic_state_alloc(&dev_priv->drm); if (drm_WARN_ON(&dev_priv->drm, !state)) @@ -853,7 +856,8 @@ static void glk_force_audio_cdclk(struct drm_i915_private *dev_priv, state->acquire_ctx = &ctx; retry: - ret = glk_force_audio_cdclk_commit(to_intel_atomic_state(state), enable); + ret = glk_force_audio_cdclk_commit(to_intel_atomic_state(state), crtc, + enable); if (ret == -EDEADLK) { drm_atomic_state_clear(state); drm_modeset_backoff(&ctx);