From: Jani Nikula <jani.nikula@linux.intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>, "Gupta\,
Anshuman" <anshuman.gupta@intel.com>
Cc: "intel-gfx\@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>, "Deak\,
Imre" <imre.deak@intel.com>, "Tangudu\,
Tilak" <tilak.tangudu@intel.com>
Subject: Re: [Intel-gfx] [PATCH 2/2] drm/i915/runtime_pm: Let's avoid the undocumented D1 opregion notification.
Date: Wed, 25 Aug 2021 18:57:12 +0300 [thread overview]
Message-ID: <878s0pecvb.fsf@intel.com> (raw)
In-Reply-To: <YSZhrTW3nVqVaOOf@intel.com>
On Wed, 25 Aug 2021, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> On Wed, Aug 25, 2021 at 09:04:02AM +0000, Gupta, Anshuman wrote:
>>
>>
>> > -----Original Message-----
>> > From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Rodrigo
>> > Vivi
>> > Sent: Tuesday, August 24, 2021 9:15 PM
>> > To: intel-gfx@lists.freedesktop.org
>> > Cc: Vivi, Rodrigo <rodrigo.vivi@intel.com>; Deak, Imre <imre.deak@intel.com>;
>> > Tangudu, Tilak <tilak.tangudu@intel.com>
>> > Subject: [Intel-gfx] [PATCH 2/2] drm/i915/runtime_pm: Let's avoid the
>> > undocumented D1 opregion notification.
>> >
>> > At least for newer generations, let's try to do the right thing that is to notify the
>> > opregion that we are going into D3hot.
>> >
>> > But to avoid breaking the world let's keep the older undocumented behavior in
>> > place.
>> >
>> > Cc: Imre Deak <imre.deak@intel.com>
>> > Cc: Tilak Tangudu <tilak.tangudu@intel.com>
>> > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> > ---
>> > drivers/gpu/drm/i915/intel_runtime_pm.c | 24 ++++++++----------------
>> > 1 file changed, 8 insertions(+), 16 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c
>> > b/drivers/gpu/drm/i915/intel_runtime_pm.c
>> > index 43cdc2f3ff9e..371bbc58db92 100644
>> > --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
>> > +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
>> > @@ -706,27 +706,19 @@ int intel_runtime_pm_suspend(struct
>> > intel_runtime_pm *rpm)
>> >
>> > rpm->suspended = true;
>> >
>> > - /*
>> > - * FIXME: We really should find a document that references the
>> > arguments
>> > - * used below!
>> > - */
>> > - if (IS_BROADWELL(i915)) {
>> > - /*
>> > - * On Broadwell, if we use PCI_D1 the PCH DDI ports will stop
>> > - * being detected, and the call we do at intel_runtime_resume()
>> > - * won't be able to restore them. Since PCI_D3hot matches the
>> > - * actual specification and appears to be working, use it.
>> > - */
>> > - intel_opregion_notify_adapter(i915, PCI_D3hot);
>> > - } else {
>> > + if (GRAPHICS_VER(i915) < 8) {
>> > /*
>> > - * current versions of firmware which depend on this opregion
>> > - * notification have repurposed the D1 definition to mean
>> > + * Some older versions of firmware which depend on this
>> > opregion
>> > + * notification had repurposed the D1 definition to mean
>> > * "runtime suspended" vs. what you would normally expect
>> > (D3)
>> > * to distinguish it from notifications that might be sent via
>> > - * the suspend path.
>> > + * the suspend path. Unfortunately there's no documentation
>> > + * available right now to justify this flow. However let's
>> > + * keep for historical reasons.
>> > */
>> > intel_opregion_notify_adapter(i915, PCI_D1);
>>
>> > + } else {
>> > + intel_opregion_notify_adapter(i915, PCI_D3hot);
>> This is going to call the opregion ACPI SBCB method with function SWSCI_SBCB_ADAPTER_POWER_STATE i.e. value =7 and with input PARAM value as input power state (PCI_D0, PCI_D1, ...).
>> Below is the TGL SBCB method code block for command SWSCI_SBCB_ADAPTER_POWER_STATE (this method can be retrieve from one of SSDT table in /sys/firmware/acpi/tables/SSDT*)
>>
>> If ((GESF == 0x07))
>> {
>> If (((S0ID == One) && (OSYS < 0x07DF)))
>> {
>> If (((PARM & 0xFF) == One))
>> {
>> ADBG ("IgSbcb:GUAM(1)")
>> \GUAM (One)
>> }
>>
>> If (((PARM & 0xFF) == Zero))
>> {
>> ADBG ("IgSbcb:GUAM(0)")
>> \GUAM (Zero)
>> }
>> }
>>
>> If ((PARM == Zero))
>> {
>> Local0 = CLID /* \_SB_.PC00.GFX0.CLID */
>> If ((0x80000000 & Local0))
>> {
>> CLID &= 0x0F
>> GLID (CLID)
>> }
>> }
>>
>> GESF = Zero
>> PARM = Zero
>> Return (SUCC) /* \_SB_.PC00.GFX0.SUCC */
>> }
>>
>> With above code block, it either checks for input PARAM value either 0 or 1.
>> I am not sure but passing PCI_D3hot as input parameter may affect the SBCB functionality. here
>
> Thanks for sharing this info.
> I left this out of my new series while we investigate internally why this doesn't match
> the spec and looks more like the command 8 where 0 is "on" and 1 is "standby"
I've let myself be told current gen platforms shouldn't have swsci at
all, but in practice we encounter opregions with swsci mailbox flag set.
BR,
Jani.
>
> Thanks,
> Rodrigo.
>
>> Thanks,
>> Anshuman Gupta
>> > }
>> >
>> > assert_forcewakes_inactive(&i915->uncore);
>> > --
>> > 2.31.1
>>
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2021-08-25 15:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-24 15:44 [Intel-gfx] [PATCH 1/2] drm/i915/runtime_pm: Consolidate runtime_pm functions Rodrigo Vivi
2021-08-24 15:44 ` [Intel-gfx] [PATCH 2/2] drm/i915/runtime_pm: Let's avoid the undocumented D1 opregion notification Rodrigo Vivi
2021-08-25 9:04 ` Gupta, Anshuman
2021-08-25 15:28 ` Rodrigo Vivi
2021-08-25 15:57 ` Jani Nikula [this message]
2021-08-24 19:49 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/2] drm/i915/runtime_pm: Consolidate runtime_pm functions Patchwork
2021-08-24 20:18 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-08-25 2:09 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
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=878s0pecvb.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=anshuman.gupta@intel.com \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=rodrigo.vivi@intel.com \
--cc=tilak.tangudu@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox