Lines Matching refs:mdl

39 void _cx18_mdl_swap(struct cx18_mdl *mdl)  in _cx18_mdl_swap()  argument
43 list_for_each_entry(buf, &mdl->buf_list, list) { in _cx18_mdl_swap()
57 struct cx18_queue *_cx18_enqueue(struct cx18_stream *s, struct cx18_mdl *mdl, in _cx18_enqueue() argument
62 mdl->bytesused = 0; in _cx18_enqueue()
63 mdl->readpos = 0; in _cx18_enqueue()
64 mdl->m_flags = 0; in _cx18_enqueue()
65 mdl->skipped = 0; in _cx18_enqueue()
66 mdl->curr_buf = NULL; in _cx18_enqueue()
77 list_add(&mdl->list, &q->list); /* LIFO */ in _cx18_enqueue()
79 list_add_tail(&mdl->list, &q->list); /* FIFO */ in _cx18_enqueue()
80 q->bytesused += mdl->bytesused - mdl->readpos; in _cx18_enqueue()
89 struct cx18_mdl *mdl = NULL; in cx18_dequeue() local
93 mdl = list_first_entry(&q->list, struct cx18_mdl, list); in cx18_dequeue()
94 list_del_init(&mdl->list); in cx18_dequeue()
95 q->bytesused -= mdl->bytesused - mdl->readpos; in cx18_dequeue()
96 mdl->skipped = 0; in cx18_dequeue()
100 return mdl; in cx18_dequeue()
104 struct cx18_mdl *mdl) in _cx18_mdl_update_bufs_for_cpu() argument
108 u32 bytesused = mdl->bytesused; in _cx18_mdl_update_bufs_for_cpu()
110 list_for_each_entry(buf, &mdl->buf_list, list) { in _cx18_mdl_update_bufs_for_cpu()
124 struct cx18_mdl *mdl) in cx18_mdl_update_bufs_for_cpu() argument
128 if (list_is_singular(&mdl->buf_list)) { in cx18_mdl_update_bufs_for_cpu()
129 buf = list_first_entry(&mdl->buf_list, struct cx18_buffer, in cx18_mdl_update_bufs_for_cpu()
131 buf->bytesused = mdl->bytesused; in cx18_mdl_update_bufs_for_cpu()
135 _cx18_mdl_update_bufs_for_cpu(s, mdl); in cx18_mdl_update_bufs_for_cpu()
143 struct cx18_mdl *mdl; in cx18_queue_get_mdl() local
155 list_for_each_entry_safe(mdl, tmp, &s->q_busy.list, list) { in cx18_queue_get_mdl()
163 if (mdl->id != id) { in cx18_queue_get_mdl()
164 mdl->skipped++; in cx18_queue_get_mdl()
165 if (mdl->skipped >= atomic_read(&s->q_busy.depth)-1) { in cx18_queue_get_mdl()
169 "rotation\n", s->name, mdl->id, in cx18_queue_get_mdl()
170 mdl->skipped); in cx18_queue_get_mdl()
172 list_move_tail(&mdl->list, &sweep_up); in cx18_queue_get_mdl()
181 list_del_init(&mdl->list); in cx18_queue_get_mdl()
183 ret = mdl; in cx18_queue_get_mdl()
202 list_for_each_entry_safe(mdl, tmp, &sweep_up, list) { in cx18_queue_get_mdl()
203 list_del_init(&mdl->list); in cx18_queue_get_mdl()
204 cx18_enqueue(s, mdl, &s->q_free); in cx18_queue_get_mdl()
213 struct cx18_mdl *mdl; in cx18_queue_flush() local
222 mdl = list_first_entry(&q_src->list, struct cx18_mdl, list); in cx18_queue_flush()
223 list_move_tail(&mdl->list, &q_dst->list); in cx18_queue_flush()
224 mdl->bytesused = 0; in cx18_queue_flush()
225 mdl->readpos = 0; in cx18_queue_flush()
226 mdl->m_flags = 0; in cx18_queue_flush()
227 mdl->skipped = 0; in cx18_queue_flush()
228 mdl->curr_buf = NULL; in cx18_queue_flush()
249 struct cx18_mdl *mdl; in cx18_unload_queues() local
259 list_for_each_entry(mdl, &q_idle->list, list) { in cx18_unload_queues()
260 while (!list_empty(&mdl->buf_list)) { in cx18_unload_queues()
261 buf = list_first_entry(&mdl->buf_list, in cx18_unload_queues()
267 mdl->id = s->mdl_base_idx; /* reset id to a "safe" value */ in cx18_unload_queues()
280 struct cx18_mdl *mdl; in cx18_load_queues() local
292 for (mdl = cx18_dequeue(s, &s->q_idle), i = s->bufs_per_mdl; in cx18_load_queues()
293 mdl != NULL && i == s->bufs_per_mdl; in cx18_load_queues()
294 mdl = cx18_dequeue(s, &s->q_idle)) { in cx18_load_queues()
296 mdl->id = mdl_id; in cx18_load_queues()
304 list_move_tail(&buf->list, &mdl->buf_list); in cx18_load_queues()
326 cx18_enqueue(s, mdl, &s->q_free); in cx18_load_queues()
329 cx18_push(s, mdl, &s->q_idle); in cx18_load_queues()
335 void _cx18_mdl_sync_for_device(struct cx18_stream *s, struct cx18_mdl *mdl) in _cx18_mdl_sync_for_device() argument
342 list_for_each_entry(buf, &mdl->buf_list, list) in _cx18_mdl_sync_for_device()
376 struct cx18_mdl *mdl; in cx18_stream_alloc() local
380 mdl = kzalloc(sizeof(struct cx18_mdl), GFP_KERNEL|__GFP_NOWARN); in cx18_stream_alloc()
381 if (mdl == NULL) in cx18_stream_alloc()
387 kfree(mdl); in cx18_stream_alloc()
393 kfree(mdl); in cx18_stream_alloc()
398 INIT_LIST_HEAD(&mdl->list); in cx18_stream_alloc()
399 INIT_LIST_HEAD(&mdl->buf_list); in cx18_stream_alloc()
400 mdl->id = s->mdl_base_idx; /* a somewhat safe value */ in cx18_stream_alloc()
401 cx18_enqueue(s, mdl, &s->q_idle); in cx18_stream_alloc()
420 struct cx18_mdl *mdl; in cx18_stream_free() local
430 while ((mdl = cx18_dequeue(s, &s->q_idle))) in cx18_stream_free()
431 kfree(mdl); in cx18_stream_free()