Re: [PATCH] drm/tegra: sor: Support for audio over HDMI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 03, 2018 at 06:05:07PM +0200, Jani Nikula wrote:
> On Mon, 03 Dec 2018, Thierry Reding <thierry.reding@xxxxxxxxx> wrote:
> > From: Thierry Reding <treding@xxxxxxxxxx>
> >
> > This code is very similar to the audio over HDMI support on older chips.
> > Interoperation with the audio codec is done via a pair of codec scratch
> > registers and an interrupt that is raised at the SOR when the codec has
> > written those registers.
> >
> > Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>
> > ---
> >  drivers/gpu/drm/tegra/sor.c | 229 ++++++++++++++++++++++++++++++++++++
> >  drivers/gpu/drm/tegra/sor.h |  68 +++++++++++
> >  2 files changed, 297 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
> > index b129da2e5afd..22a54434a757 100644
> > --- a/drivers/gpu/drm/tegra/sor.c
> > +++ b/drivers/gpu/drm/tegra/sor.c
> > @@ -19,6 +19,8 @@
> >  
> >  #include <soc/tegra/pmc.h>
> >  
> > +#include <sound/hda_verbs.h>
> > +
> >  #include <drm/drm_atomic_helper.h>
> >  #include <drm/drm_dp_helper.h>
> >  #include <drm/drm_panel.h>
> > @@ -407,6 +409,7 @@ struct tegra_sor {
> >  	const struct tegra_sor_soc *soc;
> >  	void __iomem *regs;
> >  	unsigned int index;
> > +	unsigned int irq;
> >  
> >  	struct reset_control *rst;
> >  	struct clk *clk_parent;
> > @@ -433,6 +436,11 @@ struct tegra_sor {
> >  
> >  	struct delayed_work scdc;
> >  	bool scdc_enabled;
> > +
> > +	struct {
> > +		unsigned int sample_rate;
> > +		unsigned int channels;
> > +	} audio;
> >  };
> >  
> >  struct tegra_sor_state {
> > @@ -2139,6 +2147,144 @@ tegra_sor_hdmi_setup_avi_infoframe(struct tegra_sor *sor,
> >  	return 0;
> >  }
> >  
> > +static void tegra_sor_write_eld(struct tegra_sor *sor)
> > +{
> > +	size_t length = drm_eld_size(sor->output.connector.eld), i;
> 
> This caught my eye, can't be right?

Why do you think it's wrong? The length is the number of bytes that are
to be written to the HDA ELD buffer. This is pretty much the same across
all drivers that support HDMI audio (i915 and nouveau).

Also, audio is definitely working with this patch, and the HDMI codecs
are showing the correct information in procfs.

Can you elaborate?

Thierry

Attachment: signature.asc
Description: PGP signature

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux