Subversion Repositories Kolibri OS

Rev

Rev 4559 | Rev 5178 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4559 Rev 5056
Line 62... Line 62...
62
#include 
62
#include 
63
//#include 
63
//#include 
64
#include 
64
#include 
65
#include 
65
#include 
66
#include 
66
#include 
-
 
67
#include 
-
 
68
 
67
#include 
69
#include 
68
//#include     /* For (un)lock_kernel */
-
 
69
//#include 
-
 
70
#include 
70
#include 
71
//#include 
71
//#include 
72
//#include 
72
#include 
-
 
73
 
73
//#include 
74
//#include 
74
//#include 
75
//#include 
75
//#include 
76
//#include 
76
//#include 
77
//#include 
Line -... Line 78...
-
 
78
 
77
 
79
#include 
Line 78... Line 80...
78
#include 
80
#include 
79
 
81
 
Line 90... Line 92...
90
struct drm_file;
92
struct drm_file;
91
struct drm_device;
93
struct drm_device;
Line 92... Line 94...
92
 
94
 
93
struct device_node;
95
struct device_node;
-
 
96
struct videomode;
Line 94... Line 97...
94
struct videomode;
97
struct reservation_object;
95
 
98
 
96
struct inode;
99
struct inode;
Line 115... Line 118...
115
/* get_scanout_position() return flags */
118
/* get_scanout_position() return flags */
116
#define DRM_SCANOUTPOS_VALID        (1 << 0)
119
#define DRM_SCANOUTPOS_VALID        (1 << 0)
117
#define DRM_SCANOUTPOS_INVBL        (1 << 1)
120
#define DRM_SCANOUTPOS_INVBL        (1 << 1)
118
#define DRM_SCANOUTPOS_ACCURATE     (1 << 2)
121
#define DRM_SCANOUTPOS_ACCURATE     (1 << 2)
Line 119... Line 122...
119
 
122
 
-
 
123
/*
120
 
124
 * 4 debug categories are defined:
-
 
125
 *
-
 
126
 * CORE: Used in the generic drm code: drm_ioctl.c, drm_mm.c, drm_memory.c, ...
-
 
127
 *	 This is the category used by the DRM_DEBUG() macro.
-
 
128
 *
-
 
129
 * DRIVER: Used in the vendor specific part of the driver: i915, radeon, ...
-
 
130
 *	   This is the category used by the DRM_DEBUG_DRIVER() macro.
-
 
131
 *
-
 
132
 * KMS: used in the modesetting code.
-
 
133
 *	This is the category used by the DRM_DEBUG_KMS() macro.
-
 
134
 *
-
 
135
 * PRIME: used in the prime code.
-
 
136
 *	  This is the category used by the DRM_DEBUG_PRIME() macro.
-
 
137
 *
-
 
138
 * Enabling verbose debug messages is done through the drm.debug parameter,
-
 
139
 * each category being enabled by a bit.
-
 
140
 *
-
 
141
 * drm.debug=0x1 will enable CORE messages
-
 
142
 * drm.debug=0x2 will enable DRIVER messages
-
 
143
 * drm.debug=0x3 will enable CORE and DRIVER messages
-
 
144
 * ...
-
 
145
 * drm.debug=0xf will enable all messages
-
 
146
 *
-
 
147
 * An interesting feature is that it's possible to enable verbose logging at
-
 
148
 * run-time by echoing the debug value in its sysfs node:
-
 
149
 *   # echo 0xf > /sys/module/drm/parameters/debug
121
 
150
 */
122
#define DRM_UT_CORE 		0x01
151
#define DRM_UT_CORE 		0x01
123
#define DRM_UT_DRIVER		0x02
152
#define DRM_UT_DRIVER		0x02
124
#define DRM_UT_KMS          0x04
153
#define DRM_UT_KMS          0x04
125
#define DRM_UT_PRIME		0x08
-
 
126
/*
-
 
127
 * Three debug levels are defined.
-
 
128
 * drm_core, drm_driver, drm_kms
-
 
129
 * drm_core level can be used in the generic drm code. For example:
-
 
130
 * 	drm_ioctl, drm_mm, drm_memory
-
 
131
 * The macro definition of DRM_DEBUG is used.
-
 
132
 * 	DRM_DEBUG(fmt, args...)
-
 
133
 * 	The debug info by using the DRM_DEBUG can be obtained by adding
-
 
134
 * 	the boot option of "drm.debug=1".
-
 
135
 *
-
 
136
 * drm_driver level can be used in the specific drm driver. It is used
-
 
137
 * to add the debug info related with the drm driver. For example:
-
 
138
 * i915_drv, i915_dma, i915_gem, radeon_drv,
-
 
139
 * 	The macro definition of DRM_DEBUG_DRIVER can be used.
-
 
140
 * 	DRM_DEBUG_DRIVER(fmt, args...)
-
 
141
 * 	The debug info by using the DRM_DEBUG_DRIVER can be obtained by
-
 
142
 * 	adding the boot option of "drm.debug=0x02"
-
 
143
 *
-
 
144
 * drm_kms level can be used in the KMS code related with specific drm driver.
-
 
145
 * It is used to add the debug info related with KMS mode. For example:
-
 
146
 * the connector/crtc ,
-
 
147
 * 	The macro definition of DRM_DEBUG_KMS can be used.
-
 
148
 * 	DRM_DEBUG_KMS(fmt, args...)
-
 
149
 * 	The debug info by using the DRM_DEBUG_KMS can be obtained by
-
 
150
 * 	adding the boot option of "drm.debug=0x04"
-
 
151
 *
-
 
152
 * If we add the boot option of "drm.debug=0x06", we can get the debug info by
-
 
153
 * using the DRM_DEBUG_KMS and DRM_DEBUG_DRIVER.
-
 
154
 * If we add the boot option of "drm.debug=0x05", we can get the debug info by
-
 
155
 * using the DRM_DEBUG_KMS and DRM_DEBUG.
-
 
156
 */
154
#define DRM_UT_PRIME		0x08
157
 
155
 
158
extern __printf(4, 5)
156
extern __printf(2, 3)
159
void drm_ut_debug_printk(unsigned int request_level,
-
 
160
				const char *prefix,
-
 
161
				const char *function_name,
157
void drm_ut_debug_printk(const char *function_name,
162
				const char *format, ...);
158
				const char *format, ...);
163
extern __printf(2, 3)
159
extern __printf(2, 3)
Line 164... Line 160...
164
int drm_err(const char *func, const char *format, ...);
160
int drm_err(const char *func, const char *format, ...);
Line 190... Line 186...
190
 
186
 
191
#define DRM_DEBUG_CODE 2	  /**< Include debugging code if > 1, then
187
#define DRM_DEBUG_CODE 2	  /**< Include debugging code if > 1, then
Line 192... Line 188...
192
				     also include looping detection. */
188
				     also include looping detection. */
193
 
-
 
194
#define DRM_MAGIC_HASH_ORDER  4  /**< Size of key hash table. Must be power of 2. */
-
 
Line 195... Line 189...
195
#define DRM_KERNEL_CONTEXT    0	 /**< Change drm_resctx if changed */
189
 
Line 196... Line 190...
196
#define DRM_RESERVED_CONTEXTS 1	 /**< Change drm_resctx if changed */
190
#define DRM_MAGIC_HASH_ORDER  4  /**< Size of key hash table. Must be power of 2. */
Line 229... Line 223...
229
})
223
})
Line 230... Line 224...
230
 
224
 
231
#define DRM_INFO(fmt, ...)				\
225
#define DRM_INFO(fmt, ...)				\
Line -... Line 226...
-
 
226
	printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__)
-
 
227
 
-
 
228
#define DRM_INFO_ONCE(fmt, ...)				\
232
	printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__)
229
	printk_once(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__)
233
 
230
 
234
/**
231
/**
235
 * Debug output.
232
 * Debug output.
236
 *
233
 *
237
 * \param fmt printf() like format string.
234
 * \param fmt printf() like format string.
238
 * \param arg arguments
235
 * \param arg arguments
239
 */
236
 */
240
#if DRM_DEBUG_CODE
237
#if DRM_DEBUG_CODE
241
#define DRM_DEBUG(fmt, ...)                                 \
238
#define DRM_DEBUG(fmt, args...)						\
242
    do {                                                    \
239
    do {                                                    \
Line 243... Line -...
243
    printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__);  \
-
 
244
	} while (0)
-
 
245
 
-
 
246
#define DRM_DEBUG_DRIVER(fmt, ...)                          \
-
 
247
    do {                                                    \
240
    printk(KERN_INFO "[" DRM_NAME "] " fmt, ##args);  \
248
    printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__);  \
-
 
249
	} while (0)
-
 
250
#define DRM_DEBUG_KMS(fmt, ...)              \
-
 
251
	do {								\
-
 
252
    printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__);  \
241
	} while (0)
253
	} while (0)
242
 
254
#define DRM_DEBUG_PRIME(fmt, ...)                    \
243
#define DRM_DEBUG_DRIVER(fmt, args...)					\
255
	do {								\
244
    do {                                                    \
256
    printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__);  \
245
    printk(KERN_INFO "[" DRM_NAME "] " fmt, ##args);  \
257
	} while (0)
246
	} while (0)
258
#define DRM_LOG(fmt, ...)                        \
247
#define DRM_DEBUG_KMS(fmt, args...)					\
259
	do {								\
248
	do {								\
260
    printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__);  \
249
    printk(KERN_INFO "[" DRM_NAME "] " fmt, ##args);  \
261
	} while (0)
250
	} while (0)
262
#define DRM_LOG_KMS(fmt, ...)                    \
-
 
263
	do {								\
-
 
264
    printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__);  \
-
 
265
	} while (0)
-
 
266
#define DRM_LOG_MODE(fmt, ...)                   \
-
 
267
	do {								\
-
 
268
    printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__);  \
-
 
269
	} while (0)
-
 
270
#define DRM_LOG_DRIVER(fmt, ...)                 \
251
#define DRM_DEBUG_PRIME(fmt, args...)					\
271
	do {								\
252
	do {								\
272
    printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__);  \
253
    printk(KERN_INFO "[" DRM_NAME "] " fmt, ##args);  \
273
	} while (0)
254
	} while (0)
274
#else
255
#else
275
#define DRM_DEBUG_DRIVER(fmt, args...) do { } while (0)
256
#define DRM_DEBUG_DRIVER(fmt, args...) do { } while (0)
276
#define DRM_DEBUG_KMS(fmt, args...)	do { } while (0)
-
 
277
#define DRM_DEBUG_PRIME(fmt, args...)	do { } while (0)
-
 
278
#define DRM_DEBUG(fmt, arg...)		 do { } while (0)
-
 
279
#define DRM_LOG(fmt, arg...)		do { } while (0)
-
 
280
#define DRM_LOG_KMS(fmt, args...) do { } while (0)
-
 
281
#define DRM_LOG_MODE(fmt, arg...) do { } while (0)
257
#define DRM_DEBUG_KMS(fmt, args...)	do { } while (0)
Line 282... Line 258...
282
#define DRM_LOG_DRIVER(fmt, arg...) do { } while (0)
258
#define DRM_DEBUG_PRIME(fmt, args...)	do { } while (0)
Line 283... Line 259...
283
 
259
#define DRM_DEBUG(fmt, arg...)		 do { } while (0)
Line 308... Line 284...
308
			   _file_priv->master->lock.file_priv, _file_priv);	\
284
			   _file_priv->master->lock.file_priv, _file_priv);	\
309
		return -EINVAL;							\
285
		return -EINVAL;							\
310
	}									\
286
	}									\
311
} while (0)
287
} while (0)
Line 312... Line -...
312
 
-
 
313
#if 0
288
 
314
/**
289
/**
315
 * Ioctl function type.
290
 * Ioctl function type.
316
 *
291
 *
317
 * \param inode device inode.
292
 * \param inode device inode.
Line 349... Line 324...
349
 */
324
 */
Line 350... Line 325...
350
 
325
 
351
#define DRM_IOCTL_DEF_DRV(ioctl, _func, _flags)			\
326
#define DRM_IOCTL_DEF_DRV(ioctl, _func, _flags)			\
Line -... Line 327...
-
 
327
	[DRM_IOCTL_NR(DRM_##ioctl)] = {.cmd = DRM_##ioctl, .func = _func, .flags = _flags, .cmd_drv = DRM_IOCTL_##ioctl, .name = #ioctl}
352
	[DRM_IOCTL_NR(DRM_##ioctl)] = {.cmd = DRM_##ioctl, .func = _func, .flags = _flags, .cmd_drv = DRM_IOCTL_##ioctl, .name = #ioctl}
328
 
353
 
329
#if 0
354
struct drm_magic_entry {
330
struct drm_magic_entry {
355
	struct list_head head;
331
	struct list_head head;
356
	struct drm_hash_item hash_item;
332
	struct drm_hash_item hash_item;
Line 403... Line 379...
403
	spinlock_t read_lock;
379
	spinlock_t read_lock;
404
	spinlock_t write_lock;
380
	spinlock_t write_lock;
405
};
381
};
406
#endif
382
#endif
Line 407... Line -...
407
 
-
 
408
struct drm_freelist {
-
 
409
	int initialized;	       /**< Freelist in use */
-
 
410
	atomic_t count;		       /**< Number of free buffers */
-
 
411
	struct drm_buf *next;	       /**< End pointer */
-
 
412
 
-
 
413
	wait_queue_head_t waiting;     /**< Processes waiting on free bufs */
-
 
414
	int low_mark;		       /**< Low water mark */
-
 
415
	int high_mark;		       /**< High water mark */
-
 
416
	atomic_t wfh;		       /**< If waiting for high mark */
-
 
417
	spinlock_t lock;
-
 
Line 418... Line 383...
418
};
383
 
419
 
384
 
420
typedef struct drm_dma_handle {
385
typedef struct drm_dma_handle {
421
	dma_addr_t busaddr;
386
	dma_addr_t busaddr;
Line 432... Line 397...
432
	struct drm_buf *buflist;		/**< buffer list */
397
	struct drm_buf *buflist;		/**< buffer list */
433
	int seg_count;
398
	int seg_count;
434
	int page_order;
399
	int page_order;
435
	struct drm_dma_handle **seglist;
400
	struct drm_dma_handle **seglist;
Line 436... Line 401...
436
 
401
 
-
 
402
	int low_mark;			/**< Low water mark */
437
	struct drm_freelist freelist;
403
	int high_mark;			/**< High water mark */
Line 438... Line 404...
438
};
404
};
439
 
405
 
440
/* Event queued up for userspace to read */
406
/* Event queued up for userspace to read */
Line 453... Line 419...
453
	struct mutex lock;
419
	struct mutex lock;
454
};
420
};
Line 455... Line 421...
455
 
421
 
456
/** File private data */
422
/** File private data */
457
struct drm_file {
-
 
458
	unsigned always_authenticated :1;
423
struct drm_file {
459
	unsigned authenticated :1;
424
	unsigned authenticated :1;
-
 
425
	/* Whether we're master for a minor. Protected by master_mutex */
460
	unsigned is_master :1; /* this file private is a master for a minor */
426
	unsigned is_master :1;
461
	/* true when the client has asked us to expose stereo 3D mode flags */
427
	/* true when the client has asked us to expose stereo 3D mode flags */
-
 
428
	unsigned stereo_allowed :1;
-
 
429
	/*
-
 
430
	 * true if client understands CRTC primary planes and cursor planes
-
 
431
	 * in the plane list
-
 
432
	 */
462
	unsigned stereo_allowed :1;
433
	unsigned universal_planes:1;
463
	struct list_head lhead;
434
	struct list_head lhead;
Line 464... Line 435...
464
	unsigned long lock_count;
435
	unsigned long lock_count;
465
 
436
 
466
	/** Mapping of mm object handles to object pointers. */
437
	/** Mapping of mm object handles to object pointers. */
467
	struct idr object_idr;
438
	struct idr object_idr;
Line 468... Line 439...
468
	/** Lock for synchronization of access to object_idr. */
439
	/** Lock for synchronization of access to object_idr. */
Line -... Line 440...
-
 
440
	spinlock_t table_lock;
-
 
441
 
-
 
442
	void *driver_priv;
-
 
443
 
-
 
444
	struct drm_master *master; /* master this node is currently associated with
-
 
445
				      N.B. not always minor->master */
-
 
446
	/**
-
 
447
	 * fbs - List of framebuffers associated with this file.
469
	spinlock_t table_lock;
448
	 *
-
 
449
	 * Protected by fbs_lock. Note that the fbs list holds a reference on
Line 470... Line 450...
470
 
450
	 * the fb object to prevent it from untimely disappearing.
471
	void *driver_priv;
451
	 */
472
 
452
	struct list_head fbs;
473
	struct list_head fbs;
453
	struct mutex fbs_lock;
Line 474... Line 454...
474
 
454
 
475
	wait_queue_head_t event_wait;
-
 
476
	struct list_head event_list;
-
 
477
	int event_space;
-
 
478
};
-
 
479
 
-
 
480
#if 0
-
 
481
/** Wait queue */
-
 
482
struct drm_queue {
-
 
483
	atomic_t use_count;		/**< Outstanding uses (+1) */
-
 
484
	atomic_t finalization;		/**< Finalization in progress */
-
 
485
	atomic_t block_count;		/**< Count of processes waiting */
-
 
486
	atomic_t block_read;		/**< Queue blocked for reads */
-
 
487
	wait_queue_head_t read_queue;	/**< Processes waiting on block_read */
-
 
488
	atomic_t block_write;		/**< Queue blocked for writes */
-
 
489
	wait_queue_head_t write_queue;	/**< Processes waiting on block_write */
-
 
490
	atomic_t total_queued;		/**< Total queued statistic */
-
 
491
	atomic_t total_flushed;		/**< Total flushes statistic */
-
 
492
	atomic_t total_locks;		/**< Total locks statistics */
455
	wait_queue_head_t event_wait;
493
	enum drm_ctx_flags flags;	/**< Context preserving and 2D-only */
456
	struct list_head event_list;
494
	struct drm_waitlist waitlist;	/**< Pending buffers */
457
	int event_space;
495
	wait_queue_head_t flush_queue;	/**< Processes waiting until flush */
458
};
496
};
459
 
Line 576... Line 539...
576
	struct drm_hw_lock *lock;
539
	struct drm_hw_lock *lock;
577
};
540
};
Line 578... Line 541...
578
 
541
 
Line 579... Line -...
579
#endif
-
 
580
 
542
#endif
581
 
543
 
582
/**
544
/**
583
 * Kernel side of a mapping
545
 * Kernel side of a mapping
584
 */
546
 */
Line 603... Line 565...
603
	struct drm_local_map *map;	/**< mapping */
565
	struct drm_local_map *map;	/**< mapping */
604
	uint64_t user_token;
566
	uint64_t user_token;
605
	struct drm_master *master;
567
	struct drm_master *master;
606
};
568
};
Line 607... Line -...
607
 
-
 
608
/**
-
 
609
 * Context handle list
-
 
610
 */
-
 
611
struct drm_ctx_list {
-
 
612
	struct list_head head;		/**< list head */
-
 
613
	drm_context_t handle;		/**< context handle */
-
 
614
	struct drm_file *tag;		/**< associated fd private data */
-
 
615
};
-
 
616
 
569
 
617
/* location of GART table */
570
/* location of GART table */
618
#define DRM_ATI_GART_MAIN 1
571
#define DRM_ATI_GART_MAIN 1
Line 619... Line 572...
619
#define DRM_ATI_GART_FB   2
572
#define DRM_ATI_GART_FB   2
Line 689... Line 642...
689
	 * at the point that any cache flushing occurs
642
	 * at the point that any cache flushing occurs
690
	 */
643
	 */
691
	uint32_t pending_read_domains;
644
	uint32_t pending_read_domains;
692
	uint32_t pending_write_domain;
645
	uint32_t pending_write_domain;
Line -... Line 646...
-
 
646
 
-
 
647
	/**
-
 
648
	 * dma_buf - dma buf associated with this GEM object
-
 
649
	 *
-
 
650
	 * Pointer to the dma-buf associated with this gem object (either
-
 
651
	 * through importing or exporting). We break the resulting reference
-
 
652
	 * loop when the last gem handle for this object is released.
-
 
653
	 *
-
 
654
	 * Protected by obj->object_name_lock
-
 
655
	 */
Line 693... Line 656...
693
 
656
	struct dma_buf *dma_buf;
Line 694... Line 657...
694
 
657
 
Line -... Line 658...
-
 
658
};
695
};
659
 
-
 
660
#include 
-
 
661
 
-
 
662
/**
-
 
663
 * struct drm_master - drm master structure
-
 
664
 *
-
 
665
 * @refcount: Refcount for this master object.
-
 
666
 * @minor: Link back to minor char device we are master for. Immutable.
-
 
667
 * @unique: Unique identifier: e.g. busid. Protected by drm_global_mutex.
-
 
668
 * @unique_len: Length of unique field. Protected by drm_global_mutex.
-
 
669
 * @unique_size: Amount allocated. Protected by drm_global_mutex.
-
 
670
 * @magiclist: Hash of used authentication tokens. Protected by struct_mutex.
696
 
671
 * @magicfree: List of used authentication tokens. Protected by struct_mutex.
697
#include 
-
 
698
 
672
 * @lock: DRI lock information.
699
/* per-master structure */
-
 
700
struct drm_master {
-
 
701
 
673
 * @driver_priv: Pointer to driver-private information.
702
	struct kref refcount; /* refcount for this master */
-
 
703
 
674
 */
704
	struct list_head head; /**< each minor contains a list of masters */
675
struct drm_master {
705
	struct drm_minor *minor; /**< link back to minor we are a master for */
676
	struct kref refcount;
706
 
-
 
707
	char *unique;			/**< Unique identifier: e.g., busid */
-
 
708
	int unique_len;			/**< Length of unique field */
-
 
709
	int unique_size;		/**< amount allocated */
-
 
710
 
-
 
711
	int blocked;			/**< Blocked due to VC switch? */
677
	struct drm_minor *minor;
712
 
678
	char *unique;
713
	/** \name Authentication */
-
 
714
	/*@{ */
-
 
715
//   struct drm_open_hash magiclist;
679
	int unique_len;
716
//   struct list_head magicfree;
-
 
717
	/*@} */
680
	int unique_size;
718
 
681
//	struct drm_open_hash magiclist;
Line 719... Line -...
719
//   struct drm_lock_data lock;  /**< Information on hardware lock */
-
 
720
 
-
 
721
	void *driver_priv; /**< Private structure for driver to use */
682
//	struct list_head magicfree;
722
};
683
//	struct drm_lock_data lock;
723
 
684
	void *driver_priv;
724
#if 0
685
};
Line 737... Line 698...
737
#define DRM_SCANOUTPOS_VALID        (1 << 0)
698
#define DRM_SCANOUTPOS_VALID        (1 << 0)
738
#define DRM_SCANOUTPOS_INVBL        (1 << 1)
699
#define DRM_SCANOUTPOS_INVBL        (1 << 1)
739
#define DRM_SCANOUTPOS_ACCURATE     (1 << 2)
700
#define DRM_SCANOUTPOS_ACCURATE     (1 << 2)
Line 740... Line 701...
740
 
701
 
741
struct drm_bus {
-
 
742
	int bus_type;
-
 
743
	int (*get_irq)(struct drm_device *dev);
-
 
744
	const char *(*get_name)(struct drm_device *dev);
702
struct drm_bus {
745
	int (*set_busid)(struct drm_device *dev, struct drm_master *master);
-
 
746
	int (*set_unique)(struct drm_device *dev, struct drm_master *master,
-
 
747
			  struct drm_unique *unique);
-
 
748
	int (*irq_by_busid)(struct drm_device *dev, struct drm_irq_busid *p);
703
	int (*set_busid)(struct drm_device *dev, struct drm_master *master);
749
};
-
 
750
#endif
-
 
751
 
-
 
Line 752... Line 704...
752
#define DRM_IRQ_ARGS            int irq, void *arg
704
};
753
 
705
 
754
/**
706
/**
755
 * DRM driver structure. This structure represent the common code for
707
 * DRM driver structure. This structure represent the common code for
Line 874... Line 826...
874
				     struct timeval *vblank_time,
826
				     struct timeval *vblank_time,
875
				     unsigned flags);
827
				     unsigned flags);
Line 876... Line 828...
876
 
828
 
Line 877... Line 829...
877
	/* these have to be filled in */
829
	/* these have to be filled in */
878
 
830
 
879
	irqreturn_t(*irq_handler) (DRM_IRQ_ARGS);
831
	irqreturn_t(*irq_handler) (int irq, void *arg);
880
	void (*irq_preinstall) (struct drm_device *dev);
832
	void (*irq_preinstall) (struct drm_device *dev);
Line 881... Line 833...
881
	int (*irq_postinstall) (struct drm_device *dev);
833
	int (*irq_postinstall) (struct drm_device *dev);
Line 889... Line 841...
889
	 */
841
	 */
890
	void (*gem_free_object) (struct drm_gem_object *obj);
842
	void (*gem_free_object) (struct drm_gem_object *obj);
891
	int (*gem_open_object) (struct drm_gem_object *, struct drm_file *);
843
	int (*gem_open_object) (struct drm_gem_object *, struct drm_file *);
892
	void (*gem_close_object) (struct drm_gem_object *, struct drm_file *);
844
	void (*gem_close_object) (struct drm_gem_object *, struct drm_file *);
893
	u32 driver_features;
845
	u32 driver_features;
-
 
846
	int dev_priv_size;
894
};
847
};
Line 895... Line 848...
895
 
848
 
896
#define DRM_MINOR_UNASSIGNED 0
849
enum drm_minor_type {
897
#define DRM_MINOR_LEGACY 1
850
	DRM_MINOR_LEGACY,
898
#define DRM_MINOR_CONTROL 2
851
	DRM_MINOR_CONTROL,
-
 
852
	DRM_MINOR_RENDER,
-
 
853
	DRM_MINOR_CNT,
Line 899... Line 854...
899
#define DRM_MINOR_RENDER 3
854
};
900
 
855
 
901
/**
856
/**
902
 * Info file list entry. This structure represents a debugfs or proc file to
857
 * Info file list entry. This structure represents a debugfs or proc file to
Line 923... Line 878...
923
 * DRM minor structure. This structure represents a drm minor number.
878
 * DRM minor structure. This structure represents a drm minor number.
924
 */
879
 */
925
struct drm_minor {
880
struct drm_minor {
926
	int index;			/**< Minor device number */
881
	int index;			/**< Minor device number */
927
	int type;                       /**< Control or render */
882
	int type;                       /**< Control or render */
928
//   dev_t device;           /**< Device number for mknod */
-
 
929
//   struct device kdev;     /**< Linux device */
883
//   struct device kdev;     /**< Linux device */
930
	struct drm_device *dev;
884
	struct drm_device *dev;
Line 931... Line -...
931
 
-
 
932
//   struct proc_dir_entry *proc_root;  /**< proc directory entry */
-
 
933
//   struct drm_info_node proc_nodes;
885
 
934
//   struct dentry *debugfs_root;
-
 
935
//   struct drm_info_node debugfs_nodes;
886
	struct dentry *debugfs_root;
936
 
-
 
937
    struct drm_master *master; /* currently active master for this node */
887
 
938
//   struct list_head master_list;
888
	struct list_head debugfs_list;
939
//   struct drm_mode_group mode_group;
-
 
940
};
889
	struct mutex debugfs_lock; /* Protects debugfs_list. */
941
 
890
 
942
/* mode specified on the command line */
891
	/* currently active master for this node. Protected by master_mutex */
943
struct drm_cmdline_mode {
-
 
944
	bool specified;
-
 
945
	bool refresh_specified;
-
 
946
	bool bpp_specified;
-
 
947
	int xres, yres;
-
 
948
	int bpp;
-
 
949
	int refresh;
-
 
950
	bool rb;
-
 
951
	bool interlace;
-
 
952
	bool cvt;
-
 
953
	bool margins;
892
	struct drm_master *master;
954
	enum drm_connector_force force;
893
	struct drm_mode_group mode_group;
Line 955... Line 894...
955
};
894
};
956
 
895
 
957
 
896
 
958
 
897
 
959
/**
898
/**
960
 * DRM device structure. This structure represent a complete card that
899
 * DRM device structure. This structure represent a complete card that
961
 * may contain multiple heads.
-
 
962
 */
900
 * may contain multiple heads.
Line -... Line 901...
-
 
901
 */
-
 
902
struct drm_device {
-
 
903
	struct list_head legacy_dev_list;/**< list of devices per driver for stealth attach cleanup */
-
 
904
	int if_version;			/**< Highest interface version set */
-
 
905
 
963
struct drm_device {
906
	struct device *dev;		/**< Device structure of bus-device */
964
	struct list_head legacy_dev_list;/**< list of devices per driver for stealth attach cleanup */
907
	struct drm_driver *driver;	/**< DRM driver managing the device */
965
	char *devname;			/**< For /proc/interrupts */
-
 
966
	int if_version;			/**< Highest interface version set */
908
	void *dev_private;		/**< DRM driver private data */
-
 
909
	struct drm_minor *primary;		/**< Primary node */
967
 
910
	atomic_t unplugged;			/**< Flag whether dev is dead */
Line 968... Line 911...
968
	/** \name Locks */
911
	/** \name Locks */
969
	/*@{ */
912
	/*@{ */
970
    spinlock_t count_lock;      /**< For inuse, drm_device::open_count, drm_device::buf_use */
913
	struct mutex struct_mutex;	/**< For others */
-
 
914
	struct mutex master_mutex;      /**< For drm_minor::master and drm_file::is_master */
971
	struct mutex struct_mutex;	/**< For others */
915
	/*@} */
972
	/*@} */
916
 
973
 
917
	/** \name Usage Counters */
Line 974... Line 918...
974
	/** \name Usage Counters */
918
	/*@{ */
Line 1001... Line 945...
1001
	/*@} */
945
	/*@} */
Line 1002... Line 946...
1002
 
946
 
1003
	/** \name Context support */
947
	/** \name Context support */
1004
	/*@{ */
948
	/*@{ */
-
 
949
	bool irq_enabled;		/**< True if irq handler is enabled */
-
 
950
	int irq;
1005
	bool irq_enabled;		/**< True if irq handler is enabled */
951
 
1006
	__volatile__ long context_flag;	/**< Context swapping flag */
952
	__volatile__ long context_flag;	/**< Context swapping flag */
1007
	int last_context;		/**< Last current context */
953
	int last_context;		/**< Last current context */
Line 1008... Line 954...
1008
	/*@} */
954
	/*@} */
Line 1016... Line 962...
1016
	 * Once the modeset ioctl *has* been called though, we can safely
962
	 * Once the modeset ioctl *has* been called though, we can safely
1017
	 * disable them when unused.
963
	 * disable them when unused.
1018
	 */
964
	 */
1019
	bool vblank_disable_allowed;
965
	bool vblank_disable_allowed;
Line -... Line 966...
-
 
966
 
-
 
967
	/* array of size num_crtcs */
-
 
968
	struct drm_vblank_crtc *vblank;
-
 
969
 
-
 
970
	spinlock_t vblank_time_lock;    /**< Protects vblank count and time updates during vblank enable/disable */
Line 1020... Line 971...
1020
 
971
	spinlock_t vbl_lock;
Line 1021... Line 972...
1021
 
972
 
1022
	u32 max_vblank_count;           /**< size of vblank counter register */
973
	u32 max_vblank_count;           /**< size of vblank counter register */
Line 1029... Line 980...
1029
 
980
 
Line 1030... Line 981...
1030
	/*@} */
981
	/*@} */
Line 1031... Line -...
1031
 
-
 
1032
//   struct drm_agp_head *agp;   /**< AGP data */
982
 
1033
 
-
 
1034
	struct device *dev;             /**< Device structure */
-
 
-
 
983
//   struct drm_agp_head *agp;   /**< AGP data */
1035
	struct pci_dev *pdev;		/**< PCI device structure */
984
 
1036
	int pci_vendor;			/**< PCI vendor id */
-
 
1037
	int pci_device;			/**< PCI device id */
-
 
1038
	unsigned int num_crtcs;                  /**< Number of CRTCs on this device */
-
 
1039
	void *dev_private;		/**< device private data */
-
 
1040
    struct address_space *dev_mapping;
985
	struct pci_dev *pdev;		/**< PCI device structure */
1041
//   struct drm_sigdata sigdata;    /**< For block_all_signals */
-
 
1042
//   sigset_t sigmask;
-
 
1043
 
-
 
1044
	struct drm_driver *driver;
-
 
1045
//   struct drm_local_map *agp_buffer_map;
-
 
Line 1046... Line 986...
1046
//   unsigned int agp_buffer_token;
986
 
Line 1047... Line 987...
1047
//   struct drm_minor *control;      /**< Control node for card */
987
	unsigned int num_crtcs;                  /**< Number of CRTCs on this device */
1048
   struct drm_minor *primary;      /**< render type primary screen head */
988
 
1049
 
989
 
1050
        struct drm_mode_config mode_config;	/**< Current mode config */
990
        struct drm_mode_config mode_config;	/**< Current mode config */
1051
 
991
 
1052
	/** \name GEM information */
992
	/** \name GEM information */
1053
	/*@{ */
993
	/*@{ */
1054
	struct mutex object_name_lock;
-
 
1055
	struct idr object_name_idr;
-
 
1056
	struct drm_vma_offset_manager *vma_offset_manager;
994
	struct mutex object_name_lock;
Line 1057... Line 995...
1057
	/*@} */
995
	struct idr object_name_idr;
1058
	int switch_power_state;
996
	struct drm_vma_offset_manager *vma_offset_manager;
1059
 
997
	/*@} */
Line 1069... Line 1007...
1069
					     int feature)
1007
					     int feature)
1070
{
1008
{
1071
	return ((dev->driver->driver_features & feature) ? 1 : 0);
1009
	return ((dev->driver->driver_features & feature) ? 1 : 0);
1072
}
1010
}
Line 1073... Line -...
1073
 
-
 
1074
static inline int drm_dev_to_irq(struct drm_device *dev)
-
 
1075
{
-
 
1076
	return dev->pdev->irq;
-
 
1077
}
-
 
1078
 
1011
 
1079
static inline void drm_device_set_unplugged(struct drm_device *dev)
1012
static inline void drm_device_set_unplugged(struct drm_device *dev)
1080
{
1013
{
1081
	smp_wmb();
1014
	smp_wmb();
1082
	atomic_set(&dev->unplugged, 1);
1015
	atomic_set(&dev->unplugged, 1);
Line 1087... Line 1020...
1087
	int ret = atomic_read(&dev->unplugged);
1020
	int ret = atomic_read(&dev->unplugged);
1088
	smp_rmb();
1021
	smp_rmb();
1089
	return ret;
1022
	return ret;
1090
}
1023
}
Line 1091... Line -...
1091
 
-
 
1092
static inline bool drm_modeset_is_locked(struct drm_device *dev)
-
 
1093
{
-
 
1094
	return mutex_is_locked(&dev->mode_config.mutex);
-
 
Line 1095... Line 1024...
1095
}
1024
 
1096
 
1025
 
1097
/******************************************************************/
1026
/******************************************************************/
Line 1102... Line 1031...
1102
extern long drm_ioctl(struct file *filp,
1031
extern long drm_ioctl(struct file *filp,
1103
		     unsigned int cmd, unsigned long arg);
1032
		     unsigned int cmd, unsigned long arg);
1104
extern long drm_compat_ioctl(struct file *filp,
1033
extern long drm_compat_ioctl(struct file *filp,
1105
			     unsigned int cmd, unsigned long arg);
1034
			     unsigned int cmd, unsigned long arg);
1106
extern int drm_lastclose(struct drm_device *dev);
1035
extern int drm_lastclose(struct drm_device *dev);
-
 
1036
extern bool drm_ioctl_flags(unsigned int nr, unsigned int *flags);
Line 1107... Line 1037...
1107
 
1037
 
1108
				/* Device support (drm_fops.h) */
1038
				/* Device support (drm_fops.h) */
1109
extern struct mutex drm_global_mutex;
1039
extern struct mutex drm_global_mutex;
1110
extern int drm_open(struct inode *inode, struct file *filp);
-
 
1111
extern int drm_stub_open(struct inode *inode, struct file *filp);
1040
extern int drm_open(struct inode *inode, struct file *filp);
1112
extern ssize_t drm_read(struct file *filp, char __user *buffer,
1041
extern ssize_t drm_read(struct file *filp, char __user *buffer,
1113
			size_t count, loff_t *offset);
1042
			size_t count, loff_t *offset);
Line 1114... Line 1043...
1114
extern int drm_release(struct inode *inode, struct file *filp);
1043
extern int drm_release(struct inode *inode, struct file *filp);
Line 1144... Line 1073...
1144
extern int drm_setversion(struct drm_device *dev, void *data,
1073
extern int drm_setversion(struct drm_device *dev, void *data,
1145
			  struct drm_file *file_priv);
1074
			  struct drm_file *file_priv);
1146
extern int drm_noop(struct drm_device *dev, void *data,
1075
extern int drm_noop(struct drm_device *dev, void *data,
1147
		    struct drm_file *file_priv);
1076
		    struct drm_file *file_priv);
Line 1148... Line -...
1148
 
-
 
1149
				/* Context IOCTL support (drm_context.h) */
-
 
1150
extern int drm_resctx(struct drm_device *dev, void *data,
-
 
1151
		      struct drm_file *file_priv);
-
 
1152
extern int drm_addctx(struct drm_device *dev, void *data,
-
 
1153
		      struct drm_file *file_priv);
-
 
1154
extern int drm_getctx(struct drm_device *dev, void *data,
-
 
1155
		      struct drm_file *file_priv);
-
 
1156
extern int drm_switchctx(struct drm_device *dev, void *data,
-
 
1157
			 struct drm_file *file_priv);
-
 
1158
extern int drm_newctx(struct drm_device *dev, void *data,
-
 
1159
		      struct drm_file *file_priv);
-
 
1160
extern int drm_rmctx(struct drm_device *dev, void *data,
-
 
1161
		     struct drm_file *file_priv);
-
 
1162
 
-
 
1163
extern int drm_ctxbitmap_init(struct drm_device *dev);
-
 
1164
extern void drm_ctxbitmap_cleanup(struct drm_device *dev);
-
 
1165
extern void drm_ctxbitmap_free(struct drm_device *dev, int ctx_handle);
-
 
1166
 
-
 
1167
extern int drm_setsareactx(struct drm_device *dev, void *data,
-
 
1168
			   struct drm_file *file_priv);
-
 
1169
extern int drm_getsareactx(struct drm_device *dev, void *data,
-
 
1170
			   struct drm_file *file_priv);
-
 
1171
 
1077
 
1172
				/* Authentication IOCTL support (drm_auth.h) */
1078
				/* Authentication IOCTL support (drm_auth.h) */
1173
extern int drm_getmagic(struct drm_device *dev, void *data,
1079
extern int drm_getmagic(struct drm_device *dev, void *data,
1174
			struct drm_file *file_priv);
1080
			struct drm_file *file_priv);
1175
extern int drm_authmagic(struct drm_device *dev, void *data,
1081
extern int drm_authmagic(struct drm_device *dev, void *data,
1176
			 struct drm_file *file_priv);
1082
			 struct drm_file *file_priv);
Line 1177... Line 1083...
1177
extern int drm_remove_magic(struct drm_master *master, drm_magic_t magic);
1083
extern int drm_remove_magic(struct drm_master *master, drm_magic_t magic);
1178
 
1084
 
1179
/* Cache management (drm_cache.c) */
1085
/* Cache management (drm_cache.c) */
1180
void drm_clflush_pages(struct page *pages[], unsigned long num_pages);
1086
void drm_clflush_pages(struct page *pages[], unsigned long num_pages);
Line 1181... Line 1087...
1181
void drm_clflush_sg(struct sg_table *st);
1087
void drm_clflush_sg(struct sg_table *st);
1182
void drm_clflush_virt_range(char *addr, unsigned long length);
1088
void drm_clflush_virt_range(void *addr, unsigned long length);
1183
 
1089
 
1184
				/* Locking IOCTL support (drm_lock.h) */
1090
				/* Locking IOCTL support (drm_lock.h) */
Line 1230... Line 1136...
1230
				     struct drm_file *filp);
1136
				     struct drm_file *filp);
Line 1231... Line 1137...
1231
 
1137
 
1232
				/* IRQ support (drm_irq.h) */
1138
				/* IRQ support (drm_irq.h) */
1233
extern int drm_control(struct drm_device *dev, void *data,
1139
extern int drm_control(struct drm_device *dev, void *data,
1234
		       struct drm_file *file_priv);
1140
		       struct drm_file *file_priv);
1235
extern int drm_irq_install(struct drm_device *dev);
1141
extern int drm_irq_install(struct drm_device *dev, int irq);
Line 1236... Line 1142...
1236
extern int drm_irq_uninstall(struct drm_device *dev);
1142
extern int drm_irq_uninstall(struct drm_device *dev);
1237
 
1143
 
1238
extern int drm_vblank_init(struct drm_device *dev, int num_crtcs);
1144
extern int drm_vblank_init(struct drm_device *dev, int num_crtcs);
Line 1244... Line 1150...
1244
extern void drm_send_vblank_event(struct drm_device *dev, int crtc,
1150
extern void drm_send_vblank_event(struct drm_device *dev, int crtc,
1245
				     struct drm_pending_vblank_event *e);
1151
				     struct drm_pending_vblank_event *e);
1246
extern bool drm_handle_vblank(struct drm_device *dev, int crtc);
1152
extern bool drm_handle_vblank(struct drm_device *dev, int crtc);
1247
extern int drm_vblank_get(struct drm_device *dev, int crtc);
1153
extern int drm_vblank_get(struct drm_device *dev, int crtc);
1248
extern void drm_vblank_put(struct drm_device *dev, int crtc);
1154
extern void drm_vblank_put(struct drm_device *dev, int crtc);
-
 
1155
extern int drm_crtc_vblank_get(struct drm_crtc *crtc);
-
 
1156
extern void drm_crtc_vblank_put(struct drm_crtc *crtc);
1249
extern void drm_vblank_off(struct drm_device *dev, int crtc);
1157
extern void drm_vblank_off(struct drm_device *dev, int crtc);
-
 
1158
extern void drm_vblank_on(struct drm_device *dev, int crtc);
-
 
1159
extern void drm_crtc_vblank_off(struct drm_crtc *crtc);
-
 
1160
extern void drm_crtc_vblank_on(struct drm_crtc *crtc);
1250
extern void drm_vblank_cleanup(struct drm_device *dev);
1161
extern void drm_vblank_cleanup(struct drm_device *dev);
-
 
1162
 
1251
extern u32 drm_get_last_vbltimestamp(struct drm_device *dev, int crtc,
1163
extern u32 drm_get_last_vbltimestamp(struct drm_device *dev, int crtc,
1252
				     struct timeval *tvblank, unsigned flags);
1164
				     struct timeval *tvblank, unsigned flags);
1253
extern int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,
1165
extern int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,
1254
						 int crtc, int *max_error,
1166
						 int crtc, int *max_error,
1255
						 struct timeval *vblank_time,
1167
						 struct timeval *vblank_time,
Line 1257... Line 1169...
1257
						 const struct drm_crtc *refcrtc,
1169
						 const struct drm_crtc *refcrtc,
1258
						 const struct drm_display_mode *mode);
1170
						 const struct drm_display_mode *mode);
1259
extern void drm_calc_timestamping_constants(struct drm_crtc *crtc,
1171
extern void drm_calc_timestamping_constants(struct drm_crtc *crtc,
1260
					    const struct drm_display_mode *mode);
1172
					    const struct drm_display_mode *mode);
Line 1261... Line -...
1261
 
-
 
1262
extern bool
-
 
1263
drm_mode_parse_command_line_for_connector(const char *mode_option,
-
 
1264
					  struct drm_connector *connector,
-
 
1265
					  struct drm_cmdline_mode *mode);
-
 
1266
 
-
 
1267
extern struct drm_display_mode *
-
 
1268
drm_mode_create_from_cmdline_mode(struct drm_device *dev,
-
 
1269
				  struct drm_cmdline_mode *cmd);
-
 
1270
 
-
 
1271
extern int drm_display_mode_from_videomode(const struct videomode *vm,
-
 
1272
					   struct drm_display_mode *dmode);
-
 
1273
extern int of_get_drm_display_mode(struct device_node *np,
-
 
1274
				   struct drm_display_mode *dmode,
-
 
Line 1275... Line 1173...
1275
				   int index);
1173
 
1276
 
1174
 
1277
/* Modesetting support */
1175
/* Modesetting support */
1278
extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc);
1176
extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc);
Line 1292... Line 1190...
1292
extern void drm_master_put(struct drm_master **master);
1190
extern void drm_master_put(struct drm_master **master);
Line 1293... Line 1191...
1293
 
1191
 
1294
extern void drm_put_dev(struct drm_device *dev);
1192
extern void drm_put_dev(struct drm_device *dev);
1295
extern void drm_unplug_dev(struct drm_device *dev);
1193
extern void drm_unplug_dev(struct drm_device *dev);
1296
extern unsigned int drm_debug;
-
 
Line 1297... Line 1194...
1297
extern unsigned int drm_rnodes;
1194
extern unsigned int drm_debug;
1298
 
1195
 
1299
#if 0
1196
#if 0
1300
extern unsigned int drm_vblank_offdelay;
1197
extern unsigned int drm_vblank_offdelay;
Line 1301... Line 1198...
1301
extern unsigned int drm_timestamp_precision;
1198
extern unsigned int drm_timestamp_precision;
1302
extern unsigned int drm_timestamp_monotonic;
-
 
1303
 
-
 
1304
extern struct class *drm_class;
-
 
Line 1305... Line 1199...
1305
extern struct dentry *drm_debugfs_root;
1199
extern unsigned int drm_timestamp_monotonic;
1306
 
1200
 
1307
extern struct idr drm_minors_idr;
1201
extern struct class *drm_class;
1308
 
1202
 
1309
extern struct drm_local_map *drm_getsarea(struct drm_device *dev);
1203
extern struct drm_local_map *drm_getsarea(struct drm_device *dev);
1310
 
1204
#endif
1311
				/* Debugfs support */
1205
				/* Debugfs support */
1312
#if defined(CONFIG_DEBUG_FS)
1206
#if defined(CONFIG_DEBUG_FS)
1313
extern int drm_debugfs_init(struct drm_minor *minor, int minor_id,
1207
extern int drm_debugfs_init(struct drm_minor *minor, int minor_id,
1314
			    struct dentry *root);
1208
			    struct dentry *root);
1315
extern int drm_debugfs_create_files(const struct drm_info_list *files,
1209
extern int drm_debugfs_create_files(const struct drm_info_list *files,
1316
				    int count, struct dentry *root,
1210
				    int count, struct dentry *root,
-
 
1211
                                    struct drm_minor *minor);
-
 
1212
extern int drm_debugfs_remove_files(const struct drm_info_list *files,
1317
                                    struct drm_minor *minor);
1213
				    int count, struct drm_minor *minor);
1318
extern int drm_debugfs_remove_files(const struct drm_info_list *files,
1214
extern int drm_debugfs_cleanup(struct drm_minor *minor);
1319
				    int count, struct drm_minor *minor);
1215
extern int drm_debugfs_connector_add(struct drm_connector *connector);
1320
extern int drm_debugfs_cleanup(struct drm_minor *minor);
1216
extern void drm_debugfs_connector_remove(struct drm_connector *connector);
1321
#else
1217
#else
Line 1340... Line 1236...
1340
 
1236
 
1341
static inline int drm_debugfs_cleanup(struct drm_minor *minor)
1237
static inline int drm_debugfs_cleanup(struct drm_minor *minor)
1342
{
1238
{
1343
	return 0;
1239
	return 0;
-
 
1240
}
-
 
1241
 
-
 
1242
static inline int drm_debugfs_connector_add(struct drm_connector *connector)
-
 
1243
{
-
 
1244
	return 0;
-
 
1245
}
-
 
1246
static inline void drm_debugfs_connector_remove(struct drm_connector *connector)
-
 
1247
{
-
 
1248
}
1344
}
1249
 
Line 1345... Line 1250...
1345
#endif
1250
#endif
1346
 
1251
 
1347
				/* Info file support */
1252
				/* Info file support */
Line 1366... Line 1271...
1366
			       /* ATI PCIGART support (ati_pcigart.h) */
1271
			       /* ATI PCIGART support (ati_pcigart.h) */
1367
extern int drm_ati_pcigart_init(struct drm_device *dev,
1272
extern int drm_ati_pcigart_init(struct drm_device *dev,
1368
				struct drm_ati_pcigart_info * gart_info);
1273
				struct drm_ati_pcigart_info * gart_info);
1369
extern int drm_ati_pcigart_cleanup(struct drm_device *dev,
1274
extern int drm_ati_pcigart_cleanup(struct drm_device *dev,
1370
				   struct drm_ati_pcigart_info * gart_info);
1275
				   struct drm_ati_pcigart_info * gart_info);
1371
#endif
-
 
Line 1372... Line 1276...
1372
 
1276
 
1373
extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size,
1277
extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size,
1374
				       size_t align);
1278
				       size_t align);
1375
extern void __drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah);
1279
extern void __drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah);
Line 1378... Line 1282...
1378
#if 0
1282
#if 0
1379
			       /* sysfs support (drm_sysfs.c) */
1283
			       /* sysfs support (drm_sysfs.c) */
1380
struct drm_sysfs_class;
1284
struct drm_sysfs_class;
1381
extern struct class *drm_sysfs_create(struct module *owner, char *name);
1285
extern struct class *drm_sysfs_create(struct module *owner, char *name);
1382
extern void drm_sysfs_destroy(void);
1286
extern void drm_sysfs_destroy(void);
1383
extern int drm_sysfs_device_add(struct drm_minor *minor);
1287
extern struct device *drm_sysfs_minor_alloc(struct drm_minor *minor);
1384
extern void drm_sysfs_hotplug_event(struct drm_device *dev);
1288
extern void drm_sysfs_hotplug_event(struct drm_device *dev);
1385
extern void drm_sysfs_device_remove(struct drm_minor *minor);
-
 
1386
extern int drm_sysfs_connector_add(struct drm_connector *connector);
1289
extern int drm_sysfs_connector_add(struct drm_connector *connector);
1387
extern void drm_sysfs_connector_remove(struct drm_connector *connector);
1290
extern void drm_sysfs_connector_remove(struct drm_connector *connector);
1388
#endif
1291
#endif
Line 1389... Line 1292...
1389
 
1292
 
Line 1441... Line 1344...
1441
 
1344
 
1442
void drm_gem_free_mmap_offset(struct drm_gem_object *obj);
1345
void drm_gem_free_mmap_offset(struct drm_gem_object *obj);
1443
int drm_gem_create_mmap_offset(struct drm_gem_object *obj);
1346
int drm_gem_create_mmap_offset(struct drm_gem_object *obj);
Line 1444... Line 1347...
1444
int drm_gem_create_mmap_offset_size(struct drm_gem_object *obj, size_t size);
1347
int drm_gem_create_mmap_offset_size(struct drm_gem_object *obj, size_t size);
1445
 
1348
 
1446
struct page **drm_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask);
1349
struct page **drm_gem_get_pages(struct drm_gem_object *obj);
Line 1447... Line 1350...
1447
void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages,
1350
void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages,
1448
		bool dirty, bool accessed);
1351
		bool dirty, bool accessed);
Line 1475... Line 1378...
1475
 
1378
 
1476
static __inline__ void drm_core_dropmap(struct drm_local_map *map)
1379
static __inline__ void drm_core_dropmap(struct drm_local_map *map)
1477
{
1380
{
Line 1478... Line 1381...
1478
}
1381
}
Line 1479... Line 1382...
1479
 
1382
 
1480
//#include 
1383
#include 
1481
 
1384
 
1482
extern int drm_fill_in_dev(struct drm_device *dev,
1385
extern int drm_fill_in_dev(struct drm_device *dev,
1483
			   const struct pci_device_id *ent,
1386
			   const struct pci_device_id *ent,
Line 1484... Line 1387...
1484
			   struct drm_driver *driver);
1387
			   struct drm_driver *driver);
-
 
1388
int drm_get_minor(struct drm_device *dev, struct drm_minor **minor, int type);
-
 
1389
/*@}*/
1485
int drm_get_minor(struct drm_device *dev, struct drm_minor **minor, int type);
1390
 
1486
/*@}*/
1391
 
1487
 
1392
#if 0
-
 
1393
extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver);
Line 1488... Line 1394...
1488
 
1394
extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver);
1489
 
1395
extern int drm_get_pci_dev(struct pci_dev *pdev,
1490
extern int drm_get_pci_dev(struct pci_dev *pdev,
1396
			   const struct pci_device_id *ent,