• Home
  • Raw
  • Download

Lines Matching refs:tcm

164 static s32 sita_reserve_1d(struct tcm *tcm, u32 num_slots,  in sita_reserve_1d()  argument
170 spin_lock(&(tcm->lock)); in sita_reserve_1d()
171 ret = r2l_b2t_1d(num_slots, &pos, tcm->bitmap, tcm->map_size); in sita_reserve_1d()
173 area->p0.x = pos % tcm->width; in sita_reserve_1d()
174 area->p0.y = pos / tcm->width; in sita_reserve_1d()
175 area->p1.x = (pos + num_slots - 1) % tcm->width; in sita_reserve_1d()
176 area->p1.y = (pos + num_slots - 1) / tcm->width; in sita_reserve_1d()
178 spin_unlock(&(tcm->lock)); in sita_reserve_1d()
183 static s32 sita_reserve_2d(struct tcm *tcm, u16 h, u16 w, u16 align, in sita_reserve_2d() argument
190 spin_lock(&(tcm->lock)); in sita_reserve_2d()
191 ret = l2r_t2b(w, h, align, offset, &pos, slot_bytes, tcm->bitmap, in sita_reserve_2d()
192 tcm->map_size, tcm->width); in sita_reserve_2d()
195 area->p0.x = pos % tcm->width; in sita_reserve_2d()
196 area->p0.y = pos / tcm->width; in sita_reserve_2d()
200 spin_unlock(&(tcm->lock)); in sita_reserve_2d()
205 static void sita_deinit(struct tcm *tcm) in sita_deinit() argument
207 kfree(tcm); in sita_deinit()
210 static s32 sita_free(struct tcm *tcm, struct tcm_area *area) in sita_free() argument
215 pos = area->p0.x + area->p0.y * tcm->width; in sita_free()
220 w = area->p1.x + area->p1.y * tcm->width - pos + 1; in sita_free()
224 spin_lock(&(tcm->lock)); in sita_free()
225 free_slots(pos, w, h, tcm->bitmap, tcm->width); in sita_free()
226 spin_unlock(&(tcm->lock)); in sita_free()
230 struct tcm *sita_init(u16 width, u16 height) in sita_init()
232 struct tcm *tcm; in sita_init() local
238 tcm = kzalloc(sizeof(*tcm) + map_size, GFP_KERNEL); in sita_init()
239 if (!tcm) in sita_init()
243 tcm->height = height; in sita_init()
244 tcm->width = width; in sita_init()
245 tcm->reserve_2d = sita_reserve_2d; in sita_init()
246 tcm->reserve_1d = sita_reserve_1d; in sita_init()
247 tcm->free = sita_free; in sita_init()
248 tcm->deinit = sita_deinit; in sita_init()
250 spin_lock_init(&tcm->lock); in sita_init()
251 tcm->bitmap = (unsigned long *)(tcm + 1); in sita_init()
252 bitmap_clear(tcm->bitmap, 0, width*height); in sita_init()
254 tcm->map_size = width*height; in sita_init()
256 return tcm; in sita_init()
259 kfree(tcm); in sita_init()