Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c14f28b authored by Dave Airlie's avatar Dave Airlie Committed by Dave Airlie
Browse files

drm: reorganise minor number handling using backported modesetting code.



rips out the head crap and replaces it with an idr and drm_minor structure

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 7b832b56
Loading
Loading
Loading
Loading
+20 −22
Original line number Original line Diff line number Diff line
@@ -379,13 +379,12 @@ struct drm_buf_entry {
struct drm_file {
struct drm_file {
	int authenticated;
	int authenticated;
	int master;
	int master;
	int minor;
	pid_t pid;
	pid_t pid;
	uid_t uid;
	uid_t uid;
	drm_magic_t magic;
	drm_magic_t magic;
	unsigned long ioctl_count;
	unsigned long ioctl_count;
	struct list_head lhead;
	struct list_head lhead;
	struct drm_head *head;
	struct drm_minor *minor;
	int remove_auth_on_close;
	int remove_auth_on_close;
	unsigned long lock_count;
	unsigned long lock_count;
	struct file *filp;
	struct file *filp;
@@ -630,16 +629,19 @@ struct drm_driver {
	struct pci_driver pci_driver;
	struct pci_driver pci_driver;
};
};


#define DRM_MINOR_UNASSIGNED 0
#define DRM_MINOR_LEGACY 1

/**
/**
 * DRM head structure. This structure represent a video head on a card
 * DRM minor structure. This structure represents a drm minor number.
 * that may contain multiple heads. Embed one per head of these in the
 * private drm_device structure.
 */
 */
struct drm_head {
struct drm_minor {
	int minor;			/**< Minor device number */
	int index;			/**< Minor device number */
	int type;                       /**< Control or render */
	dev_t device;			/**< Device number for mknod */
	struct device kdev;		/**< Linux device */
	struct drm_device *dev;
	struct drm_device *dev;
	struct proc_dir_entry *dev_root;  /**< proc directory entry */
	struct proc_dir_entry *dev_root;  /**< proc directory entry */
	dev_t device;			/**< Device number for mknod */
};
};


/**
/**
@@ -647,7 +649,6 @@ struct drm_head {
 * may contain multiple heads.
 * may contain multiple heads.
 */
 */
struct drm_device {
struct drm_device {
	struct device dev;		/**< Linux device */
	char *unique;			/**< Unique identifier: e.g., busid */
	char *unique;			/**< Unique identifier: e.g., busid */
	int unique_len;			/**< Length of unique field */
	int unique_len;			/**< Length of unique field */
	char *devname;			/**< For /proc/interrupts */
	char *devname;			/**< For /proc/interrupts */
@@ -763,7 +764,7 @@ struct drm_device {
	struct drm_driver *driver;
	struct drm_driver *driver;
	drm_local_map_t *agp_buffer_map;
	drm_local_map_t *agp_buffer_map;
	unsigned int agp_buffer_token;
	unsigned int agp_buffer_token;
	struct drm_head primary;		/**< primary screen head */
	struct drm_minor *primary;		/**< render type primary screen head */


	/** \name Drawable information */
	/** \name Drawable information */
	/*@{ */
	/*@{ */
@@ -1030,23 +1031,20 @@ extern int drm_agp_unbind_memory(DRM_AGP_MEM * handle);
extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
		       struct drm_driver *driver);
		       struct drm_driver *driver);
extern int drm_put_dev(struct drm_device *dev);
extern int drm_put_dev(struct drm_device *dev);
extern int drm_put_head(struct drm_head *head);
extern int drm_put_minor(struct drm_minor **minor);
extern unsigned int drm_debug;
extern unsigned int drm_debug;
extern unsigned int drm_cards_limit;

extern struct drm_head **drm_heads;
extern struct class *drm_class;
extern struct class *drm_class;
extern struct proc_dir_entry *drm_proc_root;
extern struct proc_dir_entry *drm_proc_root;


extern struct idr drm_minors_idr;

extern drm_local_map_t *drm_getsarea(struct drm_device *dev);
extern drm_local_map_t *drm_getsarea(struct drm_device *dev);


				/* Proc support (drm_proc.h) */
				/* Proc support (drm_proc.h) */
extern int drm_proc_init(struct drm_device *dev,
extern int drm_proc_init(struct drm_minor *minor, int minor_id,
			 int minor,
			 struct proc_dir_entry *root);
			 struct proc_dir_entry *root,
extern int drm_proc_cleanup(struct drm_minor *minor, struct proc_dir_entry *root);
			 struct proc_dir_entry **dev_root);
extern int drm_proc_cleanup(int minor,
			    struct proc_dir_entry *root,
			    struct proc_dir_entry *dev_root);


				/* Scatter Gather Support (drm_scatter.h) */
				/* Scatter Gather Support (drm_scatter.h) */
extern void drm_sg_cleanup(struct drm_sg_mem * entry);
extern void drm_sg_cleanup(struct drm_sg_mem * entry);
@@ -1071,8 +1069,8 @@ extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah);
struct drm_sysfs_class;
struct drm_sysfs_class;
extern struct class *drm_sysfs_create(struct module *owner, char *name);
extern struct class *drm_sysfs_create(struct module *owner, char *name);
extern void drm_sysfs_destroy(void);
extern void drm_sysfs_destroy(void);
extern int drm_sysfs_device_add(struct drm_device *dev, struct drm_head *head);
extern int drm_sysfs_device_add(struct drm_minor *minor);
extern void drm_sysfs_device_remove(struct drm_device *dev);
extern void drm_sysfs_device_remove(struct drm_minor *minor);


/*
/*
 * Basic memory manager support (drm_mm.c)
 * Basic memory manager support (drm_mm.c)
+1 −1
Original line number Original line Diff line number Diff line
@@ -122,7 +122,7 @@ EXPORT_SYMBOL(drm_agp_acquire);
int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
			  struct drm_file *file_priv)
			  struct drm_file *file_priv)
{
{
	return drm_agp_acquire((struct drm_device *) file_priv->head->dev);
	return drm_agp_acquire((struct drm_device *) file_priv->minor->dev);
}
}


/**
/**
+28 −32
Original line number Original line Diff line number Diff line
@@ -313,35 +313,36 @@ static void drm_cleanup(struct drm_device * dev)
	drm_ht_remove(&dev->map_hash);
	drm_ht_remove(&dev->map_hash);
	drm_ctxbitmap_cleanup(dev);
	drm_ctxbitmap_cleanup(dev);


	drm_put_head(&dev->primary);
	drm_put_minor(&dev->primary);
	if (drm_put_dev(dev))
	if (drm_put_dev(dev))
		DRM_ERROR("Cannot unload module\n");
		DRM_ERROR("Cannot unload module\n");
}
}


void drm_exit(struct drm_driver *driver)
int drm_minors_cleanup(int id, void *ptr, void *data)
{
{
	int i;
	struct drm_minor *minor = ptr;
	struct drm_device *dev = NULL;
	struct drm_device *dev;
	struct drm_head *head;
	struct drm_driver *driver = data;


	DRM_DEBUG("\n");
	dev = minor->dev;
	if (minor->dev->driver != driver)
		return 0;


	for (i = 0; i < drm_cards_limit; i++) {
	if (minor->type != DRM_MINOR_LEGACY)
		head = drm_heads[i];
		return 0;
		if (!head)

			continue;
	if (dev)
		if (!head->dev)
			continue;
		if (head->dev->driver != driver)
			continue;
		dev = head->dev;
		if (dev) {
			/* release the pci driver */
			if (dev->pdev)
		pci_dev_put(dev->pdev);
		pci_dev_put(dev->pdev);
	drm_cleanup(dev);
	drm_cleanup(dev);
	return 1;
}
}
	}

void drm_exit(struct drm_driver *driver)
{
	DRM_DEBUG("\n");

	idr_for_each(&drm_minors_idr, &drm_minors_cleanup, driver);

	DRM_INFO("Module unloaded\n");
	DRM_INFO("Module unloaded\n");
}
}


@@ -357,13 +358,7 @@ static int __init drm_core_init(void)
{
{
	int ret = -ENOMEM;
	int ret = -ENOMEM;


	drm_cards_limit =
	idr_init(&drm_minors_idr);
	    (drm_cards_limit <
	     DRM_MAX_MINOR + 1 ? drm_cards_limit : DRM_MAX_MINOR + 1);
	drm_heads =
	    drm_calloc(drm_cards_limit, sizeof(*drm_heads), DRM_MEM_STUB);
	if (!drm_heads)
		goto err_p1;


	if (register_chrdev(DRM_MAJOR, "drm", &drm_stub_fops))
	if (register_chrdev(DRM_MAJOR, "drm", &drm_stub_fops))
		goto err_p1;
		goto err_p1;
@@ -391,7 +386,8 @@ err_p3:
	drm_sysfs_destroy();
	drm_sysfs_destroy();
err_p2:
err_p2:
	unregister_chrdev(DRM_MAJOR, "drm");
	unregister_chrdev(DRM_MAJOR, "drm");
	drm_free(drm_heads, sizeof(*drm_heads) * drm_cards_limit, DRM_MEM_STUB);

	idr_destroy(&drm_minors_idr);
err_p1:
err_p1:
	return ret;
	return ret;
}
}
@@ -403,7 +399,7 @@ static void __exit drm_core_exit(void)


	unregister_chrdev(DRM_MAJOR, "drm");
	unregister_chrdev(DRM_MAJOR, "drm");


	drm_free(drm_heads, sizeof(*drm_heads) * drm_cards_limit, DRM_MEM_STUB);
	idr_destroy(&drm_minors_idr);
}
}


module_init(drm_core_init);
module_init(drm_core_init);
@@ -452,7 +448,7 @@ int drm_ioctl(struct inode *inode, struct file *filp,
	      unsigned int cmd, unsigned long arg)
	      unsigned int cmd, unsigned long arg)
{
{
	struct drm_file *file_priv = filp->private_data;
	struct drm_file *file_priv = filp->private_data;
	struct drm_device *dev = file_priv->head->dev;
	struct drm_device *dev = file_priv->minor->dev;
	struct drm_ioctl_desc *ioctl;
	struct drm_ioctl_desc *ioctl;
	drm_ioctl_t *func;
	drm_ioctl_t *func;
	unsigned int nr = DRM_IOCTL_NR(cmd);
	unsigned int nr = DRM_IOCTL_NR(cmd);
@@ -465,7 +461,7 @@ int drm_ioctl(struct inode *inode, struct file *filp,


	DRM_DEBUG("pid=%d, cmd=0x%02x, nr=0x%02x, dev 0x%lx, auth=%d\n",
	DRM_DEBUG("pid=%d, cmd=0x%02x, nr=0x%02x, dev 0x%lx, auth=%d\n",
		  task_pid_nr(current), cmd, nr,
		  task_pid_nr(current), cmd, nr,
		  (long)old_encode_dev(file_priv->head->device),
		  (long)old_encode_dev(file_priv->minor->device),
		  file_priv->authenticated);
		  file_priv->authenticated);


	if ((nr >= DRM_CORE_IOCTL_COUNT) &&
	if ((nr >= DRM_CORE_IOCTL_COUNT) &&
+17 −20
Original line number Original line Diff line number Diff line
@@ -129,16 +129,15 @@ static int drm_setup(struct drm_device * dev)
int drm_open(struct inode *inode, struct file *filp)
int drm_open(struct inode *inode, struct file *filp)
{
{
	struct drm_device *dev = NULL;
	struct drm_device *dev = NULL;
	int minor = iminor(inode);
	int minor_id = iminor(inode);
	struct drm_minor *minor;
	int retcode = 0;
	int retcode = 0;


	if (!((minor >= 0) && (minor < drm_cards_limit)))
	minor = idr_find(&drm_minors_idr, minor_id);
	if (!minor)
		return -ENODEV;
		return -ENODEV;


	if (!drm_heads[minor])
	if (!(dev = minor->dev))
		return -ENODEV;

	if (!(dev = drm_heads[minor]->dev))
		return -ENODEV;
		return -ENODEV;


	retcode = drm_open_helper(inode, filp, dev);
	retcode = drm_open_helper(inode, filp, dev);
@@ -168,19 +167,18 @@ EXPORT_SYMBOL(drm_open);
int drm_stub_open(struct inode *inode, struct file *filp)
int drm_stub_open(struct inode *inode, struct file *filp)
{
{
	struct drm_device *dev = NULL;
	struct drm_device *dev = NULL;
	int minor = iminor(inode);
	struct drm_minor *minor;
	int minor_id = iminor(inode);
	int err = -ENODEV;
	int err = -ENODEV;
	const struct file_operations *old_fops;
	const struct file_operations *old_fops;


	DRM_DEBUG("\n");
	DRM_DEBUG("\n");


	if (!((minor >= 0) && (minor < drm_cards_limit)))
	minor = idr_find(&drm_minors_idr, minor_id);
		return -ENODEV;
	if (!minor)

	if (!drm_heads[minor])
		return -ENODEV;
		return -ENODEV;


	if (!(dev = drm_heads[minor]->dev))
	if (!(dev = minor->dev))
		return -ENODEV;
		return -ENODEV;


	old_fops = filp->f_op;
	old_fops = filp->f_op;
@@ -225,7 +223,7 @@ static int drm_cpu_valid(void)
static int drm_open_helper(struct inode *inode, struct file *filp,
static int drm_open_helper(struct inode *inode, struct file *filp,
			   struct drm_device * dev)
			   struct drm_device * dev)
{
{
	int minor = iminor(inode);
	int minor_id = iminor(inode);
	struct drm_file *priv;
	struct drm_file *priv;
	int ret;
	int ret;


@@ -234,7 +232,7 @@ static int drm_open_helper(struct inode *inode, struct file *filp,
	if (!drm_cpu_valid())
	if (!drm_cpu_valid())
		return -EINVAL;
		return -EINVAL;


	DRM_DEBUG("pid = %d, minor = %d\n", task_pid_nr(current), minor);
	DRM_DEBUG("pid = %d, minor = %d\n", task_pid_nr(current), minor_id);


	priv = drm_alloc(sizeof(*priv), DRM_MEM_FILES);
	priv = drm_alloc(sizeof(*priv), DRM_MEM_FILES);
	if (!priv)
	if (!priv)
@@ -245,8 +243,7 @@ static int drm_open_helper(struct inode *inode, struct file *filp,
	priv->filp = filp;
	priv->filp = filp;
	priv->uid = current->euid;
	priv->uid = current->euid;
	priv->pid = task_pid_nr(current);
	priv->pid = task_pid_nr(current);
	priv->minor = minor;
	priv->minor = idr_find(&drm_minors_idr, minor_id);
	priv->head = drm_heads[minor];
	priv->ioctl_count = 0;
	priv->ioctl_count = 0;
	/* for compatibility root is always authenticated */
	/* for compatibility root is always authenticated */
	priv->authenticated = capable(CAP_SYS_ADMIN);
	priv->authenticated = capable(CAP_SYS_ADMIN);
@@ -297,11 +294,11 @@ static int drm_open_helper(struct inode *inode, struct file *filp,
int drm_fasync(int fd, struct file *filp, int on)
int drm_fasync(int fd, struct file *filp, int on)
{
{
	struct drm_file *priv = filp->private_data;
	struct drm_file *priv = filp->private_data;
	struct drm_device *dev = priv->head->dev;
	struct drm_device *dev = priv->minor->dev;
	int retcode;
	int retcode;


	DRM_DEBUG("fd = %d, device = 0x%lx\n", fd,
	DRM_DEBUG("fd = %d, device = 0x%lx\n", fd,
		  (long)old_encode_dev(priv->head->device));
		  (long)old_encode_dev(priv->minor->device));
	retcode = fasync_helper(fd, filp, on, &dev->buf_async);
	retcode = fasync_helper(fd, filp, on, &dev->buf_async);
	if (retcode < 0)
	if (retcode < 0)
		return retcode;
		return retcode;
@@ -324,7 +321,7 @@ EXPORT_SYMBOL(drm_fasync);
int drm_release(struct inode *inode, struct file *filp)
int drm_release(struct inode *inode, struct file *filp)
{
{
	struct drm_file *file_priv = filp->private_data;
	struct drm_file *file_priv = filp->private_data;
	struct drm_device *dev = file_priv->head->dev;
	struct drm_device *dev = file_priv->minor->dev;
	int retcode = 0;
	int retcode = 0;
	unsigned long irqflags;
	unsigned long irqflags;


@@ -341,7 +338,7 @@ int drm_release(struct inode *inode, struct file *filp)


	DRM_DEBUG("pid = %d, device = 0x%lx, open_count = %d\n",
	DRM_DEBUG("pid = %d, device = 0x%lx, open_count = %d\n",
		  task_pid_nr(current),
		  task_pid_nr(current),
		  (long)old_encode_dev(file_priv->head->device),
		  (long)old_encode_dev(file_priv->minor->device),
		  dev->open_count);
		  dev->open_count);


	if (dev->driver->reclaim_buffers_locked && dev->lock.hw_lock) {
	if (dev->driver->reclaim_buffers_locked && dev->lock.hw_lock) {
+36 −25
Original line number Original line Diff line number Diff line
@@ -87,34 +87,35 @@ static struct drm_proc_list {
 * "/proc/dri/%minor%/", and each entry in proc_list as
 * "/proc/dri/%minor%/", and each entry in proc_list as
 * "/proc/dri/%minor%/%name%".
 * "/proc/dri/%minor%/%name%".
 */
 */
int drm_proc_init(struct drm_device * dev, int minor,
int drm_proc_init(struct drm_minor *minor, int minor_id,
		  struct proc_dir_entry *root, struct proc_dir_entry **dev_root)
		  struct proc_dir_entry *root)
{
{
	struct proc_dir_entry *ent;
	struct proc_dir_entry *ent;
	int i, j;
	int i, j;
	char name[64];
	char name[64];


	sprintf(name, "%d", minor);
	sprintf(name, "%d", minor_id);
	*dev_root = proc_mkdir(name, root);
	minor->dev_root = proc_mkdir(name, root);
	if (!*dev_root) {
	if (!minor->dev_root) {
		DRM_ERROR("Cannot create /proc/dri/%s\n", name);
		DRM_ERROR("Cannot create /proc/dri/%s\n", name);
		return -1;
		return -1;
	}
	}


	for (i = 0; i < DRM_PROC_ENTRIES; i++) {
	for (i = 0; i < DRM_PROC_ENTRIES; i++) {
		ent = create_proc_entry(drm_proc_list[i].name,
		ent = create_proc_entry(drm_proc_list[i].name,
					S_IFREG | S_IRUGO, *dev_root);
					S_IFREG | S_IRUGO, minor->dev_root);
		if (!ent) {
		if (!ent) {
			DRM_ERROR("Cannot create /proc/dri/%s/%s\n",
			DRM_ERROR("Cannot create /proc/dri/%s/%s\n",
				  name, drm_proc_list[i].name);
				  name, drm_proc_list[i].name);
			for (j = 0; j < i; j++)
			for (j = 0; j < i; j++)
				remove_proc_entry(drm_proc_list[i].name,
				remove_proc_entry(drm_proc_list[i].name,
						  *dev_root);
						  minor->dev_root);
			remove_proc_entry(name, root);
			remove_proc_entry(name, root);
			minor->dev_root = NULL;
			return -1;
			return -1;
		}
		}
		ent->read_proc = drm_proc_list[i].f;
		ent->read_proc = drm_proc_list[i].f;
		ent->data = dev;
		ent->data = minor;
	}
	}


	return 0;
	return 0;
@@ -130,18 +131,17 @@ int drm_proc_init(struct drm_device * dev, int minor,
 *
 *
 * Remove all proc entries created by proc_init().
 * Remove all proc entries created by proc_init().
 */
 */
int drm_proc_cleanup(int minor, struct proc_dir_entry *root,
int drm_proc_cleanup(struct drm_minor *minor, struct proc_dir_entry *root)
		     struct proc_dir_entry *dev_root)
{
{
	int i;
	int i;
	char name[64];
	char name[64];


	if (!root || !dev_root)
	if (!root || !minor->dev_root)
		return 0;
		return 0;


	for (i = 0; i < DRM_PROC_ENTRIES; i++)
	for (i = 0; i < DRM_PROC_ENTRIES; i++)
		remove_proc_entry(drm_proc_list[i].name, dev_root);
		remove_proc_entry(drm_proc_list[i].name, minor->dev_root);
	sprintf(name, "%d", minor);
	sprintf(name, "%d", minor->index);
	remove_proc_entry(name, root);
	remove_proc_entry(name, root);


	return 0;
	return 0;
@@ -163,7 +163,8 @@ int drm_proc_cleanup(int minor, struct proc_dir_entry *root,
static int drm_name_info(char *buf, char **start, off_t offset, int request,
static int drm_name_info(char *buf, char **start, off_t offset, int request,
			 int *eof, void *data)
			 int *eof, void *data)
{
{
	struct drm_device *dev = (struct drm_device *) data;
	struct drm_minor *minor = (struct drm_minor *) data;
	struct drm_device *dev = minor->dev;
	int len = 0;
	int len = 0;


	if (offset > DRM_PROC_LIMIT) {
	if (offset > DRM_PROC_LIMIT) {
@@ -205,7 +206,8 @@ static int drm_name_info(char *buf, char **start, off_t offset, int request,
static int drm__vm_info(char *buf, char **start, off_t offset, int request,
static int drm__vm_info(char *buf, char **start, off_t offset, int request,
			int *eof, void *data)
			int *eof, void *data)
{
{
	struct drm_device *dev = (struct drm_device *) data;
	struct drm_minor *minor = (struct drm_minor *) data;
	struct drm_device *dev = minor->dev;
	int len = 0;
	int len = 0;
	struct drm_map *map;
	struct drm_map *map;
	struct drm_map_list *r_list;
	struct drm_map_list *r_list;
@@ -261,7 +263,8 @@ static int drm__vm_info(char *buf, char **start, off_t offset, int request,
static int drm_vm_info(char *buf, char **start, off_t offset, int request,
static int drm_vm_info(char *buf, char **start, off_t offset, int request,
		       int *eof, void *data)
		       int *eof, void *data)
{
{
	struct drm_device *dev = (struct drm_device *) data;
	struct drm_minor *minor = (struct drm_minor *) data;
	struct drm_device *dev = minor->dev;
	int ret;
	int ret;


	mutex_lock(&dev->struct_mutex);
	mutex_lock(&dev->struct_mutex);
@@ -284,7 +287,8 @@ static int drm_vm_info(char *buf, char **start, off_t offset, int request,
static int drm__queues_info(char *buf, char **start, off_t offset,
static int drm__queues_info(char *buf, char **start, off_t offset,
			    int request, int *eof, void *data)
			    int request, int *eof, void *data)
{
{
	struct drm_device *dev = (struct drm_device *) data;
	struct drm_minor *minor = (struct drm_minor *) data;
	struct drm_device *dev = minor->dev;
	int len = 0;
	int len = 0;
	int i;
	int i;
	struct drm_queue *q;
	struct drm_queue *q;
@@ -334,7 +338,8 @@ static int drm__queues_info(char *buf, char **start, off_t offset,
static int drm_queues_info(char *buf, char **start, off_t offset, int request,
static int drm_queues_info(char *buf, char **start, off_t offset, int request,
			   int *eof, void *data)
			   int *eof, void *data)
{
{
	struct drm_device *dev = (struct drm_device *) data;
	struct drm_minor *minor = (struct drm_minor *) data;
	struct drm_device *dev = minor->dev;
	int ret;
	int ret;


	mutex_lock(&dev->struct_mutex);
	mutex_lock(&dev->struct_mutex);
@@ -357,7 +362,8 @@ static int drm_queues_info(char *buf, char **start, off_t offset, int request,
static int drm__bufs_info(char *buf, char **start, off_t offset, int request,
static int drm__bufs_info(char *buf, char **start, off_t offset, int request,
			  int *eof, void *data)
			  int *eof, void *data)
{
{
	struct drm_device *dev = (struct drm_device *) data;
	struct drm_minor *minor = (struct drm_minor *) data;
	struct drm_device *dev = minor->dev;
	int len = 0;
	int len = 0;
	struct drm_device_dma *dma = dev->dma;
	struct drm_device_dma *dma = dev->dma;
	int i;
	int i;
@@ -406,7 +412,8 @@ static int drm__bufs_info(char *buf, char **start, off_t offset, int request,
static int drm_bufs_info(char *buf, char **start, off_t offset, int request,
static int drm_bufs_info(char *buf, char **start, off_t offset, int request,
			 int *eof, void *data)
			 int *eof, void *data)
{
{
	struct drm_device *dev = (struct drm_device *) data;
	struct drm_minor *minor = (struct drm_minor *) data;
	struct drm_device *dev = minor->dev;
	int ret;
	int ret;


	mutex_lock(&dev->struct_mutex);
	mutex_lock(&dev->struct_mutex);
@@ -429,7 +436,8 @@ static int drm_bufs_info(char *buf, char **start, off_t offset, int request,
static int drm__clients_info(char *buf, char **start, off_t offset,
static int drm__clients_info(char *buf, char **start, off_t offset,
			     int request, int *eof, void *data)
			     int request, int *eof, void *data)
{
{
	struct drm_device *dev = (struct drm_device *) data;
	struct drm_minor *minor = (struct drm_minor *) data;
	struct drm_device *dev = minor->dev;
	int len = 0;
	int len = 0;
	struct drm_file *priv;
	struct drm_file *priv;


@@ -445,7 +453,7 @@ static int drm__clients_info(char *buf, char **start, off_t offset,
	list_for_each_entry(priv, &dev->filelist, lhead) {
	list_for_each_entry(priv, &dev->filelist, lhead) {
		DRM_PROC_PRINT("%c %3d %5d %5d %10u %10lu\n",
		DRM_PROC_PRINT("%c %3d %5d %5d %10u %10lu\n",
			       priv->authenticated ? 'y' : 'n',
			       priv->authenticated ? 'y' : 'n',
			       priv->minor,
			       priv->minor->index,
			       priv->pid,
			       priv->pid,
			       priv->uid, priv->magic, priv->ioctl_count);
			       priv->uid, priv->magic, priv->ioctl_count);
	}
	}
@@ -462,7 +470,8 @@ static int drm__clients_info(char *buf, char **start, off_t offset,
static int drm_clients_info(char *buf, char **start, off_t offset,
static int drm_clients_info(char *buf, char **start, off_t offset,
			    int request, int *eof, void *data)
			    int request, int *eof, void *data)
{
{
	struct drm_device *dev = (struct drm_device *) data;
	struct drm_minor *minor = (struct drm_minor *) data;
	struct drm_device *dev = minor->dev;
	int ret;
	int ret;


	mutex_lock(&dev->struct_mutex);
	mutex_lock(&dev->struct_mutex);
@@ -476,7 +485,8 @@ static int drm_clients_info(char *buf, char **start, off_t offset,
static int drm__vma_info(char *buf, char **start, off_t offset, int request,
static int drm__vma_info(char *buf, char **start, off_t offset, int request,
			 int *eof, void *data)
			 int *eof, void *data)
{
{
	struct drm_device *dev = (struct drm_device *) data;
	struct drm_minor *minor = (struct drm_minor *) data;
	struct drm_device *dev = minor->dev;
	int len = 0;
	int len = 0;
	struct drm_vma_entry *pt;
	struct drm_vma_entry *pt;
	struct vm_area_struct *vma;
	struct vm_area_struct *vma;
@@ -535,7 +545,8 @@ static int drm__vma_info(char *buf, char **start, off_t offset, int request,
static int drm_vma_info(char *buf, char **start, off_t offset, int request,
static int drm_vma_info(char *buf, char **start, off_t offset, int request,
			int *eof, void *data)
			int *eof, void *data)
{
{
	struct drm_device *dev = (struct drm_device *) data;
	struct drm_minor *minor = (struct drm_minor *) data;
	struct drm_device *dev = minor->dev;
	int ret;
	int ret;


	mutex_lock(&dev->struct_mutex);
	mutex_lock(&dev->struct_mutex);
Loading