diff options
| author | Thierry Reding <treding@nvidia.com> | 2015-09-24 12:35:36 -0400 |
|---|---|---|
| committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-09-24 14:27:17 -0400 |
| commit | cf6483050e9bf13979415d9fd388554d8c8f3477 (patch) | |
| tree | 45fb6b49759d63d97e360ce6922101aa6765c9dd | |
| parent | 2b193f023dc8f43b005bc7844b07e437a4e418db (diff) | |
drm/irq: Add drm_crtc_vblank_count_and_time()
This function is the KMS native variant of drm_vblank_count_and_time().
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.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
| -rw-r--r-- | drivers/gpu/drm/drm_irq.c | 23 | ||||
| -rw-r--r-- | include/drm/drmP.h | 2 |
2 files changed, 25 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 29a6dcd674f8..ed2394e1720b 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
| @@ -917,6 +917,8 @@ EXPORT_SYMBOL(drm_crtc_vblank_count); | |||
| 917 | * vblank events since the system was booted, including lost events due to | 917 | * vblank events since the system was booted, including lost events due to |
| 918 | * modesetting activity. Returns corresponding system timestamp of the time | 918 | * modesetting activity. Returns corresponding system timestamp of the time |
| 919 | * of the vblank interval that corresponds to the current vblank counter value. | 919 | * of the vblank interval that corresponds to the current vblank counter value. |
| 920 | * | ||
| 921 | * This is the legacy version of drm_crtc_vblank_count_and_time(). | ||
| 920 | */ | 922 | */ |
| 921 | u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe, | 923 | u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe, |
| 922 | struct timeval *vblanktime) | 924 | struct timeval *vblanktime) |
| @@ -944,6 +946,27 @@ u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe, | |||
| 944 | } | 946 | } |
| 945 | EXPORT_SYMBOL(drm_vblank_count_and_time); | 947 | EXPORT_SYMBOL(drm_vblank_count_and_time); |
| 946 | 948 | ||
| 949 | /** | ||
| 950 | * drm_crtc_vblank_count_and_time - retrieve "cooked" vblank counter value | ||
| 951 | * and the system timestamp corresponding to that vblank counter value | ||
| 952 | * @crtc: which counter to retrieve | ||
| 953 | * @vblanktime: Pointer to struct timeval to receive the vblank timestamp. | ||
| 954 | * | ||
| 955 | * Fetches the "cooked" vblank count value that represents the number of | ||
| 956 | * vblank events since the system was booted, including lost events due to | ||
| 957 | * modesetting activity. Returns corresponding system timestamp of the time | ||
| 958 | * of the vblank interval that corresponds to the current vblank counter value. | ||
| 959 | * | ||
| 960 | * This is the native KMS version of drm_vblank_count_and_time(). | ||
| 961 | */ | ||
| 962 | u32 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc, | ||
| 963 | struct timeval *vblanktime) | ||
| 964 | { | ||
| 965 | return drm_vblank_count_and_time(crtc->dev, drm_crtc_index(crtc), | ||
| 966 | vblanktime); | ||
| 967 | } | ||
| 968 | EXPORT_SYMBOL(drm_crtc_vblank_count_and_time); | ||
| 969 | |||
| 947 | static void send_vblank_event(struct drm_device *dev, | 970 | static void send_vblank_event(struct drm_device *dev, |
| 948 | struct drm_pending_vblank_event *e, | 971 | struct drm_pending_vblank_event *e, |
| 949 | unsigned long seq, struct timeval *now) | 972 | unsigned long seq, struct timeval *now) |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 6717a7dcd32e..d0251ac44a50 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
| @@ -932,6 +932,8 @@ extern u32 drm_vblank_count(struct drm_device *dev, int pipe); | |||
| 932 | extern u32 drm_crtc_vblank_count(struct drm_crtc *crtc); | 932 | 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, | 933 | extern u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe, |
| 934 | struct timeval *vblanktime); | 934 | struct timeval *vblanktime); |
| 935 | extern u32 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc, | ||
| 936 | struct timeval *vblanktime); | ||
| 935 | extern void drm_send_vblank_event(struct drm_device *dev, unsigned int pipe, | 937 | extern void drm_send_vblank_event(struct drm_device *dev, unsigned int pipe, |
| 936 | struct drm_pending_vblank_event *e); | 938 | struct drm_pending_vblank_event *e); |
| 937 | extern void drm_crtc_send_vblank_event(struct drm_crtc *crtc, | 939 | extern void drm_crtc_send_vblank_event(struct drm_crtc *crtc, |
