aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/drm_irq.c')
-rw-r--r--drivers/gpu/drm/drm_irq.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index f5a5f18efa5b..4d79dad9d44f 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -830,6 +830,8 @@ drm_get_last_vbltimestamp(struct drm_device *dev, int crtc,
830 * vblank events since the system was booted, including lost events due to 830 * vblank events since the system was booted, including lost events due to
831 * modesetting activity. 831 * modesetting activity.
832 * 832 *
833 * This is the legacy version of drm_crtc_vblank_count().
834 *
833 * Returns: 835 * Returns:
834 * The software vblank counter. 836 * The software vblank counter.
835 */ 837 */
@@ -844,6 +846,25 @@ u32 drm_vblank_count(struct drm_device *dev, int crtc)
844EXPORT_SYMBOL(drm_vblank_count); 846EXPORT_SYMBOL(drm_vblank_count);
845 847
846/** 848/**
849 * drm_crtc_vblank_count - retrieve "cooked" vblank counter value
850 * @crtc: which counter to retrieve
851 *
852 * Fetches the "cooked" vblank count value that represents the number of
853 * vblank events since the system was booted, including lost events due to
854 * modesetting activity.
855 *
856 * This is the native KMS version of drm_vblank_count().
857 *
858 * Returns:
859 * The software vblank counter.
860 */
861u32 drm_crtc_vblank_count(struct drm_crtc *crtc)
862{
863 return drm_vblank_count(crtc->dev, drm_crtc_index(crtc));
864}
865EXPORT_SYMBOL(drm_crtc_vblank_count);
866
867/**
847 * drm_vblank_count_and_time - retrieve "cooked" vblank counter value 868 * drm_vblank_count_and_time - retrieve "cooked" vblank counter value
848 * and the system timestamp corresponding to that vblank counter value. 869 * and the system timestamp corresponding to that vblank counter value.
849 * 870 *
@@ -904,6 +925,8 @@ static void send_vblank_event(struct drm_device *dev,
904 * 925 *
905 * Updates sequence # and timestamp on event, and sends it to userspace. 926 * Updates sequence # and timestamp on event, and sends it to userspace.
906 * Caller must hold event lock. 927 * Caller must hold event lock.
928 *
929 * This is the legacy version of drm_crtc_send_vblank_event().
907 */ 930 */
908void drm_send_vblank_event(struct drm_device *dev, int crtc, 931void drm_send_vblank_event(struct drm_device *dev, int crtc,
909 struct drm_pending_vblank_event *e) 932 struct drm_pending_vblank_event *e)
@@ -923,6 +946,23 @@ void drm_send_vblank_event(struct drm_device *dev, int crtc,
923EXPORT_SYMBOL(drm_send_vblank_event); 946EXPORT_SYMBOL(drm_send_vblank_event);
924 947
925/** 948/**
949 * drm_crtc_send_vblank_event - helper to send vblank event after pageflip
950 * @crtc: the source CRTC of the vblank event
951 * @e: the event to send
952 *
953 * Updates sequence # and timestamp on event, and sends it to userspace.
954 * Caller must hold event lock.
955 *
956 * This is the native KMS version of drm_send_vblank_event().
957 */
958void drm_crtc_send_vblank_event(struct drm_crtc *crtc,
959 struct drm_pending_vblank_event *e)
960{
961 drm_send_vblank_event(crtc->dev, drm_crtc_index(crtc), e);
962}
963EXPORT_SYMBOL(drm_crtc_send_vblank_event);
964
965/**
926 * drm_vblank_enable - enable the vblank interrupt on a CRTC 966 * drm_vblank_enable - enable the vblank interrupt on a CRTC
927 * @dev: DRM device 967 * @dev: DRM device
928 * @crtc: CRTC in question 968 * @crtc: CRTC in question
@@ -1594,6 +1634,8 @@ static void drm_handle_vblank_events(struct drm_device *dev, int crtc)
1594 * 1634 *
1595 * Drivers should call this routine in their vblank interrupt handlers to 1635 * Drivers should call this routine in their vblank interrupt handlers to
1596 * update the vblank counter and send any signals that may be pending. 1636 * update the vblank counter and send any signals that may be pending.
1637 *
1638 * This is the legacy version of drm_crtc_handle_vblank().
1597 */ 1639 */
1598bool drm_handle_vblank(struct drm_device *dev, int crtc) 1640bool drm_handle_vblank(struct drm_device *dev, int crtc)
1599{ 1641{
@@ -1670,3 +1712,21 @@ bool drm_handle_vblank(struct drm_device *dev, int crtc)
1670 return true; 1712 return true;
1671} 1713}
1672EXPORT_SYMBOL(drm_handle_vblank); 1714EXPORT_SYMBOL(drm_handle_vblank);
1715
1716/**
1717 * drm_crtc_handle_vblank - handle a vblank event
1718 * @crtc: where this event occurred
1719 *
1720 * Drivers should call this routine in their vblank interrupt handlers to
1721 * update the vblank counter and send any signals that may be pending.
1722 *
1723 * This is the native KMS version of drm_handle_vblank().
1724 *
1725 * Returns:
1726 * True if the event was successfully handled, false on failure.
1727 */
1728bool drm_crtc_handle_vblank(struct drm_crtc *crtc)
1729{
1730 return drm_handle_vblank(crtc->dev, drm_crtc_index(crtc));
1731}
1732EXPORT_SYMBOL(drm_crtc_handle_vblank);