diff options
author | Dave Airlie <airlied@starflyer.(none)> | 2005-07-07 07:03:38 -0400 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2005-07-07 07:03:38 -0400 |
commit | c94f70298529d99ac6e1ee7709f61eab00adeb39 (patch) | |
tree | 8e61aadcec3bd299a838cd640bf104eedee61ec3 /drivers/char | |
parent | b9523249de59c49e7c2cc83dfa73fb011a489a45 (diff) |
drm: misc cleanup
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>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/drm/ati_pcigart.c | 2 | ||||
-rw-r--r-- | drivers/char/drm/drmP.h | 22 | ||||
-rw-r--r-- | drivers/char/drm/drm_auth.c | 4 | ||||
-rw-r--r-- | drivers/char/drm/drm_bufs.c | 12 | ||||
-rw-r--r-- | drivers/char/drm/drm_context.c | 4 | ||||
-rw-r--r-- | drivers/char/drm/drm_drv.c | 9 | ||||
-rw-r--r-- | drivers/char/drm/drm_fops.c | 10 | ||||
-rw-r--r-- | drivers/char/drm/drm_irq.c | 2 | ||||
-rw-r--r-- | drivers/char/drm/drm_lock.c | 12 | ||||
-rw-r--r-- | drivers/char/drm/drm_proc.c | 2 | ||||
-rw-r--r-- | drivers/char/drm/drm_stub.c | 92 | ||||
-rw-r--r-- | drivers/char/drm/drm_vm.c | 10 | ||||
-rw-r--r-- | drivers/char/drm/i810_dma.c | 24 | ||||
-rw-r--r-- | drivers/char/drm/i810_drv.h | 1 | ||||
-rw-r--r-- | drivers/char/drm/i830_dma.c | 20 | ||||
-rw-r--r-- | drivers/char/drm/i830_drv.c | 2 | ||||
-rw-r--r-- | drivers/char/drm/i830_drv.h | 2 | ||||
-rw-r--r-- | drivers/char/drm/i830_irq.c | 5 | ||||
-rw-r--r-- | drivers/char/drm/i915_dma.c | 60 | ||||
-rw-r--r-- | drivers/char/drm/i915_drv.c | 2 | ||||
-rw-r--r-- | drivers/char/drm/i915_drv.h | 10 | ||||
-rw-r--r-- | drivers/char/drm/i915_irq.c | 4 | ||||
-rw-r--r-- | drivers/char/drm/r128_state.c | 2 |
23 files changed, 135 insertions, 178 deletions
diff --git a/drivers/char/drm/ati_pcigart.c b/drivers/char/drm/ati_pcigart.c index fdca1876ecd5..0aec5ef481b8 100644 --- a/drivers/char/drm/ati_pcigart.c +++ b/drivers/char/drm/ati_pcigart.c | |||
@@ -52,7 +52,7 @@ | |||
52 | # define ATI_MAX_PCIGART_PAGES 8192 /**< 32 MB aperture, 4K pages */ | 52 | # define ATI_MAX_PCIGART_PAGES 8192 /**< 32 MB aperture, 4K pages */ |
53 | # define ATI_PCIGART_PAGE_SIZE 4096 /**< PCI GART page size */ | 53 | # define ATI_PCIGART_PAGE_SIZE 4096 /**< PCI GART page size */ |
54 | 54 | ||
55 | unsigned long drm_ati_alloc_pcigart_table( void ) | 55 | static unsigned long drm_ati_alloc_pcigart_table( void ) |
56 | { | 56 | { |
57 | unsigned long address; | 57 | unsigned long address; |
58 | struct page *page; | 58 | struct page *page; |
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h index 2c7b1fc3bb2e..5df09cc8c6db 100644 --- a/drivers/char/drm/drmP.h +++ b/drivers/char/drm/drmP.h | |||
@@ -774,8 +774,6 @@ extern int drm_cpu_valid( void ); | |||
774 | /* Driver support (drm_drv.h) */ | 774 | /* Driver support (drm_drv.h) */ |
775 | extern int drm_init(struct drm_driver *driver); | 775 | extern int drm_init(struct drm_driver *driver); |
776 | extern void drm_exit(struct drm_driver *driver); | 776 | extern void drm_exit(struct drm_driver *driver); |
777 | extern int drm_version(struct inode *inode, struct file *filp, | ||
778 | unsigned int cmd, unsigned long arg); | ||
779 | extern int drm_ioctl(struct inode *inode, struct file *filp, | 777 | extern int drm_ioctl(struct inode *inode, struct file *filp, |
780 | unsigned int cmd, unsigned long arg); | 778 | unsigned int cmd, unsigned long arg); |
781 | extern long drm_compat_ioctl(struct file *filp, | 779 | extern long drm_compat_ioctl(struct file *filp, |
@@ -785,21 +783,13 @@ extern int drm_takedown(drm_device_t * dev); | |||
785 | /* Device support (drm_fops.h) */ | 783 | /* Device support (drm_fops.h) */ |
786 | extern int drm_open(struct inode *inode, struct file *filp); | 784 | extern int drm_open(struct inode *inode, struct file *filp); |
787 | extern int drm_stub_open(struct inode *inode, struct file *filp); | 785 | extern int drm_stub_open(struct inode *inode, struct file *filp); |
788 | extern int drm_open_helper(struct inode *inode, struct file *filp, | ||
789 | drm_device_t *dev); | ||
790 | extern int drm_flush(struct file *filp); | 786 | extern int drm_flush(struct file *filp); |
791 | extern int drm_fasync(int fd, struct file *filp, int on); | 787 | extern int drm_fasync(int fd, struct file *filp, int on); |
792 | extern int drm_release(struct inode *inode, struct file *filp); | 788 | extern int drm_release(struct inode *inode, struct file *filp); |
793 | 789 | ||
794 | /* Mapping support (drm_vm.h) */ | 790 | /* Mapping support (drm_vm.h) */ |
795 | extern void drm_vm_open(struct vm_area_struct *vma); | ||
796 | extern void drm_vm_close(struct vm_area_struct *vma); | ||
797 | extern void drm_vm_shm_close(struct vm_area_struct *vma); | ||
798 | extern int drm_mmap_dma(struct file *filp, | ||
799 | struct vm_area_struct *vma); | ||
800 | extern int drm_mmap(struct file *filp, struct vm_area_struct *vma); | 791 | extern int drm_mmap(struct file *filp, struct vm_area_struct *vma); |
801 | extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); | 792 | extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); |
802 | extern ssize_t drm_read(struct file *filp, char __user *buf, size_t count, loff_t *off); | ||
803 | 793 | ||
804 | /* Memory management support (drm_memory.h) */ | 794 | /* Memory management support (drm_memory.h) */ |
805 | #include "drm_memory.h" | 795 | #include "drm_memory.h" |
@@ -853,9 +843,6 @@ extern int drm_newctx( struct inode *inode, struct file *filp, | |||
853 | extern int drm_rmctx( struct inode *inode, struct file *filp, | 843 | extern int drm_rmctx( struct inode *inode, struct file *filp, |
854 | unsigned int cmd, unsigned long arg ); | 844 | unsigned int cmd, unsigned long arg ); |
855 | 845 | ||
856 | extern int drm_context_switch(drm_device_t *dev, int old, int new); | ||
857 | extern int drm_context_switch_complete(drm_device_t *dev, int new); | ||
858 | |||
859 | extern int drm_ctxbitmap_init( drm_device_t *dev ); | 846 | extern int drm_ctxbitmap_init( drm_device_t *dev ); |
860 | extern void drm_ctxbitmap_cleanup( drm_device_t *dev ); | 847 | extern void drm_ctxbitmap_cleanup( drm_device_t *dev ); |
861 | extern void drm_ctxbitmap_free( drm_device_t *dev, int ctx_handle ); | 848 | 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, | |||
873 | 860 | ||
874 | 861 | ||
875 | /* Authentication IOCTL support (drm_auth.h) */ | 862 | /* Authentication IOCTL support (drm_auth.h) */ |
876 | extern int drm_add_magic(drm_device_t *dev, drm_file_t *priv, | ||
877 | drm_magic_t magic); | ||
878 | extern int drm_remove_magic(drm_device_t *dev, drm_magic_t magic); | ||
879 | extern int drm_getmagic(struct inode *inode, struct file *filp, | 863 | extern int drm_getmagic(struct inode *inode, struct file *filp, |
880 | unsigned int cmd, unsigned long arg); | 864 | unsigned int cmd, unsigned long arg); |
881 | extern int drm_authmagic(struct inode *inode, struct file *filp, | 865 | extern int drm_authmagic(struct inode *inode, struct file *filp, |
@@ -892,13 +876,9 @@ extern int drm_unlock(struct inode *inode, struct file *filp, | |||
892 | unsigned int cmd, unsigned long arg); | 876 | unsigned int cmd, unsigned long arg); |
893 | extern int drm_lock_take(__volatile__ unsigned int *lock, | 877 | extern int drm_lock_take(__volatile__ unsigned int *lock, |
894 | unsigned int context); | 878 | unsigned int context); |
895 | extern int drm_lock_transfer(drm_device_t *dev, | ||
896 | __volatile__ unsigned int *lock, | ||
897 | unsigned int context); | ||
898 | extern int drm_lock_free(drm_device_t *dev, | 879 | extern int drm_lock_free(drm_device_t *dev, |
899 | __volatile__ unsigned int *lock, | 880 | __volatile__ unsigned int *lock, |
900 | unsigned int context); | 881 | unsigned int context); |
901 | extern int drm_notifier(void *priv); | ||
902 | 882 | ||
903 | /* Buffer management support (drm_bufs.h) */ | 883 | /* Buffer management support (drm_bufs.h) */ |
904 | extern int drm_order( unsigned long size ); | 884 | extern int drm_order( unsigned long size ); |
@@ -926,7 +906,6 @@ extern void drm_core_reclaim_buffers(drm_device_t *dev, struct file *filp); | |||
926 | /* IRQ support (drm_irq.h) */ | 906 | /* IRQ support (drm_irq.h) */ |
927 | extern int drm_control( struct inode *inode, struct file *filp, | 907 | extern int drm_control( struct inode *inode, struct file *filp, |
928 | unsigned int cmd, unsigned long arg ); | 908 | unsigned int cmd, unsigned long arg ); |
929 | extern int drm_irq_install( drm_device_t *dev ); | ||
930 | extern int drm_irq_uninstall( drm_device_t *dev ); | 909 | extern int drm_irq_uninstall( drm_device_t *dev ); |
931 | extern irqreturn_t drm_irq_handler( DRM_IRQ_ARGS ); | 910 | extern irqreturn_t drm_irq_handler( DRM_IRQ_ARGS ); |
932 | extern void drm_driver_irq_preinstall( drm_device_t *dev ); | 911 | extern void drm_driver_irq_preinstall( drm_device_t *dev ); |
@@ -966,7 +945,6 @@ extern int drm_agp_unbind_memory(DRM_AGP_MEM *handle); | |||
966 | extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent, | 945 | extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent, |
967 | struct drm_driver *driver); | 946 | struct drm_driver *driver); |
968 | extern int drm_put_dev(drm_device_t * dev); | 947 | extern int drm_put_dev(drm_device_t * dev); |
969 | extern int drm_get_head(drm_device_t * dev, drm_head_t *head); | ||
970 | extern int drm_put_head(drm_head_t * head); | 948 | extern int drm_put_head(drm_head_t * head); |
971 | extern unsigned int drm_debug; | 949 | extern unsigned int drm_debug; |
972 | extern unsigned int drm_cards_limit; | 950 | extern unsigned int drm_cards_limit; |
diff --git a/drivers/char/drm/drm_auth.c b/drivers/char/drm/drm_auth.c index b428761c4e91..dd140bca8f71 100644 --- a/drivers/char/drm/drm_auth.c +++ b/drivers/char/drm/drm_auth.c | |||
@@ -87,7 +87,7 @@ static drm_file_t *drm_find_file(drm_device_t *dev, drm_magic_t magic) | |||
87 | * associated the magic number hash key in drm_device::magiclist, while holding | 87 | * associated the magic number hash key in drm_device::magiclist, while holding |
88 | * the drm_device::struct_sem lock. | 88 | * the drm_device::struct_sem lock. |
89 | */ | 89 | */ |
90 | int drm_add_magic(drm_device_t *dev, drm_file_t *priv, drm_magic_t magic) | 90 | static int drm_add_magic(drm_device_t *dev, drm_file_t *priv, drm_magic_t magic) |
91 | { | 91 | { |
92 | int hash; | 92 | int hash; |
93 | drm_magic_entry_t *entry; | 93 | 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) | |||
124 | * Searches and unlinks the entry in drm_device::magiclist with the magic | 124 | * Searches and unlinks the entry in drm_device::magiclist with the magic |
125 | * number hash key, while holding the drm_device::struct_sem lock. | 125 | * number hash key, while holding the drm_device::struct_sem lock. |
126 | */ | 126 | */ |
127 | int drm_remove_magic(drm_device_t *dev, drm_magic_t magic) | 127 | static int drm_remove_magic(drm_device_t *dev, drm_magic_t magic) |
128 | { | 128 | { |
129 | drm_magic_entry_t *prev = NULL; | 129 | drm_magic_entry_t *prev = NULL; |
130 | drm_magic_entry_t *pt; | 130 | drm_magic_entry_t *pt; |
diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c index 3407380b865a..4c6191d231b8 100644 --- a/drivers/char/drm/drm_bufs.c +++ b/drivers/char/drm/drm_bufs.c | |||
@@ -356,8 +356,8 @@ static void drm_cleanup_buf_error(drm_device_t *dev, drm_buf_entry_t *entry) | |||
356 | * reallocates the buffer list of the same size order to accommodate the new | 356 | * reallocates the buffer list of the same size order to accommodate the new |
357 | * buffers. | 357 | * buffers. |
358 | */ | 358 | */ |
359 | int drm_addbufs_agp( struct inode *inode, struct file *filp, | 359 | static int drm_addbufs_agp( struct inode *inode, struct file *filp, |
360 | unsigned int cmd, unsigned long arg ) | 360 | unsigned int cmd, unsigned long arg ) |
361 | { | 361 | { |
362 | drm_file_t *priv = filp->private_data; | 362 | drm_file_t *priv = filp->private_data; |
363 | drm_device_t *dev = priv->head->dev; | 363 | drm_device_t *dev = priv->head->dev; |
@@ -521,8 +521,8 @@ int drm_addbufs_agp( struct inode *inode, struct file *filp, | |||
521 | } | 521 | } |
522 | #endif /* __OS_HAS_AGP */ | 522 | #endif /* __OS_HAS_AGP */ |
523 | 523 | ||
524 | int drm_addbufs_pci( struct inode *inode, struct file *filp, | 524 | static int drm_addbufs_pci( struct inode *inode, struct file *filp, |
525 | unsigned int cmd, unsigned long arg ) | 525 | unsigned int cmd, unsigned long arg ) |
526 | { | 526 | { |
527 | drm_file_t *priv = filp->private_data; | 527 | drm_file_t *priv = filp->private_data; |
528 | drm_device_t *dev = priv->head->dev; | 528 | drm_device_t *dev = priv->head->dev; |
@@ -751,8 +751,8 @@ int drm_addbufs_pci( struct inode *inode, struct file *filp, | |||
751 | 751 | ||
752 | } | 752 | } |
753 | 753 | ||
754 | int drm_addbufs_sg( struct inode *inode, struct file *filp, | 754 | static int drm_addbufs_sg( struct inode *inode, struct file *filp, |
755 | unsigned int cmd, unsigned long arg ) | 755 | unsigned int cmd, unsigned long arg ) |
756 | { | 756 | { |
757 | drm_file_t *priv = filp->private_data; | 757 | drm_file_t *priv = filp->private_data; |
758 | drm_device_t *dev = priv->head->dev; | 758 | drm_device_t *dev = priv->head->dev; |
diff --git a/drivers/char/drm/drm_context.c b/drivers/char/drm/drm_context.c index fdf661f234ed..a7cfabd1ca2e 100644 --- a/drivers/char/drm/drm_context.c +++ b/drivers/char/drm/drm_context.c | |||
@@ -84,7 +84,7 @@ failed: | |||
84 | * drm_device::context_sareas to accommodate the new entry while holding the | 84 | * drm_device::context_sareas to accommodate the new entry while holding the |
85 | * drm_device::struct_sem lock. | 85 | * drm_device::struct_sem lock. |
86 | */ | 86 | */ |
87 | int drm_ctxbitmap_next( drm_device_t *dev ) | 87 | static int drm_ctxbitmap_next( drm_device_t *dev ) |
88 | { | 88 | { |
89 | int bit; | 89 | int bit; |
90 | 90 | ||
@@ -326,7 +326,7 @@ int drm_context_switch( drm_device_t *dev, int old, int new ) | |||
326 | * hardware lock is held, clears the drm_device::context_flag and wakes up | 326 | * hardware lock is held, clears the drm_device::context_flag and wakes up |
327 | * drm_device::context_wait. | 327 | * drm_device::context_wait. |
328 | */ | 328 | */ |
329 | int drm_context_switch_complete( drm_device_t *dev, int new ) | 329 | static int drm_context_switch_complete( drm_device_t *dev, int new ) |
330 | { | 330 | { |
331 | dev->last_context = new; /* PRE/POST: This is the _only_ writer. */ | 331 | dev->last_context = new; /* PRE/POST: This is the _only_ writer. */ |
332 | dev->last_switch = jiffies; | 332 | dev->last_switch = jiffies; |
diff --git a/drivers/char/drm/drm_drv.c b/drivers/char/drm/drm_drv.c index 1e37ed0c6b8d..3333c250c4d9 100644 --- a/drivers/char/drm/drm_drv.c +++ b/drivers/char/drm/drm_drv.c | |||
@@ -51,8 +51,11 @@ | |||
51 | #include "drmP.h" | 51 | #include "drmP.h" |
52 | #include "drm_core.h" | 52 | #include "drm_core.h" |
53 | 53 | ||
54 | static int drm_version(struct inode *inode, struct file *filp, | ||
55 | unsigned int cmd, unsigned long arg); | ||
56 | |||
54 | /** Ioctl table */ | 57 | /** Ioctl table */ |
55 | drm_ioctl_desc_t drm_ioctls[] = { | 58 | static drm_ioctl_desc_t drm_ioctls[] = { |
56 | [DRM_IOCTL_NR(DRM_IOCTL_VERSION)] = { drm_version, 0, 0 }, | 59 | [DRM_IOCTL_NR(DRM_IOCTL_VERSION)] = { drm_version, 0, 0 }, |
57 | [DRM_IOCTL_NR(DRM_IOCTL_GET_UNIQUE)] = { drm_getunique, 0, 0 }, | 60 | [DRM_IOCTL_NR(DRM_IOCTL_GET_UNIQUE)] = { drm_getunique, 0, 0 }, |
58 | [DRM_IOCTL_NR(DRM_IOCTL_GET_MAGIC)] = { drm_getmagic, 0, 0 }, | 61 | [DRM_IOCTL_NR(DRM_IOCTL_GET_MAGIC)] = { drm_getmagic, 0, 0 }, |
@@ -447,8 +450,8 @@ module_exit( drm_core_exit ); | |||
447 | * | 450 | * |
448 | * Fills in the version information in \p arg. | 451 | * Fills in the version information in \p arg. |
449 | */ | 452 | */ |
450 | int drm_version( struct inode *inode, struct file *filp, | 453 | static int drm_version( struct inode *inode, struct file *filp, |
451 | unsigned int cmd, unsigned long arg ) | 454 | unsigned int cmd, unsigned long arg ) |
452 | { | 455 | { |
453 | drm_file_t *priv = filp->private_data; | 456 | drm_file_t *priv = filp->private_data; |
454 | drm_device_t *dev = priv->head->dev; | 457 | drm_device_t *dev = priv->head->dev; |
diff --git a/drivers/char/drm/drm_fops.c b/drivers/char/drm/drm_fops.c index a53322d8c229..10e64fde8d78 100644 --- a/drivers/char/drm/drm_fops.c +++ b/drivers/char/drm/drm_fops.c | |||
@@ -37,6 +37,8 @@ | |||
37 | #include "drmP.h" | 37 | #include "drmP.h" |
38 | #include <linux/poll.h> | 38 | #include <linux/poll.h> |
39 | 39 | ||
40 | static int drm_open_helper(struct inode *inode, struct file *filp, drm_device_t *dev); | ||
41 | |||
40 | static int drm_setup( drm_device_t *dev ) | 42 | static int drm_setup( drm_device_t *dev ) |
41 | { | 43 | { |
42 | int i; | 44 | int i; |
@@ -341,7 +343,7 @@ EXPORT_SYMBOL(drm_release); | |||
341 | * Creates and initializes a drm_file structure for the file private data in \p | 343 | * Creates and initializes a drm_file structure for the file private data in \p |
342 | * filp and add it into the double linked list in \p dev. | 344 | * filp and add it into the double linked list in \p dev. |
343 | */ | 345 | */ |
344 | int drm_open_helper(struct inode *inode, struct file *filp, drm_device_t *dev) | 346 | static int drm_open_helper(struct inode *inode, struct file *filp, drm_device_t *dev) |
345 | { | 347 | { |
346 | int minor = iminor(inode); | 348 | int minor = iminor(inode); |
347 | drm_file_t *priv; | 349 | drm_file_t *priv; |
@@ -443,9 +445,3 @@ unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait) | |||
443 | } | 445 | } |
444 | EXPORT_SYMBOL(drm_poll); | 446 | EXPORT_SYMBOL(drm_poll); |
445 | 447 | ||
446 | |||
447 | /** No-op. */ | ||
448 | ssize_t drm_read(struct file *filp, char __user *buf, size_t count, loff_t *off) | ||
449 | { | ||
450 | return 0; | ||
451 | } | ||
diff --git a/drivers/char/drm/drm_irq.c b/drivers/char/drm/drm_irq.c index 2e236ebcf27b..cdd4aecd25e2 100644 --- a/drivers/char/drm/drm_irq.c +++ b/drivers/char/drm/drm_irq.c | |||
@@ -89,7 +89,7 @@ int drm_irq_by_busid(struct inode *inode, struct file *filp, | |||
89 | * \c drm_driver_irq_preinstall() and \c drm_driver_irq_postinstall() functions | 89 | * \c drm_driver_irq_preinstall() and \c drm_driver_irq_postinstall() functions |
90 | * before and after the installation. | 90 | * before and after the installation. |
91 | */ | 91 | */ |
92 | int drm_irq_install( drm_device_t *dev ) | 92 | static int drm_irq_install( drm_device_t *dev ) |
93 | { | 93 | { |
94 | int ret; | 94 | int ret; |
95 | unsigned long sh_flags=0; | 95 | unsigned long sh_flags=0; |
diff --git a/drivers/char/drm/drm_lock.c b/drivers/char/drm/drm_lock.c index d0d6fc661625..4702d863bcc6 100644 --- a/drivers/char/drm/drm_lock.c +++ b/drivers/char/drm/drm_lock.c | |||
@@ -35,6 +35,11 @@ | |||
35 | 35 | ||
36 | #include "drmP.h" | 36 | #include "drmP.h" |
37 | 37 | ||
38 | static int drm_lock_transfer(drm_device_t *dev, | ||
39 | __volatile__ unsigned int *lock, | ||
40 | unsigned int context); | ||
41 | static int drm_notifier(void *priv); | ||
42 | |||
38 | /** | 43 | /** |
39 | * Lock ioctl. | 44 | * Lock ioctl. |
40 | * | 45 | * |
@@ -225,8 +230,9 @@ int drm_lock_take(__volatile__ unsigned int *lock, unsigned int context) | |||
225 | * Resets the lock file pointer. | 230 | * Resets the lock file pointer. |
226 | * Marks the lock as held by the given context, via the \p cmpxchg instruction. | 231 | * Marks the lock as held by the given context, via the \p cmpxchg instruction. |
227 | */ | 232 | */ |
228 | int drm_lock_transfer(drm_device_t *dev, | 233 | static int drm_lock_transfer(drm_device_t *dev, |
229 | __volatile__ unsigned int *lock, unsigned int context) | 234 | __volatile__ unsigned int *lock, |
235 | unsigned int context) | ||
230 | { | 236 | { |
231 | unsigned int old, new, prev; | 237 | unsigned int old, new, prev; |
232 | 238 | ||
@@ -282,7 +288,7 @@ int drm_lock_free(drm_device_t *dev, | |||
282 | * \return one if the signal should be delivered normally, or zero if the | 288 | * \return one if the signal should be delivered normally, or zero if the |
283 | * signal should be blocked. | 289 | * signal should be blocked. |
284 | */ | 290 | */ |
285 | int drm_notifier(void *priv) | 291 | static int drm_notifier(void *priv) |
286 | { | 292 | { |
287 | drm_sigdata_t *s = (drm_sigdata_t *)priv; | 293 | drm_sigdata_t *s = (drm_sigdata_t *)priv; |
288 | unsigned int old, new, prev; | 294 | unsigned int old, new, prev; |
diff --git a/drivers/char/drm/drm_proc.c b/drivers/char/drm/drm_proc.c index 6e06e8c6a516..4774087d2e9e 100644 --- a/drivers/char/drm/drm_proc.c +++ b/drivers/char/drm/drm_proc.c | |||
@@ -57,7 +57,7 @@ static int drm_vma_info(char *buf, char **start, off_t offset, | |||
57 | /** | 57 | /** |
58 | * Proc file list. | 58 | * Proc file list. |
59 | */ | 59 | */ |
60 | struct drm_proc_list { | 60 | static struct drm_proc_list { |
61 | const char *name; /**< file name */ | 61 | const char *name; /**< file name */ |
62 | int (*f)(char *, char **, off_t, int, int *, void *); /**< proc callback*/ | 62 | int (*f)(char *, char **, off_t, int, int *, void *); /**< proc callback*/ |
63 | } drm_proc_list[] = { | 63 | } drm_proc_list[] = { |
diff --git a/drivers/char/drm/drm_stub.c b/drivers/char/drm/drm_stub.c index 8ccbdef7bb3e..48829a1a086a 100644 --- a/drivers/char/drm/drm_stub.c +++ b/drivers/char/drm/drm_stub.c | |||
@@ -157,52 +157,6 @@ int drm_stub_open(struct inode *inode, struct file *filp) | |||
157 | return err; | 157 | return err; |
158 | } | 158 | } |
159 | 159 | ||
160 | |||
161 | /** | ||
162 | * Register. | ||
163 | * | ||
164 | * \param pdev - PCI device structure | ||
165 | * \param ent entry from the PCI ID table with device type flags | ||
166 | * \return zero on success or a negative number on failure. | ||
167 | * | ||
168 | * Attempt to gets inter module "drm" information. If we are first | ||
169 | * then register the character device and inter module information. | ||
170 | * Try and register, if we fail to register, backout previous work. | ||
171 | */ | ||
172 | int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent, | ||
173 | struct drm_driver *driver) | ||
174 | { | ||
175 | drm_device_t *dev; | ||
176 | int ret; | ||
177 | |||
178 | DRM_DEBUG("\n"); | ||
179 | |||
180 | dev = drm_calloc(1, sizeof(*dev), DRM_MEM_STUB); | ||
181 | if (!dev) | ||
182 | return -ENOMEM; | ||
183 | |||
184 | pci_enable_device(pdev); | ||
185 | |||
186 | if ((ret = drm_fill_in_dev(dev, pdev, ent, driver))) { | ||
187 | printk(KERN_ERR "DRM: Fill_in_dev failed.\n"); | ||
188 | goto err_g1; | ||
189 | } | ||
190 | if ((ret = drm_get_head(dev, &dev->primary))) | ||
191 | goto err_g1; | ||
192 | |||
193 | /* postinit is a required function to display the signon banner */ | ||
194 | /* drivers add secondary heads here if needed */ | ||
195 | if ((ret = dev->driver->postinit(dev, ent->driver_data))) | ||
196 | goto err_g1; | ||
197 | |||
198 | return 0; | ||
199 | |||
200 | err_g1: | ||
201 | drm_free(dev, sizeof(*dev), DRM_MEM_STUB); | ||
202 | return ret; | ||
203 | } | ||
204 | EXPORT_SYMBOL(drm_get_dev); | ||
205 | |||
206 | /** | 160 | /** |
207 | * Get a secondary minor number. | 161 | * Get a secondary minor number. |
208 | * | 162 | * |
@@ -214,7 +168,7 @@ EXPORT_SYMBOL(drm_get_dev); | |||
214 | * create the proc init entry via proc_init(). This routines assigns | 168 | * create the proc init entry via proc_init(). This routines assigns |
215 | * minor numbers to secondary heads of multi-headed cards | 169 | * minor numbers to secondary heads of multi-headed cards |
216 | */ | 170 | */ |
217 | int drm_get_head(drm_device_t *dev, drm_head_t *head) | 171 | static int drm_get_head(drm_device_t *dev, drm_head_t *head) |
218 | { | 172 | { |
219 | drm_head_t **heads = drm_heads; | 173 | drm_head_t **heads = drm_heads; |
220 | int ret; | 174 | int ret; |
@@ -262,6 +216,50 @@ err_g1: | |||
262 | return ret; | 216 | return ret; |
263 | } | 217 | } |
264 | 218 | ||
219 | /** | ||
220 | * Register. | ||
221 | * | ||
222 | * \param pdev - PCI device structure | ||
223 | * \param ent entry from the PCI ID table with device type flags | ||
224 | * \return zero on success or a negative number on failure. | ||
225 | * | ||
226 | * Attempt to gets inter module "drm" information. If we are first | ||
227 | * then register the character device and inter module information. | ||
228 | * Try and register, if we fail to register, backout previous work. | ||
229 | */ | ||
230 | int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent, | ||
231 | struct drm_driver *driver) | ||
232 | { | ||
233 | drm_device_t *dev; | ||
234 | int ret; | ||
235 | |||
236 | DRM_DEBUG("\n"); | ||
237 | |||
238 | dev = drm_calloc(1, sizeof(*dev), DRM_MEM_STUB); | ||
239 | if (!dev) | ||
240 | return -ENOMEM; | ||
241 | |||
242 | pci_enable_device(pdev); | ||
243 | |||
244 | if ((ret = drm_fill_in_dev(dev, pdev, ent, driver))) { | ||
245 | printk(KERN_ERR "DRM: Fill_in_dev failed.\n"); | ||
246 | goto err_g1; | ||
247 | } | ||
248 | if ((ret = drm_get_head(dev, &dev->primary))) | ||
249 | goto err_g1; | ||
250 | |||
251 | /* postinit is a required function to display the signon banner */ | ||
252 | /* drivers add secondary heads here if needed */ | ||
253 | if ((ret = dev->driver->postinit(dev, ent->driver_data))) | ||
254 | goto err_g1; | ||
255 | |||
256 | return 0; | ||
257 | |||
258 | err_g1: | ||
259 | drm_free(dev, sizeof(*dev), DRM_MEM_STUB); | ||
260 | return ret; | ||
261 | } | ||
262 | EXPORT_SYMBOL(drm_get_dev); | ||
265 | 263 | ||
266 | /** | 264 | /** |
267 | * Put a device minor number. | 265 | * Put a device minor number. |
diff --git a/drivers/char/drm/drm_vm.c b/drivers/char/drm/drm_vm.c index fc72f30f312b..621220f3f372 100644 --- a/drivers/char/drm/drm_vm.c +++ b/drivers/char/drm/drm_vm.c | |||
@@ -38,6 +38,8 @@ | |||
38 | #include <linux/efi.h> | 38 | #include <linux/efi.h> |
39 | #endif | 39 | #endif |
40 | 40 | ||
41 | static void drm_vm_open(struct vm_area_struct *vma); | ||
42 | static void drm_vm_close(struct vm_area_struct *vma); | ||
41 | 43 | ||
42 | /** | 44 | /** |
43 | * \c nopage method for AGP virtual memory. | 45 | * \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, | |||
163 | * Deletes map information if we are the last | 165 | * Deletes map information if we are the last |
164 | * person to close a mapping and it's not in the global maplist. | 166 | * person to close a mapping and it's not in the global maplist. |
165 | */ | 167 | */ |
166 | void drm_vm_shm_close(struct vm_area_struct *vma) | 168 | static void drm_vm_shm_close(struct vm_area_struct *vma) |
167 | { | 169 | { |
168 | drm_file_t *priv = vma->vm_file->private_data; | 170 | drm_file_t *priv = vma->vm_file->private_data; |
169 | drm_device_t *dev = priv->head->dev; | 171 | drm_device_t *dev = priv->head->dev; |
@@ -399,7 +401,7 @@ static struct vm_operations_struct drm_vm_sg_ops = { | |||
399 | * Create a new drm_vma_entry structure as the \p vma private data entry and | 401 | * Create a new drm_vma_entry structure as the \p vma private data entry and |
400 | * add it to drm_device::vmalist. | 402 | * add it to drm_device::vmalist. |
401 | */ | 403 | */ |
402 | void drm_vm_open(struct vm_area_struct *vma) | 404 | static void drm_vm_open(struct vm_area_struct *vma) |
403 | { | 405 | { |
404 | drm_file_t *priv = vma->vm_file->private_data; | 406 | drm_file_t *priv = vma->vm_file->private_data; |
405 | drm_device_t *dev = priv->head->dev; | 407 | drm_device_t *dev = priv->head->dev; |
@@ -428,7 +430,7 @@ void drm_vm_open(struct vm_area_struct *vma) | |||
428 | * Search the \p vma private data entry in drm_device::vmalist, unlink it, and | 430 | * Search the \p vma private data entry in drm_device::vmalist, unlink it, and |
429 | * free it. | 431 | * free it. |
430 | */ | 432 | */ |
431 | void drm_vm_close(struct vm_area_struct *vma) | 433 | static void drm_vm_close(struct vm_area_struct *vma) |
432 | { | 434 | { |
433 | drm_file_t *priv = vma->vm_file->private_data; | 435 | drm_file_t *priv = vma->vm_file->private_data; |
434 | drm_device_t *dev = priv->head->dev; | 436 | drm_device_t *dev = priv->head->dev; |
@@ -463,7 +465,7 @@ void drm_vm_close(struct vm_area_struct *vma) | |||
463 | * Sets the virtual memory area operations structure to vm_dma_ops, the file | 465 | * Sets the virtual memory area operations structure to vm_dma_ops, the file |
464 | * pointer, and calls vm_open(). | 466 | * pointer, and calls vm_open(). |
465 | */ | 467 | */ |
466 | int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma) | 468 | static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma) |
467 | { | 469 | { |
468 | drm_file_t *priv = filp->private_data; | 470 | drm_file_t *priv = filp->private_data; |
469 | drm_device_t *dev; | 471 | drm_device_t *dev; |
diff --git a/drivers/char/drm/i810_dma.c b/drivers/char/drm/i810_dma.c index 24857cc6c23b..18e0b7622893 100644 --- a/drivers/char/drm/i810_dma.c +++ b/drivers/char/drm/i810_dma.c | |||
@@ -90,16 +90,7 @@ static int i810_freelist_put(drm_device_t *dev, drm_buf_t *buf) | |||
90 | return 0; | 90 | return 0; |
91 | } | 91 | } |
92 | 92 | ||
93 | static struct file_operations i810_buffer_fops = { | 93 | static int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma) |
94 | .open = drm_open, | ||
95 | .flush = drm_flush, | ||
96 | .release = drm_release, | ||
97 | .ioctl = drm_ioctl, | ||
98 | .mmap = i810_mmap_buffers, | ||
99 | .fasync = drm_fasync, | ||
100 | }; | ||
101 | |||
102 | int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma) | ||
103 | { | 94 | { |
104 | drm_file_t *priv = filp->private_data; | 95 | drm_file_t *priv = filp->private_data; |
105 | drm_device_t *dev; | 96 | drm_device_t *dev; |
@@ -126,6 +117,15 @@ int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma) | |||
126 | return 0; | 117 | return 0; |
127 | } | 118 | } |
128 | 119 | ||
120 | static struct file_operations i810_buffer_fops = { | ||
121 | .open = drm_open, | ||
122 | .flush = drm_flush, | ||
123 | .release = drm_release, | ||
124 | .ioctl = drm_ioctl, | ||
125 | .mmap = i810_mmap_buffers, | ||
126 | .fasync = drm_fasync, | ||
127 | }; | ||
128 | |||
129 | static int i810_map_buffer(drm_buf_t *buf, struct file *filp) | 129 | static int i810_map_buffer(drm_buf_t *buf, struct file *filp) |
130 | { | 130 | { |
131 | drm_file_t *priv = filp->private_data; | 131 | drm_file_t *priv = filp->private_data; |
@@ -1003,8 +1003,8 @@ void i810_reclaim_buffers(drm_device_t *dev, struct file *filp) | |||
1003 | } | 1003 | } |
1004 | } | 1004 | } |
1005 | 1005 | ||
1006 | int i810_flush_ioctl(struct inode *inode, struct file *filp, | 1006 | static int i810_flush_ioctl(struct inode *inode, struct file *filp, |
1007 | unsigned int cmd, unsigned long arg) | 1007 | unsigned int cmd, unsigned long arg) |
1008 | { | 1008 | { |
1009 | drm_file_t *priv = filp->private_data; | 1009 | drm_file_t *priv = filp->private_data; |
1010 | drm_device_t *dev = priv->head->dev; | 1010 | drm_device_t *dev = priv->head->dev; |
diff --git a/drivers/char/drm/i810_drv.h b/drivers/char/drm/i810_drv.h index fa23ca454e57..1b40538d1725 100644 --- a/drivers/char/drm/i810_drv.h +++ b/drivers/char/drm/i810_drv.h | |||
@@ -115,7 +115,6 @@ typedef struct drm_i810_private { | |||
115 | 115 | ||
116 | /* i810_dma.c */ | 116 | /* i810_dma.c */ |
117 | extern void i810_reclaim_buffers(drm_device_t *dev, struct file *filp); | 117 | extern void i810_reclaim_buffers(drm_device_t *dev, struct file *filp); |
118 | extern int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma); | ||
119 | 118 | ||
120 | extern int i810_driver_dma_quiescent(drm_device_t *dev); | 119 | extern int i810_driver_dma_quiescent(drm_device_t *dev); |
121 | extern void i810_driver_release(drm_device_t *dev, struct file *filp); | 120 | extern void i810_driver_release(drm_device_t *dev, struct file *filp); |
diff --git a/drivers/char/drm/i830_dma.c b/drivers/char/drm/i830_dma.c index 98adccf8e434..dc7733035864 100644 --- a/drivers/char/drm/i830_dma.c +++ b/drivers/char/drm/i830_dma.c | |||
@@ -92,16 +92,7 @@ static int i830_freelist_put(drm_device_t *dev, drm_buf_t *buf) | |||
92 | return 0; | 92 | return 0; |
93 | } | 93 | } |
94 | 94 | ||
95 | static struct file_operations i830_buffer_fops = { | 95 | static int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma) |
96 | .open = drm_open, | ||
97 | .flush = drm_flush, | ||
98 | .release = drm_release, | ||
99 | .ioctl = drm_ioctl, | ||
100 | .mmap = i830_mmap_buffers, | ||
101 | .fasync = drm_fasync, | ||
102 | }; | ||
103 | |||
104 | int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma) | ||
105 | { | 96 | { |
106 | drm_file_t *priv = filp->private_data; | 97 | drm_file_t *priv = filp->private_data; |
107 | drm_device_t *dev; | 98 | drm_device_t *dev; |
@@ -128,6 +119,15 @@ int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma) | |||
128 | return 0; | 119 | return 0; |
129 | } | 120 | } |
130 | 121 | ||
122 | static struct file_operations i830_buffer_fops = { | ||
123 | .open = drm_open, | ||
124 | .flush = drm_flush, | ||
125 | .release = drm_release, | ||
126 | .ioctl = drm_ioctl, | ||
127 | .mmap = i830_mmap_buffers, | ||
128 | .fasync = drm_fasync, | ||
129 | }; | ||
130 | |||
131 | static int i830_map_buffer(drm_buf_t *buf, struct file *filp) | 131 | static int i830_map_buffer(drm_buf_t *buf, struct file *filp) |
132 | { | 132 | { |
133 | drm_file_t *priv = filp->private_data; | 133 | drm_file_t *priv = filp->private_data; |
diff --git a/drivers/char/drm/i830_drv.c b/drivers/char/drm/i830_drv.c index aa80ad6a5ee0..bc36be76b8b2 100644 --- a/drivers/char/drm/i830_drv.c +++ b/drivers/char/drm/i830_drv.c | |||
@@ -40,7 +40,7 @@ | |||
40 | 40 | ||
41 | #include "drm_pciids.h" | 41 | #include "drm_pciids.h" |
42 | 42 | ||
43 | int postinit( struct drm_device *dev, unsigned long flags ) | 43 | static int postinit( struct drm_device *dev, unsigned long flags ) |
44 | { | 44 | { |
45 | dev->counters += 4; | 45 | dev->counters += 4; |
46 | dev->types[6] = _DRM_STAT_IRQ; | 46 | dev->types[6] = _DRM_STAT_IRQ; |
diff --git a/drivers/char/drm/i830_drv.h b/drivers/char/drm/i830_drv.h index d4b2d093d6ab..df7746131dea 100644 --- a/drivers/char/drm/i830_drv.h +++ b/drivers/char/drm/i830_drv.h | |||
@@ -123,8 +123,6 @@ typedef struct drm_i830_private { | |||
123 | /* i830_dma.c */ | 123 | /* i830_dma.c */ |
124 | extern void i830_reclaim_buffers(drm_device_t *dev, struct file *filp); | 124 | extern void i830_reclaim_buffers(drm_device_t *dev, struct file *filp); |
125 | 125 | ||
126 | extern int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma); | ||
127 | |||
128 | /* i830_irq.c */ | 126 | /* i830_irq.c */ |
129 | extern int i830_irq_emit( struct inode *inode, struct file *filp, | 127 | extern int i830_irq_emit( struct inode *inode, struct file *filp, |
130 | unsigned int cmd, unsigned long arg ); | 128 | unsigned int cmd, unsigned long arg ); |
diff --git a/drivers/char/drm/i830_irq.c b/drivers/char/drm/i830_irq.c index 6d7729ffe2dc..a5923e5d0a77 100644 --- a/drivers/char/drm/i830_irq.c +++ b/drivers/char/drm/i830_irq.c | |||
@@ -54,8 +54,7 @@ irqreturn_t i830_driver_irq_handler( DRM_IRQ_ARGS ) | |||
54 | return IRQ_HANDLED; | 54 | return IRQ_HANDLED; |
55 | } | 55 | } |
56 | 56 | ||
57 | 57 | static int i830_emit_irq(drm_device_t *dev) | |
58 | int i830_emit_irq(drm_device_t *dev) | ||
59 | { | 58 | { |
60 | drm_i830_private_t *dev_priv = dev->dev_private; | 59 | drm_i830_private_t *dev_priv = dev->dev_private; |
61 | RING_LOCALS; | 60 | RING_LOCALS; |
@@ -73,7 +72,7 @@ int i830_emit_irq(drm_device_t *dev) | |||
73 | } | 72 | } |
74 | 73 | ||
75 | 74 | ||
76 | int i830_wait_irq(drm_device_t *dev, int irq_nr) | 75 | static int i830_wait_irq(drm_device_t *dev, int irq_nr) |
77 | { | 76 | { |
78 | drm_i830_private_t *dev_priv = | 77 | drm_i830_private_t *dev_priv = |
79 | (drm_i830_private_t *)dev->dev_private; | 78 | (drm_i830_private_t *)dev->dev_private; |
diff --git a/drivers/char/drm/i915_dma.c b/drivers/char/drm/i915_dma.c index b5903f9f1423..acf9e52a9507 100644 --- a/drivers/char/drm/i915_dma.c +++ b/drivers/char/drm/i915_dma.c | |||
@@ -32,23 +32,6 @@ | |||
32 | #include "i915_drm.h" | 32 | #include "i915_drm.h" |
33 | #include "i915_drv.h" | 33 | #include "i915_drv.h" |
34 | 34 | ||
35 | drm_ioctl_desc_t i915_ioctls[] = { | ||
36 | [DRM_IOCTL_NR(DRM_I915_INIT)] = {i915_dma_init, 1, 1}, | ||
37 | [DRM_IOCTL_NR(DRM_I915_FLUSH)] = {i915_flush_ioctl, 1, 0}, | ||
38 | [DRM_IOCTL_NR(DRM_I915_FLIP)] = {i915_flip_bufs, 1, 0}, | ||
39 | [DRM_IOCTL_NR(DRM_I915_BATCHBUFFER)] = {i915_batchbuffer, 1, 0}, | ||
40 | [DRM_IOCTL_NR(DRM_I915_IRQ_EMIT)] = {i915_irq_emit, 1, 0}, | ||
41 | [DRM_IOCTL_NR(DRM_I915_IRQ_WAIT)] = {i915_irq_wait, 1, 0}, | ||
42 | [DRM_IOCTL_NR(DRM_I915_GETPARAM)] = {i915_getparam, 1, 0}, | ||
43 | [DRM_IOCTL_NR(DRM_I915_SETPARAM)] = {i915_setparam, 1, 1}, | ||
44 | [DRM_IOCTL_NR(DRM_I915_ALLOC)] = {i915_mem_alloc, 1, 0}, | ||
45 | [DRM_IOCTL_NR(DRM_I915_FREE)] = {i915_mem_free, 1, 0}, | ||
46 | [DRM_IOCTL_NR(DRM_I915_INIT_HEAP)] = {i915_mem_init_heap, 1, 1}, | ||
47 | [DRM_IOCTL_NR(DRM_I915_CMDBUFFER)] = {i915_cmdbuffer, 1, 0} | ||
48 | }; | ||
49 | |||
50 | int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls); | ||
51 | |||
52 | /* Really want an OS-independent resettable timer. Would like to have | 35 | /* Really want an OS-independent resettable timer. Would like to have |
53 | * this loop run for (eg) 3 sec, but have the timer reset every time | 36 | * this loop run for (eg) 3 sec, but have the timer reset every time |
54 | * the head pointer changes, so that EBUSY only happens if the ring | 37 | * 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) | |||
95 | dev_priv->sarea_priv->perf_boxes |= I915_BOX_RING_EMPTY; | 78 | dev_priv->sarea_priv->perf_boxes |= I915_BOX_RING_EMPTY; |
96 | } | 79 | } |
97 | 80 | ||
98 | int i915_dma_cleanup(drm_device_t * dev) | 81 | static int i915_dma_cleanup(drm_device_t * dev) |
99 | { | 82 | { |
100 | /* Make sure interrupts are disabled here because the uninstall ioctl | 83 | /* Make sure interrupts are disabled here because the uninstall ioctl |
101 | * may not have been called from userspace and after dev_private | 84 | * may not have been called from userspace and after dev_private |
@@ -247,7 +230,7 @@ static int i915_resume(drm_device_t * dev) | |||
247 | return 0; | 230 | return 0; |
248 | } | 231 | } |
249 | 232 | ||
250 | int i915_dma_init(DRM_IOCTL_ARGS) | 233 | static int i915_dma_init(DRM_IOCTL_ARGS) |
251 | { | 234 | { |
252 | DRM_DEVICE; | 235 | DRM_DEVICE; |
253 | drm_i915_private_t *dev_priv; | 236 | drm_i915_private_t *dev_priv; |
@@ -558,7 +541,7 @@ static int i915_quiescent(drm_device_t * dev) | |||
558 | return i915_wait_ring(dev, dev_priv->ring.Size - 8, __FUNCTION__); | 541 | return i915_wait_ring(dev, dev_priv->ring.Size - 8, __FUNCTION__); |
559 | } | 542 | } |
560 | 543 | ||
561 | int i915_flush_ioctl(DRM_IOCTL_ARGS) | 544 | static int i915_flush_ioctl(DRM_IOCTL_ARGS) |
562 | { | 545 | { |
563 | DRM_DEVICE; | 546 | DRM_DEVICE; |
564 | 547 | ||
@@ -567,7 +550,7 @@ int i915_flush_ioctl(DRM_IOCTL_ARGS) | |||
567 | return i915_quiescent(dev); | 550 | return i915_quiescent(dev); |
568 | } | 551 | } |
569 | 552 | ||
570 | int i915_batchbuffer(DRM_IOCTL_ARGS) | 553 | static int i915_batchbuffer(DRM_IOCTL_ARGS) |
571 | { | 554 | { |
572 | DRM_DEVICE; | 555 | DRM_DEVICE; |
573 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 556 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
@@ -601,7 +584,7 @@ int i915_batchbuffer(DRM_IOCTL_ARGS) | |||
601 | return ret; | 584 | return ret; |
602 | } | 585 | } |
603 | 586 | ||
604 | int i915_cmdbuffer(DRM_IOCTL_ARGS) | 587 | static int i915_cmdbuffer(DRM_IOCTL_ARGS) |
605 | { | 588 | { |
606 | DRM_DEVICE; | 589 | DRM_DEVICE; |
607 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 590 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
@@ -637,18 +620,7 @@ int i915_cmdbuffer(DRM_IOCTL_ARGS) | |||
637 | return 0; | 620 | return 0; |
638 | } | 621 | } |
639 | 622 | ||
640 | int i915_do_cleanup_pageflip(drm_device_t * dev) | 623 | static int i915_flip_bufs(DRM_IOCTL_ARGS) |
641 | { | ||
642 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
643 | |||
644 | DRM_DEBUG("%s\n", __FUNCTION__); | ||
645 | if (dev_priv->current_page != 0) | ||
646 | i915_dispatch_flip(dev); | ||
647 | |||
648 | return 0; | ||
649 | } | ||
650 | |||
651 | int i915_flip_bufs(DRM_IOCTL_ARGS) | ||
652 | { | 624 | { |
653 | DRM_DEVICE; | 625 | DRM_DEVICE; |
654 | 626 | ||
@@ -659,7 +631,7 @@ int i915_flip_bufs(DRM_IOCTL_ARGS) | |||
659 | return i915_dispatch_flip(dev); | 631 | return i915_dispatch_flip(dev); |
660 | } | 632 | } |
661 | 633 | ||
662 | int i915_getparam(DRM_IOCTL_ARGS) | 634 | static int i915_getparam(DRM_IOCTL_ARGS) |
663 | { | 635 | { |
664 | DRM_DEVICE; | 636 | DRM_DEVICE; |
665 | drm_i915_private_t *dev_priv = dev->dev_private; | 637 | drm_i915_private_t *dev_priv = dev->dev_private; |
@@ -694,7 +666,7 @@ int i915_getparam(DRM_IOCTL_ARGS) | |||
694 | return 0; | 666 | return 0; |
695 | } | 667 | } |
696 | 668 | ||
697 | int i915_setparam(DRM_IOCTL_ARGS) | 669 | static int i915_setparam(DRM_IOCTL_ARGS) |
698 | { | 670 | { |
699 | DRM_DEVICE; | 671 | DRM_DEVICE; |
700 | drm_i915_private_t *dev_priv = dev->dev_private; | 672 | drm_i915_private_t *dev_priv = dev->dev_private; |
@@ -743,3 +715,19 @@ void i915_driver_prerelease(drm_device_t *dev, DRMFILE filp) | |||
743 | } | 715 | } |
744 | } | 716 | } |
745 | 717 | ||
718 | drm_ioctl_desc_t i915_ioctls[] = { | ||
719 | [DRM_IOCTL_NR(DRM_I915_INIT)] = {i915_dma_init, 1, 1}, | ||
720 | [DRM_IOCTL_NR(DRM_I915_FLUSH)] = {i915_flush_ioctl, 1, 0}, | ||
721 | [DRM_IOCTL_NR(DRM_I915_FLIP)] = {i915_flip_bufs, 1, 0}, | ||
722 | [DRM_IOCTL_NR(DRM_I915_BATCHBUFFER)] = {i915_batchbuffer, 1, 0}, | ||
723 | [DRM_IOCTL_NR(DRM_I915_IRQ_EMIT)] = {i915_irq_emit, 1, 0}, | ||
724 | [DRM_IOCTL_NR(DRM_I915_IRQ_WAIT)] = {i915_irq_wait, 1, 0}, | ||
725 | [DRM_IOCTL_NR(DRM_I915_GETPARAM)] = {i915_getparam, 1, 0}, | ||
726 | [DRM_IOCTL_NR(DRM_I915_SETPARAM)] = {i915_setparam, 1, 1}, | ||
727 | [DRM_IOCTL_NR(DRM_I915_ALLOC)] = {i915_mem_alloc, 1, 0}, | ||
728 | [DRM_IOCTL_NR(DRM_I915_FREE)] = {i915_mem_free, 1, 0}, | ||
729 | [DRM_IOCTL_NR(DRM_I915_INIT_HEAP)] = {i915_mem_init_heap, 1, 1}, | ||
730 | [DRM_IOCTL_NR(DRM_I915_CMDBUFFER)] = {i915_cmdbuffer, 1, 0} | ||
731 | }; | ||
732 | |||
733 | int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls); | ||
diff --git a/drivers/char/drm/i915_drv.c b/drivers/char/drm/i915_drv.c index e6a9e1d1d283..f0a0c5bd7c57 100644 --- a/drivers/char/drm/i915_drv.c +++ b/drivers/char/drm/i915_drv.c | |||
@@ -34,7 +34,7 @@ | |||
34 | 34 | ||
35 | #include "drm_pciids.h" | 35 | #include "drm_pciids.h" |
36 | 36 | ||
37 | int postinit( struct drm_device *dev, unsigned long flags ) | 37 | static int postinit( struct drm_device *dev, unsigned long flags ) |
38 | { | 38 | { |
39 | dev->counters += 4; | 39 | dev->counters += 4; |
40 | dev->types[6] = _DRM_STAT_IRQ; | 40 | dev->types[6] = _DRM_STAT_IRQ; |
diff --git a/drivers/char/drm/i915_drv.h b/drivers/char/drm/i915_drv.h index fa940d64b85d..68c329965ddf 100644 --- a/drivers/char/drm/i915_drv.h +++ b/drivers/char/drm/i915_drv.h | |||
@@ -99,14 +99,6 @@ typedef struct drm_i915_private { | |||
99 | } drm_i915_private_t; | 99 | } drm_i915_private_t; |
100 | 100 | ||
101 | /* i915_dma.c */ | 101 | /* i915_dma.c */ |
102 | extern int i915_dma_init(DRM_IOCTL_ARGS); | ||
103 | extern int i915_dma_cleanup(drm_device_t * dev); | ||
104 | extern int i915_flush_ioctl(DRM_IOCTL_ARGS); | ||
105 | extern int i915_batchbuffer(DRM_IOCTL_ARGS); | ||
106 | extern int i915_flip_bufs(DRM_IOCTL_ARGS); | ||
107 | extern int i915_getparam(DRM_IOCTL_ARGS); | ||
108 | extern int i915_setparam(DRM_IOCTL_ARGS); | ||
109 | extern int i915_cmdbuffer(DRM_IOCTL_ARGS); | ||
110 | extern void i915_kernel_lost_context(drm_device_t * dev); | 102 | extern void i915_kernel_lost_context(drm_device_t * dev); |
111 | extern void i915_driver_pretakedown(drm_device_t *dev); | 103 | extern void i915_driver_pretakedown(drm_device_t *dev); |
112 | extern void i915_driver_prerelease(drm_device_t *dev, DRMFILE filp); | 104 | 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); | |||
114 | /* i915_irq.c */ | 106 | /* i915_irq.c */ |
115 | extern int i915_irq_emit(DRM_IOCTL_ARGS); | 107 | extern int i915_irq_emit(DRM_IOCTL_ARGS); |
116 | extern int i915_irq_wait(DRM_IOCTL_ARGS); | 108 | extern int i915_irq_wait(DRM_IOCTL_ARGS); |
117 | extern int i915_wait_irq(drm_device_t * dev, int irq_nr); | ||
118 | extern int i915_emit_irq(drm_device_t * dev); | ||
119 | 109 | ||
120 | extern irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS); | 110 | extern irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS); |
121 | extern void i915_driver_irq_preinstall(drm_device_t *dev); | 111 | extern void i915_driver_irq_preinstall(drm_device_t *dev); |
diff --git a/drivers/char/drm/i915_irq.c b/drivers/char/drm/i915_irq.c index a101cc9cfd7e..4fa448ee846b 100644 --- a/drivers/char/drm/i915_irq.c +++ b/drivers/char/drm/i915_irq.c | |||
@@ -56,7 +56,7 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) | |||
56 | return IRQ_HANDLED; | 56 | return IRQ_HANDLED; |
57 | } | 57 | } |
58 | 58 | ||
59 | int i915_emit_irq(drm_device_t * dev) | 59 | static int i915_emit_irq(drm_device_t * dev) |
60 | { | 60 | { |
61 | drm_i915_private_t *dev_priv = dev->dev_private; | 61 | drm_i915_private_t *dev_priv = dev->dev_private; |
62 | u32 ret; | 62 | u32 ret; |
@@ -76,7 +76,7 @@ int i915_emit_irq(drm_device_t * dev) | |||
76 | return ret; | 76 | return ret; |
77 | } | 77 | } |
78 | 78 | ||
79 | int i915_wait_irq(drm_device_t * dev, int irq_nr) | 79 | static int i915_wait_irq(drm_device_t * dev, int irq_nr) |
80 | { | 80 | { |
81 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 81 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
82 | int ret = 0; | 82 | int ret = 0; |
diff --git a/drivers/char/drm/r128_state.c b/drivers/char/drm/r128_state.c index 53af69162829..426a71c049d9 100644 --- a/drivers/char/drm/r128_state.c +++ b/drivers/char/drm/r128_state.c | |||
@@ -1307,7 +1307,7 @@ static int r128_do_init_pageflip( drm_device_t *dev ) | |||
1307 | return 0; | 1307 | return 0; |
1308 | } | 1308 | } |
1309 | 1309 | ||
1310 | int r128_do_cleanup_pageflip( drm_device_t *dev ) | 1310 | static int r128_do_cleanup_pageflip( drm_device_t *dev ) |
1311 | { | 1311 | { |
1312 | drm_r128_private_t *dev_priv = dev->dev_private; | 1312 | drm_r128_private_t *dev_priv = dev->dev_private; |
1313 | DRM_DEBUG( "\n" ); | 1313 | DRM_DEBUG( "\n" ); |