aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drmP.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2007-05-25 15:01:51 -0400
committerDave Airlie <airlied@linux.ie>2007-07-10 21:58:02 -0400
commitbd1b331fae2813d9f03ceee649296f02edc0b893 (patch)
tree6139f72ebae88c332c754745f3d98cbe794ae4de /drivers/char/drm/drmP.h
parent4eb6bf6bfb580afaf1e1a1d30cba17a078530cf4 (diff)
drm: cleanup use of Linux list handling macros
This makes the drms use of the list handling macros a lot cleaner and more along the lines of how they should be used and uses them in some more places. Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/drmP.h')
-rw-r--r--drivers/char/drm/drmP.h32
1 files changed, 12 insertions, 20 deletions
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
index d494315752a2..22779582ee5b 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
@@ -279,20 +279,15 @@ typedef struct drm_devstate {
279} drm_devstate_t; 279} drm_devstate_t;
280 280
281typedef struct drm_magic_entry { 281typedef struct drm_magic_entry {
282 drm_hash_item_t hash_item;
283 struct list_head head; 282 struct list_head head;
283 drm_hash_item_t hash_item;
284 struct drm_file *priv; 284 struct drm_file *priv;
285 struct drm_magic_entry *next; 285 struct drm_magic_entry *next;
286} drm_magic_entry_t; 286} drm_magic_entry_t;
287 287
288typedef struct drm_magic_head {
289 struct drm_magic_entry *head;
290 struct drm_magic_entry *tail;
291} drm_magic_head_t;
292
293typedef struct drm_vma_entry { 288typedef struct drm_vma_entry {
289 struct list_head head;
294 struct vm_area_struct *vma; 290 struct vm_area_struct *vma;
295 struct drm_vma_entry *next;
296 pid_t pid; 291 pid_t pid;
297} drm_vma_entry_t; 292} drm_vma_entry_t;
298 293
@@ -379,8 +374,7 @@ typedef struct drm_file {
379 uid_t uid; 374 uid_t uid;
380 drm_magic_t magic; 375 drm_magic_t magic;
381 unsigned long ioctl_count; 376 unsigned long ioctl_count;
382 struct drm_file *next; 377 struct list_head lhead;
383 struct drm_file *prev;
384 struct drm_head *head; 378 struct drm_head *head;
385 int remove_auth_on_close; 379 int remove_auth_on_close;
386 unsigned long lock_count; 380 unsigned long lock_count;
@@ -449,8 +443,7 @@ typedef struct drm_agp_mem {
449 DRM_AGP_MEM *memory; 443 DRM_AGP_MEM *memory;
450 unsigned long bound; /**< address */ 444 unsigned long bound; /**< address */
451 int pages; 445 int pages;
452 struct drm_agp_mem *prev; /**< previous entry */ 446 struct list_head head;
453 struct drm_agp_mem *next; /**< next entry */
454} drm_agp_mem_t; 447} drm_agp_mem_t;
455 448
456/** 449/**
@@ -460,7 +453,7 @@ typedef struct drm_agp_mem {
460 */ 453 */
461typedef struct drm_agp_head { 454typedef struct drm_agp_head {
462 DRM_AGP_KERN agp_info; /**< AGP device information */ 455 DRM_AGP_KERN agp_info; /**< AGP device information */
463 drm_agp_mem_t *memory; /**< memory entries */ 456 struct list_head memory;
464 unsigned long mode; /**< AGP mode */ 457 unsigned long mode; /**< AGP mode */
465 struct agp_bridge_data *bridge; 458 struct agp_bridge_data *bridge;
466 int enabled; /**< whether the AGP bus as been enabled */ 459 int enabled; /**< whether the AGP bus as been enabled */
@@ -669,28 +662,27 @@ typedef struct drm_device {
669 662
670 /** \name Authentication */ 663 /** \name Authentication */
671 /*@{ */ 664 /*@{ */
672 drm_file_t *file_first; /**< file list head */ 665 struct list_head filelist;
673 drm_file_t *file_last; /**< file list tail */
674 drm_open_hash_t magiclist; /**< magic hash table */ 666 drm_open_hash_t magiclist; /**< magic hash table */
675 struct list_head magicfree; 667 struct list_head magicfree;
676 /*@} */ 668 /*@} */
677 669
678 /** \name Memory management */ 670 /** \name Memory management */
679 /*@{ */ 671 /*@{ */
680 drm_map_list_t *maplist; /**< Linked list of regions */ 672 struct list_head maplist; /**< Linked list of regions */
681 int map_count; /**< Number of mappable regions */ 673 int map_count; /**< Number of mappable regions */
682 drm_open_hash_t map_hash; /**< User token hash table for maps */ 674 drm_open_hash_t map_hash; /**< User token hash table for maps */
683 675
684 /** \name Context handle management */ 676 /** \name Context handle management */
685 /*@{ */ 677 /*@{ */
686 drm_ctx_list_t *ctxlist; /**< Linked list of context handles */ 678 struct list_head ctxlist; /**< Linked list of context handles */
687 int ctx_count; /**< Number of context handles */ 679 int ctx_count; /**< Number of context handles */
688 struct mutex ctxlist_mutex; /**< For ctxlist */ 680 struct mutex ctxlist_mutex; /**< For ctxlist */
689 681
690 drm_map_t **context_sareas; /**< per-context SAREA's */ 682 drm_map_t **context_sareas; /**< per-context SAREA's */
691 int max_context; 683 int max_context;
692 684
693 drm_vma_entry_t *vmalist; /**< List of vmas (for debugging) */ 685 struct list_head vmalist; /**< List of vmas (for debugging) */
694 drm_lock_data_t lock; /**< Information on hardware lock */ 686 drm_lock_data_t lock; /**< Information on hardware lock */
695 /*@} */ 687 /*@} */
696 688
@@ -725,8 +717,8 @@ typedef struct drm_device {
725 atomic_t vbl_received; 717 atomic_t vbl_received;
726 atomic_t vbl_received2; /**< number of secondary VBLANK interrupts */ 718 atomic_t vbl_received2; /**< number of secondary VBLANK interrupts */
727 spinlock_t vbl_lock; 719 spinlock_t vbl_lock;
728 drm_vbl_sig_t vbl_sigs; /**< signal list to send on VBLANK */ 720 struct list_head vbl_sigs; /**< signal list to send on VBLANK */
729 drm_vbl_sig_t vbl_sigs2; /**< signals to send on secondary VBLANK */ 721 struct list_head vbl_sigs2; /**< signals to send on secondary VBLANK */
730 unsigned int vbl_pending; 722 unsigned int vbl_pending;
731 spinlock_t tasklet_lock; /**< For drm_locked_tasklet */ 723 spinlock_t tasklet_lock; /**< For drm_locked_tasklet */
732 void (*locked_tasklet_func)(struct drm_device *dev); 724 void (*locked_tasklet_func)(struct drm_device *dev);
@@ -1089,7 +1081,7 @@ static __inline__ struct drm_map *drm_core_findmap(struct drm_device *dev,
1089 unsigned int token) 1081 unsigned int token)
1090{ 1082{
1091 drm_map_list_t *_entry; 1083 drm_map_list_t *_entry;
1092 list_for_each_entry(_entry, &dev->maplist->head, head) 1084 list_for_each_entry(_entry, &dev->maplist, head)
1093 if (_entry->user_token == token) 1085 if (_entry->user_token == token)
1094 return _entry->map; 1086 return _entry->map;
1095 return NULL; 1087 return NULL;