From patchwork Fri Nov 3 18:09:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: oscar.mateo@intel.com X-Patchwork-Id: 10040999 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E596A603D7 for ; Fri, 3 Nov 2017 18:09:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD8E428F73 for ; Fri, 3 Nov 2017 18:09:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D273328F9E; Fri, 3 Nov 2017 18:09:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 74DED28F73 for ; Fri, 3 Nov 2017 18:09:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9F7B86EB02; Fri, 3 Nov 2017 18:09:45 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id C85116EAEC for ; Fri, 3 Nov 2017 18:09:41 +0000 (UTC) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP; 03 Nov 2017 11:09:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,339,1505804400"; d="scan'208";a="169033938" Received: from omateolo-linux.fm.intel.com ([10.1.27.13]) by orsmga005.jf.intel.com with ESMTP; 03 Nov 2017 11:09:35 -0700 From: Oscar Mateo To: intel-gfx@lists.freedesktop.org Date: Fri, 3 Nov 2017 11:09:37 -0700 Message-Id: <1509732588-10599-10-git-send-email-oscar.mateo@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509732588-10599-1-git-send-email-oscar.mateo@intel.com> References: <1509732588-10599-1-git-send-email-oscar.mateo@intel.com> Subject: [Intel-gfx] [RFC PATCH 09/20] drm/i915: Do not store the total counts of WAs X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Simply recalculate as needed so that we can remove the workarounds structure in dev_priv. Signed-off-by: Oscar Mateo --- drivers/gpu/drm/i915/i915_debugfs.c | 34 ++++++++++++++++++++++++-------- drivers/gpu/drm/i915/i915_drv.h | 9 --------- drivers/gpu/drm/i915/intel_workarounds.c | 4 ---- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 8a6fef4..8fa8c68 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -3392,11 +3392,28 @@ static void check_wa_registers(struct seq_file *m, } } +static uint count_wa_registers(const struct i915_wa_reg_table *wa_table, + uint table_count) +{ + uint total = 0; + int i, j; + + for (i = 0; i < table_count; i++) { + const struct i915_wa_reg *wa = wa_table[i].table; + + for (j = 0; j < wa_table[i].count; j++) { + if (wa[j].applied) + total++; + } + } + + return total; +} + static int i915_wa_registers(struct seq_file *m, void *unused) { struct drm_i915_private *dev_priv = node_to_i915(m->private); struct drm_device *dev = &dev_priv->drm; - struct i915_workarounds *workarounds = &dev_priv->workarounds; const struct i915_wa_reg_table *wa_table; uint table_count; int i, j, ret; @@ -3407,9 +3424,9 @@ static int i915_wa_registers(struct seq_file *m, void *unused) intel_runtime_pm_get(dev_priv); - seq_printf(m, "Context workarounds applied: %d\n", - workarounds->ctx_count); intel_ctx_workarounds_get(dev_priv, &wa_table, &table_count); + seq_printf(m, "Context workarounds applied: %d\n", + count_wa_registers(wa_table, table_count)); for (i = 0; i < table_count; i++) { const struct i915_wa_reg *wa = wa_table[i].table; @@ -3427,20 +3444,21 @@ static int i915_wa_registers(struct seq_file *m, void *unused) intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL); - seq_printf(m, "GT workarounds applied: %d\n", workarounds->gt_count); intel_gt_workarounds_get(dev_priv, &wa_table, &table_count); + seq_printf(m, "GT workarounds applied: %d\n", + count_wa_registers(wa_table, table_count)); check_wa_registers(m, wa_table, table_count); seq_putc(m, '\n'); - seq_printf(m, "Display workarounds applied: %d\n", - workarounds->disp_count); intel_display_workarounds_get(dev_priv, &wa_table, &table_count); + seq_printf(m, "Display workarounds applied: %d\n", + count_wa_registers(wa_table, table_count)); check_wa_registers(m, wa_table, table_count); seq_putc(m, '\n'); - seq_printf(m, "Whitelist workarounds applied: %d\n", - workarounds->hw_whitelist_count[RCS]); intel_whitelist_workarounds_get(dev_priv, &wa_table, &table_count); + seq_printf(m, "Whitelist workarounds applied: %d\n", + count_wa_registers(wa_table, table_count)); check_wa_registers(m, wa_table, table_count); seq_putc(m, '\n'); diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index f781d1c..7efb59b 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -2007,13 +2007,6 @@ struct i915_wa_reg_table { int count; }; -struct i915_workarounds { - u32 ctx_count; - u32 gt_count; - u32 disp_count; - u32 hw_whitelist_count[I915_NUM_ENGINES]; -}; - struct i915_virtual_gpu { bool active; u32 caps; @@ -2452,8 +2445,6 @@ struct drm_i915_private { int dpio_phy_iosf_port[I915_NUM_PHYS_VLV]; - struct i915_workarounds workarounds; - struct i915_frontbuffer_tracking fb_tracking; struct intel_atomic_helper { diff --git a/drivers/gpu/drm/i915/intel_workarounds.c b/drivers/gpu/drm/i915/intel_workarounds.c index 5a532a0..74e59bb 100644 --- a/drivers/gpu/drm/i915/intel_workarounds.c +++ b/drivers/gpu/drm/i915/intel_workarounds.c @@ -551,7 +551,6 @@ static uint ctx_workarounds_init(struct drm_i915_private *dev_priv, } } - dev_priv->workarounds.ctx_count = total_count; DRM_DEBUG_DRIVER("Number of context specific w/a: %u\n", total_count); return total_count; @@ -868,7 +867,6 @@ void intel_gt_workarounds_apply(struct drm_i915_private *dev_priv) intel_gt_workarounds_get(dev_priv, &wa_table, &table_count); total_count = mmio_workarounds_apply(dev_priv, wa_table, table_count); - dev_priv->workarounds.gt_count = total_count; DRM_DEBUG_DRIVER("Number of GT specific w/a: %u\n", total_count); } @@ -988,7 +986,6 @@ void intel_display_workarounds_apply(struct drm_i915_private *dev_priv) intel_display_workarounds_get(dev_priv, &wa_table, &table_count); total_count = mmio_workarounds_apply(dev_priv, wa_table, table_count); - dev_priv->workarounds.disp_count = total_count; DRM_DEBUG_DRIVER("Number of Display specific w/a: %u\n", total_count); } @@ -1133,7 +1130,6 @@ int intel_whitelist_workarounds_apply(struct intel_engine_cs *engine) } } - dev_priv->workarounds.hw_whitelist_count[engine->id] = total_count; DRM_DEBUG_DRIVER("%s: Number of whitelist w/a: %u\n", engine->name, total_count);