Lines Matching refs:tcm

42 struct tcm;
53 struct tcm *tcm; /* parent */ member
58 struct tcm { struct
71 s32 (*reserve_2d)(struct tcm *tcm, u16 height, u16 width, u8 align, argument
73 s32 (*reserve_1d)(struct tcm *tcm, u32 slots, struct tcm_area *area); argument
74 s32 (*free) (struct tcm *tcm, struct tcm_area *area); argument
75 void (*deinit) (struct tcm *tcm); argument
94 struct tcm *sita_init(u16 width, u16 height, struct tcm_pt *attr);
107 static inline void tcm_deinit(struct tcm *tcm) in tcm_deinit() argument
109 if (tcm) in tcm_deinit()
110 tcm->deinit(tcm); in tcm_deinit()
131 static inline s32 tcm_reserve_2d(struct tcm *tcm, u16 width, u16 height, in tcm_reserve_2d() argument
135 s32 res = tcm == NULL ? -ENODEV : in tcm_reserve_2d()
139 (height > tcm->height || width > tcm->width) ? -ENOMEM : 0; in tcm_reserve_2d()
143 res = tcm->reserve_2d(tcm, height, width, align, area); in tcm_reserve_2d()
144 area->tcm = res ? NULL : tcm; in tcm_reserve_2d()
163 static inline s32 tcm_reserve_1d(struct tcm *tcm, u32 slots, in tcm_reserve_1d() argument
167 s32 res = tcm == NULL ? -ENODEV : in tcm_reserve_1d()
169 slots > (tcm->width * (u32) tcm->height) ? -ENOMEM : 0; in tcm_reserve_1d()
173 res = tcm->reserve_1d(tcm, slots, area); in tcm_reserve_1d()
174 area->tcm = res ? NULL : tcm; in tcm_reserve_1d()
197 if (area && area->tcm) { in tcm_free()
198 res = area->tcm->free(area->tcm, area); in tcm_free()
200 area->tcm = NULL; in tcm_free()
225 if (slice->tcm && !slice->is2d && in tcm_slice()
227 (slice->p0.x || (slice->p1.x != slice->tcm->width - 1))) { in tcm_slice()
229 slice->p1.x = slice->tcm->width - 1; in tcm_slice()
236 parent->tcm = NULL; in tcm_slice()
243 return area && area->tcm && in tcm_area_is_valid()
245 area->p1.x < area->tcm->width && in tcm_area_is_valid()
246 area->p1.y < area->tcm->height && in tcm_area_is_valid()
250 area->p0.x < area->tcm->width && in tcm_area_is_valid()
251 area->p0.x + area->p0.y * area->tcm->width <= in tcm_area_is_valid()
252 area->p1.x + area->p1.y * area->tcm->width) || in tcm_area_is_valid()
267 i = p->x + p->y * a->tcm->width; in __tcm_is_in()
268 return i >= a->p0.x + a->p0.y * a->tcm->width && in __tcm_is_in()
269 i <= a->p1.x + a->p1.y * a->tcm->width; in __tcm_is_in()
291 area->tcm->width; in __tcm_sizeof()
306 a->p1.x = (a->p0.x + num_pg - 1) % a->tcm->width; in tcm_1d_limit()
307 a->p1.y = a->p0.y + ((a->p0.x + num_pg - 1) / a->tcm->width); in tcm_1d_limit()
326 var.tcm; tcm_slice(&safe, &var))