All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>,
	Jie Yang <yang.jie@linux.intel.com>
Subject: Re: [PATCH 2/7] ALSA: hda: Refactor display power management
Date: Tue, 11 Dec 2018 08:34:44 -0600	[thread overview]
Message-ID: <a650e6aa-60fe-7f60-ca23-5c819c9e353d@linux.intel.com> (raw)
In-Reply-To: <s5hftv4kvls.wl-tiwai@suse.de>


>>>>>      a codec was done indirectly via link_power bus ops.)
>>>>>
>>>>> - snd_hdac_display_power() receives the codec address index.  For
>>>>>      turning on/off from the controller, pass HDA_CODEC_IDX_CONTROLLER.
>>>> The need for this virtual index==16 isn't fully clear to me,
>>>> especially if you use the bitfields instead of reference counts.
>>>>
>>>> Isn't there a risk of the controller setting the bit16 to zero, but
>>>> you still have bit4 on (assuming the idx is 4). If you use this
>>>> virtual index, it should override the actual physical bits when
>>>> set/cleared.
>>> This is the index for a controller, i.e. we'd need bits for the max
>>> number of codecs + 1.
>>>
>>> Actually we do support only up to 8 codecs (HDA_MAX_CODECS), so it
>>> should be 8, instead of 16, too.  I'll update to be HDA_MAX_CODECS.
>>>
>>>> Or is this meant to actually implement a preemption mechanism, where
>>>> the display power remains on for as long as the controller wishes,
>>>> regardless of what the patch_hdmi and hdac_hdmi code requests?
>>> Right.  That's the mechanism at the initial phase, we need the display
>>> power on while probing the codec, i.e. before identifying the codec
>>> ID.
>>>
>>>> Also don't we already have the HDMI codec address already after the
>>>> probe, so couldn't we provide the address directly?
>>> The resume seemed requiring the controller to take the display power
>>> at first, so the same mechanism is used.
>> ok, makes sense, thanks for the explanations.
>>
>> So I guess for the SOF patches, the only change would be to add the
>> second argument HDA_CODEC_IDX_CONTROLLER to snd_hdac_display_power()
>> calls, the rest looks unchanged or hidden inside the hdac library or
>> hdac_hdmi parts.
> Yes, other than that, this change makes things easier.
>
> Since we don't manage with refcount, the only important point is to
> turn off/on properly at suspend/resume (also off at remove), no matter
> how many times it gets called.
Ah yes, we are missing this on remove since we assumed the refcount 
would already be zero. I guess we'll have to revalidate this part 
anyways once your patches are merged (already have an SOF issue filed to 
track this change).

  reply	other threads:[~2018-12-11 14:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-09  9:33 [PATCH 0/7] ALSA: HD-audio display power fixes Takashi Iwai
2018-12-09  9:33 ` [PATCH 1/7] ALSA: hda/intel: Refactoring PM code Takashi Iwai
2018-12-09  9:33 ` [PATCH 2/7] ALSA: hda: Refactor display power management Takashi Iwai
2018-12-10 20:52   ` Pierre-Louis Bossart
2018-12-11  6:54     ` Takashi Iwai
2018-12-11 13:58       ` Pierre-Louis Bossart
2018-12-11 14:04         ` Takashi Iwai
2018-12-11 14:34           ` Pierre-Louis Bossart [this message]
2018-12-09  9:33 ` [PATCH 3/7] ALSA: hda/intel: Drop superfluous AZX_DCAPS_I915_POWERWELL checks Takashi Iwai
2018-12-10 20:56   ` Pierre-Louis Bossart
2018-12-11  7:00     ` Takashi Iwai
2018-12-09  9:33 ` [PATCH 4/7] ALSA: hda/intel: Properly free the display power at error path Takashi Iwai
2018-12-09  9:33 ` [PATCH 5/7] ALSA: hda: Make snd_hdac_display_power() void function Takashi Iwai
2018-12-09  9:33 ` [PATCH 6/7] ASoC: hdac_hdmi: Add missing display power-off at driver removal Takashi Iwai
2018-12-10 14:33   ` Mark Brown
2018-12-09  9:33 ` [PATCH 7/7] ALSA: hda/hdmi: Always set display_power_control for Intel HSW+ codecs 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=a650e6aa-60fe-7f60-ca23-5c819c9e353d@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=tiwai@suse.de \
    --cc=yang.jie@linux.intel.com \
    /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.