Re: [alsa-devel] [PATCH 2/4] drm/i915: implement set_ncts callback

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

 



Hi Takashi,

> -----Original Message-----
> From: Takashi Iwai [mailto:tiwai@xxxxxxx]
> Sent: Thursday, August 06, 2015 5:21 PM
> To: Yang, Libin
> Cc: alsa-devel@xxxxxxxxxxxxxxxx; intel-gfx@xxxxxxxxxxxxxxxxxxxxx; Lin,
> Mengdong
> Subject: Re: [alsa-devel] [PATCH 2/4] drm/i915: implement set_ncts
> callback
> 
> On Thu, 06 Aug 2015 08:52:55 +0200,
> libin.yang@xxxxxxxxx wrote:
> >
> > From: Libin Yang <libin.yang@xxxxxxxxx>
> >
> > Display audio may not work at some frequencies
> > with the HW provided N/CTS.
> >
> > This patch sets the proper N value for the
> > given audio sample rate at the impacted frequencies.
> > At other frequencies, it will use the N/CTS value
> > which HW provides.
> >
> > Signed-off-by: Libin Yang <libin.yang@xxxxxxxxx>
> > ---
> >  drivers/gpu/drm/i915/i915_reg.h    |  2 +
> >  drivers/gpu/drm/i915/intel_audio.c | 93
> ++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 95 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_reg.h
> b/drivers/gpu/drm/i915/i915_reg.h
> > index 3a77678..0b1cd72 100644
> > --- a/drivers/gpu/drm/i915/i915_reg.h
> > +++ b/drivers/gpu/drm/i915/i915_reg.h
> > @@ -7010,6 +7010,8 @@ enum skl_disp_power_wells {
> >  					_HSW_AUD_MISC_CTRL_A, \
> >  					_HSW_AUD_MISC_CTRL_B)
> >
> > +#define HSW_AUD_PIPE_CONN_SEL_CTRL  0x650ac
> > +
> >  #define _HSW_AUD_DIP_ELD_CTRL_ST_A	0x650b4
> >  #define _HSW_AUD_DIP_ELD_CTRL_ST_B	0x651b4
> >  #define HSW_AUD_DIP_ELD_CTRL(pipe) _PIPE(pipe, \
> > diff --git a/drivers/gpu/drm/i915/intel_audio.c
> b/drivers/gpu/drm/i915/intel_audio.c
> > index dc32cf4..f1148cd 100644
> > --- a/drivers/gpu/drm/i915/intel_audio.c
> > +++ b/drivers/gpu/drm/i915/intel_audio.c
> > @@ -68,6 +68,28 @@ static const struct {
> >  	{ 148500, AUD_CONFIG_PIXEL_CLOCK_HDMI_148500 },
> >  };
> >
> > +static const struct {
> > +	int sample_rate;
> > +	int clock;
> > +	int n;
> > +	int cts;
> > +} aud_ncts[] = {
> > +	{ 44100, DIV_ROUND_UP(297000 * 1000, 1001), 4459, 234375 },
> > +	{ 44100, 297000, 4704, 247500 },
> 
> As these two clock values are referred repeatedly in other places,
> it'd be better to define constants.

Do you mean use Macro such as:
#define 297MHZ 297000
#define 296MHZ DIV_ROUND_UP(297000 * 1000, 1001)

> 
> 
> Takashi
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux