Lines Matching defs:work

31  * drm_flip_work_allocate_task - allocate a flip-work task
51 * @work: the flip-work
55 * func) on a work queue after drm_flip_work_commit() is called.
57 void drm_flip_work_queue_task(struct drm_flip_work *work,
62 spin_lock_irqsave(&work->lock, flags);
63 list_add_tail(&task->node, &work->queued);
64 spin_unlock_irqrestore(&work->lock, flags);
69 * drm_flip_work_queue - queue work
70 * @work: the flip-work
73 * Queues work, that will later be run (passed back to drm_flip_func_t
74 * func) on a work queue after drm_flip_work_commit() is called.
76 void drm_flip_work_queue(struct drm_flip_work *work, void *val)
83 drm_flip_work_queue_task(work, task);
85 DRM_ERROR("%s could not allocate task!\n", work->name);
86 work->func(work, val);
92 * drm_flip_work_commit - commit queued work
93 * @work: the flip-work
94 * @wq: the work-queue to run the queued work on
96 * Trigger work previously queued by drm_flip_work_queue() to run
97 * on a workqueue. The typical usage would be to queue work (via
99 * prior), and then from vblank irq commit the queued work.
101 void drm_flip_work_commit(struct drm_flip_work *work,
106 spin_lock_irqsave(&work->lock, flags);
107 list_splice_tail(&work->queued, &work->commited);
108 INIT_LIST_HEAD(&work->queued);
109 spin_unlock_irqrestore(&work->lock, flags);
110 queue_work(wq, &work->worker);
116 struct drm_flip_work *work = container_of(w, struct drm_flip_work, worker);
124 spin_lock_irqsave(&work->lock, flags);
125 list_splice_tail(&work->commited, &tasks);
126 INIT_LIST_HEAD(&work->commited);
127 spin_unlock_irqrestore(&work->lock, flags);
133 work->func(work, task->data);
140 * drm_flip_work_init - initialize flip-work
141 * @work: the flip-work to initialize
143 * @func: the callback work function
145 * Initializes/allocates resources for the flip-work
147 void drm_flip_work_init(struct drm_flip_work *work,
150 work->name = name;
151 INIT_LIST_HEAD(&work->queued);
152 INIT_LIST_HEAD(&work->commited);
153 mtx_init(&work->lock, IPL_TTY);
154 work->func = func;
156 INIT_WORK(&work->worker, flip_worker);
161 * drm_flip_work_cleanup - cleans up flip-work
162 * @work: the flip-work to cleanup
164 * Destroy resources allocated for the flip-work
166 void drm_flip_work_cleanup(struct drm_flip_work *work)
168 WARN_ON(!list_empty(&work->queued) || !list_empty(&work->commited));