Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293555
b: refs/heads/master
c: 6a9c308
h: refs/heads/master
i:
  293553: 92eeb68
  293551: dd3fb1e
v: v3
  • Loading branch information
Daniel Vetter committed Jan 29, 2012
1 parent b54250c commit f568cf5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 38 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 08e14e80d0229262063139a95209fa0dc354feaa
refs/heads/master: 6a9c308de0332b873720c629cb88f58d154b4f1d
55 changes: 18 additions & 37 deletions trunk/drivers/gpu/drm/i915/i915_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1637,21 +1637,6 @@ drm_add_fake_info_node(struct drm_minor *minor,
return 0;
}

static int i915_wedged_create(struct dentry *root, struct drm_minor *minor)
{
struct drm_device *dev = minor->dev;
struct dentry *ent;

ent = debugfs_create_file("i915_wedged",
S_IRUGO | S_IWUSR,
root, dev,
&i915_wedged_fops);
if (IS_ERR(ent))
return PTR_ERR(ent);

return drm_add_fake_info_node(minor, ent, &i915_wedged_fops);
}

static int i915_forcewake_open(struct inode *inode, struct file *file)
{
struct drm_device *dev = inode->i_private;
Expand Down Expand Up @@ -1713,34 +1698,22 @@ static int i915_forcewake_create(struct dentry *root, struct drm_minor *minor)
return drm_add_fake_info_node(minor, ent, &i915_forcewake_fops);
}

static int i915_max_freq_create(struct dentry *root, struct drm_minor *minor)
{
struct drm_device *dev = minor->dev;
struct dentry *ent;

ent = debugfs_create_file("i915_max_freq",
S_IRUGO | S_IWUSR,
root, dev,
&i915_max_freq_fops);
if (IS_ERR(ent))
return PTR_ERR(ent);

return drm_add_fake_info_node(minor, ent, &i915_max_freq_fops);
}

static int i915_cache_sharing_create(struct dentry *root, struct drm_minor *minor)
static int i915_debugfs_create(struct dentry *root,
struct drm_minor *minor,
const char *name,
const struct file_operations *fops)
{
struct drm_device *dev = minor->dev;
struct dentry *ent;

ent = debugfs_create_file("i915_cache_sharing",
ent = debugfs_create_file(name,
S_IRUGO | S_IWUSR,
root, dev,
&i915_cache_sharing_fops);
fops);
if (IS_ERR(ent))
return PTR_ERR(ent);

return drm_add_fake_info_node(minor, ent, &i915_cache_sharing_fops);
return drm_add_fake_info_node(minor, ent, fops);
}

static struct drm_info_list i915_debugfs_list[] = {
Expand Down Expand Up @@ -1789,17 +1762,25 @@ int i915_debugfs_init(struct drm_minor *minor)
{
int ret;

ret = i915_wedged_create(minor->debugfs_root, minor);
ret = i915_debugfs_create(minor->debugfs_root, minor,
"i915_wedged",
&i915_wedged_fops);
if (ret)
return ret;

ret = i915_forcewake_create(minor->debugfs_root, minor);
if (ret)
return ret;
ret = i915_max_freq_create(minor->debugfs_root, minor);

ret = i915_debugfs_create(minor->debugfs_root, minor,
"i915_max_freq",
&i915_max_freq_fops);
if (ret)
return ret;
ret = i915_cache_sharing_create(minor->debugfs_root, minor);

ret = i915_debugfs_create(minor->debugfs_root, minor,
"i915_cache_sharing",
&i915_cache_sharing_fops);
if (ret)
return ret;

Expand Down

0 comments on commit f568cf5

Please sign in to comment.