diff options
author | Thierry Reding <treding@nvidia.com> | 2014-12-16 07:08:47 -0500 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2014-12-17 08:27:35 -0500 |
commit | 96d3f91eb263d478777bb9bff1b1300e0c08c29e (patch) | |
tree | ee8d15d98a057273ef1fe2c3b56693bbec6267c3 | |
parent | 115ebcd4fa90df8cfc80d2302b7afa8d39edb7e2 (diff) |
drm/irq: Add drm_crtc_vblank_count()
This function is the KMS native variant of drm_vblank_count(). It takes
a struct drm_crtc * instead of a struct drm_device * and an index of the
CRTC.
Eventually the goal is to access vblank data through the CRTC only so
that the per-CRTC data can be moved to struct drm_crtc.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r-- | drivers/gpu/drm/drm_irq.c | 21 | ||||
-rw-r--r-- | include/drm/drmP.h | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index ece5a93a6114..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) | |||
844 | EXPORT_SYMBOL(drm_vblank_count); | 846 | EXPORT_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 | */ | ||
861 | u32 drm_crtc_vblank_count(struct drm_crtc *crtc) | ||
862 | { | ||
863 | return drm_vblank_count(crtc->dev, drm_crtc_index(crtc)); | ||
864 | } | ||
865 | EXPORT_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 | * |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index f1f7f15ce0f3..e1b2e8b98af7 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -901,6 +901,7 @@ extern int drm_vblank_init(struct drm_device *dev, int num_crtcs); | |||
901 | extern int drm_wait_vblank(struct drm_device *dev, void *data, | 901 | extern int drm_wait_vblank(struct drm_device *dev, void *data, |
902 | struct drm_file *filp); | 902 | struct drm_file *filp); |
903 | extern u32 drm_vblank_count(struct drm_device *dev, int crtc); | 903 | extern u32 drm_vblank_count(struct drm_device *dev, int crtc); |
904 | extern u32 drm_crtc_vblank_count(struct drm_crtc *crtc); | ||
904 | extern u32 drm_vblank_count_and_time(struct drm_device *dev, int crtc, | 905 | extern u32 drm_vblank_count_and_time(struct drm_device *dev, int crtc, |
905 | struct timeval *vblanktime); | 906 | struct timeval *vblanktime); |
906 | extern void drm_send_vblank_event(struct drm_device *dev, int crtc, | 907 | extern void drm_send_vblank_event(struct drm_device *dev, int crtc, |