From: Ben Widawsky <benjamin.widawsky@intel.com>
To: Intel GFX <intel-gfx@lists.freedesktop.org>
Cc: Ben Widawsky <ben@bwidawsk.net>,
DRI Development <dri-devel@lists.freedesktop.org>,
Ben Widawsky <benjamin.widawsky@intel.com>
Subject: [PATCH 5/6] drm/i915: Move forcewake debugfs setup also
Date: Tue, 21 Jan 2014 12:33:21 -0800 [thread overview]
Message-ID: <1390336402-2049-5-git-send-email-benjamin.widawsky@intel.com> (raw)
In-Reply-To: <1390336402-2049-1-git-send-email-benjamin.widawsky@intel.com>
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 <ben@bwidawsk.net>
---
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];
--
1.8.5.3
next prev parent reply other threads:[~2014-01-21 20:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-14 14:14 [PATCH 1/2] drm: share drm_add_fake_info_node Ben Widawsky
2014-01-14 14:14 ` [PATCH 2/2] drm/i915: Move pipecrc debug functions to new file Ben Widawsky
2014-01-14 23:28 ` Daniel Vetter
2014-01-15 1:22 ` Damien Lespiau
2014-01-15 8:46 ` Daniel Vetter
2014-01-15 20:04 ` Ben Widawsky
2014-01-14 23:25 ` [Intel-gfx] [PATCH 1/2] drm: share drm_add_fake_info_node Daniel Vetter
2014-01-14 23:40 ` Russell King - ARM Linux
2014-01-15 8:39 ` [Intel-gfx] " Daniel Vetter
2014-01-15 8:45 ` Daniel Vetter
2014-01-15 20:08 ` Ben Widawsky
2014-01-15 23:42 ` [Intel-gfx] " Daniel Vetter
2014-01-21 19:05 ` Ben Widawsky
2014-01-21 20:33 ` [PATCH 1/6] drm: Create a debugfs file creation helper Ben Widawsky
2014-01-21 20:33 ` [PATCH 4/6] drm/i915: Use new drm debugfs file helper Ben Widawsky
2014-01-21 20:33 ` Ben Widawsky [this message]
2014-01-21 20:33 ` [PATCH 6/6] drm/i915: Move pipecrc debug functions to new file Ben Widawsky
2014-01-21 21:44 ` Damien Lespiau
2014-01-21 21:50 ` Damien Lespiau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1390336402-2049-5-git-send-email-benjamin.widawsky@intel.com \
--to=benjamin.widawsky@intel.com \
--cc=ben@bwidawsk.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox