Lines Matching refs:subbuf_size
560 * @subbuf_size: size of sub-buffers
574 size_t subbuf_size,
582 if (!(subbuf_size && n_subbufs))
591 chan->subbuf_size = subbuf_size;
592 chan->alloc_size = FIX_SIZE(subbuf_size * n_subbufs);
728 if (unlikely(length > buf->chan->subbuf_size))
731 if (buf->offset != buf->chan->subbuf_size + 1) {
732 buf->prev_padding = buf->chan->subbuf_size - buf->offset;
738 buf->chan->subbuf_size -
741 buf->early_bytes += buf->chan->subbuf_size -
756 new = buf->start + new_subbuf * buf->chan->subbuf_size;
759 buf->offset = buf->chan->subbuf_size + 1;
765 if (unlikely(length + buf->offset > buf->chan->subbuf_size))
834 chan->last_toobig, chan->subbuf_size);
944 size_t subbuf_size = buf->chan->subbuf_size;
952 if (buf->bytes_consumed + bytes_consumed > subbuf_size) {
961 read_subbuf = read_pos / buf->chan->subbuf_size;
962 if (buf->bytes_consumed + buf->padding[read_subbuf] == subbuf_size) {
964 (buf->offset == subbuf_size))
976 size_t subbuf_size = buf->chan->subbuf_size;
985 if (unlikely(buf->offset > subbuf_size)) {
997 produced = (produced % n_subbufs) * subbuf_size + buf->offset;
998 consumed = (consumed % n_subbufs) * subbuf_size + buf->bytes_consumed;
1001 produced += n_subbufs * subbuf_size;
1004 if (buf->offset == subbuf_size &&
1023 size_t subbuf_size = buf->chan->subbuf_size;
1025 write_subbuf = (buf->data - buf->start) / subbuf_size;
1026 write_offset = buf->offset > subbuf_size ? subbuf_size : buf->offset;
1027 read_subbuf = read_pos / subbuf_size;
1028 read_offset = read_pos % subbuf_size;
1035 avail = (subbuf_size - padding) - read_offset;
1053 size_t subbuf_size = buf->chan->subbuf_size;
1058 read_pos = consumed * subbuf_size + buf->bytes_consumed;
1059 read_subbuf = read_pos / subbuf_size;
1061 padding_start = (read_subbuf + 1) * subbuf_size - padding;
1062 padding_end = (read_subbuf + 1) * subbuf_size;
1065 read_pos = read_subbuf * subbuf_size;
1082 size_t subbuf_size = buf->chan->subbuf_size;
1085 read_subbuf = read_pos / subbuf_size;
1087 if (read_pos % subbuf_size + count + padding == subbuf_size)
1088 end_pos = (read_subbuf + 1) * subbuf_size;
1091 if (end_pos >= subbuf_size * n_subbufs)
1186 if (rbuf->bytes_consumed >= rbuf->chan->subbuf_size) {
1188 rbuf->bytes_consumed %= rbuf->chan->subbuf_size;
1227 unsigned int subbuf_size = rbuf->chan->subbuf_size;
1231 size_t read_subbuf = read_start / subbuf_size;
1233 size_t nonpad_end = read_subbuf * subbuf_size + subbuf_size - padding;
1254 if (len > (subbuf_size - read_start % subbuf_size))
1255 len = subbuf_size - read_start % subbuf_size;