From patchwork Tue Mar 26 23:44:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 2346611 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 7F7FA3FC54 for ; Tue, 26 Mar 2013 23:44:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2EFFCE6025 for ; Tue, 26 Mar 2013 16:44:49 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com [74.125.83.49]) by gabe.freedesktop.org (Postfix) with ESMTP id BBEB0E5D15 for ; Tue, 26 Mar 2013 16:44:38 -0700 (PDT) Received: by mail-ee0-f49.google.com with SMTP id d41so3953211eek.36 for ; Tue, 26 Mar 2013 16:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=oh7k8XP+2xx6Rqw42npnec9oNP/vVuoztLC2Dp9quu4=; b=HtSoZkZ8qvVAcgdfNh0J+xRUh7TSlqmCG5r2vMyRuKpian0dWTtZtHwzBKLMlFrgyp +cBus93yQN82lKw7YrmFww1aR31/Nk3mU012Ha8hUMlCqnlK76C1drq7lE0YkV+gBlqu cyW4GSeieRwS4Jfp4rNCxb0j1MoGaHFOhZr78= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=oh7k8XP+2xx6Rqw42npnec9oNP/vVuoztLC2Dp9quu4=; b=Na9wHtOMn48A1abOfIgUd+xeYa2BWGhPaFDcdcTcSyr2AgUZGk8glpq4uugV+9C8ar NbVRlIq1Vj64uiSI9EhWWXD0qA79Y0kBH15xh7gLWyVzI+L1SzVeU67d5Nfh0Jz4P4Zi xDE9D+NsR4lFwQjkYblefIWlhBFpQTBmdyMLnVOvgz684Y1zxib850pS3neAEKM4HwcW 2+sFQZX6z1L+i4HltzZvaDPVA1i9utTf+x7sEU4X1sEVe9T+87s06LTDN1zKaF1w6u/S iRmEPmWS0cspp+I5FtvhtKHgvj6m9VYEDd9JlW6+F+wx7BFT5UI8mRuWsTd8J1bpjoRg k6eA== X-Received: by 10.15.81.136 with SMTP id x8mr50025339eey.9.1364341477971; Tue, 26 Mar 2013 16:44:37 -0700 (PDT) Received: from bremse.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id r4sm27941686eeo.12.2013.03.26.16.44.35 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 26 Mar 2013 16:44:37 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Wed, 27 Mar 2013 00:44:30 +0100 Message-Id: <1364341470-1106-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.11.7 X-Gm-Message-State: ALoCoQnt6LGHc1HZbL5orHBhYFGZ2MKn1qhoqPthATjGkcIAHEVDcc56P0lDWNBzpttPhwgyciI1 Cc: Egbert Eich , Daniel Vetter Subject: [Intel-gfx] [PATCH] drm/i915: implement ibx_hpd_irq_setup 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 Due to the irq setup rework in 3.9 Egbert's hpd rework blows up on pch-split platforms. The new init sequence is: - irq enabling - modeset init - hpd setup We need to move around the ibx setup a bit to fix this. This needs to be squashed into a commit on dinq. Cc: Egbert Eich Cc: Jesse Barnes Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/i915_irq.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 43436e0..1279a44 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -2084,7 +2084,7 @@ static void ibx_enable_hotplug(struct drm_device *dev) I915_WRITE(PCH_PORT_HOTPLUG, hotplug); } -static void ibx_irq_postinstall(struct drm_device *dev) +static void ibx_hpd_irq_setup(struct drm_device *dev) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; struct drm_mode_config *mode_config = &dev->mode_config; @@ -2095,12 +2095,10 @@ static void ibx_irq_postinstall(struct drm_device *dev) mask &= ~SDE_HOTPLUG_MASK; list_for_each_entry(intel_encoder, &mode_config->encoder_list, base.head) mask |= hpd_ibx[intel_encoder->hpd_pin]; - mask |= SDE_GMBUS | SDE_AUX_MASK; } else { mask &= ~SDE_HOTPLUG_MASK_CPT; list_for_each_entry(intel_encoder, &mode_config->encoder_list, base.head) mask |= hpd_cpt[intel_encoder->hpd_pin]; - mask |= SDE_GMBUS_CPT | SDE_AUX_MASK_CPT; } I915_WRITE(SDEIIR, I915_READ(SDEIIR)); I915_WRITE(SDEIMR, ~mask); @@ -2110,6 +2108,21 @@ static void ibx_irq_postinstall(struct drm_device *dev) ibx_enable_hotplug(dev); } +static void ibx_irq_postinstall(struct drm_device *dev) +{ + drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; + u32 mask = I915_READ(SDEIER); + + if (HAS_PCH_IBX(dev)) + mask |= SDE_GMBUS | SDE_AUX_MASK; + else + mask |= SDE_GMBUS_CPT | SDE_AUX_MASK_CPT; + I915_WRITE(SDEIIR, I915_READ(SDEIIR)); + I915_WRITE(SDEIMR, ~mask); + I915_WRITE(SDEIER, mask); + POSTING_READ(SDEIER); +} + static int ironlake_irq_postinstall(struct drm_device *dev) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; @@ -2960,6 +2973,7 @@ void intel_irq_init(struct drm_device *dev) dev->driver->irq_uninstall = ironlake_irq_uninstall; dev->driver->enable_vblank = ivybridge_enable_vblank; dev->driver->disable_vblank = ivybridge_disable_vblank; + dev_priv->display.hpd_irq_setup = ibx_hpd_irq_setup; } else if (HAS_PCH_SPLIT(dev)) { dev->driver->irq_handler = ironlake_irq_handler; dev->driver->irq_preinstall = ironlake_irq_preinstall; @@ -2967,6 +2981,7 @@ void intel_irq_init(struct drm_device *dev) dev->driver->irq_uninstall = ironlake_irq_uninstall; dev->driver->enable_vblank = ironlake_enable_vblank; dev->driver->disable_vblank = ironlake_disable_vblank; + dev_priv->display.hpd_irq_setup = ibx_hpd_irq_setup; } else { if (INTEL_INFO(dev)->gen == 2) { dev->driver->irq_preinstall = i8xx_irq_preinstall;