All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Anand, Jerome" <jerome.anand@intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: "tiwai@suse.de" <tiwai@suse.de>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"Ughreja, Rakesh A" <rakesh.a.ughreja@intel.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: [PATCH 2/7] drm/i915: Add support for audio driver notifications
Date: Thu, 15 Dec 2016 10:21:47 +0000	[thread overview]
Message-ID: <F6867404AABACB4D8EC371BF802A4B7C14934636@fmsmsx101.amr.corp.intel.com> (raw)
In-Reply-To: <20161214125552.e3gqprayngwuacy3@phenom.ffwll.local>



> -----Original Message-----
> From: Daniel Vetter [mailto:daniel.vetter@ffwll.ch] On Behalf Of Daniel
> Vetter
> Sent: Wednesday, December 14, 2016 6:26 PM
> To: Anand, Jerome <jerome.anand@intel.com>
> Cc: intel-gfx@lists.freedesktop.org; alsa-devel@alsa-project.org;
> tiwai@suse.de; broonie@kernel.org; Ughreja, Rakesh A
> <rakesh.a.ughreja@intel.com>
> Subject: Re: [Intel-gfx] [PATCH 2/7] drm/i915: Add support for audio driver
> notifications
> 
> On Mon, Dec 12, 2016 at 11:40:38PM +0530, Jerome Anand wrote:
> > Notifiations like mode change, hot plug and edid to the audio driver
> > are added. This is inturn used by the audio driver for its
> > functionality.
> >
> > A new interface file capturing the notifications needed by the audio
> > driver is added
> >
> > Signed-off-by: Pierre-Louis Bossart
> > <pierre-louis.bossart@linux.intel.com>
> > Signed-off-by: Jerome Anand <jerome.anand@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.h        |  3 +++
> >  drivers/gpu/drm/i915/intel_audio.c     |  8 ++++++
> >  drivers/gpu/drm/i915/intel_hdmi.c      |  1 +
> >  drivers/gpu/drm/i915/intel_lpe_audio.c | 46
> ++++++++++++++++++++++++++++++++++
> >  include/drm/intel_lpe_audio.h          |  1 +
> >  5 files changed, 59 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h
> > b/drivers/gpu/drm/i915/i915_drv.h index 1317834..0dbe91a 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -3696,6 +3696,9 @@ int  intel_lpe_audio_setup(struct
> > drm_i915_private *dev_priv);  void intel_lpe_audio_teardown(struct
> > drm_i915_private *dev_priv);  void intel_lpe_audio_irq_handler(struct
> > drm_i915_private *dev_priv);  bool intel_lpe_audio_detect(struct
> > drm_i915_private *dev_priv);
> > +void intel_lpe_audio_notify(struct drm_i915_private *dev_priv,
> > +			void *eld, int port, int tmds_clk_speed,
> > +			bool connected);
> >
> >  /* intel_i2c.c */
> >  extern int intel_setup_gmbus(struct drm_i915_private *dev_priv); diff
> > --git a/drivers/gpu/drm/i915/intel_audio.c
> > b/drivers/gpu/drm/i915/intel_audio.c
> > index 3bbc96c..77cd086 100644
> > --- a/drivers/gpu/drm/i915/intel_audio.c
> > +++ b/drivers/gpu/drm/i915/intel_audio.c
> > @@ -24,6 +24,7 @@
> >  #include <linux/kernel.h>
> >  #include <linux/component.h>
> >  #include <drm/i915_component.h>
> > +#include <drm/intel_lpe_audio.h>
> >  #include "intel_drv.h"
> >
> >  #include <drm/drmP.h>
> > @@ -630,6 +631,10 @@ void intel_audio_codec_enable(struct
> intel_encoder *intel_encoder,
> >  	if (acomp && acomp->audio_ops && acomp->audio_ops-
> >pin_eld_notify)
> >  		acomp->audio_ops->pin_eld_notify(acomp->audio_ops-
> >audio_ptr,
> >  						 (int) port, (int) pipe);
> > +
> > +	if (HAS_LPE_AUDIO(dev_priv))
> > +		intel_lpe_audio_notify(dev_priv, connector->eld, port,
> > +			crtc_state->port_clock, true);
> >  }
> >
> >  /**
> > @@ -663,6 +668,9 @@ void intel_audio_codec_disable(struct
> intel_encoder *intel_encoder)
> >  	if (acomp && acomp->audio_ops && acomp->audio_ops-
> >pin_eld_notify)
> >  		acomp->audio_ops->pin_eld_notify(acomp->audio_ops-
> >audio_ptr,
> >  						 (int) port, (int) pipe);
> > +
> > +	if (HAS_LPE_AUDIO(dev_priv))
> > +		intel_lpe_audio_notify(dev_priv, NULL, port, 0, true);
> >  }
> >
> >  /**
> > diff --git a/drivers/gpu/drm/i915/intel_hdmi.c
> > b/drivers/gpu/drm/i915/intel_hdmi.c
> > index 0bcfead..377584e1 100644
> > --- a/drivers/gpu/drm/i915/intel_hdmi.c
> > +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> > @@ -36,6 +36,7 @@
> >  #include <drm/drm_edid.h>
> >  #include "intel_drv.h"
> >  #include <drm/i915_drm.h>
> > +#include <drm/intel_lpe_audio.h>
> >  #include "i915_drv.h"
> >
> >  static struct drm_device *intel_hdmi_to_dev(struct intel_hdmi
> > *intel_hdmi) diff --git a/drivers/gpu/drm/i915/intel_lpe_audio.c
> > b/drivers/gpu/drm/i915/intel_lpe_audio.c
> > index e12e5f7..a141a9c 100644
> > --- a/drivers/gpu/drm/i915/intel_lpe_audio.c
> > +++ b/drivers/gpu/drm/i915/intel_lpe_audio.c
> > @@ -361,3 +361,49 @@ void intel_lpe_audio_teardown(struct
> > drm_i915_private *dev_priv)
> >
> >  	spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);  }
> > +
> > +
> > +/**
> > + * intel_lpe_audio_notify() - notify lpe audio event
> > + * audio driver and i915
> > + * @dev_priv: the i915 drm device private data
> > + * @eld : ELD data
> > + * @port: port id
> > + * @tmds_clk_speed: tmds clock frequency in Hz
> > + * @connected: hdmi connected/disconnected
> > + *
> > + * Notify lpe audio driver of eld change.
> > + */
> > +void intel_lpe_audio_notify(struct drm_i915_private *dev_priv,
> > +			void *eld, int port, int tmds_clk_speed,
> > +			bool connected)
> > +{
> > +	unsigned long irq_flags;
> > +
> > +	if (HAS_LPE_AUDIO(dev_priv)) {
> > +		struct intel_hdmi_lpe_audio_pdata *pdata =
> dev_get_platdata(
> > +			&(dev_priv->lpe_audio.platdev->dev));
> 
> Only noticed it here, but why again do we need to re-roll our intel-only
> hdmi/eld notification? The one we have for hda is somewhat justified since it
> went in at roughly the same time as the new shared one across a bunch of
> soc. But this one here is just a reinvented wheel.
> 

Am not sure whether I understand your comment fully. But this interface is intel specific
and it is only between intel hdmi audio/i915 drivers.

> And yes this code has been hanging around internally for years, but that's
> kinda not a good excuse.
> 
> Obviously this comment applies to patch 1 too.
> 
> i915 integration otherwise looks reasonable.
> -Daniel
> 
> > +
> > +		spin_lock_irqsave(&pdata->lpe_audio_slock,
> > +			irq_flags);
> > +
> > +		if (eld != NULL) {
> > +			memcpy(pdata->eld.eld_data, eld,
> > +				HDMI_MAX_ELD_BYTES);
> > +			pdata->eld.port_id = port;
> > +
> > +			if (tmds_clk_speed)
> > +				pdata->tmds_clock_speed =
> > +					tmds_clk_speed;
> > +		}
> > +		pdata->hdmi_connected = connected;
> > +		if (pdata->notify_audio_lpe)
> > +			pdata->notify_audio_lpe(
> > +				(eld != NULL) ? &pdata->eld : NULL);
> > +		else
> > +			pdata->notify_pending = true;
> > +
> > +		spin_unlock_irqrestore(&pdata->lpe_audio_slock,
> > +			irq_flags);
> > +	}
> > +}
> > diff --git a/include/drm/intel_lpe_audio.h
> > b/include/drm/intel_lpe_audio.h index a64c449..952de05 100644
> > --- a/include/drm/intel_lpe_audio.h
> > +++ b/include/drm/intel_lpe_audio.h
> > @@ -25,6 +25,7 @@
> >  #define _INTEL_LPE_AUDIO_H_
> >
> >  #include <linux/types.h>
> > +#include <linux/spinlock_types.h>
> >
> >  #define HDMI_MAX_ELD_BYTES	128
> >
> > --
> > 2.9.3
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-12-15 10:21 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-12 18:10 [PATCH 0/7] Add support for Legacy HDMI audio drivers Jerome Anand
2016-12-12  6:53 ` ✓ Fi.CI.BAT: success for Add support for Legacy HDMI audio drivers (rev2) Patchwork
2016-12-12 18:10 ` [PATCH 1/7] drm/i915: setup bridge for HDMI LPE audio driver Jerome Anand
2016-12-14 11:43   ` Takashi Iwai
2016-12-15  6:06     ` Anand, Jerome
2016-12-14 12:52   ` Daniel Vetter
2016-12-14 13:03     ` Takashi Iwai
2016-12-15  6:10     ` Anand, Jerome
2016-12-15 19:04     ` [alsa-devel] " Pierre-Louis Bossart
2016-12-12 18:10 ` [PATCH 2/7] drm/i915: Add support for audio driver notifications Jerome Anand
2016-12-14 11:50   ` Takashi Iwai
2016-12-15 10:18     ` Anand, Jerome
2016-12-15 11:48       ` Ville Syrjälä
2016-12-14 12:55   ` Daniel Vetter
2016-12-14 13:13     ` Takashi Iwai
2016-12-15 19:32       ` Pierre-Louis Bossart
2016-12-15 10:21     ` Anand, Jerome [this message]
2016-12-12 18:10 ` [PATCH 3/7] ALSA: add shell for Intel HDMI LPE audio driver Jerome Anand
2016-12-14 12:45   ` Takashi Iwai
2016-12-15 10:55     ` Anand, Jerome
2016-12-15 11:14       ` Takashi Iwai
2016-12-15 11:44         ` Mark Brown
2016-12-15 20:37         ` [alsa-devel] " Pierre-Louis Bossart
2016-12-15 21:01           ` Takashi Iwai
2016-12-12 18:10 ` [PATCH 4/7] ALSA: x86: hdmi: Add audio support for BYT and CHT Jerome Anand
2016-12-14 12:56   ` Takashi Iwai
2016-12-15 11:08     ` Anand, Jerome
2016-12-12 18:10 ` [PATCH 5/7] ALSA: x86: hdmi: Improve position reporting Jerome Anand
2016-12-14 12:57   ` Takashi Iwai
2016-12-14 14:09     ` Pierre-Louis Bossart
2016-12-14 14:36       ` Takashi Iwai
2016-12-14 23:39         ` [alsa-devel] " Pierre-Louis Bossart
2016-12-12 18:10 ` [PATCH 6/7] ALSA: x86: hdmi: Fixup some monitor Jerome Anand
2016-12-14 12:58   ` Takashi Iwai
2016-12-12 18:10 ` [PATCH 7/7] ALSA: x86: hdmi: continue playback even when display resolution changes Jerome Anand
2016-12-14 13:01   ` Takashi Iwai
2016-12-15 11:14     ` Anand, Jerome
2016-12-15 20:44       ` [alsa-devel] " Pierre-Louis Bossart
2016-12-14 11:07 ` [PATCH 0/7] Add support for Legacy HDMI audio drivers Takashi Iwai

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=F6867404AABACB4D8EC371BF802A4B7C14934636@fmsmsx101.amr.corp.intel.com \
    --to=jerome.anand@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rakesh.a.ughreja@intel.com \
    --cc=tiwai@suse.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 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.