Rev 5270 | Rev 6102 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5270 | Rev 6082 | ||
---|---|---|---|
Line 43... | Line 43... | ||
43 | #include |
43 | #include |
44 | #include |
44 | #include |
45 | #include |
45 | #include |
Line 46... | Line 46... | ||
46 | 46 | ||
47 | #include |
- | |
48 | #include |
- | |
49 | #include |
47 | #include |
50 | #include |
48 | #include |
51 | #include |
49 | #include |
Line 52... | Line 50... | ||
52 | #include |
50 | #include |
Line 108... | Line 106... | ||
108 | * This is the category used by the DRM_DEBUG_KMS() macro. |
106 | * This is the category used by the DRM_DEBUG_KMS() macro. |
109 | * |
107 | * |
110 | * PRIME: used in the prime code. |
108 | * PRIME: used in the prime code. |
111 | * This is the category used by the DRM_DEBUG_PRIME() macro. |
109 | * This is the category used by the DRM_DEBUG_PRIME() macro. |
112 | * |
110 | * |
- | 111 | * ATOMIC: used in the atomic code. |
|
- | 112 | * This is the category used by the DRM_DEBUG_ATOMIC() macro. |
|
- | 113 | * |
|
- | 114 | * VBL: used for verbose debug message in the vblank code |
|
- | 115 | * This is the category used by the DRM_DEBUG_VBL() macro. |
|
- | 116 | * |
|
113 | * Enabling verbose debug messages is done through the drm.debug parameter, |
117 | * Enabling verbose debug messages is done through the drm.debug parameter, |
114 | * each category being enabled by a bit. |
118 | * each category being enabled by a bit. |
115 | * |
119 | * |
116 | * drm.debug=0x1 will enable CORE messages |
120 | * drm.debug=0x1 will enable CORE messages |
117 | * drm.debug=0x2 will enable DRIVER messages |
121 | * drm.debug=0x2 will enable DRIVER messages |
118 | * drm.debug=0x3 will enable CORE and DRIVER messages |
122 | * drm.debug=0x3 will enable CORE and DRIVER messages |
119 | * ... |
123 | * ... |
120 | * drm.debug=0xf will enable all messages |
124 | * drm.debug=0x3f will enable all messages |
121 | * |
125 | * |
122 | * An interesting feature is that it's possible to enable verbose logging at |
126 | * An interesting feature is that it's possible to enable verbose logging at |
123 | * run-time by echoing the debug value in its sysfs node: |
127 | * run-time by echoing the debug value in its sysfs node: |
124 | * # echo 0xf > /sys/module/drm/parameters/debug |
128 | * # echo 0xf > /sys/module/drm/parameters/debug |
125 | */ |
129 | */ |
126 | #define DRM_UT_CORE 0x01 |
130 | #define DRM_UT_CORE 0x01 |
127 | #define DRM_UT_DRIVER 0x02 |
131 | #define DRM_UT_DRIVER 0x02 |
128 | #define DRM_UT_KMS 0x04 |
132 | #define DRM_UT_KMS 0x04 |
129 | #define DRM_UT_PRIME 0x08 |
133 | #define DRM_UT_PRIME 0x08 |
- | 134 | #define DRM_UT_ATOMIC 0x10 |
|
- | 135 | #define DRM_UT_VBL 0x20 |
|
Line 130... | Line 136... | ||
130 | 136 | ||
131 | extern __printf(2, 3) |
137 | extern __printf(2, 3) |
132 | void drm_ut_debug_printk(const char *function_name, |
138 | void drm_ut_debug_printk(const char *function_name, |
133 | const char *format, ...); |
139 | const char *format, ...); |
Line 147... | Line 153... | ||
147 | #define DRIVER_IRQ_SHARED 0x80 |
153 | #define DRIVER_IRQ_SHARED 0x80 |
148 | #define DRIVER_GEM 0x1000 |
154 | #define DRIVER_GEM 0x1000 |
149 | #define DRIVER_MODESET 0x2000 |
155 | #define DRIVER_MODESET 0x2000 |
150 | #define DRIVER_PRIME 0x4000 |
156 | #define DRIVER_PRIME 0x4000 |
151 | #define DRIVER_RENDER 0x8000 |
157 | #define DRIVER_RENDER 0x8000 |
- | 158 | #define DRIVER_ATOMIC 0x10000 |
|
- | 159 | #define DRIVER_KMS_LEGACY_CONTEXT 0x20000 |
|
Line 152... | Line 160... | ||
152 | 160 | ||
153 | /***********************************************************************/ |
161 | /***********************************************************************/ |
154 | /** \name Macros to make printk easier */ |
162 | /** \name Macros to make printk easier */ |
Line 159... | Line 167... | ||
159 | * |
167 | * |
160 | * \param fmt printf() like format string. |
168 | * \param fmt printf() like format string. |
161 | * \param arg arguments |
169 | * \param arg arguments |
162 | */ |
170 | */ |
163 | #define DRM_ERROR(fmt, ...) \ |
171 | #define DRM_ERROR(fmt, ...) \ |
164 | drm_err(fmt, ##__VA_ARGS__) |
172 | printk("DRM Error" fmt, ##__VA_ARGS__) |
Line 165... | Line 173... | ||
165 | 173 | ||
166 | /** |
174 | /** |
167 | * Rate limited error output. Like DRM_ERROR() but won't flood the log. |
175 | * Rate limited error output. Like DRM_ERROR() but won't flood the log. |
168 | * |
176 | * |
Line 207... | Line 215... | ||
207 | } while (0) |
215 | } while (0) |
208 | #define DRM_DEBUG_PRIME(fmt, args...) \ |
216 | #define DRM_DEBUG_PRIME(fmt, args...) \ |
209 | do { \ |
217 | do { \ |
210 | printk(KERN_INFO "[" DRM_NAME "] " fmt, ##args); \ |
218 | printk(KERN_INFO "[" DRM_NAME "] " fmt, ##args); \ |
211 | } while (0) |
219 | } while (0) |
- | 220 | #define DRM_DEBUG_ATOMIC(fmt, args...) \ |
|
- | 221 | do { \ |
|
- | 222 | printk(KERN_INFO "[" DRM_NAME "] " fmt, ##args); \ |
|
- | 223 | } while (0) |
|
- | 224 | #define DRM_DEBUG_VBL(fmt, args...) \ |
|
- | 225 | do { \ |
|
- | 226 | printk(KERN_INFO "[" DRM_NAME "] " fmt, ##args); \ |
|
- | 227 | } while (0) |
|
- | 228 | ||
212 | #else |
229 | #else |
213 | #define DRM_DEBUG_DRIVER(fmt, args...) do { } while (0) |
230 | #define DRM_DEBUG_DRIVER(fmt, args...) do { } while (0) |
214 | #define DRM_DEBUG_KMS(fmt, args...) do { } while (0) |
231 | #define DRM_DEBUG_KMS(fmt, args...) do { } while (0) |
215 | #define DRM_DEBUG_PRIME(fmt, args...) do { } while (0) |
232 | #define DRM_DEBUG_PRIME(fmt, args...) do { } while (0) |
216 | #define DRM_DEBUG(fmt, arg...) do { } while (0) |
233 | #define DRM_DEBUG(fmt, arg...) do { } while (0) |
- | 234 | #define DRM_DEBUG_ATOMIC(fmt, args...) do { } while (0) |
|
- | 235 | #define DRM_DEBUG_VBL(fmt, args...) do { } while (0) |
|
217 | #endif |
236 | #endif |
218 | - | ||
219 | /*@}*/ |
237 | /*@}*/ |
Line 220... | Line 238... | ||
220 | 238 | ||
221 | /***********************************************************************/ |
239 | /***********************************************************************/ |
222 | /** \name Internal types and structures */ |
240 | /** \name Internal types and structures */ |
Line 250... | Line 268... | ||
250 | 268 | ||
251 | struct drm_ioctl_desc { |
269 | struct drm_ioctl_desc { |
252 | unsigned int cmd; |
270 | unsigned int cmd; |
253 | int flags; |
271 | int flags; |
254 | drm_ioctl_t *func; |
- | |
255 | unsigned int cmd_drv; |
272 | drm_ioctl_t *func; |
256 | const char *name; |
273 | const char *name; |
Line 257... | Line 274... | ||
257 | }; |
274 | }; |
258 | 275 | ||
259 | /** |
276 | /** |
260 | * Creates a driver or general drm_ioctl_desc array entry for the given |
277 | * Creates a driver or general drm_ioctl_desc array entry for the given |
Line 261... | Line 278... | ||
261 | * ioctl, for use by drm_ioctl(). |
278 | * ioctl, for use by drm_ioctl(). |
262 | */ |
279 | */ |
- | 280 | ||
- | 281 | #define DRM_IOCTL_DEF_DRV(ioctl, _func, _flags) \ |
|
- | 282 | [DRM_IOCTL_NR(DRM_IOCTL_##ioctl) - DRM_COMMAND_BASE] = { \ |
|
- | 283 | .cmd = DRM_IOCTL_##ioctl, \ |
|
- | 284 | .func = _func, \ |
|
Line 263... | Line 285... | ||
263 | 285 | .flags = _flags, \ |
|
264 | #define DRM_IOCTL_DEF_DRV(ioctl, _func, _flags) \ |
286 | .name = #ioctl \ |
265 | [DRM_IOCTL_NR(DRM_##ioctl)] = {.cmd = DRM_##ioctl, .func = _func, .flags = _flags, .cmd_drv = DRM_IOCTL_##ioctl, .name = #ioctl} |
287 | } |
266 | 288 | ||
Line 290... | Line 312... | ||
290 | /* |
312 | /* |
291 | * true if client understands CRTC primary planes and cursor planes |
313 | * true if client understands CRTC primary planes and cursor planes |
292 | * in the plane list |
314 | * in the plane list |
293 | */ |
315 | */ |
294 | unsigned universal_planes:1; |
316 | unsigned universal_planes:1; |
- | 317 | /* true if client understands atomic properties */ |
|
- | 318 | unsigned atomic:1; |
|
295 | struct list_head lhead; |
319 | struct list_head lhead; |
- | 320 | struct drm_minor *minor; |
|
296 | unsigned long lock_count; |
321 | unsigned long lock_count; |
Line 297... | Line 322... | ||
297 | 322 | ||
298 | /** Mapping of mm object handles to object pointers. */ |
323 | /** Mapping of mm object handles to object pointers. */ |
299 | struct idr object_idr; |
324 | struct idr object_idr; |
Line 311... | Line 336... | ||
311 | * the fb object to prevent it from untimely disappearing. |
336 | * the fb object to prevent it from untimely disappearing. |
312 | */ |
337 | */ |
313 | struct list_head fbs; |
338 | struct list_head fbs; |
314 | struct mutex fbs_lock; |
339 | struct mutex fbs_lock; |
Line -... | Line 340... | ||
- | 340 | ||
- | 341 | /** User-created blob properties; this retains a reference on the |
|
- | 342 | * property. */ |
|
- | 343 | struct list_head blobs; |
|
315 | 344 | ||
316 | wait_queue_head_t event_wait; |
345 | wait_queue_head_t event_wait; |
317 | struct list_head event_list; |
346 | struct list_head event_list; |
318 | int event_space; |
347 | int event_space; |
Line 338... | Line 367... | ||
338 | * |
367 | * |
339 | * @refcount: Refcount for this master object. |
368 | * @refcount: Refcount for this master object. |
340 | * @minor: Link back to minor char device we are master for. Immutable. |
369 | * @minor: Link back to minor char device we are master for. Immutable. |
341 | * @unique: Unique identifier: e.g. busid. Protected by drm_global_mutex. |
370 | * @unique: Unique identifier: e.g. busid. Protected by drm_global_mutex. |
342 | * @unique_len: Length of unique field. Protected by drm_global_mutex. |
371 | * @unique_len: Length of unique field. Protected by drm_global_mutex. |
343 | * @magiclist: Hash of used authentication tokens. Protected by struct_mutex. |
372 | * @magic_map: Map of used authentication tokens. Protected by struct_mutex. |
344 | * @magicfree: List of used authentication tokens. Protected by struct_mutex. |
- | |
345 | * @lock: DRI lock information. |
373 | * @lock: DRI lock information. |
346 | * @driver_priv: Pointer to driver-private information. |
374 | * @driver_priv: Pointer to driver-private information. |
347 | */ |
375 | */ |
348 | struct drm_master { |
376 | struct drm_master { |
349 | struct kref refcount; |
377 | struct kref refcount; |
350 | struct drm_minor *minor; |
378 | struct drm_minor *minor; |
351 | char *unique; |
379 | char *unique; |
352 | int unique_len; |
380 | int unique_len; |
353 | struct drm_open_hash magiclist; |
- | |
354 | struct list_head magicfree; |
381 | struct idr magic_map; |
355 | struct drm_lock_data lock; |
382 | struct drm_lock_data lock; |
356 | void *driver_priv; |
383 | void *driver_priv; |
357 | }; |
384 | }; |
Line 358... | Line 385... | ||
358 | 385 | ||
Line 381... | Line 408... | ||
381 | int (*open) (struct drm_device *, struct drm_file *); |
408 | int (*open) (struct drm_device *, struct drm_file *); |
Line 382... | Line 409... | ||
382 | 409 | ||
383 | /** |
410 | /** |
384 | * get_vblank_counter - get raw hardware vblank counter |
411 | * get_vblank_counter - get raw hardware vblank counter |
385 | * @dev: DRM device |
412 | * @dev: DRM device |
386 | * @crtc: counter to fetch |
413 | * @pipe: counter to fetch |
387 | * |
414 | * |
388 | * Driver callback for fetching a raw hardware vblank counter for @crtc. |
415 | * Driver callback for fetching a raw hardware vblank counter for @crtc. |
389 | * If a device doesn't have a hardware counter, the driver can simply |
416 | * If a device doesn't have a hardware counter, the driver can simply |
390 | * return the value of drm_vblank_count. The DRM core will account for |
417 | * return the value of drm_vblank_count. The DRM core will account for |
Line 395... | Line 422... | ||
395 | * with in the DRM core code. |
422 | * with in the DRM core code. |
396 | * |
423 | * |
397 | * RETURNS |
424 | * RETURNS |
398 | * Raw vblank counter value. |
425 | * Raw vblank counter value. |
399 | */ |
426 | */ |
400 | u32 (*get_vblank_counter) (struct drm_device *dev, int crtc); |
427 | u32 (*get_vblank_counter) (struct drm_device *dev, unsigned int pipe); |
Line 401... | Line 428... | ||
401 | 428 | ||
402 | /** |
429 | /** |
403 | * enable_vblank - enable vblank interrupt events |
430 | * enable_vblank - enable vblank interrupt events |
404 | * @dev: DRM device |
431 | * @dev: DRM device |
405 | * @crtc: which irq to enable |
432 | * @pipe: which irq to enable |
406 | * |
433 | * |
407 | * Enable vblank interrupts for @crtc. If the device doesn't have |
434 | * Enable vblank interrupts for @crtc. If the device doesn't have |
408 | * a hardware vblank counter, this routine should be a no-op, since |
435 | * a hardware vblank counter, this routine should be a no-op, since |
409 | * interrupts will have to stay on to keep the count accurate. |
436 | * interrupts will have to stay on to keep the count accurate. |
410 | * |
437 | * |
411 | * RETURNS |
438 | * RETURNS |
412 | * Zero on success, appropriate errno if the given @crtc's vblank |
439 | * Zero on success, appropriate errno if the given @crtc's vblank |
413 | * interrupt cannot be enabled. |
440 | * interrupt cannot be enabled. |
414 | */ |
441 | */ |
Line 415... | Line 442... | ||
415 | int (*enable_vblank) (struct drm_device *dev, int crtc); |
442 | int (*enable_vblank) (struct drm_device *dev, unsigned int pipe); |
416 | 443 | ||
417 | /** |
444 | /** |
418 | * disable_vblank - disable vblank interrupt events |
445 | * disable_vblank - disable vblank interrupt events |
419 | * @dev: DRM device |
446 | * @dev: DRM device |
420 | * @crtc: which irq to enable |
447 | * @pipe: which irq to enable |
421 | * |
448 | * |
422 | * Disable vblank interrupts for @crtc. If the device doesn't have |
449 | * Disable vblank interrupts for @crtc. If the device doesn't have |
423 | * a hardware vblank counter, this routine should be a no-op, since |
450 | * a hardware vblank counter, this routine should be a no-op, since |
424 | * interrupts will have to stay on to keep the count accurate. |
451 | * interrupts will have to stay on to keep the count accurate. |
- | 452 | */ |
|
- | 453 | void (*disable_vblank) (struct drm_device *dev, unsigned int pipe); |
|
- | 454 | ||
- | 455 | /** |
|
- | 456 | * Called by \c drm_device_is_agp. Typically used to determine if a |
|
- | 457 | * card is really attached to AGP or not. |
|
- | 458 | * |
|
- | 459 | * \param dev DRM device handle |
|
- | 460 | * |
|
- | 461 | * \returns |
|
- | 462 | * One of three values is returned depending on whether or not the |
|
- | 463 | * card is absolutely \b not AGP (return of 0), absolutely \b is AGP |
|
- | 464 | * (return of 1), or may or may not be AGP (return of 2). |
|
- | 465 | */ |
|
425 | */ |
466 | int (*device_is_agp) (struct drm_device *dev); |
426 | void (*disable_vblank) (struct drm_device *dev, int crtc); |
467 | |
427 | /** |
468 | /** |
428 | * Called by vblank timestamping code. |
469 | * Called by vblank timestamping code. |
429 | * |
470 | * |
430 | * Return the current display scanout position from a crtc, and an |
471 | * Return the current display scanout position from a crtc, and an |
431 | * optional accurate ktime_get timestamp of when position was measured. |
472 | * optional accurate ktime_get timestamp of when position was measured. |
432 | * |
473 | * |
433 | * \param dev DRM device. |
474 | * \param dev DRM device. |
434 | * \param crtc Id of the crtc to query. |
475 | * \param pipe Id of the crtc to query. |
435 | * \param flags Flags from the caller (DRM_CALLED_FROM_VBLIRQ or 0). |
476 | * \param flags Flags from the caller (DRM_CALLED_FROM_VBLIRQ or 0). |
436 | * \param *vpos Target location for current vertical scanout position. |
477 | * \param *vpos Target location for current vertical scanout position. |
437 | * \param *hpos Target location for current horizontal scanout position. |
478 | * \param *hpos Target location for current horizontal scanout position. |
438 | * \param *stime Target location for timestamp taken immediately before |
479 | * \param *stime Target location for timestamp taken immediately before |
439 | * scanout position query. Can be NULL to skip timestamp. |
480 | * scanout position query. Can be NULL to skip timestamp. |
- | 481 | * \param *etime Target location for timestamp taken immediately after |
|
440 | * \param *etime Target location for timestamp taken immediately after |
482 | * scanout position query. Can be NULL to skip timestamp. |
441 | * scanout position query. Can be NULL to skip timestamp. |
483 | * \param mode Current display timings. |
442 | * |
484 | * |
443 | * Returns vpos as a positive number while in active scanout area. |
485 | * Returns vpos as a positive number while in active scanout area. |
444 | * Returns vpos as a negative number inside vblank, counting the number |
486 | * Returns vpos as a negative number inside vblank, counting the number |
Line 452... | Line 494... | ||
452 | * DRM_SCANOUTPOS_ACCURATE = Returned position is accurate. A lack of |
494 | * DRM_SCANOUTPOS_ACCURATE = Returned position is accurate. A lack of |
453 | * this flag means that returned position may be offset by a constant |
495 | * this flag means that returned position may be offset by a constant |
454 | * but unknown small number of scanlines wrt. real scanout position. |
496 | * but unknown small number of scanlines wrt. real scanout position. |
455 | * |
497 | * |
456 | */ |
498 | */ |
457 | int (*get_scanout_position) (struct drm_device *dev, int crtc, |
499 | int (*get_scanout_position) (struct drm_device *dev, unsigned int pipe, |
458 | unsigned int flags, |
500 | unsigned int flags, int *vpos, int *hpos, |
459 | int *vpos, int *hpos, void *stime, |
501 | ktime_t *stime, ktime_t *etime, |
460 | void *etime); |
502 | const struct drm_display_mode *mode); |
Line 461... | Line 503... | ||
461 | 503 | ||
462 | /** |
504 | /** |
463 | * Called by \c drm_get_last_vbltimestamp. Should return a precise |
505 | * Called by \c drm_get_last_vbltimestamp. Should return a precise |
464 | * timestamp when the most recent VBLANK interval ended or will end. |
506 | * timestamp when the most recent VBLANK interval ended or will end. |
Line 471... | Line 513... | ||
471 | * If the @crtc is currently scanning out a frame, this will be the |
513 | * If the @crtc is currently scanning out a frame, this will be the |
472 | * past start time of the current scanout. This is meant to adhere |
514 | * past start time of the current scanout. This is meant to adhere |
473 | * to the OpenML OML_sync_control extension specification. |
515 | * to the OpenML OML_sync_control extension specification. |
474 | * |
516 | * |
475 | * \param dev dev DRM device handle. |
517 | * \param dev dev DRM device handle. |
476 | * \param crtc crtc for which timestamp should be returned. |
518 | * \param pipe crtc for which timestamp should be returned. |
477 | * \param *max_error Maximum allowable timestamp error in nanoseconds. |
519 | * \param *max_error Maximum allowable timestamp error in nanoseconds. |
478 | * Implementation should strive to provide timestamp |
520 | * Implementation should strive to provide timestamp |
479 | * with an error of at most *max_error nanoseconds. |
521 | * with an error of at most *max_error nanoseconds. |
480 | * Returns true upper bound on error for timestamp. |
522 | * Returns true upper bound on error for timestamp. |
481 | * \param *vblank_time Target location for returned vblank timestamp. |
523 | * \param *vblank_time Target location for returned vblank timestamp. |
Line 487... | Line 529... | ||
487 | * \returns |
529 | * \returns |
488 | * Zero if timestamping isn't supported in current display mode or a |
530 | * Zero if timestamping isn't supported in current display mode or a |
489 | * negative number on failure. A positive status code on success, |
531 | * negative number on failure. A positive status code on success, |
490 | * which describes how the vblank_time timestamp was computed. |
532 | * which describes how the vblank_time timestamp was computed. |
491 | */ |
533 | */ |
492 | int (*get_vblank_timestamp) (struct drm_device *dev, int crtc, |
534 | int (*get_vblank_timestamp) (struct drm_device *dev, unsigned int pipe, |
493 | int *max_error, |
535 | int *max_error, |
494 | struct timeval *vblank_time, |
536 | struct timeval *vblank_time, |
495 | unsigned flags); |
537 | unsigned flags); |
Line 496... | Line 538... | ||
496 | 538 | ||
Line 546... | Line 588... | ||
546 | * DRM minor structure. This structure represents a drm minor number. |
588 | * DRM minor structure. This structure represents a drm minor number. |
547 | */ |
589 | */ |
548 | struct drm_minor { |
590 | struct drm_minor { |
549 | int index; /**< Minor device number */ |
591 | int index; /**< Minor device number */ |
550 | int type; /**< Control or render */ |
592 | int type; /**< Control or render */ |
551 | // struct device kdev; /**< Linux device */ |
593 | struct device *kdev; /**< Linux device */ |
552 | struct drm_device *dev; |
594 | struct drm_device *dev; |
Line 553... | Line 595... | ||
553 | 595 | ||
Line 554... | Line 596... | ||
554 | struct dentry *debugfs_root; |
596 | struct dentry *debugfs_root; |
555 | 597 | ||
Line 556... | Line 598... | ||
556 | struct list_head debugfs_list; |
598 | struct list_head debugfs_list; |
557 | struct mutex debugfs_lock; /* Protects debugfs_list. */ |
599 | struct mutex debugfs_lock; /* Protects debugfs_list. */ |
558 | - | ||
559 | /* currently active master for this node. Protected by master_mutex */ |
600 | |
Line 560... | Line 601... | ||
560 | struct drm_master *master; |
601 | /* currently active master for this node. Protected by master_mutex */ |
561 | struct drm_mode_group mode_group; |
602 | struct drm_master *master; |
562 | }; |
603 | }; |
563 | 604 | ||
564 | 605 | ||
Line 565... | Line 606... | ||
565 | struct drm_pending_vblank_event { |
606 | struct drm_pending_vblank_event { |
566 | struct drm_pending_event base; |
607 | struct drm_pending_event base; |
567 | int pipe; |
608 | unsigned int pipe; |
568 | struct drm_event_vblank event; |
- | |
569 | }; |
609 | struct drm_event_vblank event; |
- | 610 | }; |
|
- | 611 | ||
- | 612 | struct drm_vblank_crtc { |
|
- | 613 | struct drm_device *dev; /* pointer to the drm_device */ |
|
570 | 614 | wait_queue_head_t queue; /**< VBLANK wait queue */ |
|
- | 615 | struct timer_list disable_timer; /* delayed disable timer */ |
|
571 | struct drm_vblank_crtc { |
616 | |
572 | struct drm_device *dev; /* pointer to the drm_device */ |
617 | /* vblank counter, protected by dev->vblank_time_lock for writes */ |
573 | wait_queue_head_t queue; /**< VBLANK wait queue */ |
618 | u32 count; |
574 | struct timeval time[DRM_VBLANKTIME_RBSIZE]; /**< timestamp of current count */ |
619 | /* vblank timestamps, protected by dev->vblank_time_lock for writes */ |
575 | struct timer_list disable_timer; /* delayed disable timer */ |
620 | struct timeval time[DRM_VBLANKTIME_RBSIZE]; |
576 | atomic_t count; /**< number of VBLANK interrupts */ |
621 | |
- | 622 | atomic_t refcount; /* number of users of vblank interruptsper crtc */ |
|
- | 623 | u32 last; /* protected by dev->vbl_lock, used */ |
|
577 | atomic_t refcount; /* number of users of vblank interruptsper crtc */ |
624 | /* for wraparound handling */ |
578 | u32 last; /* protected by dev->vbl_lock, used */ |
625 | u32 last_wait; /* Last vblank seqno waited per CRTC */ |
579 | /* for wraparound handling */ |
626 | unsigned int inmodeset; /* Display driver is setting mode */ |
Line 580... | Line 627... | ||
580 | u32 last_wait; /* Last vblank seqno waited per CRTC */ |
627 | unsigned int pipe; /* crtc index */ |
Line 596... | Line 643... | ||
596 | /*@{ */ |
643 | /*@{ */ |
597 | struct kref ref; /**< Object ref-count */ |
644 | struct kref ref; /**< Object ref-count */ |
598 | struct device *dev; /**< Device structure of bus-device */ |
645 | struct device *dev; /**< Device structure of bus-device */ |
599 | struct drm_driver *driver; /**< DRM driver managing the device */ |
646 | struct drm_driver *driver; /**< DRM driver managing the device */ |
600 | void *dev_private; /**< DRM driver private data */ |
647 | void *dev_private; /**< DRM driver private data */ |
- | 648 | struct drm_minor *control; /**< Control node */ |
|
601 | struct drm_minor *primary; /**< Primary node */ |
649 | struct drm_minor *primary; /**< Primary node */ |
- | 650 | struct drm_minor *render; /**< Render node */ |
|
602 | atomic_t unplugged; /**< Flag whether dev is dead */ |
651 | atomic_t unplugged; /**< Flag whether dev is dead */ |
603 | /** \name Locks */ |
652 | /** \name Locks */ |
604 | /*@{ */ |
653 | /*@{ */ |
605 | struct mutex struct_mutex; /**< For others */ |
654 | struct mutex struct_mutex; /**< For others */ |
606 | struct mutex master_mutex; /**< For drm_minor::master and drm_file::is_master */ |
655 | struct mutex master_mutex; /**< For drm_minor::master and drm_file::is_master */ |
Line 636... | Line 685... | ||
636 | // struct drm_device_dma *dma; /**< Optional pointer for DMA support */ |
685 | // struct drm_device_dma *dma; /**< Optional pointer for DMA support */ |
637 | /*@} */ |
686 | /*@} */ |
Line 638... | Line 687... | ||
638 | 687 | ||
639 | /** \name Context support */ |
688 | /** \name Context support */ |
640 | /*@{ */ |
- | |
641 | bool irq_enabled; /**< True if irq handler is enabled */ |
- | |
Line 642... | Line 689... | ||
642 | int irq; |
689 | /*@{ */ |
643 | 690 | ||
644 | __volatile__ long context_flag; /**< Context swapping flag */ |
691 | __volatile__ long context_flag; /**< Context swapping flag */ |
Line 645... | Line 692... | ||
645 | int last_context; /**< Last current context */ |
692 | int last_context; /**< Last current context */ |
646 | /*@} */ |
693 | /*@} */ |
- | 694 | ||
- | 695 | /** \name VBLANK IRQ support */ |
|
Line 647... | Line 696... | ||
647 | 696 | /*@{ */ |
|
648 | /** \name VBLANK IRQ support */ |
697 | bool irq_enabled; |
649 | /*@{ */ |
698 | int irq; |
650 | 699 | ||
Line 732... | Line 781... | ||
732 | /******************************************************************/ |
781 | /******************************************************************/ |
733 | /** \name Internal function definitions */ |
782 | /** \name Internal function definitions */ |
734 | /*@{*/ |
783 | /*@{*/ |
Line 735... | Line 784... | ||
735 | 784 | ||
- | 785 | /* Driver support (drm_drv.h) */ |
|
736 | /* Driver support (drm_drv.h) */ |
786 | extern int drm_ioctl_permit(u32 flags, struct drm_file *file_priv); |
737 | extern long drm_ioctl(struct file *filp, |
787 | extern long drm_ioctl(struct file *filp, |
738 | unsigned int cmd, unsigned long arg); |
788 | unsigned int cmd, unsigned long arg); |
739 | extern long drm_compat_ioctl(struct file *filp, |
789 | extern long drm_compat_ioctl(struct file *filp, |
740 | unsigned int cmd, unsigned long arg); |
790 | unsigned int cmd, unsigned long arg); |
Line 743... | Line 793... | ||
743 | /* Device support (drm_fops.h) */ |
793 | /* Device support (drm_fops.h) */ |
744 | extern int drm_open(struct inode *inode, struct file *filp); |
794 | extern int drm_open(struct inode *inode, struct file *filp); |
745 | extern ssize_t drm_read(struct file *filp, char __user *buffer, |
795 | extern ssize_t drm_read(struct file *filp, char __user *buffer, |
746 | size_t count, loff_t *offset); |
796 | size_t count, loff_t *offset); |
747 | extern int drm_release(struct inode *inode, struct file *filp); |
797 | extern int drm_release(struct inode *inode, struct file *filp); |
- | 798 | extern int drm_new_set_master(struct drm_device *dev, struct drm_file *fpriv); |
|
Line 748... | Line 799... | ||
748 | 799 | ||
749 | /* Mapping support (drm_vm.h) */ |
800 | /* Mapping support (drm_vm.h) */ |
Line 750... | Line 801... | ||
750 | extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); |
801 | extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); |
751 | 802 | ||
752 | /* Misc. IOCTL support (drm_ioctl.c) */ |
803 | /* Misc. IOCTL support (drm_ioctl.c) */ |
- | 804 | int drm_noop(struct drm_device *dev, void *data, |
|
- | 805 | struct drm_file *file_priv); |
|
Line 753... | Line 806... | ||
753 | int drm_noop(struct drm_device *dev, void *data, |
806 | int drm_invalid_op(struct drm_device *dev, void *data, |
754 | struct drm_file *file_priv); |
807 | struct drm_file *file_priv); |
755 | 808 | ||
756 | /* Cache management (drm_cache.c) */ |
809 | /* Cache management (drm_cache.c) */ |
Line 765... | Line 818... | ||
765 | 818 | ||
766 | /* IRQ support (drm_irq.h) */ |
819 | /* IRQ support (drm_irq.h) */ |
767 | extern int drm_irq_install(struct drm_device *dev, int irq); |
820 | extern int drm_irq_install(struct drm_device *dev, int irq); |
Line 768... | Line 821... | ||
768 | extern int drm_irq_uninstall(struct drm_device *dev); |
821 | extern int drm_irq_uninstall(struct drm_device *dev); |
769 | 822 | ||
770 | extern int drm_vblank_init(struct drm_device *dev, int num_crtcs); |
823 | extern int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs); |
771 | extern int drm_wait_vblank(struct drm_device *dev, void *data, |
824 | extern int drm_wait_vblank(struct drm_device *dev, void *data, |
- | 825 | struct drm_file *filp); |
|
772 | struct drm_file *filp); |
826 | extern u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe); |
- | 827 | extern u32 drm_crtc_vblank_count(struct drm_crtc *crtc); |
|
- | 828 | extern u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe, |
|
773 | extern u32 drm_vblank_count(struct drm_device *dev, int crtc); |
829 | struct timeval *vblanktime); |
774 | extern u32 drm_vblank_count_and_time(struct drm_device *dev, int crtc, |
830 | extern u32 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc, |
- | 831 | struct timeval *vblanktime); |
|
- | 832 | extern void drm_send_vblank_event(struct drm_device *dev, unsigned int pipe, |
|
775 | struct timeval *vblanktime); |
833 | struct drm_pending_vblank_event *e); |
776 | extern void drm_send_vblank_event(struct drm_device *dev, int crtc, |
834 | extern void drm_crtc_send_vblank_event(struct drm_crtc *crtc, |
- | 835 | struct drm_pending_vblank_event *e); |
|
777 | struct drm_pending_vblank_event *e); |
836 | extern bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe); |
778 | extern bool drm_handle_vblank(struct drm_device *dev, int crtc); |
837 | extern bool drm_crtc_handle_vblank(struct drm_crtc *crtc); |
779 | extern int drm_vblank_get(struct drm_device *dev, int crtc); |
838 | extern int drm_vblank_get(struct drm_device *dev, unsigned int pipe); |
780 | extern void drm_vblank_put(struct drm_device *dev, int crtc); |
839 | extern void drm_vblank_put(struct drm_device *dev, unsigned int pipe); |
781 | extern int drm_crtc_vblank_get(struct drm_crtc *crtc); |
840 | extern int drm_crtc_vblank_get(struct drm_crtc *crtc); |
782 | extern void drm_crtc_vblank_put(struct drm_crtc *crtc); |
841 | extern void drm_crtc_vblank_put(struct drm_crtc *crtc); |
783 | extern void drm_wait_one_vblank(struct drm_device *dev, int crtc); |
842 | extern void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe); |
784 | extern void drm_crtc_wait_one_vblank(struct drm_crtc *crtc); |
843 | extern void drm_crtc_wait_one_vblank(struct drm_crtc *crtc); |
785 | extern void drm_vblank_off(struct drm_device *dev, int crtc); |
844 | extern void drm_vblank_off(struct drm_device *dev, unsigned int pipe); |
- | 845 | extern void drm_vblank_on(struct drm_device *dev, unsigned int pipe); |
|
786 | extern void drm_vblank_on(struct drm_device *dev, int crtc); |
846 | extern void drm_crtc_vblank_off(struct drm_crtc *crtc); |
787 | extern void drm_crtc_vblank_off(struct drm_crtc *crtc); |
847 | extern void drm_crtc_vblank_reset(struct drm_crtc *crtc); |
- | 848 | extern void drm_crtc_vblank_on(struct drm_crtc *crtc); |
|
Line 788... | Line 849... | ||
788 | extern void drm_crtc_vblank_on(struct drm_crtc *crtc); |
849 | extern void drm_vblank_cleanup(struct drm_device *dev); |
789 | extern void drm_vblank_cleanup(struct drm_device *dev); |
850 | extern u32 drm_vblank_no_hw_counter(struct drm_device *dev, unsigned int pipe); |
790 | 851 | ||
791 | extern int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, |
852 | extern int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, |
792 | int crtc, int *max_error, |
- | |
793 | struct timeval *vblank_time, |
853 | unsigned int pipe, int *max_error, |
794 | unsigned flags, |
854 | struct timeval *vblank_time, |
795 | const struct drm_crtc *refcrtc, |
855 | unsigned flags, |
Line 796... | Line 856... | ||
796 | const struct drm_display_mode *mode); |
856 | const struct drm_display_mode *mode); |
Line 808... | Line 868... | ||
808 | { |
868 | { |
809 | return &crtc->dev->vblank[drm_crtc_index(crtc)].queue; |
869 | return &crtc->dev->vblank[drm_crtc_index(crtc)].queue; |
810 | } |
870 | } |
Line 811... | Line 871... | ||
811 | 871 | ||
812 | /* Modesetting support */ |
872 | /* Modesetting support */ |
813 | extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); |
873 | extern void drm_vblank_pre_modeset(struct drm_device *dev, unsigned int pipe); |
Line 814... | Line 874... | ||
814 | extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc); |
874 | extern void drm_vblank_post_modeset(struct drm_device *dev, unsigned int pipe); |
815 | 875 | ||
816 | /* Stub support (drm_stub.h) */ |
876 | /* Stub support (drm_stub.h) */ |
Line 817... | Line 877... | ||
817 | extern struct drm_master *drm_master_get(struct drm_master *master); |
877 | extern struct drm_master *drm_master_get(struct drm_master *master); |
818 | extern void drm_master_put(struct drm_master **master); |
878 | extern void drm_master_put(struct drm_master **master); |
819 | 879 | ||
- | 880 | extern void drm_put_dev(struct drm_device *dev); |
|
Line 820... | Line 881... | ||
820 | extern void drm_put_dev(struct drm_device *dev); |
881 | extern void drm_unplug_dev(struct drm_device *dev); |
821 | extern void drm_unplug_dev(struct drm_device *dev); |
882 | extern unsigned int drm_debug; |
822 | extern unsigned int drm_debug; |
883 | extern bool drm_atomic; |
823 | 884 |