From patchwork Thu Dec 13 16:09:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Lespiau X-Patchwork-Id: 1875401 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 35FB9DF23A for ; Thu, 13 Dec 2012 16:12:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B4A0E6872 for ; Thu, 13 Dec 2012 08:12:16 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by gabe.freedesktop.org (Postfix) with ESMTP id C6D2AE680B for ; Thu, 13 Dec 2012 08:09:16 -0800 (PST) Received: by mail-we0-f177.google.com with SMTP id x48so958023wey.36 for ; Thu, 13 Dec 2012 08:09:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:x-mailer:in-reply-to:references; bh=WbWcHOKRlDlLi9bu8PjQ5/gWlSWuyipGX1gSLVerIrw=; b=Zdb75XGmifJzAn/HuNsmun1X1kRabT7LAARnBpl2zNV6DQA2w3pqFHh4WqssB/3lLT igC0c8WtdcZQccXOXcc/HGHlqitYte1MRSbg0xLj8O9UUorxUrpFyL0uGkFShVYTfI19 XCFSNlJW08BBkSCQFpc/eyECG2vWuIBWZOUNaq4QSKqa6E9j3r5j0VSmGykXhU0zfx7+ 8/kn8LMiJk3rt9uGSDMEMzhy7iX/Qua5ylmdZgs65Pjy0CV5pXvScur5N0Om2UfFGPE3 ntC+kX2lY1xn/tl2RtpUl2BkKzomreMq1T6yj789hsO6OX8HMn/uOHWZKEd9lGqRNxbi JSZA== Received: by 10.194.20.231 with SMTP id q7mr9306203wje.44.1355414956004; Thu, 13 Dec 2012 08:09:16 -0800 (PST) Received: from localhost.localdomain ([83.217.123.106]) by mx.google.com with ESMTPS id d9sm8649072wiw.0.2012.12.13.08.09.15 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 13 Dec 2012 08:09:15 -0800 (PST) From: Damien Lespiau To: intel-gfx@lists.freedesktop.org Date: Thu, 13 Dec 2012 16:09:03 +0000 Message-Id: <1355414944-1494-5-git-send-email-damien.lespiau@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1355414944-1494-1-git-send-email-damien.lespiau@gmail.com> References: <1355414944-1494-1-git-send-email-damien.lespiau@gmail.com> Subject: [Intel-gfx] [PATCH 5/6] drm/i915: Implement ibx_digital_port_connected() for IBX 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+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org From: Damien Lespiau CPT+ PCHs have different bit definition to read the HPD live status. I don't have an ILK with digital ports handy, which is why this patch is separate from the CPT+ implementation. If the docs don't lie, it should all be fine though. Signed-off-by: Damien Lespiau Reviewed-by: Jani Nikula --- drivers/gpu/drm/i915/intel_display.c | 44 +++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 21fedf7..10759ea 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -1006,22 +1006,34 @@ bool ibx_digital_port_connected(struct drm_i915_private *dev_priv, { u32 bit; - /* XXX: IBX has different SDEISR bits */ - if (HAS_PCH_IBX(dev_priv->dev)) - return true; - - switch(port->port) { - case PORT_B: - bit = SDE_PORTB_HOTPLUG_CPT; - break; - case PORT_C: - bit = SDE_PORTC_HOTPLUG_CPT; - break; - case PORT_D: - bit = SDE_PORTD_HOTPLUG_CPT; - break; - default: - return true; + if (HAS_PCH_IBX(dev_priv->dev)) { + switch(port->port) { + case PORT_B: + bit = SDE_PORTB_HOTPLUG; + break; + case PORT_C: + bit = SDE_PORTC_HOTPLUG; + break; + case PORT_D: + bit = SDE_PORTD_HOTPLUG; + break; + default: + return true; + } + } else { + switch(port->port) { + case PORT_B: + bit = SDE_PORTB_HOTPLUG_CPT; + break; + case PORT_C: + bit = SDE_PORTC_HOTPLUG_CPT; + break; + case PORT_D: + bit = SDE_PORTD_HOTPLUG_CPT; + break; + default: + return true; + } } return I915_READ(SDEISR) & bit;