All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yang, Libin" <libin.yang@intel.com>
To: "ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>,
	"libin.yang@linux.intel.com" <libin.yang@linux.intel.com>
Cc: "Vetter, Daniel" <daniel.vetter@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"tiwai@suse.de" <tiwai@suse.de>
Subject: Re: [PATCH 1/2] drm/i915: fix get digital port issue in intel_audio
Date: Fri, 8 Jan 2016 02:18:05 +0000	[thread overview]
Message-ID: <96A12704CE18D347B625EE2D4A099D190464D14B@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <20160107165025.GK4437@intel.com>

Hi Ville,

> -----Original Message-----
> From: Ville Syrjälä [mailto:ville.syrjala@linux.intel.com]
> Sent: Friday, January 08, 2016 12:50 AM
> To: libin.yang@linux.intel.com
> Cc: intel-gfx@lists.freedesktop.org; conselvan2@gmail.com;
> jani.nikula@linux.intel.com; Vetter, Daniel; tiwai@suse.de; Yang, Libin
> Subject: Re: [PATCH 1/2] drm/i915: fix get digital port issue in intel_audio
> 
> On Wed, Jan 06, 2016 at 10:26:41AM +0800, libin.yang@linux.intel.com
> wrote:
> > From: Libin Yang <libin.yang@linux.intel.com>
> >
> > For DP MST, use enc_to_mst(encoder)->primary to get
> intel_digital_port,
> > instead of using enc_to_dig_port(encoder).
> >
> > Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_audio.c | 21 +++++++++++++++++----
> >  1 file changed, 17 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_audio.c
> b/drivers/gpu/drm/i915/intel_audio.c
> > index 31f6d21..431487a0 100644
> > --- a/drivers/gpu/drm/i915/intel_audio.c
> > +++ b/drivers/gpu/drm/i915/intel_audio.c
> > @@ -187,6 +187,16 @@ static bool intel_eld_uptodate(struct
> drm_connector *connector,
> >  	return true;
> >  }
> >
> > +static struct intel_digital_port *
> > +intel_encoder_to_dig_port(struct intel_encoder *intel_encoder)
> > +{
> > +	struct drm_encoder *encoder = &intel_encoder->base;
> > +
> > +	if (intel_encoder->type == INTEL_OUTPUT_DP_MST)
> > +		return enc_to_mst(encoder)->primary;
> > +	return enc_to_dig_port(encoder);
> > +}
> > +
> >  static void g4x_audio_codec_disable(struct intel_encoder *encoder)
> >  {
> >  	struct drm_i915_private *dev_priv = encoder->base.dev-
> >dev_private;
> > @@ -286,7 +296,7 @@ static void hsw_audio_codec_enable(struct
> drm_connector *connector,
> >  	struct i915_audio_component *acomp = dev_priv-
> >audio_component;
> >  	const uint8_t *eld = connector->eld;
> >  	struct intel_digital_port *intel_dig_port =
> > -		enc_to_dig_port(&encoder->base);
> > +		intel_encoder_to_dig_port(encoder);
> 
> This hunk makes sense since we just look at intel_dig_port->port. Might
> make sense to entirely eliminate the local inte_dig_port variable from
> these hooks so that there's no confusion whether it points at the fake
> or primary encoder.

Do you mean we can still use enc_to_dig_port()? Maybe the new code
is better. What do you think we use the wrapper
intel_encoder_to_dig_port() here?

> 
> >  	enum port port = intel_dig_port->port;
> >  	uint32_t tmp;
> >  	int len, i;
> > @@ -500,7 +510,8 @@ void intel_audio_codec_enable(struct
> intel_encoder *intel_encoder)
> >  	struct drm_device *dev = encoder->dev;
> >  	struct drm_i915_private *dev_priv = dev->dev_private;
> >  	struct i915_audio_component *acomp = dev_priv-
> >audio_component;
> > -	struct intel_digital_port *intel_dig_port =
> enc_to_dig_port(encoder);
> > +	struct intel_digital_port *intel_dig_port =
> > +		intel_encoder_to_dig_port(intel_encoder);
> >  	enum port port = intel_dig_port->port;
> >
> >  	connector = drm_select_eld(encoder);
> > @@ -546,7 +557,8 @@ void intel_audio_codec_disable(struct
> intel_encoder *intel_encoder)
> >  	struct drm_device *dev = encoder->dev;
> >  	struct drm_i915_private *dev_priv = dev->dev_private;
> >  	struct i915_audio_component *acomp = dev_priv-
> >audio_component;
> > -	struct intel_digital_port *intel_dig_port =
> enc_to_dig_port(encoder);
> > +	struct intel_digital_port *intel_dig_port =
> > +		intel_encoder_to_dig_port(intel_encoder);
> 
> >  	enum port port = intel_dig_port->port;
> >
> >  	if (dev_priv->display.audio_codec_disable)
> > @@ -724,7 +736,8 @@ static int
> i915_audio_component_get_eld(struct device *dev, int port,
> >  	/* intel_encoder might be NULL for DP MST */
> >  	if (intel_encoder) {
> >  		ret = 0;
> > -		intel_dig_port = enc_to_dig_port(&intel_encoder-
> >base);
> > +		intel_dig_port =
> > +			intel_encoder_to_dig_port(intel_encoder);
> >  		*enabled = intel_dig_port->audio_connector != NULL;
> 
> These not so much. We'd clobber 'intel_dig_port->audio_connector' for
> the primary encoder whenever a new MST stream is enabled.

Yes. If we are using i915_audio_component_get_eld() for MST audio,
we need a parameter device_entry_id in the function. I remember
David has sent a patch to support device entry before. But MST was
not supported and he removed the device_entry_id parameter.

> 
> Was the intention just to fix the port information passed to
> .pin_eld_notify()?

No. It's based on device entry.

> 
> This whole thing seems highlight a rather big issue with the current
> component stuff; How do you tell the streams apart when all are using
> the same DDI port?

If we need support other device entries, we need get
the other ports besides primary port. Do you know how
to get the ports?

As Takashi has changed to get eld_info from unsol_event to using this
callback, it seems this is a must to support MST audio.

> 
> >  		if (*enabled) {
> >  			eld = intel_dig_port->audio_connector->eld;
> > --
> > 1.9.1
> 
> --
> Ville Syrjälä
> Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-01-08  2:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-06  2:26 [PATCH 1/2] drm/i915: fix get digital port issue in intel_audio libin.yang
2016-01-06  2:26 ` [PATCH 2/2] drm/i915: add dp mst judgement in hsw_audio_codec_enable libin.yang
2016-01-07 16:51   ` Ville Syrjälä
2016-01-07 16:59     ` Daniel Vetter
2016-01-06 12:49 ` ✗ failure: Fi.CI.BAT Patchwork
2016-01-07 16:50 ` [PATCH 1/2] drm/i915: fix get digital port issue in intel_audio Ville Syrjälä
2016-01-08  2:18   ` Yang, Libin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-12-23  6:50 libin.yang

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=96A12704CE18D347B625EE2D4A099D190464D14B@SHSMSX103.ccr.corp.intel.com \
    --to=libin.yang@intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=libin.yang@linux.intel.com \
    --cc=tiwai@suse.de \
    --cc=ville.syrjala@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.