From patchwork Thu Sep 6 07:10:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1412481 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 7711F3FC85 for ; Thu, 6 Sep 2012 08:18:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5EE609EEEA for ; Thu, 6 Sep 2012 01:18:26 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-bk0-f49.google.com (mail-bk0-f49.google.com [209.85.214.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 39B019EC00 for ; Thu, 6 Sep 2012 01:17:26 -0700 (PDT) Received: by bkcji2 with SMTP id ji2so643797bkc.36 for ; Thu, 06 Sep 2012 01:17:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=e8TZEu0/kujBtc2tgVWilYjvwBPA2x4qs3hG20nHke0=; b=A1ZBYbreYgi158qYyBUXb1dQlBY7YR1Slsg0t//qasVAjAvkpajvw3ZLMcnHT8MruK 9Sq7hAhoDyxOZOdllOIFWW6dQIfJSGXFikcKypQavZT5Hk1/gxcnivw4ncR/7DdXTYfX xU6DVMvXC3nNBPMnrAy6fNTtJrVQ7L4l3asNk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=e8TZEu0/kujBtc2tgVWilYjvwBPA2x4qs3hG20nHke0=; b=deT8tFZ09FAL9VFJUBQS/WCjbr5lO3n6WlKVcnvhbIyrdsLjz0CtC/itS3iOG+MsoA mv0Ir1DNyH5TNKT/GrhnlT+gb70kjM8y3VIaaONdW9P+b7d2Ye32PXwIym3rfrxWWENc 1FRXN5eUdhX/w2pS5vM0On7x6RKGzmXoT6/eORg9kJLBoDsJe85Y5VjzhEFGUivCw0/h PaNdO4LTEqzMR6Q3BbQVVl18gOISSr86wvi0gmC39bWnS6hPqxXgw/5erw52io9e8IJl m8F3vX8qxPKQ/3Xy72+n5yICW/G6dG0ZqU4dRG+PWTvHNyqt/3TDewaCTDA+H1zUrDUO UJoA== Received: by 10.204.10.92 with SMTP id o28mr357751bko.39.1346919445209; Thu, 06 Sep 2012 01:17:25 -0700 (PDT) Received: from wespe.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id hg13sm485182bkc.7.2012.09.06.01.17.23 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Sep 2012 01:17:24 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Thu, 6 Sep 2012 09:10:00 +0200 Message-Id: <1346915402-9399-2-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.11.2 In-Reply-To: <1346915402-9399-1-git-send-email-daniel.vetter@ffwll.ch> References: <1346915402-9399-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQnHWcLgjftkxmqKqLqWr+vrSmnPpFCyZqpOSmAFbJ46qz6ntOr2F1whUHTQMxpqOEGPYVuG Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 2/4] drm/i915: wire up gmbus irq handler 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 Only enables the interrupt and puts a irq handler into place, doesn't do anything yet. Unfortunately there's no gmbus interrupt support for gen2/3 (safe for pnv, but there the irq is marked as "Test mode"). Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/i915_irq.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index a61b41a..8415fa6 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -596,6 +596,11 @@ out: return ret; } +static void gmbus_irq_handler(struct drm_device *dev) +{ + DRM_DEBUG_DRIVER("GMBUS interrupt\n"); +} + static void ibx_irq_handler(struct drm_device *dev, u32 pch_iir) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; @@ -607,7 +612,7 @@ static void ibx_irq_handler(struct drm_device *dev, u32 pch_iir) SDE_AUDIO_POWER_SHIFT); if (pch_iir & SDE_GMBUS) - DRM_DEBUG_DRIVER("PCH GMBUS interrupt\n"); + gmbus_irq_handler(dev); if (pch_iir & SDE_AUDIO_HDCP_MASK) DRM_DEBUG_DRIVER("PCH HDCP audio interrupt\n"); @@ -650,7 +655,7 @@ static void cpt_irq_handler(struct drm_device *dev, u32 pch_iir) DRM_DEBUG_DRIVER("AUX channel interrupt\n"); if (pch_iir & SDE_GMBUS_CPT) - DRM_DEBUG_DRIVER("PCH GMBUS interrupt\n"); + gmbus_irq_handler(dev); if (pch_iir & SDE_AUDIO_CP_REQ_CPT) DRM_DEBUG_DRIVER("Audio CP request interrupt\n"); @@ -1841,12 +1846,14 @@ static int ironlake_irq_postinstall(struct drm_device *dev) hotplug_mask = (SDE_CRT_HOTPLUG_CPT | SDE_PORTB_HOTPLUG_CPT | SDE_PORTC_HOTPLUG_CPT | - SDE_PORTD_HOTPLUG_CPT); + SDE_PORTD_HOTPLUG_CPT | + SDE_GMBUS_CPT); } else { hotplug_mask = (SDE_CRT_HOTPLUG | SDE_PORTB_HOTPLUG | SDE_PORTC_HOTPLUG | SDE_PORTD_HOTPLUG | + SDE_GMBUS | SDE_AUX_MASK); } @@ -1906,7 +1913,8 @@ static int ivybridge_irq_postinstall(struct drm_device *dev) hotplug_mask = (SDE_CRT_HOTPLUG_CPT | SDE_PORTB_HOTPLUG_CPT | SDE_PORTC_HOTPLUG_CPT | - SDE_PORTD_HOTPLUG_CPT); + SDE_PORTD_HOTPLUG_CPT | + SDE_GMBUS_CPT); dev_priv->pch_irq_mask = ~hotplug_mask; I915_WRITE(SDEIIR, I915_READ(SDEIIR)); @@ -1959,6 +1967,7 @@ static int valleyview_irq_postinstall(struct drm_device *dev) POSTING_READ(VLV_IER); i915_enable_pipestat(dev_priv, 0, pipestat_enable); + i915_enable_pipestat(dev_priv, 0, PIPE_GMBUS_INTERRUPT_STATUS); i915_enable_pipestat(dev_priv, 1, pipestat_enable); I915_WRITE(VLV_IIR, 0xffffffff); @@ -2454,6 +2463,7 @@ static int i965_irq_postinstall(struct drm_device *dev) dev_priv->pipestat[0] = 0; dev_priv->pipestat[1] = 0; + i915_enable_pipestat(dev_priv, 0, PIPE_GMBUS_INTERRUPT_STATUS); /* * Enable some error detection, note the instruction error mask