From patchwork Mon Jun 12 15:24:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manna, Animesh" X-Patchwork-Id: 9781415 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6723A60244 for ; Mon, 12 Jun 2017 15:26:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 547F32807B for ; Mon, 12 Jun 2017 15:26:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4959628522; Mon, 12 Jun 2017 15:26:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0769A2807B for ; Mon, 12 Jun 2017 15:26:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E4C196E145; Mon, 12 Jun 2017 15:26:00 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9C77E6E143 for ; Mon, 12 Jun 2017 15:25:59 +0000 (UTC) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP; 12 Jun 2017 08:25:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,334,1493708400"; d="scan'208";a="113872568" Received: from amanna-desktop.iind.intel.com ([10.223.25.34]) by fmsmga006.fm.intel.com with ESMTP; 12 Jun 2017 08:25:58 -0700 From: Animesh Manna To: intel-gfx@lists.freedesktop.org Date: Mon, 12 Jun 2017 20:54:05 +0530 Message-Id: <1497281047-25204-4-git-send-email-animesh.manna@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497281047-25204-1-git-send-email-animesh.manna@intel.com> References: <1497281047-25204-1-git-send-email-animesh.manna@intel.com> Subject: [Intel-gfx] [PATCH v4 3/5] drm/i915/bxt: Added _DSM call to set HPD_CTL. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP _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 --- drivers/gpu/drm/i915/intel_acpi.c | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_acpi.c b/drivers/gpu/drm/i915/intel_acpi.c index 5c49cef..e7d15720 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,30 @@ 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 argv = { + .integer.type = ACPI_TYPE_INTEGER, + .integer.value = HPD_WAKEUP_EN_VAL, + }; + union acpi_object argv4; + + argv4.type = ACPI_TYPE_PACKAGE; + argv4.package.count = 1; + argv4.package.elements = &argv; + + obj = acpi_evaluate_dsm(intel_dsm_priv.dhandle, guid, + INTEL_DSM_REVISION_ID, INTEL_DSM_SET_HPD_WAKEUP, + &argv4); + + 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 +157,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,