Lines Matching refs:work

48 	struct drm_vblank_work *work, *next;  in drm_handle_vblank_works()  local
54 list_for_each_entry_safe(work, next, &vblank->pending_work, node) { in drm_handle_vblank_works()
55 if (!drm_vblank_passed(count, work->count)) in drm_handle_vblank_works()
58 list_del_init(&work->node); in drm_handle_vblank_works()
60 kthread_queue_work(vblank->worker, &work->base); in drm_handle_vblank_works()
72 struct drm_vblank_work *work, *next; in drm_vblank_cancel_pending_works() local
76 list_for_each_entry_safe(work, next, &vblank->pending_work, node) { in drm_vblank_cancel_pending_works()
77 list_del_init(&work->node); in drm_vblank_cancel_pending_works()
106 int drm_vblank_work_schedule(struct drm_vblank_work *work, in drm_vblank_work_schedule() argument
109 struct drm_vblank_crtc *vblank = work->vblank; in drm_vblank_work_schedule()
117 if (work->cancelling) in drm_vblank_work_schedule()
126 if (list_empty(&work->node)) { in drm_vblank_work_schedule()
130 } else if (work->count == count) { in drm_vblank_work_schedule()
137 work->count = count; in drm_vblank_work_schedule()
147 ret = kthread_queue_work(vblank->worker, &work->base); in drm_vblank_work_schedule()
150 list_del_init(&work->node); in drm_vblank_work_schedule()
155 list_add_tail(&work->node, &vblank->pending_work); in drm_vblank_work_schedule()
182 bool drm_vblank_work_cancel_sync(struct drm_vblank_work *work) in drm_vblank_work_cancel_sync() argument
184 struct drm_vblank_crtc *vblank = work->vblank; in drm_vblank_work_cancel_sync()
189 if (!list_empty(&work->node)) { in drm_vblank_work_cancel_sync()
190 list_del_init(&work->node); in drm_vblank_work_cancel_sync()
195 work->cancelling++; in drm_vblank_work_cancel_sync()
200 if (kthread_cancel_work_sync(&work->base)) in drm_vblank_work_cancel_sync()
204 work->cancelling--; in drm_vblank_work_cancel_sync()
218 void drm_vblank_work_flush(struct drm_vblank_work *work) in drm_vblank_work_flush() argument
220 struct drm_vblank_crtc *vblank = work->vblank; in drm_vblank_work_flush()
224 wait_event_lock_irq(vblank->work_wait_queue, list_empty(&work->node), in drm_vblank_work_flush()
228 kthread_flush_work(&work->base); in drm_vblank_work_flush()
240 void drm_vblank_work_init(struct drm_vblank_work *work, struct drm_crtc *crtc, in drm_vblank_work_init() argument
241 void (*func)(struct kthread_work *work)) in drm_vblank_work_init() argument
243 kthread_init_work(&work->base, func); in drm_vblank_work_init()
244 INIT_LIST_HEAD(&work->node); in drm_vblank_work_init()
245 work->vblank = &crtc->dev->vblank[drm_crtc_index(crtc)]; in drm_vblank_work_init()