Lines Matching refs:work

57 void drm_flip_work_queue_task(struct drm_flip_work *work,  in drm_flip_work_queue_task()  argument
62 spin_lock_irqsave(&work->lock, flags); in drm_flip_work_queue_task()
63 list_add_tail(&task->node, &work->queued); in drm_flip_work_queue_task()
64 spin_unlock_irqrestore(&work->lock, flags); in drm_flip_work_queue_task()
76 void drm_flip_work_queue(struct drm_flip_work *work, void *val) in drm_flip_work_queue() argument
83 drm_flip_work_queue_task(work, task); in drm_flip_work_queue()
85 DRM_ERROR("%s could not allocate task!\n", work->name); in drm_flip_work_queue()
86 work->func(work, val); in drm_flip_work_queue()
101 void drm_flip_work_commit(struct drm_flip_work *work, in drm_flip_work_commit() argument
106 spin_lock_irqsave(&work->lock, flags); in drm_flip_work_commit()
107 list_splice_tail(&work->queued, &work->commited); in drm_flip_work_commit()
108 INIT_LIST_HEAD(&work->queued); in drm_flip_work_commit()
109 spin_unlock_irqrestore(&work->lock, flags); in drm_flip_work_commit()
110 queue_work(wq, &work->worker); in drm_flip_work_commit()
116 struct drm_flip_work *work = container_of(w, struct drm_flip_work, worker); in flip_worker() local
124 spin_lock_irqsave(&work->lock, flags); in flip_worker()
125 list_splice_tail(&work->commited, &tasks); in flip_worker()
126 INIT_LIST_HEAD(&work->commited); in flip_worker()
127 spin_unlock_irqrestore(&work->lock, flags); in flip_worker()
133 work->func(work, task->data); in flip_worker()
147 void drm_flip_work_init(struct drm_flip_work *work, in drm_flip_work_init() argument
150 work->name = name; in drm_flip_work_init()
151 INIT_LIST_HEAD(&work->queued); in drm_flip_work_init()
152 INIT_LIST_HEAD(&work->commited); in drm_flip_work_init()
153 spin_lock_init(&work->lock); in drm_flip_work_init()
154 work->func = func; in drm_flip_work_init()
156 INIT_WORK(&work->worker, flip_worker); in drm_flip_work_init()
166 void drm_flip_work_cleanup(struct drm_flip_work *work) in drm_flip_work_cleanup() argument
168 WARN_ON(!list_empty(&work->queued) || !list_empty(&work->commited)); in drm_flip_work_cleanup()