diff options
author | Ben Gamari <bgamari@gmail.com> | 2009-02-17 20:08:49 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-03-13 00:24:07 -0400 |
commit | 955b12def42e83287c1bdb1411d99451753c1391 (patch) | |
tree | 5dc5025f500b7a0a86c70ea79f2294e94902e3b2 /drivers/gpu/drm/drm_stub.c | |
parent | dd8d7cb49e6e61da96ca44174b063081892c4dc6 (diff) |
drm: Convert proc files to seq_file and introduce debugfs
The old mechanism to formatting proc files is extremely ugly. The
seq_file API was designed specifically for cases like this and greatly
simplifies the process.
Also, most of the files in /proc really don't belong there. This patch
introduces the infrastructure for putting these into debugfs and exposes
all of the proc files in debugfs as well.
This contains the i915 hooks rewrite as well, to make bisectability better.
Signed-off-by: Ben Gamari <bgamari@gmail.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_stub.c')
-rw-r--r-- | drivers/gpu/drm/drm_stub.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index 45a536b9d7f5..d009661781bc 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c | |||
@@ -50,6 +50,7 @@ struct idr drm_minors_idr; | |||
50 | 50 | ||
51 | struct class *drm_class; | 51 | struct class *drm_class; |
52 | struct proc_dir_entry *drm_proc_root; | 52 | struct proc_dir_entry *drm_proc_root; |
53 | struct dentry *drm_debugfs_root; | ||
53 | 54 | ||
54 | static int drm_minor_get_id(struct drm_device *dev, int type) | 55 | static int drm_minor_get_id(struct drm_device *dev, int type) |
55 | { | 56 | { |
@@ -313,7 +314,15 @@ static int drm_get_minor(struct drm_device *dev, struct drm_minor **minor, int t | |||
313 | goto err_mem; | 314 | goto err_mem; |
314 | } | 315 | } |
315 | } else | 316 | } else |
316 | new_minor->dev_root = NULL; | 317 | new_minor->proc_root = NULL; |
318 | |||
319 | #if defined(CONFIG_DEBUG_FS) | ||
320 | ret = drm_debugfs_init(new_minor, minor_id, drm_debugfs_root); | ||
321 | if (ret) { | ||
322 | DRM_ERROR("DRM: Failed to initialize /debugfs/dri.\n"); | ||
323 | goto err_g2; | ||
324 | } | ||
325 | #endif | ||
317 | 326 | ||
318 | ret = drm_sysfs_device_add(new_minor); | 327 | ret = drm_sysfs_device_add(new_minor); |
319 | if (ret) { | 328 | if (ret) { |
@@ -430,6 +439,10 @@ int drm_put_minor(struct drm_minor **minor_p) | |||
430 | 439 | ||
431 | if (minor->type == DRM_MINOR_LEGACY) | 440 | if (minor->type == DRM_MINOR_LEGACY) |
432 | drm_proc_cleanup(minor, drm_proc_root); | 441 | drm_proc_cleanup(minor, drm_proc_root); |
442 | #if defined(CONFIG_DEBUG_FS) | ||
443 | drm_debugfs_cleanup(minor); | ||
444 | #endif | ||
445 | |||
433 | drm_sysfs_device_remove(minor); | 446 | drm_sysfs_device_remove(minor); |
434 | 447 | ||
435 | idr_remove(&drm_minors_idr, minor->index); | 448 | idr_remove(&drm_minors_idr, minor->index); |