aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drmP.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2008-04-21 02:47:32 -0400
committerDave Airlie <airlied@linux.ie>2008-04-26 03:55:07 -0400
commit2c14f28be2a3f2a2e9861b156d64fbe2bc7000c3 (patch)
treedbf55c07d1b245a45330e0d879833df29954fe12 /drivers/char/drm/drmP.h
parent7b832b56bd971348329c3f4c753ca0abfdf3a3d1 (diff)
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: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/char/drm/drmP.h')
-rw-r--r--drivers/char/drm/drmP.h42
1 files changed, 20 insertions, 22 deletions
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
index 6540948d5176..5446235094d8 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
@@ -379,13 +379,12 @@ struct drm_buf_entry {
379struct drm_file { 379struct drm_file {
380 int authenticated; 380 int authenticated;
381 int master; 381 int master;
382 int minor;
383 pid_t pid; 382 pid_t pid;
384 uid_t uid; 383 uid_t uid;
385 drm_magic_t magic; 384 drm_magic_t magic;
386 unsigned long ioctl_count; 385 unsigned long ioctl_count;
387 struct list_head lhead; 386 struct list_head lhead;
388 struct drm_head *head; 387 struct drm_minor *minor;
389 int remove_auth_on_close; 388 int remove_auth_on_close;
390 unsigned long lock_count; 389 unsigned long lock_count;
391 struct file *filp; 390 struct file *filp;
@@ -630,16 +629,19 @@ struct drm_driver {
630 struct pci_driver pci_driver; 629 struct pci_driver pci_driver;
631}; 630};
632 631
632#define DRM_MINOR_UNASSIGNED 0
633#define DRM_MINOR_LEGACY 1
634
633/** 635/**
634 * DRM head structure. This structure represent a video head on a card 636 * DRM minor structure. This structure represents a drm minor number.
635 * that may contain multiple heads. Embed one per head of these in the
636 * private drm_device structure.
637 */ 637 */
638struct drm_head { 638struct drm_minor {
639 int minor; /**< Minor device number */ 639 int index; /**< Minor device number */
640 int type; /**< Control or render */
641 dev_t device; /**< Device number for mknod */
642 struct device kdev; /**< Linux device */
640 struct drm_device *dev; 643 struct drm_device *dev;
641 struct proc_dir_entry *dev_root; /**< proc directory entry */ 644 struct proc_dir_entry *dev_root; /**< proc directory entry */
642 dev_t device; /**< Device number for mknod */
643}; 645};
644 646
645/** 647/**
@@ -647,7 +649,6 @@ struct drm_head {
647 * may contain multiple heads. 649 * may contain multiple heads.
648 */ 650 */
649struct drm_device { 651struct drm_device {
650 struct device dev; /**< Linux device */
651 char *unique; /**< Unique identifier: e.g., busid */ 652 char *unique; /**< Unique identifier: e.g., busid */
652 int unique_len; /**< Length of unique field */ 653 int unique_len; /**< Length of unique field */
653 char *devname; /**< For /proc/interrupts */ 654 char *devname; /**< For /proc/interrupts */
@@ -763,7 +764,7 @@ struct drm_device {
763 struct drm_driver *driver; 764 struct drm_driver *driver;
764 drm_local_map_t *agp_buffer_map; 765 drm_local_map_t *agp_buffer_map;
765 unsigned int agp_buffer_token; 766 unsigned int agp_buffer_token;
766 struct drm_head primary; /**< primary screen head */ 767 struct drm_minor *primary; /**< render type primary screen head */
767 768
768 /** \name Drawable information */ 769 /** \name Drawable information */
769 /*@{ */ 770 /*@{ */
@@ -1030,23 +1031,20 @@ extern int drm_agp_unbind_memory(DRM_AGP_MEM * handle);
1030extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent, 1031extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
1031 struct drm_driver *driver); 1032 struct drm_driver *driver);
1032extern int drm_put_dev(struct drm_device *dev); 1033extern int drm_put_dev(struct drm_device *dev);
1033extern int drm_put_head(struct drm_head *head); 1034extern int drm_put_minor(struct drm_minor **minor);
1034extern unsigned int drm_debug; 1035extern unsigned int drm_debug;
1035extern unsigned int drm_cards_limit; 1036
1036extern struct drm_head **drm_heads;
1037extern struct class *drm_class; 1037extern struct class *drm_class;
1038extern struct proc_dir_entry *drm_proc_root; 1038extern struct proc_dir_entry *drm_proc_root;
1039 1039
1040extern struct idr drm_minors_idr;
1041
1040extern drm_local_map_t *drm_getsarea(struct drm_device *dev); 1042extern drm_local_map_t *drm_getsarea(struct drm_device *dev);
1041 1043
1042 /* Proc support (drm_proc.h) */ 1044 /* Proc support (drm_proc.h) */
1043extern int drm_proc_init(struct drm_device *dev, 1045extern int drm_proc_init(struct drm_minor *minor, int minor_id,
1044 int minor, 1046 struct proc_dir_entry *root);
1045 struct proc_dir_entry *root, 1047extern int drm_proc_cleanup(struct drm_minor *minor, struct proc_dir_entry *root);
1046 struct proc_dir_entry **dev_root);
1047extern int drm_proc_cleanup(int minor,
1048 struct proc_dir_entry *root,
1049 struct proc_dir_entry *dev_root);
1050 1048
1051 /* Scatter Gather Support (drm_scatter.h) */ 1049 /* Scatter Gather Support (drm_scatter.h) */
1052extern void drm_sg_cleanup(struct drm_sg_mem * entry); 1050extern 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);
1071struct drm_sysfs_class; 1069struct drm_sysfs_class;
1072extern struct class *drm_sysfs_create(struct module *owner, char *name); 1070extern struct class *drm_sysfs_create(struct module *owner, char *name);
1073extern void drm_sysfs_destroy(void); 1071extern void drm_sysfs_destroy(void);
1074extern int drm_sysfs_device_add(struct drm_device *dev, struct drm_head *head); 1072extern int drm_sysfs_device_add(struct drm_minor *minor);
1075extern void drm_sysfs_device_remove(struct drm_device *dev); 1073extern void drm_sysfs_device_remove(struct drm_minor *minor);
1076 1074
1077/* 1075/*
1078 * Basic memory manager support (drm_mm.c) 1076 * Basic memory manager support (drm_mm.c)