From patchwork Thu Sep 26 23:05:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 2951721 Return-Path: X-Original-To: patchwork-dri-devel@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 A91C59F289 for ; Thu, 26 Sep 2013 23:09:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B49B8202EA for ; Thu, 26 Sep 2013 23:09:10 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id ABB5C202E6 for ; Thu, 26 Sep 2013 23:09:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5E585E7F6D for ; Thu, 26 Sep 2013 16:09:09 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qe0-f43.google.com (mail-qe0-f43.google.com [209.85.128.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 765ECE7F4D; Thu, 26 Sep 2013 16:06:38 -0700 (PDT) Received: by mail-qe0-f43.google.com with SMTP id gh4so1340444qeb.30 for ; Thu, 26 Sep 2013 16:06:38 -0700 (PDT) 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=gj+A3LmbCATOy36Btc0vObGVi1tg0r1DfG3FGj9M63k=; b=sPJUkNjahER51lvOkGrCkITJfTWtmw77ysUfDYS+DgDJ4vFNQMJiPIAzyoNo8T1VA/ UnUBUXImzYICtoQDw5IKyQPDDqtdmM3ZScHYXu9BTKdZZ4xmbcB9sPQVcKgtfA2XHWQ5 4OD8wn/dUQtL3TtIeVChj/krnpZYqO3s6y1uxalY3qKcrYUZb4bqag4juK9LhuMI0yPM XF0+2ICsZ08gA02gPDkvE9j3ApIfOLL9NyJB+15LGimQ4sCbWtEhrc8brAyBR6cc11/D dK4E3JyIqzNSzTN39FsZtBzaxneNIgmzCRuH9OhWp2t4FD9p7qEialBKCzLiBJWOEcEx /6Ig== X-Received: by 10.229.219.199 with SMTP id hv7mr4976564qcb.15.1380236798120; Thu, 26 Sep 2013 16:06:38 -0700 (PDT) Received: from localhost.localdomain ([187.112.183.101]) by mx.google.com with ESMTPSA id m6sm12528338qaa.13.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 26 Sep 2013 16:06:37 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Subject: [PATCH 1/5] drm/i915: redisable VGA when we disable the power well Date: Thu, 26 Sep 2013 20:05:58 -0300 Message-Id: <1380236762-1698-2-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1380236762-1698-1-git-send-email-przanoni@gmail.com> References: <1380236762-1698-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-6.5 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 From: Paulo Zanoni VGA whack-a-mole! We need VGA to be disabled whenever our driver is working. So even without reproducible bugs this patch makes sense, but we do have a bug solved by this patch. If you boot a Haswell machine with eDP+HDMI, then kill your display manager and run: echo 0 > /sys/class/vtconsole/vtcon1/bind you'll get thousands of "unclaimed register" messages. Notice that since we have eDP+HDMI, the power well is *enabled* when we run the command, but if you look at dmesg you'll see that at some point during the boot we disabled it and then reenabled it. This patch solves this problem. I didn't do a deep analysis of the problem, but I guess vgacon gets seriously confused when it sees that the VGA plane is enabled. Besides the command above, this problem can also be reproduced by the "module_reload" test from intel-gpu-tools. Fixes regression introduced by: commit bf51d5e2cda5d36d98e4b46ac7fca9461e512c41 Author: Paulo Zanoni drm/i915: switch disable_power_well default value to 1 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67813 Signed-off-by: Paulo Zanoni --- drivers/gpu/drm/i915/intel_display.c | 2 +- drivers/gpu/drm/i915/intel_drv.h | 1 + drivers/gpu/drm/i915/intel_pm.c | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 665fa8f..065ffed 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -10232,7 +10232,7 @@ static void intel_init_quirks(struct drm_device *dev) } /* Disable the VGA plane that we never use */ -static void i915_disable_vga(struct drm_device *dev) +void i915_disable_vga(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; u8 sr1; diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index a17a86a..e63646a 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -678,6 +678,7 @@ void ironlake_check_encoder_dotclock(const struct intel_crtc_config *pipe_config, int dotclock); bool intel_crtc_active(struct drm_crtc *crtc); +void i915_disable_vga(struct drm_device *dev); void i915_disable_vga_mem(struct drm_device *dev); diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 2ac1c2f..7a8af95 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -5329,6 +5329,12 @@ static void __intel_set_power_well(struct drm_device *dev, bool enable) if (wait_for((I915_READ(HSW_PWR_WELL_DRIVER) & HSW_PWR_WELL_STATE_ENABLED), 20)) DRM_ERROR("Timeout enabling power well\n"); + + if (I915_READ(i915_vgacntrl_reg(dev)) != + VGA_DISP_DISABLE) { + i915_disable_vga(dev); + i915_disable_vga_mem(dev); + } } } else { if (enable_requested) {