Home | History | Annotate | Line # | Download | only in drm
drm_debugfs.c revision 1.3.30.1
      1  1.3.30.1  christos /*	$NetBSD: drm_debugfs.c,v 1.3.30.1 2019/06/10 22:07:57 christos Exp $	*/
      2  1.3.30.1  christos 
      3       1.1  riastrad /**
      4       1.1  riastrad  * \file drm_debugfs.c
      5       1.1  riastrad  * debugfs support for DRM
      6       1.1  riastrad  *
      7       1.1  riastrad  * \author Ben Gamari <bgamari (at) gmail.com>
      8       1.1  riastrad  */
      9       1.1  riastrad 
     10       1.1  riastrad /*
     11       1.1  riastrad  * Created: Sun Dec 21 13:08:50 2008 by bgamari (at) gmail.com
     12       1.1  riastrad  *
     13       1.1  riastrad  * Copyright 2008 Ben Gamari <bgamari (at) gmail.com>
     14       1.1  riastrad  *
     15       1.1  riastrad  * Permission is hereby granted, free of charge, to any person obtaining a
     16       1.1  riastrad  * copy of this software and associated documentation files (the "Software"),
     17       1.1  riastrad  * to deal in the Software without restriction, including without limitation
     18       1.1  riastrad  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
     19       1.1  riastrad  * and/or sell copies of the Software, and to permit persons to whom the
     20       1.1  riastrad  * Software is furnished to do so, subject to the following conditions:
     21       1.1  riastrad  *
     22       1.1  riastrad  * The above copyright notice and this permission notice (including the next
     23       1.1  riastrad  * paragraph) shall be included in all copies or substantial portions of the
     24       1.1  riastrad  * Software.
     25       1.1  riastrad  *
     26       1.1  riastrad  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     27       1.1  riastrad  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     28       1.1  riastrad  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
     29       1.1  riastrad  * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
     30       1.1  riastrad  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
     31       1.1  riastrad  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
     32       1.1  riastrad  * OTHER DEALINGS IN THE SOFTWARE.
     33       1.1  riastrad  */
     34       1.1  riastrad 
     35  1.3.30.1  christos #include <sys/cdefs.h>
     36  1.3.30.1  christos __KERNEL_RCSID(0, "$NetBSD: drm_debugfs.c,v 1.3.30.1 2019/06/10 22:07:57 christos Exp $");
     37  1.3.30.1  christos 
     38       1.1  riastrad #include <linux/debugfs.h>
     39       1.1  riastrad #include <linux/seq_file.h>
     40       1.1  riastrad #include <linux/slab.h>
     41       1.1  riastrad #include <linux/export.h>
     42       1.1  riastrad #include <drm/drmP.h>
     43  1.3.30.1  christos #include <drm/drm_edid.h>
     44  1.3.30.1  christos #include "drm_internal.h"
     45       1.1  riastrad 
     46       1.1  riastrad #if defined(CONFIG_DEBUG_FS)
     47       1.1  riastrad 
     48       1.1  riastrad /***************************************************
     49       1.1  riastrad  * Initialization, etc.
     50       1.1  riastrad  **************************************************/
     51       1.1  riastrad 
     52       1.3  riastrad static const struct drm_info_list drm_debugfs_list[] = {
     53       1.1  riastrad 	{"name", drm_name_info, 0},
     54       1.1  riastrad 	{"vm", drm_vm_info, 0},
     55       1.1  riastrad 	{"clients", drm_clients_info, 0},
     56       1.1  riastrad 	{"bufs", drm_bufs_info, 0},
     57       1.1  riastrad 	{"gem_names", drm_gem_name_info, DRIVER_GEM},
     58       1.1  riastrad 	{"vma", drm_vma_info, 0},
     59       1.1  riastrad };
     60       1.1  riastrad #define DRM_DEBUGFS_ENTRIES ARRAY_SIZE(drm_debugfs_list)
     61       1.1  riastrad 
     62       1.1  riastrad 
     63       1.1  riastrad static int drm_debugfs_open(struct inode *inode, struct file *file)
     64       1.1  riastrad {
     65       1.1  riastrad 	struct drm_info_node *node = inode->i_private;
     66       1.1  riastrad 
     67       1.1  riastrad 	return single_open(file, node->info_ent->show, node);
     68       1.1  riastrad }
     69       1.1  riastrad 
     70       1.1  riastrad 
     71       1.1  riastrad static const struct file_operations drm_debugfs_fops = {
     72       1.1  riastrad 	.owner = THIS_MODULE,
     73       1.1  riastrad 	.open = drm_debugfs_open,
     74       1.1  riastrad 	.read = seq_read,
     75       1.1  riastrad 	.llseek = seq_lseek,
     76       1.1  riastrad 	.release = single_release,
     77       1.1  riastrad };
     78       1.1  riastrad 
     79       1.1  riastrad 
     80       1.1  riastrad /**
     81       1.1  riastrad  * Initialize a given set of debugfs files for a device
     82       1.1  riastrad  *
     83       1.1  riastrad  * \param files The array of files to create
     84       1.1  riastrad  * \param count The number of files given
     85       1.1  riastrad  * \param root DRI debugfs dir entry.
     86       1.1  riastrad  * \param minor device minor number
     87       1.1  riastrad  * \return Zero on success, non-zero on failure
     88       1.1  riastrad  *
     89       1.1  riastrad  * Create a given set of debugfs files represented by an array of
     90       1.1  riastrad  * gdm_debugfs_lists in the given root directory.
     91       1.1  riastrad  */
     92       1.3  riastrad int drm_debugfs_create_files(const struct drm_info_list *files, int count,
     93       1.1  riastrad 			     struct dentry *root, struct drm_minor *minor)
     94       1.1  riastrad {
     95       1.1  riastrad 	struct drm_device *dev = minor->dev;
     96       1.1  riastrad 	struct dentry *ent;
     97       1.1  riastrad 	struct drm_info_node *tmp;
     98       1.1  riastrad 	int i, ret;
     99       1.1  riastrad 
    100       1.1  riastrad 	for (i = 0; i < count; i++) {
    101       1.1  riastrad 		u32 features = files[i].driver_features;
    102       1.1  riastrad 
    103       1.1  riastrad 		if (features != 0 &&
    104       1.1  riastrad 		    (dev->driver->driver_features & features) != features)
    105       1.1  riastrad 			continue;
    106       1.1  riastrad 
    107       1.1  riastrad 		tmp = kmalloc(sizeof(struct drm_info_node), GFP_KERNEL);
    108       1.1  riastrad 		if (tmp == NULL) {
    109       1.1  riastrad 			ret = -1;
    110       1.1  riastrad 			goto fail;
    111       1.1  riastrad 		}
    112       1.1  riastrad 		ent = debugfs_create_file(files[i].name, S_IFREG | S_IRUGO,
    113       1.1  riastrad 					  root, tmp, &drm_debugfs_fops);
    114       1.1  riastrad 		if (!ent) {
    115       1.1  riastrad 			DRM_ERROR("Cannot create /sys/kernel/debug/dri/%s/%s\n",
    116       1.1  riastrad 				  root->d_name.name, files[i].name);
    117       1.1  riastrad 			kfree(tmp);
    118       1.1  riastrad 			ret = -1;
    119       1.1  riastrad 			goto fail;
    120       1.1  riastrad 		}
    121       1.1  riastrad 
    122       1.1  riastrad 		tmp->minor = minor;
    123       1.1  riastrad 		tmp->dent = ent;
    124       1.1  riastrad 		tmp->info_ent = &files[i];
    125       1.1  riastrad 
    126       1.1  riastrad 		mutex_lock(&minor->debugfs_lock);
    127       1.1  riastrad 		list_add(&tmp->list, &minor->debugfs_list);
    128       1.1  riastrad 		mutex_unlock(&minor->debugfs_lock);
    129       1.1  riastrad 	}
    130       1.1  riastrad 	return 0;
    131       1.1  riastrad 
    132       1.1  riastrad fail:
    133       1.1  riastrad 	drm_debugfs_remove_files(files, count, minor);
    134       1.1  riastrad 	return ret;
    135       1.1  riastrad }
    136       1.1  riastrad EXPORT_SYMBOL(drm_debugfs_create_files);
    137       1.1  riastrad 
    138       1.1  riastrad /**
    139       1.1  riastrad  * Initialize the DRI debugfs filesystem for a device
    140       1.1  riastrad  *
    141       1.1  riastrad  * \param dev DRM device
    142       1.1  riastrad  * \param minor device minor number
    143       1.1  riastrad  * \param root DRI debugfs dir entry.
    144       1.1  riastrad  *
    145       1.1  riastrad  * Create the DRI debugfs root entry "/sys/kernel/debug/dri", the device debugfs root entry
    146       1.1  riastrad  * "/sys/kernel/debug/dri/%minor%/", and each entry in debugfs_list as
    147       1.1  riastrad  * "/sys/kernel/debug/dri/%minor%/%name%".
    148       1.1  riastrad  */
    149       1.1  riastrad int drm_debugfs_init(struct drm_minor *minor, int minor_id,
    150       1.1  riastrad 		     struct dentry *root)
    151       1.1  riastrad {
    152       1.1  riastrad 	struct drm_device *dev = minor->dev;
    153       1.1  riastrad 	char name[64];
    154       1.1  riastrad 	int ret;
    155       1.1  riastrad 
    156       1.1  riastrad 	INIT_LIST_HEAD(&minor->debugfs_list);
    157       1.1  riastrad 	mutex_init(&minor->debugfs_lock);
    158       1.2  christos 	snprintf(name, sizeof(name), "%d", minor_id);
    159       1.1  riastrad 	minor->debugfs_root = debugfs_create_dir(name, root);
    160       1.1  riastrad 	if (!minor->debugfs_root) {
    161       1.1  riastrad 		DRM_ERROR("Cannot create /sys/kernel/debug/dri/%s\n", name);
    162       1.1  riastrad 		return -1;
    163       1.1  riastrad 	}
    164       1.1  riastrad 
    165       1.1  riastrad 	ret = drm_debugfs_create_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES,
    166       1.1  riastrad 				       minor->debugfs_root, minor);
    167       1.1  riastrad 	if (ret) {
    168       1.1  riastrad 		debugfs_remove(minor->debugfs_root);
    169       1.1  riastrad 		minor->debugfs_root = NULL;
    170       1.1  riastrad 		DRM_ERROR("Failed to create core drm debugfs files\n");
    171       1.1  riastrad 		return ret;
    172       1.1  riastrad 	}
    173       1.1  riastrad 
    174       1.1  riastrad 	if (dev->driver->debugfs_init) {
    175       1.1  riastrad 		ret = dev->driver->debugfs_init(minor);
    176       1.1  riastrad 		if (ret) {
    177       1.1  riastrad 			DRM_ERROR("DRM: Driver failed to initialize "
    178       1.1  riastrad 				  "/sys/kernel/debug/dri.\n");
    179       1.1  riastrad 			return ret;
    180       1.1  riastrad 		}
    181       1.1  riastrad 	}
    182       1.1  riastrad 	return 0;
    183       1.1  riastrad }
    184       1.1  riastrad 
    185       1.1  riastrad 
    186       1.1  riastrad /**
    187       1.1  riastrad  * Remove a list of debugfs files
    188       1.1  riastrad  *
    189       1.1  riastrad  * \param files The list of files
    190       1.1  riastrad  * \param count The number of files
    191       1.1  riastrad  * \param minor The minor of which we should remove the files
    192       1.1  riastrad  * \return always zero.
    193       1.1  riastrad  *
    194       1.1  riastrad  * Remove all debugfs entries created by debugfs_init().
    195       1.1  riastrad  */
    196       1.3  riastrad int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
    197       1.1  riastrad 			     struct drm_minor *minor)
    198       1.1  riastrad {
    199       1.1  riastrad 	struct list_head *pos, *q;
    200       1.1  riastrad 	struct drm_info_node *tmp;
    201       1.1  riastrad 	int i;
    202       1.1  riastrad 
    203       1.1  riastrad 	mutex_lock(&minor->debugfs_lock);
    204       1.1  riastrad 	for (i = 0; i < count; i++) {
    205       1.1  riastrad 		list_for_each_safe(pos, q, &minor->debugfs_list) {
    206       1.1  riastrad 			tmp = list_entry(pos, struct drm_info_node, list);
    207       1.1  riastrad 			if (tmp->info_ent == &files[i]) {
    208       1.1  riastrad 				debugfs_remove(tmp->dent);
    209       1.1  riastrad 				list_del(pos);
    210       1.1  riastrad 				kfree(tmp);
    211       1.1  riastrad 			}
    212       1.1  riastrad 		}
    213       1.1  riastrad 	}
    214       1.1  riastrad 	mutex_unlock(&minor->debugfs_lock);
    215       1.1  riastrad 	return 0;
    216       1.1  riastrad }
    217       1.1  riastrad EXPORT_SYMBOL(drm_debugfs_remove_files);
    218       1.1  riastrad 
    219       1.1  riastrad /**
    220       1.1  riastrad  * Cleanup the debugfs filesystem resources.
    221       1.1  riastrad  *
    222       1.1  riastrad  * \param minor device minor number.
    223       1.1  riastrad  * \return always zero.
    224       1.1  riastrad  *
    225       1.1  riastrad  * Remove all debugfs entries created by debugfs_init().
    226       1.1  riastrad  */
    227       1.1  riastrad int drm_debugfs_cleanup(struct drm_minor *minor)
    228       1.1  riastrad {
    229       1.1  riastrad 	struct drm_device *dev = minor->dev;
    230       1.1  riastrad 
    231       1.1  riastrad 	if (!minor->debugfs_root)
    232       1.1  riastrad 		return 0;
    233       1.1  riastrad 
    234       1.1  riastrad 	if (dev->driver->debugfs_cleanup)
    235       1.1  riastrad 		dev->driver->debugfs_cleanup(minor);
    236       1.1  riastrad 
    237       1.1  riastrad 	drm_debugfs_remove_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES, minor);
    238       1.1  riastrad 
    239       1.1  riastrad 	debugfs_remove(minor->debugfs_root);
    240       1.1  riastrad 	minor->debugfs_root = NULL;
    241       1.1  riastrad 
    242       1.1  riastrad 	return 0;
    243       1.1  riastrad }
    244       1.1  riastrad 
    245  1.3.30.1  christos static int connector_show(struct seq_file *m, void *data)
    246  1.3.30.1  christos {
    247  1.3.30.1  christos 	struct drm_connector *connector = m->private;
    248  1.3.30.1  christos 	const char *status;
    249  1.3.30.1  christos 
    250  1.3.30.1  christos 	switch (connector->force) {
    251  1.3.30.1  christos 	case DRM_FORCE_ON:
    252  1.3.30.1  christos 		status = "on\n";
    253  1.3.30.1  christos 		break;
    254  1.3.30.1  christos 
    255  1.3.30.1  christos 	case DRM_FORCE_ON_DIGITAL:
    256  1.3.30.1  christos 		status = "digital\n";
    257  1.3.30.1  christos 		break;
    258  1.3.30.1  christos 
    259  1.3.30.1  christos 	case DRM_FORCE_OFF:
    260  1.3.30.1  christos 		status = "off\n";
    261  1.3.30.1  christos 		break;
    262  1.3.30.1  christos 
    263  1.3.30.1  christos 	case DRM_FORCE_UNSPECIFIED:
    264  1.3.30.1  christos 		status = "unspecified\n";
    265  1.3.30.1  christos 		break;
    266  1.3.30.1  christos 
    267  1.3.30.1  christos 	default:
    268  1.3.30.1  christos 		return 0;
    269  1.3.30.1  christos 	}
    270  1.3.30.1  christos 
    271  1.3.30.1  christos 	seq_puts(m, status);
    272  1.3.30.1  christos 
    273  1.3.30.1  christos 	return 0;
    274  1.3.30.1  christos }
    275  1.3.30.1  christos 
    276  1.3.30.1  christos static int connector_open(struct inode *inode, struct file *file)
    277  1.3.30.1  christos {
    278  1.3.30.1  christos 	struct drm_connector *dev = inode->i_private;
    279  1.3.30.1  christos 
    280  1.3.30.1  christos 	return single_open(file, connector_show, dev);
    281  1.3.30.1  christos }
    282  1.3.30.1  christos 
    283  1.3.30.1  christos static ssize_t connector_write(struct file *file, const char __user *ubuf,
    284  1.3.30.1  christos 			       size_t len, loff_t *offp)
    285  1.3.30.1  christos {
    286  1.3.30.1  christos 	struct seq_file *m = file->private_data;
    287  1.3.30.1  christos 	struct drm_connector *connector = m->private;
    288  1.3.30.1  christos 	char buf[12];
    289  1.3.30.1  christos 
    290  1.3.30.1  christos 	if (len > sizeof(buf) - 1)
    291  1.3.30.1  christos 		return -EINVAL;
    292  1.3.30.1  christos 
    293  1.3.30.1  christos 	if (copy_from_user(buf, ubuf, len))
    294  1.3.30.1  christos 		return -EFAULT;
    295  1.3.30.1  christos 
    296  1.3.30.1  christos 	buf[len] = '\0';
    297  1.3.30.1  christos 
    298  1.3.30.1  christos 	if (!strcmp(buf, "on"))
    299  1.3.30.1  christos 		connector->force = DRM_FORCE_ON;
    300  1.3.30.1  christos 	else if (!strcmp(buf, "digital"))
    301  1.3.30.1  christos 		connector->force = DRM_FORCE_ON_DIGITAL;
    302  1.3.30.1  christos 	else if (!strcmp(buf, "off"))
    303  1.3.30.1  christos 		connector->force = DRM_FORCE_OFF;
    304  1.3.30.1  christos 	else if (!strcmp(buf, "unspecified"))
    305  1.3.30.1  christos 		connector->force = DRM_FORCE_UNSPECIFIED;
    306  1.3.30.1  christos 	else
    307  1.3.30.1  christos 		return -EINVAL;
    308  1.3.30.1  christos 
    309  1.3.30.1  christos 	return len;
    310  1.3.30.1  christos }
    311  1.3.30.1  christos 
    312  1.3.30.1  christos static int edid_show(struct seq_file *m, void *data)
    313  1.3.30.1  christos {
    314  1.3.30.1  christos 	struct drm_connector *connector = m->private;
    315  1.3.30.1  christos 	struct drm_property_blob *edid = connector->edid_blob_ptr;
    316  1.3.30.1  christos 
    317  1.3.30.1  christos 	if (connector->override_edid && edid)
    318  1.3.30.1  christos 		seq_write(m, edid->data, edid->length);
    319  1.3.30.1  christos 
    320  1.3.30.1  christos 	return 0;
    321  1.3.30.1  christos }
    322  1.3.30.1  christos 
    323  1.3.30.1  christos static int edid_open(struct inode *inode, struct file *file)
    324  1.3.30.1  christos {
    325  1.3.30.1  christos 	struct drm_connector *dev = inode->i_private;
    326  1.3.30.1  christos 
    327  1.3.30.1  christos 	return single_open(file, edid_show, dev);
    328  1.3.30.1  christos }
    329  1.3.30.1  christos 
    330  1.3.30.1  christos static ssize_t edid_write(struct file *file, const char __user *ubuf,
    331  1.3.30.1  christos 			  size_t len, loff_t *offp)
    332  1.3.30.1  christos {
    333  1.3.30.1  christos 	struct seq_file *m = file->private_data;
    334  1.3.30.1  christos 	struct drm_connector *connector = m->private;
    335  1.3.30.1  christos 	char *buf;
    336  1.3.30.1  christos 	struct edid *edid;
    337  1.3.30.1  christos 	int ret;
    338  1.3.30.1  christos 
    339  1.3.30.1  christos 	buf = memdup_user(ubuf, len);
    340  1.3.30.1  christos 	if (IS_ERR(buf))
    341  1.3.30.1  christos 		return PTR_ERR(buf);
    342  1.3.30.1  christos 
    343  1.3.30.1  christos 	edid = (struct edid *) buf;
    344  1.3.30.1  christos 
    345  1.3.30.1  christos 	if (len == 5 && !strncmp(buf, "reset", 5)) {
    346  1.3.30.1  christos 		connector->override_edid = false;
    347  1.3.30.1  christos 		ret = drm_mode_connector_update_edid_property(connector, NULL);
    348  1.3.30.1  christos 	} else if (len < EDID_LENGTH ||
    349  1.3.30.1  christos 		   EDID_LENGTH * (1 + edid->extensions) > len)
    350  1.3.30.1  christos 		ret = -EINVAL;
    351  1.3.30.1  christos 	else {
    352  1.3.30.1  christos 		connector->override_edid = false;
    353  1.3.30.1  christos 		ret = drm_mode_connector_update_edid_property(connector, edid);
    354  1.3.30.1  christos 		if (!ret)
    355  1.3.30.1  christos 			connector->override_edid = true;
    356  1.3.30.1  christos 	}
    357  1.3.30.1  christos 
    358  1.3.30.1  christos 	kfree(buf);
    359  1.3.30.1  christos 
    360  1.3.30.1  christos 	return (ret) ? ret : len;
    361  1.3.30.1  christos }
    362  1.3.30.1  christos 
    363  1.3.30.1  christos static const struct file_operations drm_edid_fops = {
    364  1.3.30.1  christos 	.owner = THIS_MODULE,
    365  1.3.30.1  christos 	.open = edid_open,
    366  1.3.30.1  christos 	.read = seq_read,
    367  1.3.30.1  christos 	.llseek = seq_lseek,
    368  1.3.30.1  christos 	.release = single_release,
    369  1.3.30.1  christos 	.write = edid_write
    370  1.3.30.1  christos };
    371  1.3.30.1  christos 
    372  1.3.30.1  christos 
    373  1.3.30.1  christos static const struct file_operations drm_connector_fops = {
    374  1.3.30.1  christos 	.owner = THIS_MODULE,
    375  1.3.30.1  christos 	.open = connector_open,
    376  1.3.30.1  christos 	.read = seq_read,
    377  1.3.30.1  christos 	.llseek = seq_lseek,
    378  1.3.30.1  christos 	.release = single_release,
    379  1.3.30.1  christos 	.write = connector_write
    380  1.3.30.1  christos };
    381  1.3.30.1  christos 
    382  1.3.30.1  christos int drm_debugfs_connector_add(struct drm_connector *connector)
    383  1.3.30.1  christos {
    384  1.3.30.1  christos 	struct drm_minor *minor = connector->dev->primary;
    385  1.3.30.1  christos 	struct dentry *root, *ent;
    386  1.3.30.1  christos 
    387  1.3.30.1  christos 	if (!minor->debugfs_root)
    388  1.3.30.1  christos 		return -1;
    389  1.3.30.1  christos 
    390  1.3.30.1  christos 	root = debugfs_create_dir(connector->name, minor->debugfs_root);
    391  1.3.30.1  christos 	if (!root)
    392  1.3.30.1  christos 		return -ENOMEM;
    393  1.3.30.1  christos 
    394  1.3.30.1  christos 	connector->debugfs_entry = root;
    395  1.3.30.1  christos 
    396  1.3.30.1  christos 	/* force */
    397  1.3.30.1  christos 	ent = debugfs_create_file("force", S_IRUGO | S_IWUSR, root, connector,
    398  1.3.30.1  christos 				  &drm_connector_fops);
    399  1.3.30.1  christos 	if (!ent)
    400  1.3.30.1  christos 		goto error;
    401  1.3.30.1  christos 
    402  1.3.30.1  christos 	/* edid */
    403  1.3.30.1  christos 	ent = debugfs_create_file("edid_override", S_IRUGO | S_IWUSR, root,
    404  1.3.30.1  christos 				  connector, &drm_edid_fops);
    405  1.3.30.1  christos 	if (!ent)
    406  1.3.30.1  christos 		goto error;
    407  1.3.30.1  christos 
    408  1.3.30.1  christos 	return 0;
    409  1.3.30.1  christos 
    410  1.3.30.1  christos error:
    411  1.3.30.1  christos 	debugfs_remove_recursive(connector->debugfs_entry);
    412  1.3.30.1  christos 	connector->debugfs_entry = NULL;
    413  1.3.30.1  christos 	return -ENOMEM;
    414  1.3.30.1  christos }
    415  1.3.30.1  christos 
    416  1.3.30.1  christos void drm_debugfs_connector_remove(struct drm_connector *connector)
    417  1.3.30.1  christos {
    418  1.3.30.1  christos 	if (!connector->debugfs_entry)
    419  1.3.30.1  christos 		return;
    420  1.3.30.1  christos 
    421  1.3.30.1  christos 	debugfs_remove_recursive(connector->debugfs_entry);
    422  1.3.30.1  christos 
    423  1.3.30.1  christos 	connector->debugfs_entry = NULL;
    424  1.3.30.1  christos }
    425  1.3.30.1  christos 
    426       1.1  riastrad #endif /* CONFIG_DEBUG_FS */
    427       1.1  riastrad 
    428