From patchwork Thu Apr 7 14:52:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manna, Animesh" X-Patchwork-Id: 8773751 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A9C619FBEA for ; Thu, 7 Apr 2016 14:54:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B41622017E for ; Thu, 7 Apr 2016 14:54:42 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D05042025A for ; Thu, 7 Apr 2016 14:54:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5D6D46E9AF; Thu, 7 Apr 2016 14:54:41 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 6DE156E9AF for ; Thu, 7 Apr 2016 14:54:40 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 07 Apr 2016 07:54:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,449,1455004800"; d="scan'208";a="682449580" Received: from amanna-desktop.iind.intel.com ([10.223.25.127]) by FMSMGA003.fm.intel.com with ESMTP; 07 Apr 2016 07:54:39 -0700 From: Animesh Manna To: intel-gfx@lists.freedesktop.org Date: Thu, 7 Apr 2016 20:22:09 +0530 Message-Id: <1460040732-31417-3-git-send-email-animesh.manna@intel.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1460040732-31417-1-git-send-email-animesh.manna@intel.com> References: <1460040732-31417-1-git-send-email-animesh.manna@intel.com> Subject: [Intel-gfx] [PATCH v2 2/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-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org 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. PMC hpd control register programming will enable PMC to get hpd interrupt during dc9. Signed-off-by: Animesh Manna --- drivers/gpu/drm/i915/intel_acpi.c | 45 +++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_acpi.c b/drivers/gpu/drm/i915/intel_acpi.c index eb638a1..8f3d672 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; @@ -110,23 +112,52 @@ static void intel_dsm_platform_mux_info(void) ACPI_FREE(pkg); } +static void intel_dsm_set_hpd_wakeup(void) +{ + 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, intel_dsm_guid, + INTEL_DSM_REVISION_ID, INTEL_DSM_SET_HPD_WAKEUP, + &argv4, ACPI_TYPE_INTEGER); + + 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; + struct drm_device *dev = pci_get_drvdata(pdev); + struct drm_i915_private *dev_priv = dev->dev_private; dhandle = ACPI_HANDLE(&pdev->dev); - if (!dhandle) - return false; - if (!acpi_check_dsm(dhandle, intel_dsm_guid, INTEL_DSM_REVISION_ID, - 1 << INTEL_DSM_FN_PLATFORM_MUX_INFO)) { - DRM_DEBUG_KMS("no _DSM method for intel device\n"); + if (!dhandle) return false; - } intel_dsm_priv.dhandle = dhandle; - intel_dsm_platform_mux_info(); + if (acpi_check_dsm(dhandle, intel_dsm_guid, INTEL_DSM_REVISION_ID, + 1 << INTEL_DSM_FN_PLATFORM_MUX_INFO)) + intel_dsm_platform_mux_info(); + else + DRM_DEBUG_KMS("no _DSM method for mux-info\n"); + + /* Need to ensure vbt parsing is completed. */ + if (dev_priv->vbt.hpd_wakeup_enabled && + acpi_check_dsm(dhandle, intel_dsm_guid, INTEL_DSM_REVISION_ID, + 1 << INTEL_DSM_SET_HPD_WAKEUP)) + intel_dsm_set_hpd_wakeup(); + else { + dev_priv->vbt.hpd_wakeup_enabled = false; + DRM_DEBUG_KMS("no _DSM method for hpd-enabling\n"); + } return true; }