diff options
Diffstat (limited to 'include/drm/drmP.h')
-rw-r--r-- | include/drm/drmP.h | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index d0251ac44a50..0b921ae06cd8 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -107,6 +107,9 @@ struct dma_buf_attachment; | |||
107 | * ATOMIC: used in the atomic code. | 107 | * ATOMIC: used in the atomic code. |
108 | * This is the category used by the DRM_DEBUG_ATOMIC() macro. | 108 | * This is the category used by the DRM_DEBUG_ATOMIC() macro. |
109 | * | 109 | * |
110 | * VBL: used for verbose debug message in the vblank code | ||
111 | * This is the category used by the DRM_DEBUG_VBL() macro. | ||
112 | * | ||
110 | * Enabling verbose debug messages is done through the drm.debug parameter, | 113 | * Enabling verbose debug messages is done through the drm.debug parameter, |
111 | * each category being enabled by a bit. | 114 | * each category being enabled by a bit. |
112 | * | 115 | * |
@@ -114,7 +117,7 @@ struct dma_buf_attachment; | |||
114 | * drm.debug=0x2 will enable DRIVER messages | 117 | * drm.debug=0x2 will enable DRIVER messages |
115 | * drm.debug=0x3 will enable CORE and DRIVER messages | 118 | * drm.debug=0x3 will enable CORE and DRIVER messages |
116 | * ... | 119 | * ... |
117 | * drm.debug=0xf will enable all messages | 120 | * drm.debug=0x3f will enable all messages |
118 | * | 121 | * |
119 | * An interesting feature is that it's possible to enable verbose logging at | 122 | * An interesting feature is that it's possible to enable verbose logging at |
120 | * run-time by echoing the debug value in its sysfs node: | 123 | * run-time by echoing the debug value in its sysfs node: |
@@ -125,6 +128,7 @@ struct dma_buf_attachment; | |||
125 | #define DRM_UT_KMS 0x04 | 128 | #define DRM_UT_KMS 0x04 |
126 | #define DRM_UT_PRIME 0x08 | 129 | #define DRM_UT_PRIME 0x08 |
127 | #define DRM_UT_ATOMIC 0x10 | 130 | #define DRM_UT_ATOMIC 0x10 |
131 | #define DRM_UT_VBL 0x20 | ||
128 | 132 | ||
129 | extern __printf(2, 3) | 133 | extern __printf(2, 3) |
130 | void drm_ut_debug_printk(const char *function_name, | 134 | void drm_ut_debug_printk(const char *function_name, |
@@ -217,6 +221,11 @@ void drm_err(const char *format, ...); | |||
217 | if (unlikely(drm_debug & DRM_UT_ATOMIC)) \ | 221 | if (unlikely(drm_debug & DRM_UT_ATOMIC)) \ |
218 | drm_ut_debug_printk(__func__, fmt, ##args); \ | 222 | drm_ut_debug_printk(__func__, fmt, ##args); \ |
219 | } while (0) | 223 | } while (0) |
224 | #define DRM_DEBUG_VBL(fmt, args...) \ | ||
225 | do { \ | ||
226 | if (unlikely(drm_debug & DRM_UT_VBL)) \ | ||
227 | drm_ut_debug_printk(__func__, fmt, ##args); \ | ||
228 | } while (0) | ||
220 | 229 | ||
221 | /*@}*/ | 230 | /*@}*/ |
222 | 231 | ||
@@ -412,7 +421,7 @@ struct drm_driver { | |||
412 | /** | 421 | /** |
413 | * get_vblank_counter - get raw hardware vblank counter | 422 | * get_vblank_counter - get raw hardware vblank counter |
414 | * @dev: DRM device | 423 | * @dev: DRM device |
415 | * @crtc: counter to fetch | 424 | * @pipe: counter to fetch |
416 | * | 425 | * |
417 | * Driver callback for fetching a raw hardware vblank counter for @crtc. | 426 | * Driver callback for fetching a raw hardware vblank counter for @crtc. |
418 | * If a device doesn't have a hardware counter, the driver can simply | 427 | * If a device doesn't have a hardware counter, the driver can simply |
@@ -426,12 +435,12 @@ struct drm_driver { | |||
426 | * RETURNS | 435 | * RETURNS |
427 | * Raw vblank counter value. | 436 | * Raw vblank counter value. |
428 | */ | 437 | */ |
429 | u32 (*get_vblank_counter) (struct drm_device *dev, int crtc); | 438 | u32 (*get_vblank_counter) (struct drm_device *dev, unsigned int pipe); |
430 | 439 | ||
431 | /** | 440 | /** |
432 | * enable_vblank - enable vblank interrupt events | 441 | * enable_vblank - enable vblank interrupt events |
433 | * @dev: DRM device | 442 | * @dev: DRM device |
434 | * @crtc: which irq to enable | 443 | * @pipe: which irq to enable |
435 | * | 444 | * |
436 | * Enable vblank interrupts for @crtc. If the device doesn't have | 445 | * Enable vblank interrupts for @crtc. If the device doesn't have |
437 | * a hardware vblank counter, this routine should be a no-op, since | 446 | * a hardware vblank counter, this routine should be a no-op, since |
@@ -441,18 +450,18 @@ struct drm_driver { | |||
441 | * Zero on success, appropriate errno if the given @crtc's vblank | 450 | * Zero on success, appropriate errno if the given @crtc's vblank |
442 | * interrupt cannot be enabled. | 451 | * interrupt cannot be enabled. |
443 | */ | 452 | */ |
444 | int (*enable_vblank) (struct drm_device *dev, int crtc); | 453 | int (*enable_vblank) (struct drm_device *dev, unsigned int pipe); |
445 | 454 | ||
446 | /** | 455 | /** |
447 | * disable_vblank - disable vblank interrupt events | 456 | * disable_vblank - disable vblank interrupt events |
448 | * @dev: DRM device | 457 | * @dev: DRM device |
449 | * @crtc: which irq to enable | 458 | * @pipe: which irq to enable |
450 | * | 459 | * |
451 | * Disable vblank interrupts for @crtc. If the device doesn't have | 460 | * Disable vblank interrupts for @crtc. If the device doesn't have |
452 | * a hardware vblank counter, this routine should be a no-op, since | 461 | * a hardware vblank counter, this routine should be a no-op, since |
453 | * interrupts will have to stay on to keep the count accurate. | 462 | * interrupts will have to stay on to keep the count accurate. |
454 | */ | 463 | */ |
455 | void (*disable_vblank) (struct drm_device *dev, int crtc); | 464 | void (*disable_vblank) (struct drm_device *dev, unsigned int pipe); |
456 | 465 | ||
457 | /** | 466 | /** |
458 | * Called by \c drm_device_is_agp. Typically used to determine if a | 467 | * Called by \c drm_device_is_agp. Typically used to determine if a |
@@ -474,7 +483,7 @@ struct drm_driver { | |||
474 | * optional accurate ktime_get timestamp of when position was measured. | 483 | * optional accurate ktime_get timestamp of when position was measured. |
475 | * | 484 | * |
476 | * \param dev DRM device. | 485 | * \param dev DRM device. |
477 | * \param crtc Id of the crtc to query. | 486 | * \param pipe Id of the crtc to query. |
478 | * \param flags Flags from the caller (DRM_CALLED_FROM_VBLIRQ or 0). | 487 | * \param flags Flags from the caller (DRM_CALLED_FROM_VBLIRQ or 0). |
479 | * \param *vpos Target location for current vertical scanout position. | 488 | * \param *vpos Target location for current vertical scanout position. |
480 | * \param *hpos Target location for current horizontal scanout position. | 489 | * \param *hpos Target location for current horizontal scanout position. |
@@ -498,9 +507,8 @@ struct drm_driver { | |||
498 | * but unknown small number of scanlines wrt. real scanout position. | 507 | * but unknown small number of scanlines wrt. real scanout position. |
499 | * | 508 | * |
500 | */ | 509 | */ |
501 | int (*get_scanout_position) (struct drm_device *dev, int crtc, | 510 | int (*get_scanout_position) (struct drm_device *dev, unsigned int pipe, |
502 | unsigned int flags, | 511 | unsigned int flags, int *vpos, int *hpos, |
503 | int *vpos, int *hpos, | ||
504 | ktime_t *stime, ktime_t *etime, | 512 | ktime_t *stime, ktime_t *etime, |
505 | const struct drm_display_mode *mode); | 513 | const struct drm_display_mode *mode); |
506 | 514 | ||
@@ -518,7 +526,7 @@ struct drm_driver { | |||
518 | * to the OpenML OML_sync_control extension specification. | 526 | * to the OpenML OML_sync_control extension specification. |
519 | * | 527 | * |
520 | * \param dev dev DRM device handle. | 528 | * \param dev dev DRM device handle. |
521 | * \param crtc crtc for which timestamp should be returned. | 529 | * \param pipe crtc for which timestamp should be returned. |
522 | * \param *max_error Maximum allowable timestamp error in nanoseconds. | 530 | * \param *max_error Maximum allowable timestamp error in nanoseconds. |
523 | * Implementation should strive to provide timestamp | 531 | * Implementation should strive to provide timestamp |
524 | * with an error of at most *max_error nanoseconds. | 532 | * with an error of at most *max_error nanoseconds. |
@@ -534,7 +542,7 @@ struct drm_driver { | |||
534 | * negative number on failure. A positive status code on success, | 542 | * negative number on failure. A positive status code on success, |
535 | * which describes how the vblank_time timestamp was computed. | 543 | * which describes how the vblank_time timestamp was computed. |
536 | */ | 544 | */ |
537 | int (*get_vblank_timestamp) (struct drm_device *dev, int crtc, | 545 | int (*get_vblank_timestamp) (struct drm_device *dev, unsigned int pipe, |
538 | int *max_error, | 546 | int *max_error, |
539 | struct timeval *vblank_time, | 547 | struct timeval *vblank_time, |
540 | unsigned flags); | 548 | unsigned flags); |
@@ -826,7 +834,6 @@ struct drm_device { | |||
826 | 834 | ||
827 | struct drm_sg_mem *sg; /**< Scatter gather memory */ | 835 | struct drm_sg_mem *sg; /**< Scatter gather memory */ |
828 | unsigned int num_crtcs; /**< Number of CRTCs on this device */ | 836 | unsigned int num_crtcs; /**< Number of CRTCs on this device */ |
829 | sigset_t sigmask; | ||
830 | 837 | ||
831 | struct { | 838 | struct { |
832 | int context; | 839 | int context; |
@@ -910,6 +917,8 @@ extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); | |||
910 | /* Misc. IOCTL support (drm_ioctl.c) */ | 917 | /* Misc. IOCTL support (drm_ioctl.c) */ |
911 | int drm_noop(struct drm_device *dev, void *data, | 918 | int drm_noop(struct drm_device *dev, void *data, |
912 | struct drm_file *file_priv); | 919 | struct drm_file *file_priv); |
920 | int drm_invalid_op(struct drm_device *dev, void *data, | ||
921 | struct drm_file *file_priv); | ||
913 | 922 | ||
914 | /* Cache management (drm_cache.c) */ | 923 | /* Cache management (drm_cache.c) */ |
915 | void drm_clflush_pages(struct page *pages[], unsigned long num_pages); | 924 | void drm_clflush_pages(struct page *pages[], unsigned long num_pages); |
@@ -928,7 +937,7 @@ extern int drm_irq_uninstall(struct drm_device *dev); | |||
928 | extern int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs); | 937 | extern int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs); |
929 | extern int drm_wait_vblank(struct drm_device *dev, void *data, | 938 | extern int drm_wait_vblank(struct drm_device *dev, void *data, |
930 | struct drm_file *filp); | 939 | struct drm_file *filp); |
931 | extern u32 drm_vblank_count(struct drm_device *dev, int pipe); | 940 | extern u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe); |
932 | extern u32 drm_crtc_vblank_count(struct drm_crtc *crtc); | 941 | extern u32 drm_crtc_vblank_count(struct drm_crtc *crtc); |
933 | extern u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe, | 942 | extern u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe, |
934 | struct timeval *vblanktime); | 943 | struct timeval *vblanktime); |
@@ -952,6 +961,7 @@ extern void drm_crtc_vblank_off(struct drm_crtc *crtc); | |||
952 | extern void drm_crtc_vblank_reset(struct drm_crtc *crtc); | 961 | extern void drm_crtc_vblank_reset(struct drm_crtc *crtc); |
953 | extern void drm_crtc_vblank_on(struct drm_crtc *crtc); | 962 | extern void drm_crtc_vblank_on(struct drm_crtc *crtc); |
954 | extern void drm_vblank_cleanup(struct drm_device *dev); | 963 | extern void drm_vblank_cleanup(struct drm_device *dev); |
964 | extern u32 drm_vblank_no_hw_counter(struct drm_device *dev, unsigned int pipe); | ||
955 | 965 | ||
956 | extern int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, | 966 | extern int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, |
957 | unsigned int pipe, int *max_error, | 967 | unsigned int pipe, int *max_error, |