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_drv.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_drv.c')
-rw-r--r-- | drivers/gpu/drm/drm_drv.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 1441655388ab..c26ee0822a05 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c | |||
@@ -46,9 +46,11 @@ | |||
46 | * OTHER DEALINGS IN THE SOFTWARE. | 46 | * OTHER DEALINGS IN THE SOFTWARE. |
47 | */ | 47 | */ |
48 | 48 | ||
49 | #include <linux/debugfs.h> | ||
49 | #include "drmP.h" | 50 | #include "drmP.h" |
50 | #include "drm_core.h" | 51 | #include "drm_core.h" |
51 | 52 | ||
53 | |||
52 | static int drm_version(struct drm_device *dev, void *data, | 54 | static int drm_version(struct drm_device *dev, void *data, |
53 | struct drm_file *file_priv); | 55 | struct drm_file *file_priv); |
54 | 56 | ||
@@ -178,7 +180,7 @@ int drm_lastclose(struct drm_device * dev) | |||
178 | 180 | ||
179 | /* Clear AGP information */ | 181 | /* Clear AGP information */ |
180 | if (drm_core_has_AGP(dev) && dev->agp && | 182 | if (drm_core_has_AGP(dev) && dev->agp && |
181 | !drm_core_check_feature(dev, DRIVER_MODESET)) { | 183 | !drm_core_check_feature(dev, DRIVER_MODESET)) { |
182 | struct drm_agp_mem *entry, *tempe; | 184 | struct drm_agp_mem *entry, *tempe; |
183 | 185 | ||
184 | /* Remove AGP resources, but leave dev->agp | 186 | /* Remove AGP resources, but leave dev->agp |
@@ -335,6 +337,13 @@ static int __init drm_core_init(void) | |||
335 | goto err_p3; | 337 | goto err_p3; |
336 | } | 338 | } |
337 | 339 | ||
340 | drm_debugfs_root = debugfs_create_dir("dri", NULL); | ||
341 | if (!drm_debugfs_root) { | ||
342 | DRM_ERROR("Cannot create /debugfs/dri\n"); | ||
343 | ret = -1; | ||
344 | goto err_p3; | ||
345 | } | ||
346 | |||
338 | drm_mem_init(); | 347 | drm_mem_init(); |
339 | 348 | ||
340 | DRM_INFO("Initialized %s %d.%d.%d %s\n", | 349 | DRM_INFO("Initialized %s %d.%d.%d %s\n", |
@@ -353,6 +362,7 @@ err_p1: | |||
353 | static void __exit drm_core_exit(void) | 362 | static void __exit drm_core_exit(void) |
354 | { | 363 | { |
355 | remove_proc_entry("dri", NULL); | 364 | remove_proc_entry("dri", NULL); |
365 | debugfs_remove(drm_debugfs_root); | ||
356 | drm_sysfs_destroy(); | 366 | drm_sysfs_destroy(); |
357 | 367 | ||
358 | unregister_chrdev(DRM_MAJOR, "drm"); | 368 | unregister_chrdev(DRM_MAJOR, "drm"); |