From patchwork Thu Jan 23 04:22:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todd Previte X-Patchwork-Id: 3526561 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7C2CB9F491 for ; Thu, 23 Jan 2014 04:22:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A456A20173 for ; Thu, 23 Jan 2014 04:22:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 66DE120161 for ; Thu, 23 Jan 2014 04:22:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0A53FFBB2E; Wed, 22 Jan 2014 20:22:49 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) by gabe.freedesktop.org (Postfix) with ESMTP id A2AC2FBCBC for ; Wed, 22 Jan 2014 20:22:44 -0800 (PST) Received: by mail-pa0-f42.google.com with SMTP id kl14so1330289pab.29 for ; Wed, 22 Jan 2014 20:22:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=77KhtMLBnn1E+EWpnZwDUKEokeOH3ASW1IxTKIlWdaI=; b=vHQmmoayY7H8pICrxvJGpia5QCaCoap9lfOR8X7D5//3ZcRRwxszu6voL0a0wIeYfb H4sQ2OxSyvYz5/nYXubj6NNoMqWm1PAVMCpUk+a2Ln/fQCf9kEoc80VmekMkFyVugH+i j5Wl+wAprPwIF8BZQAMC0gB/dyvf/bueKa7N8dmm7prXcAbTkWPaUrWIEh6PFtP9Z10J WSRQR0QcOEOQB5fL1R8pmURrsejB9VPsCPaQtY6vSKnvALz0oRzdRy4XX4XrHqRXDLq3 qFOce1jPN0qrdApJE20w/rztEE15FzGoo1bUqbUEJnlDVRva+6tuKh5cnh5oR3xwZacu 93UA== X-Received: by 10.66.232.129 with SMTP id to1mr5738283pac.29.1390450964466; Wed, 22 Jan 2014 20:22:44 -0800 (PST) Received: from panzer.ph.cox.net (ip70-162-72-129.ph.ph.cox.net. [70.162.72.129]) by mx.google.com with ESMTPSA id un5sm56158388pab.3.2014.01.22.20.22.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 Jan 2014 20:22:43 -0800 (PST) From: Todd Previte To: intel-gfx@lists.freedesktop.org Date: Wed, 22 Jan 2014 21:22:32 -0700 Message-Id: <1390450952-3039-2-git-send-email-tprevite@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1390450952-3039-1-git-send-email-tprevite@gmail.com> References: <1390322330-6486-1-git-send-email-tprevite@gmail.com> <1390450952-3039-1-git-send-email-tprevite@gmail.com> Subject: [Intel-gfx] [PATCH v3] drm/i915: VLV2 - Fix hotplug detect bits X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Add new definitions for hotplug live status bits for VLV2 since they're in reverse order from the gen4x ones. Changelog: - Restored gen4 bit definitions - Added new definitions for VLV2 - Added platform check for IS_VALLEYVIEW() in dp_detect to use the correct bit defintions Signed-off-by: Todd Previte Reviewed-by: Jani Nikula --- drivers/gpu/drm/i915/i915_reg.h | 11 ++++++++--- drivers/gpu/drm/i915/intel_dp.c | 39 +++++++++++++++++++++++++++------------ 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 2d77b51..0e65717 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h @@ -2083,9 +2083,14 @@ * Please check the detailed lore in the commit message for for experimental * evidence. */ -#define PORTD_HOTPLUG_LIVE_STATUS (1 << 29) -#define PORTC_HOTPLUG_LIVE_STATUS (1 << 28) -#define PORTB_HOTPLUG_LIVE_STATUS (1 << 27) +/* VLV hot plug bits are different */ +#define VLV_PORTD_HOTPLUG_LIVE_STATUS (1 << 27) +#define VLV_PORTC_HOTPLUG_LIVE_STATUS (1 << 28) +#define VLV_PORTB_HOTPLUG_LIVE_STATUS (1 << 29) + +#define PORTD_HOTPLUG_LIVE_STATUS (1 << 29) +#define PORTC_HOTPLUG_LIVE_STATUS (1 << 28) +#define PORTB_HOTPLUG_LIVE_STATUS (1 << 27) #define PORTD_HOTPLUG_INT_STATUS (3 << 21) #define PORTC_HOTPLUG_INT_STATUS (3 << 19) #define PORTB_HOTPLUG_INT_STATUS (3 << 17) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 1386efb..1f080b2 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -2946,18 +2946,33 @@ g4x_dp_detect(struct intel_dp *intel_dp) return status; } - switch (intel_dig_port->port) { - case PORT_B: - bit = PORTB_HOTPLUG_LIVE_STATUS; - break; - case PORT_C: - bit = PORTC_HOTPLUG_LIVE_STATUS; - break; - case PORT_D: - bit = PORTD_HOTPLUG_LIVE_STATUS; - break; - default: - return connector_status_unknown; + if (IS_VALLEYVIEW(dev)) { + switch (intel_dig_port->port) { + case PORT_B: + bit = VLV_PORTB_HOTPLUG_LIVE_STATUS; + break; + case PORT_C: + bit = VLV_PORTC_HOTPLUG_LIVE_STATUS; + break; + case PORT_D: + bit = VLV_PORTD_HOTPLUG_LIVE_STATUS; + break; + default: + return connector_status_unknown; + } else { + switch (intel_dig_port->port) { + case PORT_B: + bit = PORTB_HOTPLUG_LIVE_STATUS; + break; + case PORT_C: + bit = PORTC_HOTPLUG_LIVE_STATUS; + break; + case PORT_D: + bit = PORTD_HOTPLUG_LIVE_STATUS; + break; + default: + return connector_status_unknown; + } } if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0)