[Intel-gfx] [PATCH] drm/i915/dp: DP audio API changes for MST
Takashi Iwai
tiwai at suse.de
Wed Aug 3 13:53:37 UTC 2016
On Wed, 03 Aug 2016 04:14:30 +0200,
Dhinakaran Pandiyan wrote:
>
> DP MST provides the capability to send multiple video and audio streams via
> one single port. This requires the API's between i915 and audio drivers to
> distinguish between audio capable displays connected to a port. This patch
> adds this support via an additional parameter 'int dev_id'. The existing
> parameter 'port' does not change it's meaning.
>
> dev_id =
> MST : pipe that the stream originates from
> Non-MST : -1
>
> Affected APIs:
> struct i915_audio_component_ops
> - int (*sync_audio_rate)(struct device *, int port, int rate);
> + int (*sync_audio_rate)(struct device *, int port, int dev_id,
> + int rate);
>
> - int (*get_eld)(struct device *, int port, bool *enabled,
> - unsigned char *buf, int max_bytes);
> + int (*get_eld)(struct device *, int port, int dev_id,
> + bool *enabled, unsigned char *buf, int max_bytes);
>
> struct i915_audio_component_audio_ops
> - void (*pin_eld_notify)(void *audio_ptr, int port);
> + void (*pin_eld_notify)(void *audio_ptr, int port, int dev_id);
>
> This patch makes dummy changes in the audio drivers for build to succeed.
OK, so the explicit dev_id will be passed in future change in the
audio side, right? It'd be good to write up the grand plan.
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.h | 2 +-
> drivers/gpu/drm/i915/intel_audio.c | 82 +++++++++++++++++++++++++++++---------
> include/drm/i915_component.h | 6 +--
> include/sound/hda_i915.h | 11 ++---
> sound/hda/hdac_i915.c | 9 +++--
> sound/pci/hda/patch_hdmi.c | 7 ++--
> 6 files changed, 82 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 65ada5d..8e4c8c8 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2054,7 +2054,7 @@ struct drm_i915_private {
> /* perform PHY state sanity checks? */
> bool chv_phy_assert[2];
>
> - struct intel_encoder *dig_port_map[I915_MAX_PORTS];
> + struct intel_encoder *av_enc_map[I915_MAX_PIPES];
Better to have a comment for this field.
> -static int i915_audio_component_sync_audio_rate(struct device *dev,
> - int port, int rate)
> +static struct intel_encoder *get_saved_encoder(struct intel_encoder *av_enc_map[],
> + int port, int dev_id)
> +{
> +
> + enum pipe pipe;
> + struct drm_encoder *encoder;
> +
> + if (dev_id >= 0 && dev_id < I915_MAX_PIPES)
> + return av_enc_map[dev_id];
Actually dev_id >= I915_MAX_PIPES is an invalid call, and worth to
catch with WARN_ON() and bail out.
thanks,
Takashi
More information about the Intel-gfx
mailing list