public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Animesh Manna <animesh.manna@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 3/5] drm/i915/bxt: Added _DSM call to set HPD_CTL.
Date: Fri, 10 Feb 2017 19:15:55 +0200	[thread overview]
Message-ID: <20170210171555.GD15795@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <1482845396-23408-4-git-send-email-animesh.manna@intel.com>

On Tue, Dec 27, 2016 at 06:59:54PM +0530, Animesh Manna wrote:
> _DSM is added to program HPD_CTL(0x1094) register
> of PMC from i915 driver which will be called
> based on driver feature flag.
> 
> During S0ix display engine is completely powered down. Hot plug will be
> missed by display HPD detection logic. GPIO unit detect any edge on HPD
> pin and then triggers PMC->Punit to power up and restore display.
> By programming PMC hpd control register we are enabling the manual
> trigger from Punit which will be done by writing the PM interrupt register.
> 
> Note: Display engine continue to get HPD interrupt even after DC9 but
> the system is in S0 state (VNN will be on).
> 
> v1: Initial version as RFC.
> 
> v2: Modified the commit message.
> 
> Signed-off-by: Animesh Manna <animesh.manna@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_acpi.c | 32 +++++++++++++++++++++++++++-----
>  1 file changed, 27 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_acpi.c b/drivers/gpu/drm/i915/intel_acpi.c
> index 5c49cef..47b8bbd 100644
> --- a/drivers/gpu/drm/i915/intel_acpi.c
> +++ b/drivers/gpu/drm/i915/intel_acpi.c
> @@ -10,6 +10,8 @@
>  
>  #define INTEL_DSM_REVISION_ID 1 /* For Calpella anyway... */
>  #define INTEL_DSM_FN_PLATFORM_MUX_INFO 1 /* No args */
> +#define INTEL_DSM_SET_HPD_WAKEUP 17
> +#define HPD_WAKEUP_EN_VAL 0xFCF0
>  
>  static struct intel_dsm_priv {
>  	acpi_handle dhandle;
> @@ -118,6 +120,25 @@ static void intel_dsm_platform_mux_info(void)
>  	ACPI_FREE(pkg);
>  }
>  
> +static void intel_dsm_set_hpd_wakeup(const u8 *guid)
> +{
> +	union acpi_object *obj;
> +	union acpi_object argv4 = {
> +		.integer.type = ACPI_TYPE_INTEGER,
> +		.integer.value = HPD_WAKEUP_EN_VAL,
> +	};
> +
> +	obj = acpi_evaluate_dsm_typed(intel_dsm_priv.dhandle, guid,
> +			INTEL_DSM_REVISION_ID, INTEL_DSM_SET_HPD_WAKEUP,
> +			&argv4, ACPI_TYPE_INTEGER);

Did this call succeed for you? For me on all platforms I tried
it results in
ACPI Warning: \_SB.PCI0.GFX0._DSM: Argument #4 type mismatch - Found [Integer], ACPI requires [Package] (20160930/nsarguments-95)
and the above function returning NULL.

> +
> +	if (!obj)
> +		DRM_DEBUG_DRIVER("failed to evaluate _DSM\n");
> +
> +	ACPI_FREE(obj);
> +}
> +
> +
>  static bool intel_dsm_pci_probe(struct pci_dev *pdev)
>  {
>  	acpi_handle dhandle;
> @@ -131,11 +152,12 @@ static bool intel_dsm_pci_probe(struct pci_dev *pdev)
>  	intel_dsm_priv.dhandle = dhandle;
>  
>  	if (IS_BROXTON(dev_priv)) {
> -		union acpi_object *obj;
> -
> -		obj = acpi_evaluate_dsm(dhandle, intel_dsm_guid_bxt,
> -					INTEL_DSM_REVISION_ID, 0, NULL);
> -		if (!obj)
> +		if (dev_priv->vbt.hpd_wakeup_enabled &&
> +		    acpi_check_dsm(dhandle, intel_dsm_guid_bxt,
> +				   INTEL_DSM_REVISION_ID,
> +				   1 << INTEL_DSM_SET_HPD_WAKEUP))
> +			intel_dsm_set_hpd_wakeup(intel_dsm_guid_bxt);
> +		else
>  			return false;
>  	} else {
>  		if (acpi_check_dsm(dhandle, intel_dsm_guid,
> -- 
> 2.7.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-02-10 17:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-27 13:29 [PATCH v3 0/5] HPD support during suspend for BXT/APL Animesh Manna
2016-12-27 13:29 ` [PATCH v3 1/5] drm/i915/bxt: Corrected the guid for bxt Animesh Manna
2017-02-10 17:11   ` Imre Deak
2016-12-27 13:29 ` [PATCH v3 2/5] drm/i915/bxt: VBT changes for hpd as wakeup feature Animesh Manna
2016-12-27 13:29 ` [PATCH v3 3/5] drm/i915/bxt: Added _DSM call to set HPD_CTL Animesh Manna
2017-02-10 17:15   ` Imre Deak [this message]
2016-12-27 13:29 ` [PATCH v3 4/5] drm/i915/bxt: Block D3 during suspend Animesh Manna
2016-12-27 13:29 ` [PATCH v3 5/5] drm/i915: Enable HPD interrupts with master ctl interrupt Animesh Manna
2017-02-10 17:37   ` Imre Deak
2017-02-10 18:04     ` Imre Deak
2016-12-27 13:54 ` ✗ Fi.CI.BAT: failure for HPD support during suspend for BXT/APL. (rev2) Patchwork
2016-12-28  7:42   ` [PATCH v3 5/5] drm/i915: Enable HPD interrupts with master ctl interrupt Animesh Manna
2016-12-28  9:24     ` Daniel Vetter
2017-02-10 16:13 ` [PATCH v3 0/5] HPD support during suspend for BXT/APL Imre Deak

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=20170210171555.GD15795@ideak-desk.fi.intel.com \
    --to=imre.deak@intel.com \
    --cc=animesh.manna@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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