Lines Matching refs:vblank

46 void drm_handle_vblank_works(struct drm_vblank_crtc *vblank)  in drm_handle_vblank_works()  argument
49 u64 count = atomic64_read(&vblank->count); in drm_handle_vblank_works()
52 assert_spin_locked(&vblank->dev->event_lock); in drm_handle_vblank_works()
54 list_for_each_entry_safe(work, next, &vblank->pending_work, node) { in drm_handle_vblank_works()
59 drm_vblank_put(vblank->dev, vblank->pipe); in drm_handle_vblank_works()
60 kthread_queue_work(vblank->worker, &work->base); in drm_handle_vblank_works()
64 wake_up_all(&vblank->work_wait_queue); in drm_handle_vblank_works()
70 void drm_vblank_cancel_pending_works(struct drm_vblank_crtc *vblank) in drm_vblank_cancel_pending_works() argument
74 assert_spin_locked(&vblank->dev->event_lock); in drm_vblank_cancel_pending_works()
76 drm_WARN_ONCE(vblank->dev, !list_empty(&vblank->pending_work), in drm_vblank_cancel_pending_works()
79 list_for_each_entry_safe(work, next, &vblank->pending_work, node) { in drm_vblank_cancel_pending_works()
81 drm_vblank_put(vblank->dev, vblank->pipe); in drm_vblank_cancel_pending_works()
84 wake_up_all(&vblank->work_wait_queue); in drm_vblank_cancel_pending_works()
112 struct drm_vblank_crtc *vblank = work->vblank; in drm_vblank_work_schedule() local
113 struct drm_device *dev = vblank->dev; in drm_vblank_work_schedule()
124 inmodeset = vblank->inmodeset; in drm_vblank_work_schedule()
130 ret = drm_vblank_get(dev, vblank->pipe); in drm_vblank_work_schedule()
141 cur_vbl = drm_vblank_count(dev, vblank->pipe); in drm_vblank_work_schedule()
146 vblank->pipe, count, cur_vbl); in drm_vblank_work_schedule()
149 drm_vblank_put(dev, vblank->pipe); in drm_vblank_work_schedule()
150 ret = kthread_queue_work(vblank->worker, &work->base); in drm_vblank_work_schedule()
158 list_add_tail(&work->node, &vblank->pending_work); in drm_vblank_work_schedule()
165 wake_up_all(&vblank->work_wait_queue); in drm_vblank_work_schedule()
187 struct drm_vblank_crtc *vblank = work->vblank; in drm_vblank_work_cancel_sync() local
188 struct drm_device *dev = vblank->dev; in drm_vblank_work_cancel_sync()
194 drm_vblank_put(vblank->dev, vblank->pipe); in drm_vblank_work_cancel_sync()
201 wake_up_all(&vblank->work_wait_queue); in drm_vblank_work_cancel_sync()
223 struct drm_vblank_crtc *vblank = work->vblank; in drm_vblank_work_flush() local
224 struct drm_device *dev = vblank->dev; in drm_vblank_work_flush()
227 wait_event_lock_irq(vblank->work_wait_queue, list_empty(&work->node), in drm_vblank_work_flush()
245 struct drm_vblank_crtc *vblank = &dev->vblank[drm_crtc_index(crtc)]; in drm_vblank_work_flush_all() local
248 wait_event_lock_irq(vblank->work_wait_queue, in drm_vblank_work_flush_all()
249 list_empty(&vblank->pending_work), in drm_vblank_work_flush_all()
253 kthread_flush_worker(vblank->worker); in drm_vblank_work_flush_all()
270 work->vblank = drm_crtc_vblank_crtc(crtc); in drm_vblank_work_init()
274 int drm_vblank_worker_init(struct drm_vblank_crtc *vblank) in drm_vblank_worker_init() argument
278 INIT_LIST_HEAD(&vblank->pending_work); in drm_vblank_worker_init()
279 init_waitqueue_head(&vblank->work_wait_queue); in drm_vblank_worker_init()
281 vblank->dev->primary->index, in drm_vblank_worker_init()
282 vblank->pipe); in drm_vblank_worker_init()
286 vblank->worker = worker; in drm_vblank_worker_init()