Lines Matching refs:area
72 struct tcm_area *area);
73 s32 (*reserve_1d)(struct tcm *tcm, u32 slots, struct tcm_area *area);
74 s32 (*free) (struct tcm *tcm, struct tcm_area *area);
132 u16 align, struct tcm_area *area) in tcm_reserve_2d() argument
136 (area == NULL || width == 0 || height == 0 || in tcm_reserve_2d()
142 area->is2d = true; 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()
164 struct tcm_area *area) in tcm_reserve_1d() argument
168 (area == NULL || slots == 0) ? -EINVAL : in tcm_reserve_1d()
172 area->is2d = false; 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()
193 static inline s32 tcm_free(struct tcm_area *area) in tcm_free() argument
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()
241 static inline bool tcm_area_is_valid(struct tcm_area *area) in tcm_area_is_valid() argument
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()
247 area->p0.y <= area->p1.y && in tcm_area_is_valid()
249 ((!area->is2d && 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()
254 (area->is2d && in tcm_area_is_valid()
255 area->p0.x <= area->p1.x)); in tcm_area_is_valid()
274 static inline u16 __tcm_area_width(struct tcm_area *area) in __tcm_area_width() argument
276 return area->p1.x - area->p0.x + 1; in __tcm_area_width()
280 static inline u16 __tcm_area_height(struct tcm_area *area) in __tcm_area_height() argument
282 return area->p1.y - area->p0.y + 1; in __tcm_area_height()
286 static inline u16 __tcm_sizeof(struct tcm_area *area) in __tcm_sizeof() argument
288 return area->is2d ? in __tcm_sizeof()
289 __tcm_area_width(area) * __tcm_area_height(area) : in __tcm_sizeof()
290 (area->p1.x - area->p0.x + 1) + (area->p1.y - area->p0.y) * in __tcm_sizeof()
291 area->tcm->width; in __tcm_sizeof()
293 #define tcm_sizeof(area) __tcm_sizeof(&(area)) argument
294 #define tcm_awidth(area) __tcm_area_width(&(area)) argument
295 #define tcm_aheight(area) __tcm_area_height(&(area)) argument
296 #define tcm_is_in(pt, area) __tcm_is_in(&(pt), &(area)) argument
323 #define tcm_for_each_slice(var, area, safe) \ argument
324 for (safe = area, \