Lines Matching +full:1 +full:w

3  * SImple Tiler Allocator (SiTA): 2D and 1D allocation(reservation) algorithm
23 * w width in slots
28 static void free_slots(unsigned long pos, u16 w, u16 h, in free_slots() argument
34 bitmap_clear(map, pos, w); in free_slots()
38 * w width in 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()
55 if (bit - *pos >= w) { in r2l_b2t_1d()
57 bitmap_set(map, *pos, w); in r2l_b2t_1d()
62 search_count = num_bits - bit + w; in r2l_b2t_1d()
63 *pos = bit - w; in r2l_b2t_1d()
70 * w = width in slots
72 * a = align in slots (mask, 2^n-1, 0 is unaligned)
79 static int l2r_t2b(u16 w, u16 h, u16 a, s16 offset, in l2r_t2b() argument
90 /* reset alignment to 1 if we are matching a specific offset */ in l2r_t2b()
91 /* adjust alignment - 1 to get to the format expected in bitmaps */ in l2r_t2b()
92 a = (offset > 0) ? 0 : a - 1; in l2r_t2b()
97 *pos = bitmap_find_next_zero_area(map, num_bits, curr_bit, w, in l2r_t2b()
107 if ((*pos % slot_stride) + w > slot_stride) { in l2r_t2b()
120 bitmap_set(mask, (*pos % BITS_PER_LONG), w); in l2r_t2b()
126 for (i = 1; i < h; i++) { in l2r_t2b()
129 (*pos % BITS_PER_LONG) + w)) { in l2r_t2b()
142 curr_bit = *pos + a + 1; in l2r_t2b()
148 bitmap_set(map, index, w); in l2r_t2b()
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()
173 static s32 sita_reserve_2d(struct tcm *tcm, u16 h, u16 w, u16 align, in sita_reserve_2d() argument
181 ret = l2r_t2b(w, h, align, offset, &pos, slot_bytes, tcm->bitmap, in sita_reserve_2d()
187 area->p1.x = area->p0.x + w - 1; in sita_reserve_2d()
188 area->p1.y = area->p0.y + h - 1; in sita_reserve_2d()
203 u16 w, h; in sita_free() local
207 w = area->p1.x - area->p0.x + 1; in sita_free()
208 h = area->p1.y - area->p0.y + 1; in sita_free()
210 w = area->p1.x + area->p1.y * tcm->width - pos + 1; in sita_free()
211 h = 1; in sita_free()
215 free_slots(pos, w, h, tcm->bitmap, tcm->width); in sita_free()
241 tcm->bitmap = (unsigned long *)(tcm + 1); in sita_init()