]> git.baikalelectronics.ru Git - kernel.git/commit
drm: Add get_vblank_timestamp() to struct drm_crtc_funcs
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 23 Jan 2020 13:59:24 +0000 (14:59 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 13 Feb 2020 12:08:13 +0000 (13:08 +0100)
commitfdc0f6168da8405094e343ee6e649bd71513d273
treeff005fcab13165c3859c8c4cdce19b181f666e26
parent44cd84f27de21331ce74d7e80ae0df0bbc35b584
drm: Add get_vblank_timestamp() to struct drm_crtc_funcs

The callback get_vblank_timestamp() is currently located in struct
drm_driver, but really belongs into struct drm_crtc_funcs. Add an
equivalent there. Driver will be converted in separate patches.

The default implementation is drm_calc_vbltimestamp_from_scanoutpos().
The patch adds drm_crtc_vblank_helper_get_vblank_timestamp(), which is
an implementation for the CRTC callback.

v4:
* more readable code for setting high_prec (Ville, Jani)
v3:
* use refactored timestamp calculation to minimize duplicated code
* do more checks for crtc != NULL to support legacy drivers
v2:
* rename helper to drm_crtc_vblank_helper_get_vblank_timestamp()
* replace drm_calc_vbltimestamp_from_scanoutpos() with
  drm_crtc_vblank_helper_get_vblank_timestamp() in docs

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200123135943.24140-4-tzimmermann@suse.de
drivers/gpu/drm/drm_vblank.c
include/drm/drm_crtc.h
include/drm/drm_modeset_helper_vtables.h
include/drm/drm_vblank.h