OSDN Git Service

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)
commit7fe3f0d15aac6c98a97e6d7086f5a6b7bc4ccae4
treeff005fcab13165c3859c8c4cdce19b181f666e26
parentf1e2b6371c12aec5e772e5fdedaa4455c20a787f
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