From patchwork Thu Jan 23 07:13:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todd Previte X-Patchwork-Id: 3526851 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A4684C02DC for ; Thu, 23 Jan 2014 07:14:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D20A6201B9 for ; Thu, 23 Jan 2014 07:13:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4B21C20179 for ; Thu, 23 Jan 2014 07:13:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 04C03FBD74; Wed, 22 Jan 2014 23:13:57 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by gabe.freedesktop.org (Postfix) with ESMTP id 99A4DFBD74 for ; Wed, 22 Jan 2014 23:13:51 -0800 (PST) Received: by mail-pd0-f178.google.com with SMTP id y13so1423346pdi.37 for ; Wed, 22 Jan 2014 23:13:51 -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=9YhFoOnmVyd3TUAhn3U4c4rH5albjPQ7c4sCAItbrxw=; b=V6WByQ7Fo+asF8Kjompbt+oCg6sLB9XuHe57BKrBaMX2FQlJ4m2HRQ4zLRdNangmNM fyovReZdQGF2RhMC5MONZcuf5OVSFnMc07pdvaIWkgfvs4kzvcd373lYbgf/F6ebFL1m MOtHaNnxVCLk8//jcuKTU+P3aLd1Xi61gU2nROb/c3TwkN+3AyvYaa3nKRUO/j9sXU9y XHMgkDHJ8/aVKbNJqURIJOkFlbDK5vJlFlv7Ly92ERiujqxPcaTf/EFSrovLTnLW5a0e dPQdnA78PCzQJVBhUY3NVZNG1rKJrs6HDnbGiJKu42ufPrKNG7sRPol4dUkGHtm0ypk6 9WkQ== X-Received: by 10.66.148.230 with SMTP id tv6mr6467124pab.155.1390461231618; Wed, 22 Jan 2014 23:13:51 -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 gw11sm32475616pbd.17.2014.01.22.23.13.49 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 Jan 2014 23:13:50 -0800 (PST) From: Todd Previte To: intel-gfx@lists.freedesktop.org Date: Thu, 23 Jan 2014 00:13:41 -0700 Message-Id: <1390461221-19715-2-git-send-email-tprevite@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1390461221-19715-1-git-send-email-tprevite@gmail.com> References: <1390322330-6486-1-git-send-email-tprevite@gmail.com> <1390461221-19715-1-git-send-email-tprevite@gmail.com> Subject: [Intel-gfx] [PATCH V4] 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.6 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=ham 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 - Replaced a lost trailing brace for the added switch() Signed-off-by: Todd Previte --- drivers/gpu/drm/i915/i915_reg.h | 11 ++++++++--- drivers/gpu/drm/i915/intel_dp.c | 40 ++++++++++++++++++++++++++++------------ 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 10ecf90..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..51c6497 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -2946,18 +2946,34 @@ 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)