• Home
  • Raw
  • Download

Lines Matching full:contract

139 	struct sun4i_dma_contract	*contract;  member
153 /* A contract is a set of promises */
315 * from the next pending contract.
323 struct sun4i_dma_contract *contract = NULL; in __execute_vchan_pending() local
347 /* Figure out which contract we're working with today */ in __execute_vchan_pending()
351 "No pending contract found"); in __execute_vchan_pending()
356 contract = to_sun4i_dma_contract(vd); in __execute_vchan_pending()
357 if (list_empty(&contract->demands)) { in __execute_vchan_pending()
358 /* The contract has been completed so mark it as such */ in __execute_vchan_pending()
359 list_del(&contract->vd.node); in __execute_vchan_pending()
360 vchan_cookie_complete(&contract->vd); in __execute_vchan_pending()
362 "Empty contract found and marked complete"); in __execute_vchan_pending()
364 } while (list_empty(&contract->demands)); in __execute_vchan_pending()
367 promise = list_first_entry(&contract->demands, in __execute_vchan_pending()
373 vchan->contract = contract; in __execute_vchan_pending()
375 set_pchan_interrupt(priv, pchan, contract->is_cyclic, 1); in __execute_vchan_pending()
423 * Generate a promise, to be used in a normal DMA contract.
427 * promise will live in the demands list on a contract. Once it has been
429 * All linked promises will be freed when the corresponding contract is freed
490 * Generate a promise, to be used in a dedicated DMA contract.
494 * promise will live in the demands list on a contract. Once it has been
496 * All linked promises will be freed when the corresponding contract is freed
547 * Generate a contract
550 * linked lists, we need to implement SG via software. We use a contract
556 struct sun4i_dma_contract *contract; in generate_dma_contract() local
558 contract = kzalloc(sizeof(*contract), GFP_NOWAIT); in generate_dma_contract()
559 if (!contract) in generate_dma_contract()
562 INIT_LIST_HEAD(&contract->demands); in generate_dma_contract()
563 INIT_LIST_HEAD(&contract->completed_demands); in generate_dma_contract()
565 return contract; in generate_dma_contract()
572 * loop. This function returns the next promise from a cyclic contract,
576 get_next_cyclic_promise(struct sun4i_dma_contract *contract) in get_next_cyclic_promise() argument
580 promise = list_first_entry_or_null(&contract->demands, in get_next_cyclic_promise()
583 list_splice_init(&contract->completed_demands, in get_next_cyclic_promise()
584 &contract->demands); in get_next_cyclic_promise()
585 promise = list_first_entry(&contract->demands, in get_next_cyclic_promise()
593 * Free a contract and all its associated promises
597 struct sun4i_dma_contract *contract = to_sun4i_dma_contract(vd); in sun4i_dma_free_contract() local
601 list_for_each_entry_safe(promise, tmp, &contract->demands, list) in sun4i_dma_free_contract()
604 list_for_each_entry_safe(promise, tmp, &contract->completed_demands, list) in sun4i_dma_free_contract()
607 kfree(contract); in sun4i_dma_free_contract()
617 struct sun4i_dma_contract *contract; in sun4i_dma_prep_dma_memcpy() local
619 contract = generate_dma_contract(); in sun4i_dma_prep_dma_memcpy()
620 if (!contract) in sun4i_dma_prep_dma_memcpy()
640 kfree(contract); in sun4i_dma_prep_dma_memcpy()
653 /* Fill the contract with our only promise */ in sun4i_dma_prep_dma_memcpy()
654 list_add_tail(&promise->list, &contract->demands); in sun4i_dma_prep_dma_memcpy()
657 return vchan_tx_prep(&vchan->vc, &contract->vd, flags); in sun4i_dma_prep_dma_memcpy()
668 struct sun4i_dma_contract *contract; in sun4i_dma_prep_dma_cyclic() local
679 contract = generate_dma_contract(); in sun4i_dma_prep_dma_cyclic()
680 if (!contract) in sun4i_dma_prep_dma_cyclic()
683 contract->is_cyclic = 1; in sun4i_dma_prep_dma_cyclic()
763 /* Then add it to the contract */ in sun4i_dma_prep_dma_cyclic()
764 list_add_tail(&promise->list, &contract->demands); in sun4i_dma_prep_dma_cyclic()
768 return vchan_tx_prep(&vchan->vc, &contract->vd, flags); in sun4i_dma_prep_dma_cyclic()
779 struct sun4i_dma_contract *contract; in sun4i_dma_prep_slave_sg() local
794 contract = generate_dma_contract(); in sun4i_dma_prep_slave_sg()
795 if (!contract) in sun4i_dma_prep_slave_sg()
856 /* Then add it to the contract */ in sun4i_dma_prep_slave_sg()
857 list_add_tail(&promise->list, &contract->demands); in sun4i_dma_prep_slave_sg()
861 * Once we've got all the promises ready, add the contract in sun4i_dma_prep_slave_sg()
864 return vchan_tx_prep(&vchan->vc, &contract->vd, flags); in sun4i_dma_prep_slave_sg()
949 struct sun4i_dma_contract *contract; in sun4i_dma_tx_status() local
964 contract = to_sun4i_dma_contract(vd); in sun4i_dma_tx_status()
966 list_for_each_entry(promise, &contract->demands, list) in sun4i_dma_tx_status()
974 promise = list_first_entry_or_null(&contract->demands, in sun4i_dma_tx_status()
1015 struct sun4i_dma_contract *contract; in sun4i_dma_interrupt() local
1032 contract = vchan->contract; in sun4i_dma_interrupt()
1047 &contract->completed_demands); in sun4i_dma_interrupt()
1062 if (contract->is_cyclic) { in sun4i_dma_interrupt()
1063 promise = get_next_cyclic_promise(contract); in sun4i_dma_interrupt()
1066 vchan_cyclic_callback(&contract->vd); in sun4i_dma_interrupt()
1079 if (contract->is_cyclic) in sun4i_dma_interrupt()
1080 vchan_cyclic_callback(&contract->vd); in sun4i_dma_interrupt()