From patchwork Fri Aug 31 19:42:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1394321 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 AC5C2DFFCF for ; Fri, 31 Aug 2012 19:42:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 95813A0AD2 for ; Fri, 31 Aug 2012 12:42:48 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 22691A08B1 for ; Fri, 31 Aug 2012 12:42:01 -0700 (PDT) Received: by wgbdr1 with SMTP id dr1so2044604wgb.12 for ; Fri, 31 Aug 2012 12:42:01 -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; bh=eLOuLl3Dju8w00xYIvSsTt0dWWqdm6dzXg7NKrx2bxg=; b=PSzfBtv8sTDe6M/sEI8ilJr7Kw7guWXOZjHinoB87YvqqaT59iGei/yU1Jr0AMeZZl tcNf6HinepCyPGtW2KL/GtArHKRQanDe+06T1uQpsGHpxUgm8nZ8fcCQ8UGub2nCTiNJ w6rdo6jp45bQOxl+yhl+RMgIcXnUXZfxdir28= 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:x-gm-message-state; bh=eLOuLl3Dju8w00xYIvSsTt0dWWqdm6dzXg7NKrx2bxg=; b=duAYh63FID6B719v56aOJUl+OHIhOuHdegwhHaB/Q8ynNNa472Iu9zL12GuxhYBUFP 2Gw6Skr7eznqY/NJqkb8bGCxunP62XpSAvcwwZzSyAfF2ytm5qYZsgWGP35qzsgoCU3S ewDbkR81x3AFnwXZjaKSrkebHx9trDLf8TKGGgzc3d/awGJCjapvhulx44egqFoMSTCL xZx9Xz+vbG70RC/q03RlKWwOzKCMYqwpGab2W+PRAkcdBZvOC+X1X53/z/8CjhvxYSlS egtNMN2ahh2hdko4Zoh+bglgyM48xkbCZutfdOxSRTDqAHddn2Uje3PcsTr1HMEjOwJk /Bag== Received: by 10.217.3.71 with SMTP id q49mr5558593wes.33.1346442121003; Fri, 31 Aug 2012 12:42:01 -0700 (PDT) Received: from phenom.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id el6sm2531985wib.8.2012.08.31.12.41.59 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 31 Aug 2012 12:42:00 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Fri, 31 Aug 2012 21:42:26 +0200 Message-Id: <1346442146-11748-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQn7+TXcMm1Ebgwud+/OzmY+UN55fXAH+f1xh+Fd68w+G06qCGE0peVLaA6NGP/SYQhM5JTR Cc: Daniel Vetter , Ben Widawsky Subject: [Intel-gfx] [PATCH] drm/i915: move i915_get_extra_insdone out of CONFIG_DEBUG_FS block 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 Otherwise it just won't compile ... Reported-by: Fengguang Wu Cc: Ben Widawsky Signed-off-by: Daniel Vetter Reviewed-by: Ben Widawsky --- drivers/gpu/drm/i915/i915_irq.c | 59 +++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 72093ba..d601013 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -853,6 +853,35 @@ static void i915_error_work_func(struct work_struct *work) } } +/* NB: please notice the memset */ +static void i915_get_extra_instdone(struct drm_device *dev, + uint32_t *instdone) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + memset(instdone, 0, sizeof(*instdone) * I915_NUM_INSTDONE_REG); + + switch(INTEL_INFO(dev)->gen) { + case 2: + case 3: + instdone[0] = I915_READ(INSTDONE); + break; + case 4: + case 5: + case 6: + instdone[0] = I915_READ(INSTDONE_I965); + instdone[1] = I915_READ(INSTDONE1); + break; + default: + WARN_ONCE(1, "Unsupported platform\n"); + case 7: + instdone[0] = I915_READ(GEN7_INSTDONE_1); + instdone[1] = I915_READ(GEN7_SC_INSTDONE); + instdone[2] = I915_READ(GEN7_SAMPLER_INSTDONE); + instdone[3] = I915_READ(GEN7_ROW_INSTDONE); + break; + } +} + #ifdef CONFIG_DEBUG_FS static struct drm_i915_error_object * i915_error_object_create(struct drm_i915_private *dev_priv, @@ -1070,36 +1099,6 @@ i915_error_first_batchbuffer(struct drm_i915_private *dev_priv, return NULL; } -/* NB: please notice the memset */ -static void i915_get_extra_instdone(struct drm_device *dev, - uint32_t *instdone) -{ - struct drm_i915_private *dev_priv = dev->dev_private; - memset(instdone, 0, sizeof(*instdone) * I915_NUM_INSTDONE_REG); - - switch(INTEL_INFO(dev)->gen) { - case 2: - case 3: - instdone[0] = I915_READ(INSTDONE); - break; - case 4: - case 5: - case 6: - instdone[0] = I915_READ(INSTDONE_I965); - instdone[1] = I915_READ(INSTDONE1); - break; - default: - WARN_ONCE(1, "Unsupported platform\n"); - case 7: - instdone[0] = I915_READ(GEN7_INSTDONE_1); - instdone[1] = I915_READ(GEN7_SC_INSTDONE); - instdone[2] = I915_READ(GEN7_SAMPLER_INSTDONE); - instdone[3] = I915_READ(GEN7_ROW_INSTDONE); - break; - } -} - - static void i915_record_ring_state(struct drm_device *dev, struct drm_i915_error_state *error, struct intel_ring_buffer *ring)