diff options
Diffstat (limited to 'drivers/gpu/drm/drm_internal.h')
-rw-r--r-- | drivers/gpu/drm/drm_internal.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h index 2470a352730b..8e01caaf95cc 100644 --- a/drivers/gpu/drm/drm_internal.h +++ b/drivers/gpu/drm/drm_internal.h @@ -21,7 +21,10 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +#include <linux/kthread.h> + #include <drm/drm_ioctl.h> +#include <drm/drm_vblank.h> #define DRM_IF_MAJOR 1 #define DRM_IF_MINOR 4 @@ -38,6 +41,7 @@ struct drm_master; struct drm_minor; struct drm_prime_file_private; struct drm_printer; +struct drm_vblank_crtc; /* drm_file.c */ extern struct mutex drm_global_mutex; @@ -93,7 +97,30 @@ void drm_minor_release(struct drm_minor *minor); void drm_managed_release(struct drm_device *dev); /* drm_vblank.c */ +static inline bool drm_vblank_passed(u64 seq, u64 ref) +{ + return (seq - ref) <= (1 << 23); +} + void drm_vblank_disable_and_save(struct drm_device *dev, unsigned int pipe); +int drm_vblank_get(struct drm_device *dev, unsigned int pipe); +void drm_vblank_put(struct drm_device *dev, unsigned int pipe); +u64 drm_vblank_count(struct drm_device *dev, unsigned int pipe); + +/* drm_vblank_work.c */ +static inline void drm_vblank_flush_worker(struct drm_vblank_crtc *vblank) +{ + kthread_flush_worker(vblank->worker); +} + +static inline void drm_vblank_destroy_worker(struct drm_vblank_crtc *vblank) +{ + kthread_destroy_worker(vblank->worker); +} + +int drm_vblank_worker_init(struct drm_vblank_crtc *vblank); +void drm_vblank_cancel_pending_works(struct drm_vblank_crtc *vblank); +void drm_handle_vblank_works(struct drm_vblank_crtc *vblank); /* IOCTLS */ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data, |