144144/** \name Backward compatibility section */
145145/*@{*/
146146
147- #ifndef MODULE_LICENSE
148- #define MODULE_LICENSE (x )
149- #endif
150-
151- #ifndef preempt_disable
152- #define preempt_disable ()
153- #define preempt_enable ()
154- #endif
155-
156- #ifndef pte_offset_map
157- #define pte_offset_map pte_offset
158- #define pte_unmap (pte )
159- #endif
160-
161147#define DRM_RPR_ARG (vma ) vma,
162148
163149#define VM_OFFSET (vma ) ((vma)->vm_pgoff << PAGE_SHIFT)
@@ -286,10 +272,13 @@ typedef int drm_ioctl_t(struct inode *inode, struct file *filp,
286272typedef int drm_ioctl_compat_t (struct file * filp , unsigned int cmd ,
287273 unsigned long arg );
288274
275+ #define DRM_AUTH 0x1
276+ #define DRM_MASTER 0x2
277+ #define DRM_ROOT_ONLY 0x4
278+
289279typedef struct drm_ioctl_desc {
290280 drm_ioctl_t * func ;
291- int auth_needed ;
292- int root_only ;
281+ int flags ;
293282} drm_ioctl_desc_t ;
294283
295284typedef struct drm_devstate {
@@ -384,6 +373,7 @@ typedef struct drm_buf_entry {
384373/** File private data */
385374typedef struct drm_file {
386375 int authenticated ;
376+ int master ;
387377 int minor ;
388378 pid_t pid ;
389379 uid_t uid ;
@@ -532,8 +522,9 @@ typedef struct drm_vbl_sig {
532522typedef struct ati_pcigart_info {
533523 int gart_table_location ;
534524 int is_pcie ;
535- unsigned long addr ;
525+ void * addr ;
536526 dma_addr_t bus_addr ;
527+ drm_local_map_t mapping ;
537528} drm_ati_pcigart_info ;
538529
539530/**
@@ -544,25 +535,24 @@ typedef struct ati_pcigart_info {
544535struct drm_device ;
545536
546537struct drm_driver {
547- int (* preinit ) (struct drm_device * , unsigned long flags );
548- void (* prerelease ) (struct drm_device * , struct file * filp );
549- void (* pretakedown ) (struct drm_device * );
550- int (* postcleanup ) (struct drm_device * );
551- int (* presetup ) (struct drm_device * );
552- int (* postsetup ) (struct drm_device * );
538+ int (* load ) (struct drm_device * , unsigned long flags );
539+ int (* firstopen ) (struct drm_device * );
540+ int (* open ) (struct drm_device * , drm_file_t * );
541+ void (* preclose ) (struct drm_device * , struct file * filp );
542+ void (* postclose ) (struct drm_device * , drm_file_t * );
543+ void (* lastclose ) (struct drm_device * );
544+ int (* unload ) (struct drm_device * );
553545 int (* dma_ioctl ) (DRM_IOCTL_ARGS );
554- int (* open_helper ) (struct drm_device * , drm_file_t * );
555- void (* free_filp_priv ) (struct drm_device * , drm_file_t * );
556- void (* release ) (struct drm_device * , struct file * filp );
557546 void (* dma_ready ) (struct drm_device * );
558547 int (* dma_quiescent ) (struct drm_device * );
559548 int (* context_ctor ) (struct drm_device * dev , int context );
560549 int (* context_dtor ) (struct drm_device * dev , int context );
561550 int (* kernel_context_switch ) (struct drm_device * dev , int old ,
562551 int new );
563552 void (* kernel_context_switch_unlock ) (struct drm_device * dev ,
564- drm_lock_t * lock );
553+ drm_lock_t * lock );
565554 int (* vblank_wait ) (struct drm_device * dev , unsigned int * sequence );
555+ int (* dri_library_name ) (struct drm_device * dev , char * buf );
566556
567557 /**
568558 * Called by \c drm_device_is_agp. Typically used to determine if a
@@ -579,16 +569,24 @@ struct drm_driver {
579569
580570 /* these have to be filled in */
581571
582- int (* postinit ) (struct drm_device * , unsigned long flags );
583- irqreturn_t (* irq_handler ) (DRM_IRQ_ARGS );
572+ irqreturn_t (* irq_handler ) (DRM_IRQ_ARGS );
584573 void (* irq_preinstall ) (struct drm_device * dev );
585574 void (* irq_postinstall ) (struct drm_device * dev );
586575 void (* irq_uninstall ) (struct drm_device * dev );
587576 void (* reclaim_buffers ) (struct drm_device * dev , struct file * filp );
577+ void (* reclaim_buffers_locked ) (struct drm_device * dev ,
578+ struct file * filp );
588579 unsigned long (* get_map_ofs ) (drm_map_t * map );
589580 unsigned long (* get_reg_ofs ) (struct drm_device * dev );
590581 void (* set_version ) (struct drm_device * dev , drm_set_version_t * sv );
591- int (* version ) (drm_version_t * version );
582+
583+ int major ;
584+ int minor ;
585+ int patchlevel ;
586+ char * name ;
587+ char * desc ;
588+ char * date ;
589+
592590 u32 driver_features ;
593591 int dev_priv_size ;
594592 drm_ioctl_desc_t * ioctls ;
@@ -752,32 +750,55 @@ static inline int drm_core_has_MTRR(struct drm_device *dev)
752750{
753751 return drm_core_check_feature (dev , DRIVER_USE_MTRR );
754752}
753+
754+ #define DRM_MTRR_WC MTRR_TYPE_WRCOMB
755+
756+ static inline int drm_mtrr_add (unsigned long offset , unsigned long size ,
757+ unsigned int flags )
758+ {
759+ return mtrr_add (offset , size , flags , 1 );
760+ }
761+
762+ static inline int drm_mtrr_del (int handle , unsigned long offset ,
763+ unsigned long size , unsigned int flags )
764+ {
765+ return mtrr_del (handle , offset , size );
766+ }
767+
755768#else
756769#define drm_core_has_MTRR (dev ) (0)
770+
771+ #define DRM_MTRR_WC 0
772+
773+ static inline int drm_mtrr_add (unsigned long offset , unsigned long size ,
774+ unsigned int flags )
775+ {
776+ return 0 ;
777+ }
778+
779+ static inline int drm_mtrr_del (int handle , unsigned long offset ,
780+ unsigned long size , unsigned int flags )
781+ {
782+ return 0 ;
783+ }
757784#endif
758785
759786/******************************************************************/
760787/** \name Internal function definitions */
761788/*@{*/
762789
763- /* Misc. support (drm_init.h) */
764- extern int drm_flags ;
765- extern void drm_parse_options (char * s );
766- extern int drm_cpu_valid (void );
767-
768790 /* Driver support (drm_drv.h) */
769791extern int drm_init (struct drm_driver * driver );
770792extern void drm_exit (struct drm_driver * driver );
771793extern int drm_ioctl (struct inode * inode , struct file * filp ,
772794 unsigned int cmd , unsigned long arg );
773795extern long drm_compat_ioctl (struct file * filp ,
774796 unsigned int cmd , unsigned long arg );
775- extern int drm_takedown (drm_device_t * dev );
797+ extern int drm_lastclose (drm_device_t * dev );
776798
777799 /* Device support (drm_fops.h) */
778800extern int drm_open (struct inode * inode , struct file * filp );
779801extern int drm_stub_open (struct inode * inode , struct file * filp );
780- extern int drm_flush (struct file * filp );
781802extern int drm_fasync (int fd , struct file * filp , int on );
782803extern int drm_release (struct inode * inode , struct file * filp );
783804
@@ -819,6 +840,8 @@ extern int drm_getstats(struct inode *inode, struct file *filp,
819840 unsigned int cmd , unsigned long arg );
820841extern int drm_setversion (struct inode * inode , struct file * filp ,
821842 unsigned int cmd , unsigned long arg );
843+ extern int drm_noop (struct inode * inode , struct file * filp ,
844+ unsigned int cmd , unsigned long arg );
822845
823846 /* Context IOCTL support (drm_context.h) */
824847extern int drm_resctx (struct inode * inode , struct file * filp ,
@@ -857,10 +880,6 @@ extern int drm_getmagic(struct inode *inode, struct file *filp,
857880extern int drm_authmagic (struct inode * inode , struct file * filp ,
858881 unsigned int cmd , unsigned long arg );
859882
860- /* Placeholder for ioctls past */
861- extern int drm_noop (struct inode * inode , struct file * filp ,
862- unsigned int cmd , unsigned long arg );
863-
864883 /* Locking IOCTL support (drm_lock.h) */
865884extern int drm_lock (struct inode * inode , struct file * filp ,
866885 unsigned int cmd , unsigned long arg );
@@ -873,6 +892,7 @@ extern int drm_lock_free(drm_device_t * dev,
873892 /* Buffer management support (drm_bufs.h) */
874893extern int drm_addbufs_agp (drm_device_t * dev , drm_buf_desc_t * request );
875894extern int drm_addbufs_pci (drm_device_t * dev , drm_buf_desc_t * request );
895+ extern int drm_addbufs_fb (drm_device_t * dev , drm_buf_desc_t * request );
876896extern int drm_addmap (drm_device_t * dev , unsigned int offset ,
877897 unsigned int size , drm_map_type_t type ,
878898 drm_map_flags_t flags , drm_local_map_t * * map_ptr );
@@ -908,8 +928,8 @@ extern void drm_core_reclaim_buffers(drm_device_t * dev, struct file *filp);
908928 /* IRQ support (drm_irq.h) */
909929extern int drm_control (struct inode * inode , struct file * filp ,
910930 unsigned int cmd , unsigned long arg );
911- extern int drm_irq_uninstall (drm_device_t * dev );
912931extern irqreturn_t drm_irq_handler (DRM_IRQ_ARGS );
932+ extern int drm_irq_uninstall (drm_device_t * dev );
913933extern void drm_driver_irq_preinstall (drm_device_t * dev );
914934extern void drm_driver_irq_postinstall (drm_device_t * dev );
915935extern void drm_driver_irq_uninstall (drm_device_t * dev );
@@ -933,13 +953,17 @@ extern int drm_agp_enable_ioctl(struct inode *inode, struct file *filp,
933953extern int drm_agp_info (drm_device_t * dev , drm_agp_info_t * info );
934954extern int drm_agp_info_ioctl (struct inode * inode , struct file * filp ,
935955 unsigned int cmd , unsigned long arg );
936- extern int drm_agp_alloc (struct inode * inode , struct file * filp ,
956+ extern int drm_agp_alloc (drm_device_t * dev , drm_agp_buffer_t * request );
957+ extern int drm_agp_alloc_ioctl (struct inode * inode , struct file * filp ,
937958 unsigned int cmd , unsigned long arg );
938- extern int drm_agp_free (struct inode * inode , struct file * filp ,
959+ extern int drm_agp_free (drm_device_t * dev , drm_agp_buffer_t * request );
960+ extern int drm_agp_free_ioctl (struct inode * inode , struct file * filp ,
939961 unsigned int cmd , unsigned long arg );
940- extern int drm_agp_unbind (struct inode * inode , struct file * filp ,
962+ extern int drm_agp_unbind (drm_device_t * dev , drm_agp_binding_t * request );
963+ extern int drm_agp_unbind_ioctl (struct inode * inode , struct file * filp ,
941964 unsigned int cmd , unsigned long arg );
942- extern int drm_agp_bind (struct inode * inode , struct file * filp ,
965+ extern int drm_agp_bind (drm_device_t * dev , drm_agp_binding_t * request );
966+ extern int drm_agp_bind_ioctl (struct inode * inode , struct file * filp ,
943967 unsigned int cmd , unsigned long arg );
944968extern DRM_AGP_MEM * drm_agp_allocate_memory (struct agp_bridge_data * bridge ,
945969 size_t pages , u32 type );
@@ -991,10 +1015,8 @@ extern struct drm_sysfs_class *drm_sysfs_create(struct module *owner,
9911015 char * name );
9921016extern void drm_sysfs_destroy (struct drm_sysfs_class * cs );
9931017extern struct class_device * drm_sysfs_device_add (struct drm_sysfs_class * cs ,
994- dev_t dev ,
995- struct device * device ,
996- const char * fmt , ...);
997- extern void drm_sysfs_device_remove (dev_t dev );
1018+ drm_head_t * head );
1019+ extern void drm_sysfs_device_remove (struct class_device * class_dev );
9981020
9991021/* Inline replacements for DRM_IOREMAP macros */
10001022static __inline__ void drm_core_ioremap (struct drm_map * map ,
0 commit comments