public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: airlied@linux.ie, intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org,
	Martin Kepplinger <martink@posteo.de>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH] drm/i915: Fix bogus dig_port_map[] assignment for pre-HSW
Date: Thu, 03 Mar 2016 16:05:21 +0100	[thread overview]
Message-ID: <s5h37s761qm.wl-tiwai@suse.de> (raw)
In-Reply-To: <877fhntwau.fsf@intel.com>

On Mon, 29 Feb 2016 15:39:53 +0100,
Jani Nikula wrote:
> 
> On Mon, 29 Feb 2016, Martin Kepplinger <martink@posteo.de> wrote:
> > Am 2016-02-26 um 20:59 schrieb Takashi Iwai:
> >> Sorry, Cc to Jani was missing mistakenly.
> >> 
> >> Please check this.  It's a regression in 4.5-rc.
> >> 
> >> 
> >> thanks,
> >> 
> >> Takashi
> >> 
> >
> > I can confirm that with -rc6 nothing changed and this fixes audio over
> > HDMI for me. I added David Airlie and dri-devel to CC aswell and hope
> > that this can go in for 4.5 in the last minute.
> 
> I'll pick this up when we get the CI results. (This had fallen between
> the cracks...)

As far as looking at linux-next, this one still seems remaining in the
crevasse...


thanks,

Takashi

> 
> BR,
> Jani.
> 
> 
> 
> >
> > thanks
> >                             martin
> >
> >
> >> On Wed, 24 Feb 2016 15:35:22 +0100,
> >> Takashi Iwai wrote:
> >>>
> >>> The recent commit [0bdf5a05647a: drm/i915: Add reverse mapping between
> >>> port and intel_encoder] introduced a reverse mapping to retrieve
> >>> intel_dig_port object from the port number.  The code assumed that the
> >>> port vs intel_dig_port are 1:1 mapping.  But in reality, this was a
> >>> too naive assumption.
> >>>
> >>> As Martin reported about the missing HDMI audio on his SNB machine,
> >>> pre-HSW chips may have multiple intel_dig_port objects corresponding
> >>> to the same port.  Since we assign the mapping statically at the init
> >>> time and the multiple objects override the map, it may not match with
> >>> the actually enabled output.
> >>>
> >>> This patch tries to address the regression above.  The reverse mapping
> >>> is provided basically only for the audio callbacks, so now we set /
> >>> clear the mapping dynamically at enabling and disabling HDMI/DP audio,
> >>> so that we can always track the latest and correct object
> >>> corresponding to the given port.
> >>>
> >>> Fixes: 0bdf5a05647a ('drm/i915: Add reverse mapping between port and intel_encoder')
> >>> Reported-and-tested-by: Martin Kepplinger <martink@posteo.de>
> >>> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> >>> ---
> >>>  drivers/gpu/drm/i915/intel_audio.c | 3 +++
> >>>  drivers/gpu/drm/i915/intel_ddi.c   | 1 -
> >>>  drivers/gpu/drm/i915/intel_dp.c    | 1 -
> >>>  drivers/gpu/drm/i915/intel_hdmi.c  | 2 --
> >>>  4 files changed, 3 insertions(+), 4 deletions(-)
> >>>
> >>> diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
> >>> index 31f6d212fb1b..30f921421b0c 100644
> >>> --- a/drivers/gpu/drm/i915/intel_audio.c
> >>> +++ b/drivers/gpu/drm/i915/intel_audio.c
> >>> @@ -527,6 +527,8 @@ void intel_audio_codec_enable(struct intel_encoder *intel_encoder)
> >>>  
> >>>  	mutex_lock(&dev_priv->av_mutex);
> >>>  	intel_dig_port->audio_connector = connector;
> >>> +	/* referred in audio callbacks */
> >>> +	dev_priv->dig_port_map[port] = intel_encoder;
> >>>  	mutex_unlock(&dev_priv->av_mutex);
> >>>  
> >>>  	if (acomp && acomp->audio_ops && acomp->audio_ops->pin_eld_notify)
> >>> @@ -554,6 +556,7 @@ void intel_audio_codec_disable(struct intel_encoder *intel_encoder)
> >>>  
> >>>  	mutex_lock(&dev_priv->av_mutex);
> >>>  	intel_dig_port->audio_connector = NULL;
> >>> +	dev_priv->dig_port_map[port] = NULL;
> >>>  	mutex_unlock(&dev_priv->av_mutex);
> >>>  
> >>>  	if (acomp && acomp->audio_ops && acomp->audio_ops->pin_eld_notify)
> >>> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> >>> index 54a165b9c92d..a50fc452d5f1 100644
> >>> --- a/drivers/gpu/drm/i915/intel_ddi.c
> >>> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> >>> @@ -3312,7 +3312,6 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
> >>>  	intel_encoder->get_config = intel_ddi_get_config;
> >>>  
> >>>  	intel_dig_port->port = port;
> >>> -	dev_priv->dig_port_map[port] = intel_encoder;
> >>>  	intel_dig_port->saved_port_bits = I915_READ(DDI_BUF_CTL(port)) &
> >>>  					  (DDI_BUF_PORT_REVERSAL |
> >>>  					   DDI_A_4_LANES);
> >>> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> >>> index 1bbd67b046da..acf918728492 100644
> >>> --- a/drivers/gpu/drm/i915/intel_dp.c
> >>> +++ b/drivers/gpu/drm/i915/intel_dp.c
> >>> @@ -6035,7 +6035,6 @@ intel_dp_init(struct drm_device *dev,
> >>>  	}
> >>>  
> >>>  	intel_dig_port->port = port;
> >>> -	dev_priv->dig_port_map[port] = intel_encoder;
> >>>  	intel_dig_port->dp.output_reg = output_reg;
> >>>  
> >>>  	intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
> >>> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> >>> index 4a77639a489d..23ee48dc765f 100644
> >>> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> >>> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> >>> @@ -2146,7 +2146,6 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
> >>>  void intel_hdmi_init(struct drm_device *dev,
> >>>  		     i915_reg_t hdmi_reg, enum port port)
> >>>  {
> >>> -	struct drm_i915_private *dev_priv = dev->dev_private;
> >>>  	struct intel_digital_port *intel_dig_port;
> >>>  	struct intel_encoder *intel_encoder;
> >>>  	struct intel_connector *intel_connector;
> >>> @@ -2215,7 +2214,6 @@ void intel_hdmi_init(struct drm_device *dev,
> >>>  		intel_encoder->cloneable |= 1 << INTEL_OUTPUT_HDMI;
> >>>  
> >>>  	intel_dig_port->port = port;
> >>> -	dev_priv->dig_port_map[port] = intel_encoder;
> >>>  	intel_dig_port->hdmi.hdmi_reg = hdmi_reg;
> >>>  	intel_dig_port->dp.output_reg = INVALID_MMIO_REG;
> >>>  
> >>> -- 
> >>> 2.7.2
> >>>
> >>> _______________________________________________
> >>> Intel-gfx mailing list
> >>> Intel-gfx@lists.freedesktop.org
> >>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> >
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-03-03 15:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24 14:35 [PATCH] drm/i915: Fix bogus dig_port_map[] assignment for pre-HSW Takashi Iwai
2016-02-26 19:59 ` Takashi Iwai
2016-02-29 14:34   ` Martin Kepplinger
2016-02-29 14:39     ` Jani Nikula
2016-03-03 15:05       ` Takashi Iwai [this message]
2016-03-07 12:18         ` Martin Kepplinger
2016-03-07 18:06           ` [Intel-gfx] " Jani Nikula
2016-02-27  0:08 ` Ville Syrjälä
2016-02-29 14:26 ` ✗ Fi.CI.BAT: failure for " Patchwork
2016-03-03 16:06   ` Ville Syrjälä

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5h37s761qm.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=martink@posteo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox