From patchwork Tue Jan 21 20:33:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 3519591 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 E3CF3C02DC for ; Tue, 21 Jan 2014 20:33:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 16A362013A for ; Tue, 21 Jan 2014 20:33:42 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DD73D20149 for ; Tue, 21 Jan 2014 20:33:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 37A15FB5D6; Tue, 21 Jan 2014 12:33:31 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 99C89FB5CD; Tue, 21 Jan 2014 12:33:25 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 21 Jan 2014 12:33:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.95,697,1384329600"; d="scan'208";a="442459561" Received: from ironside.jf.intel.com ([10.7.197.221]) by orsmga001.jf.intel.com with ESMTP; 21 Jan 2014 12:33:23 -0800 From: Ben Widawsky To: Intel GFX Subject: [PATCH 5/6] drm/i915: Move forcewake debugfs setup also Date: Tue, 21 Jan 2014 12:33:21 -0800 Message-Id: <1390336402-2049-5-git-send-email-benjamin.widawsky@intel.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1390336402-2049-1-git-send-email-benjamin.widawsky@intel.com> References: <1389708847-25038-1-git-send-email-benjamin.widawsky@intel.com> <1390336402-2049-1-git-send-email-benjamin.widawsky@intel.com> Cc: Ben Widawsky , DRI Development , Ben Widawsky 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@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 The forcewake setup is eerily similar, except it needs special mode flags. Inserting that info into our structure is trivial, and with that forcewake easily converts to using the new interface as well. Notice that CRC is lacking from this patch (CRC being very similar to forcewake in code). CRC is targeted for a new file, so there is no reason to move it. Signed-off-by: Ben Widawsky --- drivers/gpu/drm/i915/i915_debugfs.c | 48 +++++++++++-------------------------- 1 file changed, 14 insertions(+), 34 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 72b8388..d092631 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -3206,21 +3206,6 @@ static const struct file_operations i915_forcewake_fops = { .release = i915_forcewake_release, }; -static int i915_forcewake_create(struct dentry *root, struct drm_minor *minor) -{ - struct drm_device *dev = minor->dev; - struct dentry *ent; - - ent = debugfs_create_file("i915_forcewake_user", - S_IRUSR, - root, dev, - &i915_forcewake_fops); - if (!ent) - return -ENOMEM; - - return drm_add_fake_info_node(minor, ent, &i915_forcewake_fops); -} - static const struct drm_info_list i915_debugfs_list[] = { {"i915_capabilities", i915_capabilities, 0}, {"i915_gem_objects", i915_gem_object_info, 0}, @@ -3267,18 +3252,20 @@ static const struct drm_info_list i915_debugfs_list[] = { static const struct i915_debugfs_files { const char *name; const struct file_operations *fops; + umode_t mode; } i915_debugfs_files[] = { - {"i915_wedged", &i915_wedged_fops}, - {"i915_max_freq", &i915_max_freq_fops}, - {"i915_min_freq", &i915_min_freq_fops}, - {"i915_cache_sharing", &i915_cache_sharing_fops}, - {"i915_ring_stop", &i915_ring_stop_fops}, - {"i915_ring_missed_irq", &i915_ring_missed_irq_fops}, - {"i915_ring_test_irq", &i915_ring_test_irq_fops}, - {"i915_gem_drop_caches", &i915_drop_caches_fops}, - {"i915_error_state", &i915_error_state_fops}, - {"i915_next_seqno", &i915_next_seqno_fops}, - {"i915_display_crc_ctl", &i915_display_crc_ctl_fops}, + {"i915_wedged", &i915_wedged_fops, S_IRUGO | S_IWUSR}, + {"i915_max_freq", &i915_max_freq_fops, S_IRUGO | S_IWUSR}, + {"i915_min_freq", &i915_min_freq_fops, S_IRUGO | S_IWUSR}, + {"i915_cache_sharing", &i915_cache_sharing_fops, S_IRUGO | S_IWUSR}, + {"i915_ring_stop", &i915_ring_stop_fops, S_IRUGO | S_IWUSR}, + {"i915_ring_missed_irq", &i915_ring_missed_irq_fops, S_IRUGO | S_IWUSR}, + {"i915_ring_test_irq", &i915_ring_test_irq_fops, S_IRUGO | S_IWUSR}, + {"i915_gem_drop_caches", &i915_drop_caches_fops, S_IRUGO | S_IWUSR}, + {"i915_error_state", &i915_error_state_fops, S_IRUGO | S_IWUSR}, + {"i915_next_seqno", &i915_next_seqno_fops, S_IRUGO | S_IWUSR}, + {"i915_display_crc_ctl", &i915_display_crc_ctl_fops, S_IRUGO | S_IWUSR}, + {"i915_forcewake_user", &i915_forcewake_fops, S_IRUGO}, }; void intel_display_crc_init(struct drm_device *dev) @@ -3299,10 +3286,6 @@ int i915_debugfs_init(struct drm_minor *minor) { int ret, i; - ret = i915_forcewake_create(minor->debugfs_root, minor); - if (ret) - return ret; - for (i = 0; i < ARRAY_SIZE(i915_pipe_crc_data); i++) { ret = i915_pipe_crc_create(minor->debugfs_root, minor, i); if (ret) @@ -3313,7 +3296,7 @@ int i915_debugfs_init(struct drm_minor *minor) ret = drm_debugfs_create_file(minor->debugfs_root, minor, i915_debugfs_files[i].name, i915_debugfs_files[i].fops, - S_IRUGO | S_IWUSR); + i915_debugfs_files[i].mode); if (ret) return ret; } @@ -3330,9 +3313,6 @@ void i915_debugfs_cleanup(struct drm_minor *minor) drm_debugfs_remove_files(i915_debugfs_list, I915_DEBUGFS_ENTRIES, minor); - drm_debugfs_remove_files((struct drm_info_list *) &i915_forcewake_fops, - 1, minor); - for (i = 0; i < ARRAY_SIZE(i915_pipe_crc_data); i++) { struct drm_info_list *info_list = (struct drm_info_list *)&i915_pipe_crc_data[i];