From patchwork Thu Sep 26 23:06:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 2951811 Return-Path: X-Original-To: patchwork-dri-devel@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 D4E45BFF0B for ; Thu, 26 Sep 2013 23:15:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F357A202EA for ; Thu, 26 Sep 2013 23:15:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2CDBE202E6 for ; Thu, 26 Sep 2013 23:15:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D7F3BE6455 for ; Thu, 26 Sep 2013 16:15:56 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qc0-f173.google.com (mail-qc0-f173.google.com [209.85.216.173]) by gabe.freedesktop.org (Postfix) with ESMTP id 6CD81E7F3A; Thu, 26 Sep 2013 16:07:02 -0700 (PDT) Received: by mail-qc0-f173.google.com with SMTP id c3so1242869qcv.18 for ; Thu, 26 Sep 2013 16:07:02 -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=EN3SDLxAtTke0unTQA6JCoV3beHgOnyh05xJDucWF3w=; b=Yjmj3oiWKa8g49upH9R0YdmNYHHI+BfI4CSuGHx6qRArTUEss5nmSv5CcIxjmVPzk1 Aq7SMqF/o+9xePNjBb8uazTIc4z9ZDPuTJnYu+ZGNIjcjDOm1uZL8IDgrRQCPYS3Zbkx 2Ievh2u4PbKggU9dYyWNFByErtbwYmZNFkSe0kswdgsUFcrzxe+jo4i2cR2tRkqQynNm EgJG5JKzCihZkiG0f6pdUAM+HlzTyFPQYdIcvBwq2s1VfJawH3bt2/Z2EJN5comAs7fO JWgz2dbIKh0LCK363vGqGzWVYKlECw9DlJU6ZZujvPP/+mNClMA7ovOMJ3F3MK328VTR UBfQ== X-Received: by 10.224.15.202 with SMTP id l10mr8781118qaa.24.1380236822205; Thu, 26 Sep 2013 16:07:02 -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:07:01 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Subject: [PATCH 5/5] drm/i915: put/get the power well at the FB bind/unbind functions Date: Thu, 26 Sep 2013 20:06:02 -0300 Message-Id: <1380236762-1698-6-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 If we run the following command on Haswell when the power well is disabled: echo 0 > /sys/class/vtconsole/vtcon1/bind then we'll get thousands of consecutive interrupts because something is trying to touch registers that are on the disabled power well. So before we unbind the console, we need to enable the power well to make the VGA interface work correctly. With this, whoever is using it doesn't trigger interrupts on i915.ko. Fixes regression introduced by: commit bf51d5e2cda5d36d98e4b46ac7fca9461e512c41 Author: Paulo Zanoni drm/i915: switch disable_power_well default value to 1 Besides the command above, the "module_reload" test from intel-gpu-tools can also be used to reproduce the bug fixed by this patch. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67813 Signed-off-by: Paulo Zanoni --- drivers/gpu/drm/i915/intel_drv.h | 1 + drivers/gpu/drm/i915/intel_fb.c | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index e63646a..a643c48 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -113,6 +113,7 @@ struct intel_fbdev { struct intel_framebuffer ifb; struct list_head fbdev_list; struct drm_display_mode *our_mode; + bool first_bind_done; }; struct intel_encoder { diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c index d883b77..8c6ed1c 100644 --- a/drivers/gpu/drm/i915/intel_fb.c +++ b/drivers/gpu/drm/i915/intel_fb.c @@ -43,6 +43,27 @@ #include #include "i915_drv.h" +static void intel_fb_bind(struct fb_info *info) +{ + struct drm_fb_helper *drm_helper = info->par; + struct drm_device *dev = drm_helper->dev; + struct intel_fbdev *ifbdev = + container_of(drm_helper, struct intel_fbdev, helper); + + if (ifbdev->first_bind_done) + intel_display_power_put(dev, POWER_DOMAIN_VGA); + else + ifbdev->first_bind_done = true; +} + +static void intel_fb_unbind(struct fb_info *info) +{ + struct drm_fb_helper *fb_helper = info->par; + struct drm_device *dev = fb_helper->dev; + + intel_display_power_get(dev, POWER_DOMAIN_VGA); +} + static struct fb_ops intelfb_ops = { .owner = THIS_MODULE, .fb_check_var = drm_fb_helper_check_var, @@ -55,6 +76,8 @@ static struct fb_ops intelfb_ops = { .fb_setcmap = drm_fb_helper_setcmap, .fb_debug_enter = drm_fb_helper_debug_enter, .fb_debug_leave = drm_fb_helper_debug_leave, + .fb_bind = intel_fb_bind, + .fb_unbind = intel_fb_unbind, }; static int intelfb_create(struct drm_fb_helper *helper,