41 #include <linux/slab.h>
42 #include <linux/export.h>
52 static struct drm_info_list drm_proc_list[] = {
59 {
"vma", drm_vma_info, 0},
62 #define DRM_PROC_ENTRIES ARRAY_SIZE(drm_proc_list)
66 struct drm_info_node*
node = PDE(inode)->data;
68 return single_open(file, node->info_ent->show, node);
73 .open = drm_proc_open,
92 static int drm_proc_create_files(
struct drm_info_list *
files,
int count,
97 struct drm_info_node *
tmp;
100 for (i = 0; i <
count; i++) {
104 (dev->driver->driver_features & features) != features)
113 tmp->info_ent = &files[
i];
114 list_add(&tmp->list, &minor->proc_nodes.list);
117 &drm_proc_fops, tmp);
119 DRM_ERROR(
"Cannot create /proc/dri/%s/%s\n",
120 root->
name, files[i].name);
131 for (i = 0; i <
count; i++)
155 INIT_LIST_HEAD(&minor->proc_nodes.list);
158 if (!minor->proc_root) {
159 DRM_ERROR(
"Cannot create /proc/dri/%s\n", name);
164 minor->proc_root, minor);
167 minor->proc_root =
NULL;
168 DRM_ERROR(
"Failed to create core drm proc files\n");
175 static int drm_proc_remove_files(
struct drm_info_list *files,
int count,
176 struct drm_minor *minor)
179 struct drm_info_node *
tmp;
182 for (i = 0; i <
count; i++) {
185 if (tmp->info_ent == &files[i]) {
210 if (!root || !minor->proc_root)
215 sprintf(name,
"%d", minor->index);