]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm: misc cleanup
authorDave Airlie <airlied@starflyer.(none)>
Thu, 7 Jul 2005 11:03:38 +0000 (21:03 +1000)
committerDave Airlie <airlied@linux.ie>
Thu, 7 Jul 2005 11:03:38 +0000 (21:03 +1000)
This patch contains the following cleanups:
- make needlessly global functions static
- remove the following unused global functions:
 - drm_fops.c: drm_read
 - i915_dma.c: i915_do_cleanup_pageflip

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave Airlie <airlied@linux.ie>
23 files changed:
drivers/char/drm/ati_pcigart.c
drivers/char/drm/drmP.h
drivers/char/drm/drm_auth.c
drivers/char/drm/drm_bufs.c
drivers/char/drm/drm_context.c
drivers/char/drm/drm_drv.c
drivers/char/drm/drm_fops.c
drivers/char/drm/drm_irq.c
drivers/char/drm/drm_lock.c
drivers/char/drm/drm_proc.c
drivers/char/drm/drm_stub.c
drivers/char/drm/drm_vm.c
drivers/char/drm/i810_dma.c
drivers/char/drm/i810_drv.h
drivers/char/drm/i830_dma.c
drivers/char/drm/i830_drv.c
drivers/char/drm/i830_drv.h
drivers/char/drm/i830_irq.c
drivers/char/drm/i915_dma.c
drivers/char/drm/i915_drv.c
drivers/char/drm/i915_drv.h
drivers/char/drm/i915_irq.c
drivers/char/drm/r128_state.c

index fdca1876ecd5f0aa65012b0dc96e88ab4db59846..0aec5ef481b8600040da86257d049e65d74b1a4b 100644 (file)
@@ -52,7 +52,7 @@
 # define ATI_MAX_PCIGART_PAGES         8192    /**< 32 MB aperture, 4K pages */
 # define ATI_PCIGART_PAGE_SIZE         4096    /**< PCI GART page size */
 
-unsigned long drm_ati_alloc_pcigart_table( void )
+static unsigned long drm_ati_alloc_pcigart_table( void )
 {
        unsigned long address;
        struct page *page;
index 2c7b1fc3bb2eb19379e7a9033969cd509768c300..5df09cc8c6db62a7eab1a2a3e1d6061bbb54c997 100644 (file)
@@ -774,8 +774,6 @@ extern int           drm_cpu_valid( void );
                                /* Driver support (drm_drv.h) */
 extern int           drm_init(struct drm_driver *driver);
 extern void          drm_exit(struct drm_driver *driver);
-extern int           drm_version(struct inode *inode, struct file *filp,
-                                 unsigned int cmd, unsigned long arg);
 extern int           drm_ioctl(struct inode *inode, struct file *filp,
                                unsigned int cmd, unsigned long arg);
 extern long         drm_compat_ioctl(struct file *filp,
@@ -785,21 +783,13 @@ extern int           drm_takedown(drm_device_t * dev);
                                /* Device support (drm_fops.h) */
 extern int           drm_open(struct inode *inode, struct file *filp);
 extern int           drm_stub_open(struct inode *inode, struct file *filp);
-extern int          drm_open_helper(struct inode *inode, struct file *filp,
-                                     drm_device_t *dev);
 extern int          drm_flush(struct file *filp);
 extern int          drm_fasync(int fd, struct file *filp, int on);
 extern int           drm_release(struct inode *inode, struct file *filp);
 
                                /* Mapping support (drm_vm.h) */
-extern void         drm_vm_open(struct vm_area_struct *vma);
-extern void         drm_vm_close(struct vm_area_struct *vma);
-extern void         drm_vm_shm_close(struct vm_area_struct *vma);
-extern int          drm_mmap_dma(struct file *filp,
-                                  struct vm_area_struct *vma);
 extern int          drm_mmap(struct file *filp, struct vm_area_struct *vma);
 extern unsigned int  drm_poll(struct file *filp, struct poll_table_struct *wait);
-extern ssize_t       drm_read(struct file *filp, char __user *buf, size_t count, loff_t *off);
 
                                /* Memory management support (drm_memory.h) */
 #include "drm_memory.h"
@@ -853,9 +843,6 @@ extern int       drm_newctx( struct inode *inode, struct file *filp,
 extern int          drm_rmctx( struct inode *inode, struct file *filp,
                                 unsigned int cmd, unsigned long arg );
 
-extern int          drm_context_switch(drm_device_t *dev, int old, int new);
-extern int          drm_context_switch_complete(drm_device_t *dev, int new);
-
 extern int          drm_ctxbitmap_init( drm_device_t *dev );
 extern void         drm_ctxbitmap_cleanup( drm_device_t *dev );
 extern void          drm_ctxbitmap_free( drm_device_t *dev, int ctx_handle );
@@ -873,9 +860,6 @@ extern int       drm_rmdraw(struct inode *inode, struct file *filp,
 
 
                                /* Authentication IOCTL support (drm_auth.h) */
-extern int          drm_add_magic(drm_device_t *dev, drm_file_t *priv,
-                                   drm_magic_t magic);
-extern int          drm_remove_magic(drm_device_t *dev, drm_magic_t magic);
 extern int          drm_getmagic(struct inode *inode, struct file *filp,
                                   unsigned int cmd, unsigned long arg);
 extern int          drm_authmagic(struct inode *inode, struct file *filp,
@@ -892,13 +876,9 @@ extern int           drm_unlock(struct inode *inode, struct file *filp,
                                 unsigned int cmd, unsigned long arg);
 extern int          drm_lock_take(__volatile__ unsigned int *lock,
                                    unsigned int context);
-extern int          drm_lock_transfer(drm_device_t *dev,
-                                       __volatile__ unsigned int *lock,
-                                       unsigned int context);
 extern int          drm_lock_free(drm_device_t *dev,
                                    __volatile__ unsigned int *lock,
                                    unsigned int context);
-extern int           drm_notifier(void *priv);
 
                                /* Buffer management support (drm_bufs.h) */
 extern int          drm_order( unsigned long size );
@@ -926,7 +906,6 @@ extern void      drm_core_reclaim_buffers(drm_device_t *dev, struct file *filp);
                                /* IRQ support (drm_irq.h) */
 extern int           drm_control( struct inode *inode, struct file *filp,
                                   unsigned int cmd, unsigned long arg );
-extern int           drm_irq_install( drm_device_t *dev );
 extern int           drm_irq_uninstall( drm_device_t *dev );
 extern irqreturn_t   drm_irq_handler( DRM_IRQ_ARGS );
 extern void          drm_driver_irq_preinstall( drm_device_t *dev );
@@ -966,7 +945,6 @@ 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,
                     struct drm_driver *driver);
 extern int drm_put_dev(drm_device_t * dev);
-extern int drm_get_head(drm_device_t * dev, drm_head_t *head);
 extern int drm_put_head(drm_head_t * head);
 extern unsigned int   drm_debug;
 extern unsigned int   drm_cards_limit;
index b428761c4e913069017abb97d7a3851845fa51d3..dd140bca8f71d5b3c5fedbc2d74f1c33187780ed 100644 (file)
@@ -87,7 +87,7 @@ static drm_file_t *drm_find_file(drm_device_t *dev, drm_magic_t magic)
  * associated the magic number hash key in drm_device::magiclist, while holding
  * the drm_device::struct_sem lock.
  */
-int drm_add_magic(drm_device_t *dev, drm_file_t *priv, drm_magic_t magic)
+static int drm_add_magic(drm_device_t *dev, drm_file_t *priv, drm_magic_t magic)
 {
        int               hash;
        drm_magic_entry_t *entry;
@@ -124,7 +124,7 @@ int drm_add_magic(drm_device_t *dev, drm_file_t *priv, drm_magic_t magic)
  * Searches and unlinks the entry in drm_device::magiclist with the magic
  * number hash key, while holding the drm_device::struct_sem lock.
  */
-int drm_remove_magic(drm_device_t *dev, drm_magic_t magic)
+static int drm_remove_magic(drm_device_t *dev, drm_magic_t magic)
 {
        drm_magic_entry_t *prev = NULL;
        drm_magic_entry_t *pt;
index 3407380b865a5953ff4d13b1a086a0c93f315f6d..4c6191d231b8e06e20d876af0287d03df9335153 100644 (file)
@@ -356,8 +356,8 @@ static void drm_cleanup_buf_error(drm_device_t *dev, drm_buf_entry_t *entry)
  * reallocates the buffer list of the same size order to accommodate the new
  * buffers.
  */
-int drm_addbufs_agp( struct inode *inode, struct file *filp,
-                     unsigned int cmd, unsigned long arg )
+static int drm_addbufs_agp( struct inode *inode, struct file *filp,
+                           unsigned int cmd, unsigned long arg )
 {
        drm_file_t *priv = filp->private_data;
        drm_device_t *dev = priv->head->dev;
@@ -521,8 +521,8 @@ int drm_addbufs_agp( struct inode *inode, struct file *filp,
 }
 #endif /* __OS_HAS_AGP */
 
-int drm_addbufs_pci( struct inode *inode, struct file *filp,
-                     unsigned int cmd, unsigned long arg )
+static int drm_addbufs_pci( struct inode *inode, struct file *filp,
+                           unsigned int cmd, unsigned long arg )
 {
        drm_file_t *priv = filp->private_data;
        drm_device_t *dev = priv->head->dev;
@@ -751,8 +751,8 @@ int drm_addbufs_pci( struct inode *inode, struct file *filp,
 
 }
 
-int drm_addbufs_sg( struct inode *inode, struct file *filp,
-                     unsigned int cmd, unsigned long arg )
+static int drm_addbufs_sg( struct inode *inode, struct file *filp,
+                          unsigned int cmd, unsigned long arg )
 {
        drm_file_t *priv = filp->private_data;
        drm_device_t *dev = priv->head->dev;
index fdf661f234ed304b070cc8fe3e48769c609cca5e..a7cfabd1ca2e9d0801c3e8c10b12cc1acbb0601c 100644 (file)
@@ -84,7 +84,7 @@ failed:
  * drm_device::context_sareas to accommodate the new entry while holding the
  * drm_device::struct_sem lock.
  */
-int drm_ctxbitmap_next( drm_device_t *dev )
+static int drm_ctxbitmap_next( drm_device_t *dev )
 {
        int bit;
 
@@ -326,7 +326,7 @@ int drm_context_switch( drm_device_t *dev, int old, int new )
  * hardware lock is held, clears the drm_device::context_flag and wakes up
  * drm_device::context_wait.
  */
-int drm_context_switch_complete( drm_device_t *dev, int new )
+static int drm_context_switch_complete( drm_device_t *dev, int new )
 {
         dev->last_context = new;  /* PRE/POST: This is the _only_ writer. */
         dev->last_switch  = jiffies;
index 1e37ed0c6b8d7c6b34f469dde8d0ca86bfa528b6..3333c250c4d9995848053d4f8a3ecf1286b1ed6b 100644 (file)
 #include "drmP.h"
 #include "drm_core.h"
 
+static int drm_version(struct inode *inode, struct file *filp,
+                      unsigned int cmd, unsigned long arg);
+
 /** Ioctl table */
-drm_ioctl_desc_t                 drm_ioctls[] = {
+static drm_ioctl_desc_t                  drm_ioctls[] = {
        [DRM_IOCTL_NR(DRM_IOCTL_VERSION)]       = { drm_version,     0, 0 },
        [DRM_IOCTL_NR(DRM_IOCTL_GET_UNIQUE)]    = { drm_getunique,   0, 0 },
        [DRM_IOCTL_NR(DRM_IOCTL_GET_MAGIC)]     = { drm_getmagic,    0, 0 },
@@ -447,8 +450,8 @@ module_exit( drm_core_exit );
  *
  * Fills in the version information in \p arg.
  */
-int drm_version( struct inode *inode, struct file *filp,
-                 unsigned int cmd, unsigned long arg )
+static int drm_version( struct inode *inode, struct file *filp,
+                       unsigned int cmd, unsigned long arg )
 {
        drm_file_t *priv = filp->private_data;
        drm_device_t *dev = priv->head->dev;
index a53322d8c2296d3fcec073f1d6e06a6d95e745d7..10e64fde8d782ca23dbc3ef57a3348f97a40d87d 100644 (file)
@@ -37,6 +37,8 @@
 #include "drmP.h"
 #include <linux/poll.h>
 
+static int drm_open_helper(struct inode *inode, struct file *filp, drm_device_t *dev);
+
 static int drm_setup( drm_device_t *dev )
 {
        int i;
@@ -341,7 +343,7 @@ EXPORT_SYMBOL(drm_release);
  * Creates and initializes a drm_file structure for the file private data in \p
  * filp and add it into the double linked list in \p dev.
  */
-int drm_open_helper(struct inode *inode, struct file *filp, drm_device_t *dev)
+static int drm_open_helper(struct inode *inode, struct file *filp, drm_device_t *dev)
 {
        int          minor = iminor(inode);
        drm_file_t   *priv;
@@ -443,9 +445,3 @@ unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait)
 }
 EXPORT_SYMBOL(drm_poll);
 
-
-/** No-op. */
-ssize_t drm_read(struct file *filp, char __user *buf, size_t count, loff_t *off)
-{
-       return 0;
-}
index 2e236ebcf27b344305772d9bd4adf6c9cf235baf..cdd4aecd25e2616b8d5f1dda0db1191b58e58ba0 100644 (file)
@@ -89,7 +89,7 @@ int drm_irq_by_busid(struct inode *inode, struct file *filp,
  * \c drm_driver_irq_preinstall() and \c drm_driver_irq_postinstall() functions
  * before and after the installation.
  */
-int drm_irq_install( drm_device_t *dev )
+static int drm_irq_install( drm_device_t *dev )
 {
        int ret;
        unsigned long sh_flags=0;
index d0d6fc6616253e177f304101976343a2f7af6e9c..4702d863bcc62b11759739818e142c26480b49d2 100644 (file)
 
 #include "drmP.h"
 
+static int drm_lock_transfer(drm_device_t *dev,
+                            __volatile__ unsigned int *lock,
+                            unsigned int context);
+static int drm_notifier(void *priv);
+
 /** 
  * Lock ioctl.
  *
@@ -225,8 +230,9 @@ int drm_lock_take(__volatile__ unsigned int *lock, unsigned int context)
  * Resets the lock file pointer.
  * Marks the lock as held by the given context, via the \p cmpxchg instruction.
  */
-int drm_lock_transfer(drm_device_t *dev,
-                      __volatile__ unsigned int *lock, unsigned int context)
+static int drm_lock_transfer(drm_device_t *dev,
+                            __volatile__ unsigned int *lock,
+                            unsigned int context)
 {
        unsigned int old, new, prev;
 
@@ -282,7 +288,7 @@ int drm_lock_free(drm_device_t *dev,
  * \return one if the signal should be delivered normally, or zero if the
  * signal should be blocked.
  */
-int drm_notifier(void *priv)
+static int drm_notifier(void *priv)
 {
        drm_sigdata_t *s = (drm_sigdata_t *)priv;
        unsigned int  old, new, prev;
index 6e06e8c6a51676222027317d3cee98ac168e9a73..4774087d2e9e82c64d0d05511d02743d9371375f 100644 (file)
@@ -57,7 +57,7 @@ static int       drm_vma_info(char *buf, char **start, off_t offset,
 /**
  * Proc file list.
  */
-struct drm_proc_list {
+static struct drm_proc_list {
        const char *name;       /**< file name */
        int        (*f)(char *, char **, off_t, int, int *, void *);    /**< proc callback*/
 } drm_proc_list[] = {
index 8ccbdef7bb3ec3b9c35096acec942739bb40525e..48829a1a086a94cba10327d6896f8e1dbfdc5e95 100644 (file)
@@ -157,52 +157,6 @@ int drm_stub_open(struct inode *inode, struct file *filp)
        return err;
 }
 
-
-/**
- * Register.
- *
- * \param pdev - PCI device structure
- * \param ent entry from the PCI ID table with device type flags
- * \return zero on success or a negative number on failure.
- *
- * Attempt to gets inter module "drm" information. If we are first
- * then register the character device and inter module information.
- * Try and register, if we fail to register, backout previous work.
- */
-int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
-             struct drm_driver *driver)
-{
-       drm_device_t *dev;
-       int ret;
-
-       DRM_DEBUG("\n");
-
-       dev = drm_calloc(1, sizeof(*dev), DRM_MEM_STUB);
-       if (!dev)
-               return -ENOMEM;
-
-       pci_enable_device(pdev);
-
-       if ((ret = drm_fill_in_dev(dev, pdev, ent, driver))) {
-               printk(KERN_ERR "DRM: Fill_in_dev failed.\n");
-               goto err_g1;
-       }
-       if ((ret = drm_get_head(dev, &dev->primary)))
-               goto err_g1;
-
-       /* postinit is a required function to display the signon banner */
-       /* drivers add secondary heads here if needed */
-       if ((ret = dev->driver->postinit(dev, ent->driver_data)))
-               goto err_g1;
-
-       return 0;
-
-err_g1:
-       drm_free(dev, sizeof(*dev), DRM_MEM_STUB);
-       return ret;
-}
-EXPORT_SYMBOL(drm_get_dev);
-
 /**
  * Get a secondary minor number.
  *
@@ -214,7 +168,7 @@ EXPORT_SYMBOL(drm_get_dev);
  * create the proc init entry via proc_init(). This routines assigns
  * minor numbers to secondary heads of multi-headed cards
  */
-int drm_get_head(drm_device_t *dev, drm_head_t *head)
+static int drm_get_head(drm_device_t *dev, drm_head_t *head)
 {
        drm_head_t **heads = drm_heads;
        int ret;
@@ -262,6 +216,50 @@ err_g1:
        return ret;
 }
                
+/**
+ * Register.
+ *
+ * \param pdev - PCI device structure
+ * \param ent entry from the PCI ID table with device type flags
+ * \return zero on success or a negative number on failure.
+ *
+ * Attempt to gets inter module "drm" information. If we are first
+ * then register the character device and inter module information.
+ * Try and register, if we fail to register, backout previous work.
+ */
+int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
+             struct drm_driver *driver)
+{
+       drm_device_t *dev;
+       int ret;
+
+       DRM_DEBUG("\n");
+
+       dev = drm_calloc(1, sizeof(*dev), DRM_MEM_STUB);
+       if (!dev)
+               return -ENOMEM;
+
+       pci_enable_device(pdev);
+
+       if ((ret = drm_fill_in_dev(dev, pdev, ent, driver))) {
+               printk(KERN_ERR "DRM: Fill_in_dev failed.\n");
+               goto err_g1;
+       }
+       if ((ret = drm_get_head(dev, &dev->primary)))
+               goto err_g1;
+
+       /* postinit is a required function to display the signon banner */
+       /* drivers add secondary heads here if needed */
+       if ((ret = dev->driver->postinit(dev, ent->driver_data)))
+               goto err_g1;
+
+       return 0;
+
+err_g1:
+       drm_free(dev, sizeof(*dev), DRM_MEM_STUB);
+       return ret;
+}
+EXPORT_SYMBOL(drm_get_dev);
 
 /**
  * Put a device minor number.
index fc72f30f312b9f769d25ff942c1d0df480d745c9..621220f3f37207492ed8bfccdcef7d5e94cc0fda 100644 (file)
@@ -38,6 +38,8 @@
 #include <linux/efi.h>
 #endif
 
+static void drm_vm_open(struct vm_area_struct *vma);
+static void drm_vm_close(struct vm_area_struct *vma);
 
 /**
  * \c nopage method for AGP virtual memory.
@@ -163,7 +165,7 @@ static __inline__ struct page *drm_do_vm_shm_nopage(struct vm_area_struct *vma,
  * Deletes map information if we are the last
  * person to close a mapping and it's not in the global maplist.
  */
-void drm_vm_shm_close(struct vm_area_struct *vma)
+static void drm_vm_shm_close(struct vm_area_struct *vma)
 {
        drm_file_t      *priv   = vma->vm_file->private_data;
        drm_device_t    *dev    = priv->head->dev;
@@ -399,7 +401,7 @@ static struct vm_operations_struct   drm_vm_sg_ops = {
  * Create a new drm_vma_entry structure as the \p vma private data entry and
  * add it to drm_device::vmalist.
  */
-void drm_vm_open(struct vm_area_struct *vma)
+static void drm_vm_open(struct vm_area_struct *vma)
 {
        drm_file_t      *priv   = vma->vm_file->private_data;
        drm_device_t    *dev    = priv->head->dev;
@@ -428,7 +430,7 @@ void drm_vm_open(struct vm_area_struct *vma)
  * Search the \p vma private data entry in drm_device::vmalist, unlink it, and
  * free it.
  */
-void drm_vm_close(struct vm_area_struct *vma)
+static void drm_vm_close(struct vm_area_struct *vma)
 {
        drm_file_t      *priv   = vma->vm_file->private_data;
        drm_device_t    *dev    = priv->head->dev;
@@ -463,7 +465,7 @@ void drm_vm_close(struct vm_area_struct *vma)
  * Sets the virtual memory area operations structure to vm_dma_ops, the file
  * pointer, and calls vm_open().
  */
-int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma)
+static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma)
 {
        drm_file_t       *priv   = filp->private_data;
        drm_device_t     *dev;
index 24857cc6c23b3f37fbc57ce514c87f3d43ffbd4b..18e0b76228937d5236f4f55ee820b573353ed819 100644 (file)
@@ -90,16 +90,7 @@ static int i810_freelist_put(drm_device_t *dev, drm_buf_t *buf)
        return 0;
 }
 
-static struct file_operations i810_buffer_fops = {
-       .open    = drm_open,
-       .flush   = drm_flush,
-       .release = drm_release,
-       .ioctl   = drm_ioctl,
-       .mmap    = i810_mmap_buffers,
-       .fasync  = drm_fasync,
-};
-
-int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
+static int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
 {
        drm_file_t          *priv         = filp->private_data;
        drm_device_t        *dev;
@@ -126,6 +117,15 @@ int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
        return 0;
 }
 
+static struct file_operations i810_buffer_fops = {
+       .open    = drm_open,
+       .flush   = drm_flush,
+       .release = drm_release,
+       .ioctl   = drm_ioctl,
+       .mmap    = i810_mmap_buffers,
+       .fasync  = drm_fasync,
+};
+
 static int i810_map_buffer(drm_buf_t *buf, struct file *filp)
 {
        drm_file_t        *priv   = filp->private_data;
@@ -1003,8 +1003,8 @@ void i810_reclaim_buffers(drm_device_t *dev, struct file *filp)
        }
 }
 
-int i810_flush_ioctl(struct inode *inode, struct file *filp,
-                    unsigned int cmd, unsigned long arg)
+static int i810_flush_ioctl(struct inode *inode, struct file *filp,
+                           unsigned int cmd, unsigned long arg)
 {
        drm_file_t        *priv   = filp->private_data;
        drm_device_t      *dev    = priv->head->dev;
index fa23ca454e57928d771639f5bebecb5d85cbb0b0..1b40538d1725041d3dff8c603ef54b7adf4d1552 100644 (file)
@@ -115,7 +115,6 @@ typedef struct drm_i810_private {
 
                                /* i810_dma.c */
 extern void i810_reclaim_buffers(drm_device_t *dev, struct file *filp);
-extern int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma);
 
 extern int i810_driver_dma_quiescent(drm_device_t *dev);
 extern void i810_driver_release(drm_device_t *dev, struct file *filp);
index 98adccf8e4341f748adf70255c15fb6cf91f93ff..dc7733035864d9e2e058e0b86766bec7d1e11643 100644 (file)
@@ -92,16 +92,7 @@ static int i830_freelist_put(drm_device_t *dev, drm_buf_t *buf)
        return 0;
 }
 
-static struct file_operations i830_buffer_fops = {
-       .open    = drm_open,
-       .flush   = drm_flush,
-       .release = drm_release,
-       .ioctl   = drm_ioctl,
-       .mmap    = i830_mmap_buffers,
-       .fasync  = drm_fasync,
-};
-
-int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
+static int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
 {
        drm_file_t          *priv         = filp->private_data;
        drm_device_t        *dev;
@@ -128,6 +119,15 @@ int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
        return 0;
 }
 
+static struct file_operations i830_buffer_fops = {
+       .open    = drm_open,
+       .flush   = drm_flush,
+       .release = drm_release,
+       .ioctl   = drm_ioctl,
+       .mmap    = i830_mmap_buffers,
+       .fasync  = drm_fasync,
+};
+
 static int i830_map_buffer(drm_buf_t *buf, struct file *filp)
 {
        drm_file_t        *priv   = filp->private_data;
index aa80ad6a5ee01927c9a46f4ddc4811ce156f7cf4..bc36be76b8b238f79f13b4cdf0125fa7513a0cce 100644 (file)
@@ -40,7 +40,7 @@
 
 #include "drm_pciids.h"
 
-int postinit( struct drm_device *dev, unsigned long flags )
+static int postinit( struct drm_device *dev, unsigned long flags )
 {
        dev->counters += 4;
        dev->types[6] = _DRM_STAT_IRQ;
index d4b2d093d6abe7a0f4698d5f02e6205304ab0824..df7746131dea80b1866d938c72cfda6c4e24e9a2 100644 (file)
@@ -123,8 +123,6 @@ typedef struct drm_i830_private {
 /* i830_dma.c */
 extern void i830_reclaim_buffers(drm_device_t *dev, struct file *filp);
 
-extern int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma);
-
 /* i830_irq.c */
 extern int i830_irq_emit( struct inode *inode, struct file *filp, 
                          unsigned int cmd, unsigned long arg );
index 6d7729ffe2dc149e66145a14c443156fec252108..a5923e5d0a771c5d6de9e34c5a9919dd3fd4c427 100644 (file)
@@ -54,8 +54,7 @@ irqreturn_t i830_driver_irq_handler( DRM_IRQ_ARGS )
        return IRQ_HANDLED;
 }
 
-
-int i830_emit_irq(drm_device_t *dev)
+static int i830_emit_irq(drm_device_t *dev)
 {
        drm_i830_private_t *dev_priv = dev->dev_private;
        RING_LOCALS;
@@ -73,7 +72,7 @@ int i830_emit_irq(drm_device_t *dev)
 }
 
 
-int i830_wait_irq(drm_device_t *dev, int irq_nr)
+static int i830_wait_irq(drm_device_t *dev, int irq_nr)
 {
        drm_i830_private_t *dev_priv = 
           (drm_i830_private_t *)dev->dev_private;
index b5903f9f14236a0fe0223db59ab5c0b39241cb43..acf9e52a9507ff9293d0cd629a450289487d9774 100644 (file)
 #include "i915_drm.h"
 #include "i915_drv.h"
 
-drm_ioctl_desc_t i915_ioctls[] = {
-       [DRM_IOCTL_NR(DRM_I915_INIT)] = {i915_dma_init, 1, 1},
-       [DRM_IOCTL_NR(DRM_I915_FLUSH)] = {i915_flush_ioctl, 1, 0},
-       [DRM_IOCTL_NR(DRM_I915_FLIP)] = {i915_flip_bufs, 1, 0},
-       [DRM_IOCTL_NR(DRM_I915_BATCHBUFFER)] = {i915_batchbuffer, 1, 0},
-       [DRM_IOCTL_NR(DRM_I915_IRQ_EMIT)] = {i915_irq_emit, 1, 0},
-       [DRM_IOCTL_NR(DRM_I915_IRQ_WAIT)] = {i915_irq_wait, 1, 0},
-       [DRM_IOCTL_NR(DRM_I915_GETPARAM)] = {i915_getparam, 1, 0},
-       [DRM_IOCTL_NR(DRM_I915_SETPARAM)] = {i915_setparam, 1, 1},
-       [DRM_IOCTL_NR(DRM_I915_ALLOC)] = {i915_mem_alloc, 1, 0},
-       [DRM_IOCTL_NR(DRM_I915_FREE)] = {i915_mem_free, 1, 0},
-       [DRM_IOCTL_NR(DRM_I915_INIT_HEAP)] = {i915_mem_init_heap, 1, 1},
-       [DRM_IOCTL_NR(DRM_I915_CMDBUFFER)] = {i915_cmdbuffer, 1, 0}
-};
-
-int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls);
-
 /* Really want an OS-independent resettable timer.  Would like to have
  * this loop run for (eg) 3 sec, but have the timer reset every time
  * the head pointer changes, so that EBUSY only happens if the ring
@@ -95,7 +78,7 @@ void i915_kernel_lost_context(drm_device_t * dev)
                dev_priv->sarea_priv->perf_boxes |= I915_BOX_RING_EMPTY;
 }
 
-int i915_dma_cleanup(drm_device_t * dev)
+static int i915_dma_cleanup(drm_device_t * dev)
 {
        /* Make sure interrupts are disabled here because the uninstall ioctl
         * may not have been called from userspace and after dev_private
@@ -247,7 +230,7 @@ static int i915_resume(drm_device_t * dev)
        return 0;
 }
 
-int i915_dma_init(DRM_IOCTL_ARGS)
+static int i915_dma_init(DRM_IOCTL_ARGS)
 {
        DRM_DEVICE;
        drm_i915_private_t *dev_priv;
@@ -558,7 +541,7 @@ static int i915_quiescent(drm_device_t * dev)
        return i915_wait_ring(dev, dev_priv->ring.Size - 8, __FUNCTION__);
 }
 
-int i915_flush_ioctl(DRM_IOCTL_ARGS)
+static int i915_flush_ioctl(DRM_IOCTL_ARGS)
 {
        DRM_DEVICE;
 
@@ -567,7 +550,7 @@ int i915_flush_ioctl(DRM_IOCTL_ARGS)
        return i915_quiescent(dev);
 }
 
-int i915_batchbuffer(DRM_IOCTL_ARGS)
+static int i915_batchbuffer(DRM_IOCTL_ARGS)
 {
        DRM_DEVICE;
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
@@ -601,7 +584,7 @@ int i915_batchbuffer(DRM_IOCTL_ARGS)
        return ret;
 }
 
-int i915_cmdbuffer(DRM_IOCTL_ARGS)
+static int i915_cmdbuffer(DRM_IOCTL_ARGS)
 {
        DRM_DEVICE;
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
@@ -637,18 +620,7 @@ int i915_cmdbuffer(DRM_IOCTL_ARGS)
        return 0;
 }
 
-int i915_do_cleanup_pageflip(drm_device_t * dev)
-{
-       drm_i915_private_t *dev_priv = dev->dev_private;
-
-       DRM_DEBUG("%s\n", __FUNCTION__);
-       if (dev_priv->current_page != 0)
-               i915_dispatch_flip(dev);
-
-       return 0;
-}
-
-int i915_flip_bufs(DRM_IOCTL_ARGS)
+static int i915_flip_bufs(DRM_IOCTL_ARGS)
 {
        DRM_DEVICE;
 
@@ -659,7 +631,7 @@ int i915_flip_bufs(DRM_IOCTL_ARGS)
        return i915_dispatch_flip(dev);
 }
 
-int i915_getparam(DRM_IOCTL_ARGS)
+static int i915_getparam(DRM_IOCTL_ARGS)
 {
        DRM_DEVICE;
        drm_i915_private_t *dev_priv = dev->dev_private;
@@ -694,7 +666,7 @@ int i915_getparam(DRM_IOCTL_ARGS)
        return 0;
 }
 
-int i915_setparam(DRM_IOCTL_ARGS)
+static int i915_setparam(DRM_IOCTL_ARGS)
 {
        DRM_DEVICE;
        drm_i915_private_t *dev_priv = dev->dev_private;
@@ -743,3 +715,19 @@ void i915_driver_prerelease(drm_device_t *dev, DRMFILE filp)
        }
 }
 
+drm_ioctl_desc_t i915_ioctls[] = {
+       [DRM_IOCTL_NR(DRM_I915_INIT)] = {i915_dma_init, 1, 1},
+       [DRM_IOCTL_NR(DRM_I915_FLUSH)] = {i915_flush_ioctl, 1, 0},
+       [DRM_IOCTL_NR(DRM_I915_FLIP)] = {i915_flip_bufs, 1, 0},
+       [DRM_IOCTL_NR(DRM_I915_BATCHBUFFER)] = {i915_batchbuffer, 1, 0},
+       [DRM_IOCTL_NR(DRM_I915_IRQ_EMIT)] = {i915_irq_emit, 1, 0},
+       [DRM_IOCTL_NR(DRM_I915_IRQ_WAIT)] = {i915_irq_wait, 1, 0},
+       [DRM_IOCTL_NR(DRM_I915_GETPARAM)] = {i915_getparam, 1, 0},
+       [DRM_IOCTL_NR(DRM_I915_SETPARAM)] = {i915_setparam, 1, 1},
+       [DRM_IOCTL_NR(DRM_I915_ALLOC)] = {i915_mem_alloc, 1, 0},
+       [DRM_IOCTL_NR(DRM_I915_FREE)] = {i915_mem_free, 1, 0},
+       [DRM_IOCTL_NR(DRM_I915_INIT_HEAP)] = {i915_mem_init_heap, 1, 1},
+       [DRM_IOCTL_NR(DRM_I915_CMDBUFFER)] = {i915_cmdbuffer, 1, 0}
+};
+
+int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls);
index e6a9e1d1d2831a6fa17ff660c12146359a58e33a..f0a0c5bd7c57b3665f617cbc03d2f85a97dacb01 100644 (file)
@@ -34,7 +34,7 @@
 
 #include "drm_pciids.h"
 
-int postinit( struct drm_device *dev, unsigned long flags )
+static int postinit( struct drm_device *dev, unsigned long flags )
 {
        dev->counters += 4;
        dev->types[6] = _DRM_STAT_IRQ;
index fa940d64b85d6da335a2ea2a21b84a8079d1ceac..68c329965ddffec34cce3b29ab077ce23843b84c 100644 (file)
@@ -99,14 +99,6 @@ typedef struct drm_i915_private {
 } drm_i915_private_t;
 
                                /* i915_dma.c */
-extern int i915_dma_init(DRM_IOCTL_ARGS);
-extern int i915_dma_cleanup(drm_device_t * dev);
-extern int i915_flush_ioctl(DRM_IOCTL_ARGS);
-extern int i915_batchbuffer(DRM_IOCTL_ARGS);
-extern int i915_flip_bufs(DRM_IOCTL_ARGS);
-extern int i915_getparam(DRM_IOCTL_ARGS);
-extern int i915_setparam(DRM_IOCTL_ARGS);
-extern int i915_cmdbuffer(DRM_IOCTL_ARGS);
 extern void i915_kernel_lost_context(drm_device_t * dev);
 extern void i915_driver_pretakedown(drm_device_t *dev);
 extern void i915_driver_prerelease(drm_device_t *dev, DRMFILE filp);
@@ -114,8 +106,6 @@ extern void i915_driver_prerelease(drm_device_t *dev, DRMFILE filp);
 /* i915_irq.c */
 extern int i915_irq_emit(DRM_IOCTL_ARGS);
 extern int i915_irq_wait(DRM_IOCTL_ARGS);
-extern int i915_wait_irq(drm_device_t * dev, int irq_nr);
-extern int i915_emit_irq(drm_device_t * dev);
 
 extern irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS);
 extern void i915_driver_irq_preinstall(drm_device_t *dev);
index a101cc9cfd7e1441e0010a501943ae70efb72eae..4fa448ee846b58dbd4ee0a821c964c341944a1ad 100644 (file)
@@ -56,7 +56,7 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
        return IRQ_HANDLED;
 }
 
-int i915_emit_irq(drm_device_t * dev)
+static int i915_emit_irq(drm_device_t * dev)
 {
        drm_i915_private_t *dev_priv = dev->dev_private;
        u32 ret;
@@ -76,7 +76,7 @@ int i915_emit_irq(drm_device_t * dev)
        return ret;
 }
 
-int i915_wait_irq(drm_device_t * dev, int irq_nr)
+static int i915_wait_irq(drm_device_t * dev, int irq_nr)
 {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
        int ret = 0;
index 53af69162829fd3114b9cf6e206b4dbbcf5cbe3c..426a71c049d9be85ccb54f12e76bbd227f456469 100644 (file)
@@ -1307,7 +1307,7 @@ static int r128_do_init_pageflip( drm_device_t *dev )
        return 0;
 }
 
-int r128_do_cleanup_pageflip( drm_device_t *dev )
+static int r128_do_cleanup_pageflip( drm_device_t *dev )
 {
        drm_r128_private_t *dev_priv = dev->dev_private;
        DRM_DEBUG( "\n" );