Lines Matching full:txn

208 /* simple allocator to grab next 16 byte aligned memory from txn */
209 static void *alloc_dma(struct dmm_txn *txn, size_t sz, dma_addr_t *pa) in alloc_dma() argument
212 struct refill_engine *engine = txn->engine_handle; in alloc_dma()
215 txn->current_pa = round_up(txn->current_pa, 16); in alloc_dma()
216 txn->current_va = (void *)round_up((long)txn->current_va, 16); in alloc_dma()
218 ptr = txn->current_va; in alloc_dma()
219 *pa = txn->current_pa; in alloc_dma()
221 txn->current_pa += sz; in alloc_dma()
222 txn->current_va += sz; in alloc_dma()
224 BUG_ON((txn->current_va - engine->refill_va) > REFILL_BUFFER_SIZE); in alloc_dma()
307 struct dmm_txn *txn = NULL; in dmm_txn_init() local
330 txn = &engine->txn; in dmm_txn_init()
332 txn->engine_handle = engine; in dmm_txn_init()
333 txn->last_pat = NULL; in dmm_txn_init()
334 txn->current_va = engine->refill_va; in dmm_txn_init()
335 txn->current_pa = engine->refill_pa; in dmm_txn_init()
337 return txn; in dmm_txn_init()
344 static void dmm_txn_append(struct dmm_txn *txn, struct pat_area *area, in dmm_txn_append() argument
350 struct refill_engine *engine = txn->engine_handle; in dmm_txn_append()
355 pat = alloc_dma(txn, sizeof(*pat), &pat_pa); in dmm_txn_append()
357 if (txn->last_pat) in dmm_txn_append()
358 txn->last_pat->next_pa = (u32)pat_pa; in dmm_txn_append()
371 data = alloc_dma(txn, 4*i, &data_pa); in dmm_txn_append()
383 txn->last_pat = pat; in dmm_txn_append()
391 static int dmm_txn_commit(struct dmm_txn *txn, bool wait) in dmm_txn_commit() argument
394 struct refill_engine *engine = txn->engine_handle; in dmm_txn_commit()
397 if (!txn->last_pat) { in dmm_txn_commit()
398 dev_err(engine->dmm->dev, "need at least one txn\n"); in dmm_txn_commit()
403 txn->last_pat->next_pa = 0; in dmm_txn_commit()
414 readl(&txn->last_pat->next_pa); in dmm_txn_commit()
464 struct dmm_txn *txn; in fill() local
481 txn = dmm_txn_init(omap_dmm, area->tcm); in fill()
482 if (IS_ERR_OR_NULL(txn)) in fill()
491 dmm_txn_append(txn, &p_area, pages, npages, roll); in fill()
496 ret = dmm_txn_commit(txn, wait); in fill()