Lines Matching defs:contract

149 	struct sun4i_dma_contract	*contract;
163 /* A contract is a set of promises */
326 * from the next pending contract.
334 struct sun4i_dma_contract *contract = NULL;
358 /* Figure out which contract we're working with today */
362 "No pending contract found");
367 contract = to_sun4i_dma_contract(vd);
368 if (list_empty(&contract->demands)) {
369 /* The contract has been completed so mark it as such */
370 list_del(&contract->vd.node);
371 vchan_cookie_complete(&contract->vd);
373 "Empty contract found and marked complete");
375 } while (list_empty(&contract->demands));
378 promise = list_first_entry(&contract->demands,
384 vchan->contract = contract;
386 set_pchan_interrupt(priv, pchan, contract->use_half_int, 1);
434 * Generate a promise, to be used in a normal DMA contract.
438 * promise will live in the demands list on a contract. Once it has been
440 * All linked promises will be freed when the corresponding contract is freed
501 * Generate a promise, to be used in a dedicated DMA contract.
505 * promise will live in the demands list on a contract. Once it has been
507 * All linked promises will be freed when the corresponding contract is freed
558 * Generate a contract
561 * linked lists, we need to implement SG via software. We use a contract
567 struct sun4i_dma_contract *contract;
569 contract = kzalloc(sizeof(*contract), GFP_NOWAIT);
570 if (!contract)
573 INIT_LIST_HEAD(&contract->demands);
574 INIT_LIST_HEAD(&contract->completed_demands);
576 return contract;
583 * loop. This function returns the next promise from a cyclic contract,
587 get_next_cyclic_promise(struct sun4i_dma_contract *contract)
591 promise = list_first_entry_or_null(&contract->demands,
594 list_splice_init(&contract->completed_demands,
595 &contract->demands);
596 promise = list_first_entry(&contract->demands,
604 * Free a contract and all its associated promises
608 struct sun4i_dma_contract *contract = to_sun4i_dma_contract(vd);
612 list_for_each_entry_safe(promise, tmp, &contract->demands, list)
615 list_for_each_entry_safe(promise, tmp, &contract->completed_demands, list)
618 kfree(contract);
628 struct sun4i_dma_contract *contract;
630 contract = generate_dma_contract();
631 if (!contract)
651 kfree(contract);
664 /* Fill the contract with our only promise */
665 list_add_tail(&promise->list, &contract->demands);
668 return vchan_tx_prep(&vchan->vc, &contract->vd, flags);
679 struct sun4i_dma_contract *contract;
690 contract = generate_dma_contract();
691 if (!contract)
694 contract->is_cyclic = 1;
756 contract->use_half_int = 1;
783 /* Then add it to the contract */
784 list_add_tail(&promise->list, &contract->demands);
788 return vchan_tx_prep(&vchan->vc, &contract->vd, flags);
799 struct sun4i_dma_contract *contract;
814 contract = generate_dma_contract();
815 if (!contract)
876 /* Then add it to the contract */
877 list_add_tail(&promise->list, &contract->demands);
881 * Once we've got all the promises ready, add the contract
884 return vchan_tx_prep(&vchan->vc, &contract->vd, flags);
969 struct sun4i_dma_contract *contract;
984 contract = to_sun4i_dma_contract(vd);
986 list_for_each_entry(promise, &contract->demands, list)
994 promise = list_first_entry_or_null(&contract->demands,
1035 struct sun4i_dma_contract *contract;
1052 contract = vchan->contract;
1066 &contract->completed_demands);
1081 if (contract->is_cyclic) {
1082 promise = get_next_cyclic_promise(contract);
1085 vchan_cyclic_callback(&contract->vd);
1098 if (contract->is_cyclic)
1099 vchan_cyclic_callback(&contract->vd);