Lines Matching full:rx
49 * through the rx.channel pointer. This delineates ownership of the cache
68 } rx; member
103 u32 rx = tegra_ivc_header_read_field(map, rx.count); in tegra_ivc_empty() local
115 if (tx - rx > ivc->num_frames) in tegra_ivc_empty()
118 return tx == rx; in tegra_ivc_empty()
124 u32 rx = tegra_ivc_header_read_field(map, rx.count); in tegra_ivc_full() local
130 return tx - rx >= ivc->num_frames; in tegra_ivc_full()
136 u32 rx = tegra_ivc_header_read_field(map, rx.count); in tegra_ivc_available() local
144 return tx - rx; in tegra_ivc_available()
161 unsigned int count = tegra_ivc_header_read_field(&ivc->rx.map, rx.count); in tegra_ivc_advance_rx()
163 tegra_ivc_header_write_field(&ivc->rx.map, rx.count, count + 1); in tegra_ivc_advance_rx()
165 if (ivc->rx.position == ivc->num_frames - 1) in tegra_ivc_advance_rx()
166 ivc->rx.position = 0; in tegra_ivc_advance_rx()
168 ivc->rx.position++; in tegra_ivc_advance_rx()
181 * asynchronous transition of rx.channel->state to in tegra_ivc_check_read()
195 if (!tegra_ivc_empty(ivc, &ivc->rx.map)) in tegra_ivc_check_read()
198 tegra_ivc_invalidate(ivc, ivc->rx.phys + offset); in tegra_ivc_check_read()
200 if (tegra_ivc_empty(ivc, &ivc->rx.map)) in tegra_ivc_check_read()
208 unsigned int offset = offsetof(struct tegra_ivc_header, rx.count); in tegra_ivc_check_write()
278 /* directly peek at the next frame rx'ed */
291 * Order observation of ivc->rx.position potentially indicating new in tegra_ivc_read_get_next_frame()
296 tegra_ivc_invalidate_frame(ivc, ivc->rx.phys, ivc->rx.position, 0, in tegra_ivc_read_get_next_frame()
299 return tegra_ivc_frame_virt(ivc, &ivc->rx.map, ivc->rx.position, map); in tegra_ivc_read_get_next_frame()
305 unsigned int rx = offsetof(struct tegra_ivc_header, rx.count); in tegra_ivc_read_advance() local
320 tegra_ivc_flush(ivc, ivc->rx.phys + rx); in tegra_ivc_read_advance()
323 * Ensure our write to ivc->rx.position occurs before our read from in tegra_ivc_read_advance()
333 tegra_ivc_invalidate(ivc, ivc->rx.phys + tx); in tegra_ivc_read_advance()
335 if (tegra_ivc_available(ivc, &ivc->rx.map) == ivc->num_frames - 1) in tegra_ivc_read_advance()
359 unsigned int rx = offsetof(struct tegra_ivc_header, rx.count); in tegra_ivc_write_advance() local
380 * ivc->rx.position. in tegra_ivc_write_advance()
389 tegra_ivc_invalidate(ivc, ivc->tx.phys + rx); in tegra_ivc_write_advance()
434 tegra_ivc_invalidate(ivc, ivc->rx.phys + offset); in tegra_ivc_notified()
435 rx_state = tegra_ivc_header_read_field(&ivc->rx.map, tx.state); in tegra_ivc_notified()
453 tegra_ivc_header_write_field(&ivc->rx.map, rx.count, 0); in tegra_ivc_notified()
456 ivc->rx.position = 0; in tegra_ivc_notified()
492 tegra_ivc_header_write_field(&ivc->rx.map, rx.count, 0); in tegra_ivc_notified()
495 ivc->rx.position = 0; in tegra_ivc_notified()
574 static int tegra_ivc_check_params(unsigned long rx, unsigned long tx, in tegra_ivc_check_params() argument
579 BUILD_BUG_ON(!IS_ALIGNED(offsetof(struct tegra_ivc_header, rx.count), in tegra_ivc_check_params()
598 if (!IS_ALIGNED(rx, TEGRA_IVC_ALIGN)) { in tegra_ivc_check_params()
599 pr_err("IVC channel start not aligned: %#lx\n", rx); in tegra_ivc_check_params()
608 if (rx < tx) { in tegra_ivc_check_params()
609 if (rx + frame_size * num_frames > tx) { in tegra_ivc_check_params()
611 rx, frame_size * num_frames, tx); in tegra_ivc_check_params()
615 if (tx + frame_size * num_frames > rx) { in tegra_ivc_check_params()
617 tx, frame_size * num_frames, rx); in tegra_ivc_check_params()
646 int tegra_ivc_init(struct tegra_ivc *ivc, struct device *peer, const struct iosys_map *rx, in tegra_ivc_init() argument
665 err = tegra_ivc_check_params(iosys_map_get_address(rx), iosys_map_get_address(tx), in tegra_ivc_init()
673 ivc->rx.phys = dma_map_single(peer, iosys_map_get_vaddr(rx), queue_size, in tegra_ivc_init()
675 if (dma_mapping_error(peer, ivc->rx.phys)) in tegra_ivc_init()
681 dma_unmap_single(peer, ivc->rx.phys, queue_size, in tegra_ivc_init()
686 ivc->rx.phys = rx_phys; in tegra_ivc_init()
690 iosys_map_copy(&ivc->rx.map, rx); in tegra_ivc_init()
703 ivc->rx.position = 0; in tegra_ivc_init()
715 dma_unmap_single(ivc->peer, ivc->rx.phys, size, in tegra_ivc_cleanup()