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
Showing
- drivers/gpu/drm/drm_vblank.c 67 additions, 9 deletionsdrivers/gpu/drm/drm_vblank.c
- include/drm/drm_crtc.h 44 additions, 2 deletionsinclude/drm/drm_crtc.h
- include/drm/drm_modeset_helper_vtables.h 2 additions, 2 deletionsinclude/drm/drm_modeset_helper_vtables.h
- include/drm/drm_vblank.h 12 additions, 4 deletionsinclude/drm/drm_vblank.h
Loading
Please register or sign in to comment