From: Daniel Vetter <daniel@ffwll.ch>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org,
intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch
Subject: Re: [PATCH v2 2/4] drm/i915: implement set_ncts callback
Date: Wed, 12 Aug 2015 15:04:57 +0200 [thread overview]
Message-ID: <20150812130457.GN17734@phenom.ffwll.local> (raw)
In-Reply-To: <877fp38ib6.fsf@intel.com>
On Mon, Aug 10, 2015 at 03:00:13PM +0300, Jani Nikula wrote:
> On Mon, 10 Aug 2015, libin.yang@intel.com wrote:
> > + n_low = n & 0xfff;
> > + n_up = (n >> 12) & 0xff;
> > +
> > + /* 4. set the N/CTS */
> > + tmp = I915_READ(HSW_AUD_CFG(pipe));
> > + tmp |= AUD_CONFIG_N_PROG_ENABLE;
> > + tmp &= ~AUD_CONFIG_UPPER_N_MASK;
> > + tmp |= (n_up << AUD_CONFIG_UPPER_N_SHIFT);
> > + tmp &= ~AUD_CONFIG_LOWER_N_MASK;
> > + tmp |= (n_low << AUD_CONFIG_LOWER_N_SHIFT);
>
> You could squash the ors and ands together.
Also read-modify-write considered evil. If you need to save a few bits
please be explicit about it like
tmp &= BITS_WE_WANT_TO_KEEP;
if there's no bits to keep just start out with 0. If we have too much rwm
to hw registers then probably something with the overall design is
botched, e.g. with the pipe config precomputation we managed to remove
almost all the rwm code for modesets.
-Daniel
>
> > + I915_WRITE(HSW_AUD_CFG(pipe), tmp);
> > +
> > + return 0;
> > +}
> > +
> > static const struct i915_audio_component_ops i915_audio_component_ops = {
> > .owner = THIS_MODULE,
> > .get_power = i915_audio_component_get_power,
> > .put_power = i915_audio_component_put_power,
> > .codec_wake_override = i915_audio_component_codec_wake_override,
> > .get_cdclk_freq = i915_audio_component_get_cdclk_freq,
> > + .set_ncts = i915_audio_component_set_ncts,
> > };
> >
> > static int i915_audio_component_bind(struct device *i915_dev,
> > --
> > 1.9.1
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> --
> Jani Nikula, Intel Open Source Technology Center
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-08-12 13:05 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-10 7:32 [PATCH v2 1/4] drm/i915: Add audio set_ncts callback libin.yang
2015-08-10 7:32 ` [PATCH v2 2/4] drm/i915: implement " libin.yang
2015-08-10 12:00 ` Jani Nikula
2015-08-11 2:49 ` Yang, Libin
2015-08-12 13:04 ` Daniel Vetter [this message]
2015-08-12 14:31 ` Yang, Libin
2015-08-10 12:16 ` Jani Nikula
2015-08-11 2:55 ` Yang, Libin
2015-08-12 13:06 ` Daniel Vetter
2015-08-12 14:36 ` Yang, Libin
2015-08-12 14:45 ` Jani Nikula
2015-08-12 14:48 ` Yang, Libin
2015-08-10 7:32 ` [PATCH v3 3/4] ALSA: hda - display audio call ncts callback libin.yang
2015-08-10 12:03 ` Jani Nikula
2015-08-11 2:51 ` Yang, Libin
2015-08-10 7:32 ` [PATCH v4 4/4] drm/i915: set proper N/CTS in modeset libin.yang
2015-08-10 8:04 ` Takashi Iwai
2015-08-10 8:30 ` Yang, Libin
2015-08-10 12:10 ` Jani Nikula
2015-08-11 3:10 ` Yang, Libin
2015-08-11 7:13 ` Jani Nikula
2015-08-11 7:46 ` Yang, Libin
2015-08-11 8:14 ` Jani Nikula
2015-08-12 2:41 ` Yang, Libin
2015-08-12 6:20 ` Jani Nikula
2015-08-12 7:28 ` Yang, Libin
2015-08-12 13:10 ` Daniel Vetter
2015-08-12 13:23 ` Jani Nikula
2015-08-12 13:43 ` Daniel Vetter
2015-08-12 14:18 ` Jani Nikula
2015-08-12 14:57 ` Yang, Libin
2015-08-10 11:46 ` [PATCH v2 1/4] drm/i915: Add audio set_ncts callback Jani Nikula
2015-08-11 2:40 ` Yang, Libin
2015-08-12 3:16 ` Yang, Libin
2015-08-12 6:14 ` [Intel-gfx] " Jani Nikula
2015-08-11 5:51 ` Yang, Libin
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=20150812130457.GN17734@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=alsa-devel@alsa-project.org \
--cc=daniel.vetter@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox