Commit 343cb0f9 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915/audio: Don't program the hardware ELD buffer on ilk+

Since we use the audio component to transfer the ELD to the audio
driver on ilk+ platforms there is no point in even programming
the hardware ELD buffer. Stop doing so.

The one slight caveat here is that this is not strictly legal
according to the HDA spec. PD=1;ELD=0 is only documented as
an intermediate state during modeset. But if there is no hardware
that depends on that then I guess we're fine. Or we could
perhaps set ELD=1 without actually programming the buffer?

Note that the bspec sequence of PD=0;ELD=0 -> PD=1;ELD=0 ->
PD=1;ELD=1 is also not strictly correct according to the HDA
spec, as the only documented transition from PD=0;ELD=0 is
straight to PD=1;ELD=1. But that is not even possible on
these platforms as the bits live in different registers.

Cc: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Cc: Takashi Iwai <tiwai@suse.de>
Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230124144628.4649-2-ville.syrjala@linux.intel.com
parent 902ecddc
......@@ -691,20 +691,6 @@ static void ilk_audio_regs_init(struct drm_i915_private *i915,
}
}
/* ELD buffer size in dwords */
static int ilk_eld_buffer_size(struct drm_i915_private *i915,
enum pipe pipe)
{
struct ilk_audio_regs regs;
u32 tmp;
ilk_audio_regs_init(i915, pipe, &regs);
tmp = intel_de_read(i915, regs.aud_cntl_st);
return REG_FIELD_GET(IBX_ELD_BUFFER_SIZE_MASK, tmp);
}
static void ilk_audio_codec_disable(struct intel_encoder *encoder,
const struct intel_crtc_state *old_crtc_state,
const struct drm_connector_state *old_conn_state)
......@@ -747,11 +733,8 @@ static void ilk_audio_codec_enable(struct intel_encoder *encoder,
{
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
struct drm_connector *connector = conn_state->connector;
const u32 *eld = (const u32 *)connector->eld;
enum port port = encoder->port;
enum pipe pipe = crtc->pipe;
int eld_buffer_size, len, i;
struct ilk_audio_regs regs;
if (drm_WARN_ON(&i915->drm, port == PORT_A))
......@@ -767,24 +750,10 @@ static void ilk_audio_codec_enable(struct intel_encoder *encoder,
intel_de_rmw(i915, regs.aud_cntrl_st2,
IBX_ELD_VALID(port), 0);
/* Reset ELD address */
intel_de_rmw(i915, regs.aud_cntl_st,
IBX_ELD_ADDRESS_MASK, 0);
eld_buffer_size = ilk_eld_buffer_size(i915, pipe);
len = min(drm_eld_size(connector->eld) / 4, eld_buffer_size);
for (i = 0; i < len; i++)
intel_de_write(i915, regs.hdmiw_hdmiedid, eld[i]);
for (; i < eld_buffer_size; i++)
intel_de_write(i915, regs.hdmiw_hdmiedid, 0);
drm_WARN_ON(&i915->drm,
(intel_de_read(i915, regs.aud_cntl_st) & IBX_ELD_ADDRESS_MASK) != 0);
/* ELD valid */
intel_de_rmw(i915, regs.aud_cntrl_st2,
0, IBX_ELD_VALID(port));
/*
* The audio componenent is used to convey the ELD
* instead using of the hardware ELD buffer.
*/
/* Enable timestamps */
intel_de_rmw(i915, regs.aud_config,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment