Commit 8562b3f2 authored by Dave Airlie's avatar Dave Airlie Committed by Dave Airlie

drm: some minor cleanups and changes to make memory manager merging easier.

Signed-off-by: default avatarDave Airlie <airlied@linux.ie>
parent 488b5ec8
...@@ -292,7 +292,6 @@ struct drm_magic_entry { ...@@ -292,7 +292,6 @@ struct drm_magic_entry {
struct list_head head; struct list_head head;
struct drm_hash_item hash_item; struct drm_hash_item hash_item;
struct drm_file *priv; struct drm_file *priv;
struct drm_magic_entry *next;
}; };
struct drm_vma_entry { struct drm_vma_entry {
...@@ -388,8 +387,8 @@ struct drm_file { ...@@ -388,8 +387,8 @@ struct drm_file {
struct drm_head *head; struct drm_head *head;
int remove_auth_on_close; int remove_auth_on_close;
unsigned long lock_count; unsigned long lock_count;
void *driver_priv;
struct file *filp; struct file *filp;
void *driver_priv;
}; };
/** Wait queue */ /** Wait queue */
...@@ -401,11 +400,9 @@ struct drm_queue { ...@@ -401,11 +400,9 @@ struct drm_queue {
wait_queue_head_t read_queue; /**< Processes waiting on block_read */ wait_queue_head_t read_queue; /**< Processes waiting on block_read */
atomic_t block_write; /**< Queue blocked for writes */ atomic_t block_write; /**< Queue blocked for writes */
wait_queue_head_t write_queue; /**< Processes waiting on block_write */ wait_queue_head_t write_queue; /**< Processes waiting on block_write */
#if 1
atomic_t total_queued; /**< Total queued statistic */ atomic_t total_queued; /**< Total queued statistic */
atomic_t total_flushed; /**< Total flushes statistic */ atomic_t total_flushed; /**< Total flushes statistic */
atomic_t total_locks; /**< Total locks statistics */ atomic_t total_locks; /**< Total locks statistics */
#endif
enum drm_ctx_flags flags; /**< Context preserving and 2D-only */ enum drm_ctx_flags flags; /**< Context preserving and 2D-only */
struct drm_waitlist waitlist; /**< Pending buffers */ struct drm_waitlist waitlist; /**< Pending buffers */
wait_queue_head_t flush_queue; /**< Processes waiting until flush */ wait_queue_head_t flush_queue; /**< Processes waiting until flush */
...@@ -416,7 +413,8 @@ struct drm_queue { ...@@ -416,7 +413,8 @@ struct drm_queue {
*/ */
struct drm_lock_data { struct drm_lock_data {
struct drm_hw_lock *hw_lock; /**< Hardware lock */ struct drm_hw_lock *hw_lock; /**< Hardware lock */
struct drm_file *file_priv; /**< File descr of lock holder (0=kernel) */ /** Private of lock holder's file (NULL=kernel) */
struct drm_file *file_priv;
wait_queue_head_t lock_queue; /**< Queue of blocked processes */ wait_queue_head_t lock_queue; /**< Queue of blocked processes */
unsigned long lock_time; /**< Time of last lock in jiffies */ unsigned long lock_time; /**< Time of last lock in jiffies */
spinlock_t spinlock; spinlock_t spinlock;
...@@ -491,6 +489,27 @@ struct drm_sigdata { ...@@ -491,6 +489,27 @@ struct drm_sigdata {
struct drm_hw_lock *lock; struct drm_hw_lock *lock;
}; };
/*
* Generic memory manager structs
*/
struct drm_mm_node {
struct list_head fl_entry;
struct list_head ml_entry;
int free;
unsigned long start;
unsigned long size;
struct drm_mm *mm;
void *private;
};
struct drm_mm {
struct list_head fl_entry;
struct list_head ml_entry;
};
/** /**
* Mappings list * Mappings list
*/ */
...@@ -498,7 +517,7 @@ struct drm_map_list { ...@@ -498,7 +517,7 @@ struct drm_map_list {
struct list_head head; /**< list head */ struct list_head head; /**< list head */
struct drm_hash_item hash; struct drm_hash_item hash;
struct drm_map *map; /**< mapping */ struct drm_map *map; /**< mapping */
unsigned int user_token; uint64_t user_token;
}; };
typedef struct drm_map drm_local_map_t; typedef struct drm_map drm_local_map_t;
...@@ -536,24 +555,6 @@ struct drm_ati_pcigart_info { ...@@ -536,24 +555,6 @@ struct drm_ati_pcigart_info {
int table_size; int table_size;
}; };
/*
* Generic memory manager structs
*/
struct drm_mm_node {
struct list_head fl_entry;
struct list_head ml_entry;
int free;
unsigned long start;
unsigned long size;
struct drm_mm *mm;
void *private;
};
struct drm_mm {
struct list_head fl_entry;
struct list_head ml_entry;
};
/** /**
* DRM driver structure. This structure represent the common code for * DRM driver structure. This structure represent the common code for
* a family of cards. There will one drm_device for each card present * a family of cards. There will one drm_device for each card present
...@@ -750,7 +751,6 @@ struct drm_device { ...@@ -750,7 +751,6 @@ struct drm_device {
struct pci_controller *hose; struct pci_controller *hose;
#endif #endif
struct drm_sg_mem *sg; /**< Scatter gather memory */ struct drm_sg_mem *sg; /**< Scatter gather memory */
unsigned long *ctx_bitmap; /**< context bitmap */
void *dev_private; /**< device private data */ void *dev_private; /**< device private data */
struct drm_sigdata sigdata; /**< For block_all_signals */ struct drm_sigdata sigdata; /**< For block_all_signals */
sigset_t sigmask; sigset_t sigmask;
...@@ -1073,7 +1073,7 @@ extern void drm_sysfs_device_remove(struct class_device *class_dev); ...@@ -1073,7 +1073,7 @@ extern void drm_sysfs_device_remove(struct class_device *class_dev);
extern struct drm_mm_node *drm_mm_get_block(struct drm_mm_node * parent, extern struct drm_mm_node *drm_mm_get_block(struct drm_mm_node * parent,
unsigned long size, unsigned long size,
unsigned alignment); unsigned alignment);
void drm_mm_put_block(struct drm_mm_node * cur); extern void drm_mm_put_block(struct drm_mm_node * cur);
extern struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm, unsigned long size, extern struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm, unsigned long size,
unsigned alignment, int best_match); unsigned alignment, int best_match);
extern int drm_mm_init(struct drm_mm *mm, unsigned long start, unsigned long size); extern int drm_mm_init(struct drm_mm *mm, unsigned long start, unsigned long size);
......
...@@ -236,11 +236,11 @@ static int drm__vm_info(char *buf, char **start, off_t offset, int request, ...@@ -236,11 +236,11 @@ static int drm__vm_info(char *buf, char **start, off_t offset, int request,
type = "??"; type = "??";
else else
type = types[map->type]; type = types[map->type];
DRM_PROC_PRINT("%4d 0x%08lx 0x%08lx %4.4s 0x%02x 0x%08x ", DRM_PROC_PRINT("%4d 0x%08lx 0x%08lx %4.4s 0x%02x 0x%08lx ",
i, i,
map->offset, map->offset,
map->size, type, map->flags, map->size, type, map->flags,
r_list->user_token); (unsigned long) r_list->user_token);
if (map->mtrr < 0) { if (map->mtrr < 0) {
DRM_PROC_PRINT("none\n"); DRM_PROC_PRINT("none\n");
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment