From patchwork Mon Jul 13 04:17:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sonika.jindal@intel.com X-Patchwork-Id: 6774011 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 151CDC05AC for ; Mon, 13 Jul 2015 04:28:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3439720149 for ; Mon, 13 Jul 2015 04:28:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2BE8520398 for ; Mon, 13 Jul 2015 04:28:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 52DA66E09F; Sun, 12 Jul 2015 21:28:11 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id D80176E09F for ; Sun, 12 Jul 2015 21:28:09 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 12 Jul 2015 21:28:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,459,1432623600"; d="scan'208";a="523236599" Received: from sonikaji-desktop.iind.intel.com ([10.223.25.81]) by FMSMGA003.fm.intel.com with ESMTP; 12 Jul 2015 21:28:07 -0700 From: Sonika Jindal To: intel-gfx@lists.freedesktop.org Date: Mon, 13 Jul 2015 09:47:50 +0530 Message-Id: <1436761070-29138-1-git-send-email-sonika.jindal@intel.com> X-Mailer: git-send-email 1.7.10.4 Subject: [Intel-gfx] [PATCH] drm/i915/bxt: WA for swapped HPD pins in A stepping 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.6 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 As per bspec, on BXT A0/A1, sw needs to activate DDIA HPD logic and interrupts to check the external panel connection. And remove the redundant comment. v2: Remove redundant IS_BROXTON check, Add comment about port C not connected, and rephrase the commit message to include only what we are doing here (Imre) Signed-off-by: Sonika Jindal Tested-By: Intel Graphics QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com) --- drivers/gpu/drm/i915/i915_irq.c | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index eb52a03..760539c 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -88,7 +88,11 @@ static const u32 hpd_status_i915[HPD_NUM_PINS] = { [HPD_PORT_D] = PORTD_HOTPLUG_INT_STATUS }; -/* BXT hpd list */ +/* Port C is not connected on bxt A0/A1 */ +static const u32 hpd_bxt_a0[HPD_NUM_PINS] = { + [HPD_PORT_B] = BXT_DE_PORT_HP_DDIA +}; + static const u32 hpd_bxt[HPD_NUM_PINS] = { [HPD_PORT_B] = BXT_DE_PORT_HP_DDIB, [HPD_PORT_C] = BXT_DE_PORT_HP_DDIC @@ -2257,6 +2261,7 @@ static void bxt_hpd_handler(struct drm_device *dev, uint32_t iir_status) struct drm_i915_private *dev_priv = dev->dev_private; u32 hp_control, hp_trigger; u32 pin_mask, long_mask; + const u32 *hpd; /* Get the status */ hp_trigger = iir_status & BXT_DE_PORT_HOTPLUG_MASK; @@ -2271,7 +2276,12 @@ static void bxt_hpd_handler(struct drm_device *dev, uint32_t iir_status) /* Clear sticky bits in hpd status */ I915_WRITE(BXT_HOTPLUG_CTL, hp_control); - pch_get_hpd_pins(&pin_mask, &long_mask, hp_trigger, hp_control, hpd_bxt); + if (INTEL_REVID(dev) < BXT_REVID_B0) + hpd = hpd_bxt_a0; + else + hpd = hpd_bxt; + + pch_get_hpd_pins(&pin_mask, &long_mask, hp_trigger, hp_control, hpd); intel_hpd_irq_handler(dev, pin_mask, long_mask); } @@ -3315,8 +3325,15 @@ static void bxt_hpd_irq_setup(struct drm_device *dev) /* Now, enable HPD */ for_each_intel_encoder(dev, intel_encoder) { if (dev_priv->hotplug.stats[intel_encoder->hpd_pin].state - == HPD_ENABLED) - hotplug_port |= hpd_bxt[intel_encoder->hpd_pin]; + == HPD_ENABLED) { + const u32 *hpd; + + if (INTEL_REVID(dev) < BXT_REVID_B0) + hpd = hpd_bxt_a0; + else + hpd = hpd_bxt; + hotplug_port |= hpd[intel_encoder->hpd_pin]; + } } /* Mask all HPD control bits */ @@ -3324,11 +3341,14 @@ static void bxt_hpd_irq_setup(struct drm_device *dev) /* Enable requested port in hotplug control */ /* TODO: implement (short) HPD support on port A */ - WARN_ON_ONCE(hotplug_port & BXT_DE_PORT_HP_DDIA); - if (hotplug_port & BXT_DE_PORT_HP_DDIB) - hotplug_ctrl |= BXT_DDIB_HPD_ENABLE; - if (hotplug_port & BXT_DE_PORT_HP_DDIC) - hotplug_ctrl |= BXT_DDIC_HPD_ENABLE; + if (INTEL_REVID(dev) < BXT_REVID_B0 && (hotplug_port & BXT_DE_PORT_HP_DDIA)) + hotplug_ctrl |= BXT_DDIA_HPD_ENABLE; + else { + if (hotplug_port & BXT_DE_PORT_HP_DDIB) + hotplug_ctrl |= BXT_DDIB_HPD_ENABLE; + if (hotplug_port & BXT_DE_PORT_HP_DDIC) + hotplug_ctrl |= BXT_DDIC_HPD_ENABLE; + } I915_WRITE(BXT_HOTPLUG_CTL, hotplug_ctrl); /* Unmask DDI hotplug in IMR */