Lines Matching refs:pos
28 static void free_slots(unsigned long pos, u16 w, u16 h, in free_slots() argument
33 for (i = 0; i < h; i++, pos += stride) in free_slots()
34 bitmap_clear(map, pos, w); in free_slots()
43 static int r2l_b2t_1d(u16 w, unsigned long *pos, unsigned long *map, in r2l_b2t_1d() argument
50 *pos = num_bits - w; in r2l_b2t_1d()
53 bit = find_next_bit(map, num_bits, *pos); in r2l_b2t_1d()
55 if (bit - *pos >= w) { in r2l_b2t_1d()
57 bitmap_set(map, *pos, w); in r2l_b2t_1d()
63 *pos = bit - w; in r2l_b2t_1d()
80 unsigned long *pos, unsigned long slot_bytes, in l2r_t2b() argument
97 *pos = bitmap_find_next_zero_area(map, num_bits, curr_bit, w, in l2r_t2b()
101 if (bit_offset > 0 && (*pos % slots_per_band != bit_offset)) { in l2r_t2b()
102 curr_bit = ALIGN(*pos, slots_per_band) + bit_offset; in l2r_t2b()
107 if ((*pos % slot_stride) + w > slot_stride) { in l2r_t2b()
108 curr_bit = ALIGN(*pos, slot_stride) + bit_offset; in l2r_t2b()
115 if ((*pos + slot_stride * h) > num_bits) in l2r_t2b()
120 bitmap_set(mask, (*pos % BITS_PER_LONG), w); in l2r_t2b()
127 index = *pos / BITS_PER_LONG + i * 8; in l2r_t2b()
129 (*pos % BITS_PER_LONG) + w)) { in l2r_t2b()
140 curr_bit = ALIGN(*pos, slots_per_band) + bit_offset; in l2r_t2b()
142 curr_bit = *pos + a + 1; in l2r_t2b()
147 for (i = 0, index = *pos; i < h; i++, index += slot_stride) in l2r_t2b()
157 unsigned long pos; in sita_reserve_1d() local
161 ret = r2l_b2t_1d(num_slots, &pos, tcm->bitmap, tcm->map_size); in sita_reserve_1d()
163 area->p0.x = pos % tcm->width; in sita_reserve_1d()
164 area->p0.y = pos / tcm->width; in sita_reserve_1d()
165 area->p1.x = (pos + num_slots - 1) % tcm->width; in sita_reserve_1d()
166 area->p1.y = (pos + num_slots - 1) / tcm->width; in sita_reserve_1d()
177 unsigned long pos; in sita_reserve_2d() local
181 ret = l2r_t2b(w, h, align, offset, &pos, slot_bytes, tcm->bitmap, in sita_reserve_2d()
185 area->p0.x = pos % tcm->width; in sita_reserve_2d()
186 area->p0.y = pos / tcm->width; in sita_reserve_2d()
202 unsigned long pos; in sita_free() local
205 pos = area->p0.x + area->p0.y * tcm->width; in sita_free()
210 w = area->p1.x + area->p1.y * tcm->width - pos + 1; in sita_free()
215 free_slots(pos, w, h, tcm->bitmap, tcm->width); in sita_free()