From patchwork Tue Feb 19 19:13:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 2164811 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 96544DF24C for ; Tue, 19 Feb 2013 19:13:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 69B53E65E1 for ; Tue, 19 Feb 2013 11:13:50 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-gh0-f175.google.com (mail-gh0-f175.google.com [209.85.160.175]) by gabe.freedesktop.org (Postfix) with ESMTP id 67B57E651A for ; Tue, 19 Feb 2013 11:13:42 -0800 (PST) Received: by mail-gh0-f175.google.com with SMTP id g18so859838ghb.20 for ; Tue, 19 Feb 2013 11:13:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=MuKDyOsXxsoLYWdDoj+fL3hjwesRvFDlmA6CfhK4Xhs=; b=NS+oTLZm67RDaJOvSVEHznv0RXcf5SycQ+EdkvBfF2CvmioH+NO3h3JcD/LUVTm0zO jMPzwZoH2TeK6O+La8pL2FBvzsFGQXqxiOx+UTTy2isIPFTBSyKbi7CdMYiFjCE1Vfga M8Hwn3n/NWDnF9bt0O7hDPitpHOptRyAFWiUmMFbfDI4ysg2Xf7HPM88BoWZXpyRVxQl IeUxk8d8FOJFQwbIR0OUNlTBqdDUfjYMgLXBeW7MJUw1CAilXqg48d9EpY0ZPKLbPsDb MMMndIW6qDkqSzgpbBnIx/iQQKT13rQXllKyigQzHKyNn73aaS3Vd+UYijjfivv9w3oF 9b0g== X-Received: by 10.236.188.230 with SMTP id a66mr30989073yhn.81.1361301221615; Tue, 19 Feb 2013 11:13:41 -0800 (PST) Received: from localhost.localdomain ([177.96.10.96]) by mx.google.com with ESMTPS id j1sm126370359yhn.3.2013.02.19.11.13.39 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Feb 2013 11:13:40 -0800 (PST) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Tue, 19 Feb 2013 16:13:35 -0300 Message-Id: <1361301215-3792-1-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1361224828-3730-4-git-send-email-przanoni@gmail.com> References: <1361224828-3730-4-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH 3/7] drm/i915: clear the FPGA_DBG_RM_NOCLAIM bit at driver init 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: Paulo Zanoni Otherwise, if the BIOS did anything wrong, our first I915_{WRITE,READ} will give us "unclaimed register" messages. V2: Even earlier. V3: Move it to intel_early_sanitize_regs. Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=58897 Signed-off-by: Paulo Zanoni --- drivers/gpu/drm/i915/i915_dma.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 4fa6beb..e16099b 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c @@ -1453,6 +1453,22 @@ static void i915_dump_device_info(struct drm_i915_private *dev_priv) } /** + * intel_early_sanitize_regs - clean up BIOS state + * @dev: DRM device + * + * This function must be called before we do any I915_READ or I915_WRITE. Its + * purpose is to clean up any state left by the BIOS that may affect us when + * reading and/or writing registers. + */ +static void intel_early_sanitize_regs(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + + if (IS_HASWELL(dev)) + I915_WRITE_NOTRACE(FPGA_DBG, FPGA_DBG_RM_NOCLAIM); +} + +/** * i915_driver_load - setup chip and create an initial config * @dev: DRM device * @flags: startup flags @@ -1542,6 +1558,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) goto put_gmch; } + intel_early_sanitize_regs(dev); + aperture_size = dev_priv->gtt.mappable_end; dev_priv->gtt.mappable =