Lines Matching defs:mdl

25 void _cx18_mdl_swap(struct cx18_mdl *mdl)
29 list_for_each_entry(buf, &mdl->buf_list, list) {
43 struct cx18_queue *_cx18_enqueue(struct cx18_stream *s, struct cx18_mdl *mdl,
46 /* clear the mdl if it is not to be enqueued to the full queue */
48 mdl->bytesused = 0;
49 mdl->readpos = 0;
50 mdl->m_flags = 0;
51 mdl->skipped = 0;
52 mdl->curr_buf = NULL;
63 list_add(&mdl->list, &q->list); /* LIFO */
65 list_add_tail(&mdl->list, &q->list); /* FIFO */
66 q->bytesused += mdl->bytesused - mdl->readpos;
75 struct cx18_mdl *mdl = NULL;
79 mdl = list_first_entry(&q->list, struct cx18_mdl, list);
80 list_del_init(&mdl->list);
81 q->bytesused -= mdl->bytesused - mdl->readpos;
82 mdl->skipped = 0;
86 return mdl;
90 struct cx18_mdl *mdl)
94 u32 bytesused = mdl->bytesused;
96 list_for_each_entry(buf, &mdl->buf_list, list) {
110 struct cx18_mdl *mdl)
114 if (list_is_singular(&mdl->buf_list)) {
115 buf = list_first_entry(&mdl->buf_list, struct cx18_buffer,
117 buf->bytesused = mdl->bytesused;
121 _cx18_mdl_update_bufs_for_cpu(s, mdl);
129 struct cx18_mdl *mdl;
141 list_for_each_entry_safe(mdl, tmp, &s->q_busy.list, list) {
145 * missed an mdl done message from the firmware.
146 * Once we skip an mdl repeatedly, relative to the size of
149 if (mdl->id != id) {
150 mdl->skipped++;
151 if (mdl->skipped >= atomic_read(&s->q_busy.depth)-1) {
152 /* mdl must have fallen out of rotation */
154 s->name, mdl->id,
155 mdl->skipped);
157 list_move_tail(&mdl->list, &sweep_up);
163 * We pull the desired mdl off of the queue here. Something
166 list_del_init(&mdl->list);
168 ret = mdl;
174 * We found the mdl for which we were looking. Get it ready for
180 /* 0'ed readpos, m_flags & curr_buf when mdl went on q_busy */
187 list_for_each_entry_safe(mdl, tmp, &sweep_up, list) {
188 list_del_init(&mdl->list);
189 cx18_enqueue(s, mdl, &s->q_free);
194 /* Move all mdls of a queue, while flushing the mdl */
198 struct cx18_mdl *mdl;
207 mdl = list_first_entry(&q_src->list, struct cx18_mdl, list);
208 list_move_tail(&mdl->list, &q_dst->list);
209 mdl->bytesused = 0;
210 mdl->readpos = 0;
211 mdl->m_flags = 0;
212 mdl->skipped = 0;
213 mdl->curr_buf = NULL;
234 struct cx18_mdl *mdl;
244 list_for_each_entry(mdl, &q_idle->list, list) {
245 while (!list_empty(&mdl->buf_list)) {
246 buf = list_first_entry(&mdl->buf_list,
252 mdl->id = s->mdl_base_idx; /* reset id to a "safe" value */
253 /* all other mdl fields were cleared by cx18_queue_flush() */
265 struct cx18_mdl *mdl;
277 for (mdl = cx18_dequeue(s, &s->q_idle), i = s->bufs_per_mdl;
278 mdl != NULL && i == s->bufs_per_mdl;
279 mdl = cx18_dequeue(s, &s->q_idle)) {
281 mdl->id = mdl_id;
289 list_move_tail(&buf->list, &mdl->buf_list);
311 cx18_enqueue(s, mdl, &s->q_free);
314 cx18_push(s, mdl, &s->q_idle);
320 void _cx18_mdl_sync_for_device(struct cx18_stream *s, struct cx18_mdl *mdl)
327 list_for_each_entry(buf, &mdl->buf_list, list)
360 struct cx18_mdl *mdl;
364 mdl = kzalloc(sizeof(struct cx18_mdl), GFP_KERNEL|__GFP_NOWARN);
365 if (mdl == NULL)
371 kfree(mdl);
377 kfree(mdl);
382 INIT_LIST_HEAD(&mdl->list);
383 INIT_LIST_HEAD(&mdl->buf_list);
384 mdl->id = s->mdl_base_idx; /* a somewhat safe value */
385 cx18_enqueue(s, mdl, &s->q_idle);
405 struct cx18_mdl *mdl;
415 while ((mdl = cx18_dequeue(s, &s->q_idle)))
416 kfree(mdl);