]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
drm: de-typedef sman
authorDave Airlie <airlied@linux.ie>
Thu, 12 Jul 2007 00:21:05 +0000 (10:21 +1000)
committerDave Airlie <airlied@linux.ie>
Thu, 12 Jul 2007 00:21:05 +0000 (10:21 +1000)
Signed-off-by: Dave Airlie <airlied@linux.ie>
drivers/char/drm/drm_sman.c
drivers/char/drm/drm_sman.h
drivers/char/drm/sis_drv.h
drivers/char/drm/sis_mm.c
drivers/char/drm/via_drv.h
drivers/char/drm/via_mm.c

index 8e4bfbd89632932fea5554121c1258661c68293e..5a075f070c6a10e4550fee92c7372dd6ac667bf9 100644 (file)
@@ -44,7 +44,7 @@ typedef struct drm_owner_item {
        struct list_head mem_blocks;
 } drm_owner_item_t;
 
-void drm_sman_takedown(drm_sman_t * sman)
+void drm_sman_takedown(struct drm_sman * sman)
 {
        drm_ht_remove(&sman->user_hash_tab);
        drm_ht_remove(&sman->owner_hash_tab);
@@ -56,12 +56,12 @@ void drm_sman_takedown(drm_sman_t * sman)
 EXPORT_SYMBOL(drm_sman_takedown);
 
 int
-drm_sman_init(drm_sman_t * sman, unsigned int num_managers,
+drm_sman_init(struct drm_sman * sman, unsigned int num_managers,
              unsigned int user_order, unsigned int owner_order)
 {
        int ret = 0;
 
-       sman->mm = (drm_sman_mm_t *) drm_calloc(num_managers, sizeof(*sman->mm),
+       sman->mm = (struct drm_sman_mm *) drm_calloc(num_managers, sizeof(*sman->mm),
                                                DRM_MEM_MM);
        if (!sman->mm) {
                ret = -ENOMEM;
@@ -120,10 +120,10 @@ static unsigned long drm_sman_mm_offset(void *private, void *ref)
 }
 
 int
-drm_sman_set_range(drm_sman_t * sman, unsigned int manager,
+drm_sman_set_range(struct drm_sman * sman, unsigned int manager,
                   unsigned long start, unsigned long size)
 {
-       drm_sman_mm_t *sman_mm;
+       struct drm_sman_mm *sman_mm;
        struct drm_mm *mm;
        int ret;
 
@@ -153,8 +153,8 @@ drm_sman_set_range(drm_sman_t * sman, unsigned int manager,
 EXPORT_SYMBOL(drm_sman_set_range);
 
 int
-drm_sman_set_manager(drm_sman_t * sman, unsigned int manager,
-                    drm_sman_mm_t * allocator)
+drm_sman_set_manager(struct drm_sman * sman, unsigned int manager,
+                    struct drm_sman_mm * allocator)
 {
        BUG_ON(manager >= sman->num_managers);
        sman->mm[manager] = *allocator;
@@ -163,7 +163,7 @@ drm_sman_set_manager(drm_sman_t * sman, unsigned int manager,
 }
 EXPORT_SYMBOL(drm_sman_set_manager);
 
-static drm_owner_item_t *drm_sman_get_owner_item(drm_sman_t * sman,
+static drm_owner_item_t *drm_sman_get_owner_item(struct drm_sman * sman,
                                                 unsigned long owner)
 {
        int ret;
@@ -194,14 +194,14 @@ out:
        return NULL;
 }
 
-drm_memblock_item_t *drm_sman_alloc(drm_sman_t *sman, unsigned int manager,
+struct drm_memblock_item *drm_sman_alloc(struct drm_sman *sman, unsigned int manager,
                                    unsigned long size, unsigned alignment,
                                    unsigned long owner)
 {
        void *tmp;
-       drm_sman_mm_t *sman_mm;
+       struct drm_sman_mm *sman_mm;
        drm_owner_item_t *owner_item;
-       drm_memblock_item_t *memblock;
+       struct drm_memblock_item *memblock;
 
        BUG_ON(manager >= sman->num_managers);
 
@@ -246,9 +246,9 @@ out:
 
 EXPORT_SYMBOL(drm_sman_alloc);
 
-static void drm_sman_free(drm_memblock_item_t *item)
+static void drm_sman_free(struct drm_memblock_item *item)
 {
-       drm_sman_t *sman = item->sman;
+       struct drm_sman *sman = item->sman;
 
        list_del(&item->owner_list);
        drm_ht_remove_item(&sman->user_hash_tab, &item->user_hash);
@@ -256,22 +256,23 @@ static void drm_sman_free(drm_memblock_item_t *item)
        drm_free(item, sizeof(*item), DRM_MEM_MM);
 }
 
-int drm_sman_free_key(drm_sman_t *sman, unsigned int key)
+int drm_sman_free_key(struct drm_sman *sman, unsigned int key)
 {
        drm_hash_item_t *hash_item;
-       drm_memblock_item_t *memblock_item;
+       struct drm_memblock_item *memblock_item;
 
        if (drm_ht_find_item(&sman->user_hash_tab, key, &hash_item))
                return -EINVAL;
 
-       memblock_item = drm_hash_entry(hash_item, drm_memblock_item_t, user_hash);
+       memblock_item = drm_hash_entry(hash_item, struct drm_memblock_item,
+                                      user_hash);
        drm_sman_free(memblock_item);
        return 0;
 }
 
 EXPORT_SYMBOL(drm_sman_free_key);
 
-static void drm_sman_remove_owner(drm_sman_t *sman,
+static void drm_sman_remove_owner(struct drm_sman *sman,
                                  drm_owner_item_t *owner_item)
 {
        list_del(&owner_item->sman_list);
@@ -279,7 +280,7 @@ static void drm_sman_remove_owner(drm_sman_t *sman,
        drm_free(owner_item, sizeof(*owner_item), DRM_MEM_MM);
 }
 
-int drm_sman_owner_clean(drm_sman_t *sman, unsigned long owner)
+int drm_sman_owner_clean(struct drm_sman *sman, unsigned long owner)
 {
 
        drm_hash_item_t *hash_item;
@@ -300,10 +301,10 @@ int drm_sman_owner_clean(drm_sman_t *sman, unsigned long owner)
 
 EXPORT_SYMBOL(drm_sman_owner_clean);
 
-static void drm_sman_do_owner_cleanup(drm_sman_t *sman,
+static void drm_sman_do_owner_cleanup(struct drm_sman *sman,
                                      drm_owner_item_t *owner_item)
 {
-       drm_memblock_item_t *entry, *next;
+       struct drm_memblock_item *entry, *next;
 
        list_for_each_entry_safe(entry, next, &owner_item->mem_blocks,
                                 owner_list) {
@@ -312,7 +313,7 @@ static void drm_sman_do_owner_cleanup(drm_sman_t *sman,
        drm_sman_remove_owner(sman, owner_item);
 }
 
-void drm_sman_owner_cleanup(drm_sman_t *sman, unsigned long owner)
+void drm_sman_owner_cleanup(struct drm_sman *sman, unsigned long owner)
 {
 
        drm_hash_item_t *hash_item;
@@ -329,11 +330,11 @@ void drm_sman_owner_cleanup(drm_sman_t *sman, unsigned long owner)
 
 EXPORT_SYMBOL(drm_sman_owner_cleanup);
 
-void drm_sman_cleanup(drm_sman_t *sman)
+void drm_sman_cleanup(struct drm_sman *sman)
 {
        drm_owner_item_t *entry, *next;
        unsigned int i;
-       drm_sman_mm_t *sman_mm;
+       struct drm_sman_mm *sman_mm;
 
        list_for_each_entry_safe(entry, next, &sman->owner_items, sman_list) {
                drm_sman_do_owner_cleanup(sman, entry);
index ddc732a1bf2730efd5d27c31613576ca1a6945b9..2fef3b2bb61334997e61a8eb5d1d9f007ff1e59a 100644 (file)
@@ -50,7 +50,7 @@
  * for memory management.
  */
 
-typedef struct drm_sman_mm {
+struct drm_sman_mm {
        /* private info. If allocated, needs to be destroyed by the destroy
           function */
        void *private;
@@ -74,30 +74,30 @@ typedef struct drm_sman_mm {
           "alloc" function */
 
        unsigned long (*offset) (void *private, void *ref);
-} drm_sman_mm_t;
+};
 
-typedef struct drm_memblock_item {
+struct drm_memblock_item {
        struct list_head owner_list;
        drm_hash_item_t user_hash;
        void *mm_info;
-       drm_sman_mm_t *mm;
+       struct drm_sman_mm *mm;
        struct drm_sman *sman;
-} drm_memblock_item_t;
+};
 
-typedef struct drm_sman {
-       drm_sman_mm_t *mm;
+struct drm_sman {
+       struct drm_sman_mm *mm;
        int num_managers;
        drm_open_hash_t owner_hash_tab;
        drm_open_hash_t user_hash_tab;
        struct list_head owner_items;
-} drm_sman_t;
+};
 
 /*
  * Take down a memory manager. This function should only be called after a
  * successful init and after a call to drm_sman_cleanup.
  */
 
-extern void drm_sman_takedown(drm_sman_t * sman);
+extern void drm_sman_takedown(struct drm_sman * sman);
 
 /*
  * Allocate structures for a manager.
@@ -112,7 +112,7 @@ extern void drm_sman_takedown(drm_sman_t * sman);
  *
  */
 
-extern int drm_sman_init(drm_sman_t * sman, unsigned int num_managers,
+extern int drm_sman_init(struct drm_sman * sman, unsigned int num_managers,
                         unsigned int user_order, unsigned int owner_order);
 
 /*
@@ -120,7 +120,7 @@ extern int drm_sman_init(drm_sman_t * sman, unsigned int num_managers,
  * manager unless a customized allogator is used.
  */
 
-extern int drm_sman_set_range(drm_sman_t * sman, unsigned int manager,
+extern int drm_sman_set_range(struct drm_sman * sman, unsigned int manager,
                              unsigned long start, unsigned long size);
 
 /*
@@ -129,23 +129,23 @@ extern int drm_sman_set_range(drm_sman_t * sman, unsigned int manager,
  * so it can be destroyed after this call.
  */
 
-extern int drm_sman_set_manager(drm_sman_t * sman, unsigned int mananger,
-                               drm_sman_mm_t * allocator);
+extern int drm_sman_set_manager(struct drm_sman * sman, unsigned int mananger,
+                               struct drm_sman_mm * allocator);
 
 /*
  * Allocate a memory block. Aligment is not implemented yet.
  */
 
-extern drm_memblock_item_t *drm_sman_alloc(drm_sman_t * sman,
-                                          unsigned int manager,
-                                          unsigned long size,
-                                          unsigned alignment,
-                                          unsigned long owner);
+extern struct drm_memblock_item *drm_sman_alloc(struct drm_sman * sman,
+                                               unsigned int manager,
+                                               unsigned long size,
+                                               unsigned alignment,
+                                               unsigned long owner);
 /*
  * Free a memory block identified by its user hash key.
  */
 
-extern int drm_sman_free_key(drm_sman_t * sman, unsigned int key);
+extern int drm_sman_free_key(struct drm_sman * sman, unsigned int key);
 
 /*
  * returns 1 iff there are no stale memory blocks associated with this owner.
@@ -154,7 +154,7 @@ extern int drm_sman_free_key(drm_sman_t * sman, unsigned int key);
  * resources associated with owner.
  */
 
-extern int drm_sman_owner_clean(drm_sman_t * sman, unsigned long owner);
+extern int drm_sman_owner_clean(struct drm_sman * sman, unsigned long owner);
 
 /*
  * Frees all stale memory blocks associated with this owner. Note that this
@@ -164,13 +164,13 @@ extern int drm_sman_owner_clean(drm_sman_t * sman, unsigned long owner);
  * is not going to be referenced anymore.
  */
 
-extern void drm_sman_owner_cleanup(drm_sman_t * sman, unsigned long owner);
+extern void drm_sman_owner_cleanup(struct drm_sman * sman, unsigned long owner);
 
 /*
  * Frees all stale memory blocks associated with the memory manager.
  * See idling above.
  */
 
-extern void drm_sman_cleanup(drm_sman_t * sman);
+extern void drm_sman_cleanup(struct drm_sman * sman);
 
 #endif
index 83c0ef264a154c63cab7326813331bf58635e88b..5630df8743539c86377007d588b6932933e5cc4f 100644 (file)
@@ -46,6 +46,7 @@ enum sis_family {
 
 #include "drm_sman.h"
 
+
 #define SIS_BASE (dev_priv->mmio)
 #define SIS_READ(reg)         DRM_READ32(SIS_BASE, reg);
 #define SIS_WRITE(reg, val)   DRM_WRITE32(SIS_BASE, reg, val);
@@ -53,7 +54,7 @@ enum sis_family {
 typedef struct drm_sis_private {
        drm_local_map_t *mmio;
        unsigned int idle_fault;
-       drm_sman_t sman;
+       struct drm_sman sman;
        unsigned int chipset;
        int vram_initialized;
        int agp_initialized;
index e524b66a8ee9452d88ed3d3aa6e0f69f42f51089..0580fa33cb77cf0e3db579d93c6c0146936d58e2 100644 (file)
@@ -130,7 +130,7 @@ static int sis_drm_alloc(struct drm_device *dev, struct drm_file * priv,
        drm_sis_mem_t __user *argp = (drm_sis_mem_t __user *) data;
        drm_sis_mem_t mem;
        int retval = 0;
-       drm_memblock_item_t *item;
+       struct drm_memblock_item *item;
 
        DRM_COPY_FROM_USER_IOCTL(mem, argp, sizeof(mem));
 
index 11416b9568454a54cfa01358cb488aa3eb7afe25..576711564a11d9d6668eb57da75b962e82e41252 100644 (file)
@@ -87,7 +87,7 @@ typedef struct drm_via_private {
        uint32_t irq_pending_mask;
        int *irq_map;
        unsigned int idle_fault;
-       drm_sman_t sman;
+       struct drm_sman sman;
        int vram_initialized;
        int agp_initialized;
        unsigned long vram_offset;
index b609c48d07f232195f1b08218deaac93323f443a..85d56acd9d82e0755a2c837272c62a2931750088 100644 (file)
@@ -127,7 +127,7 @@ int via_mem_alloc(DRM_IOCTL_ARGS)
 
        drm_via_mem_t mem;
        int retval = 0;
-       drm_memblock_item_t *item;
+       struct drm_memblock_item *item;
        drm_via_private_t *dev_priv = (drm_via_private_t *) dev->dev_private;
        unsigned long tmpSize;