Lines Matching refs:area
69 struct tcm_area *area);
70 s32 (*reserve_1d)(struct tcm *tcm, u32 slots, struct tcm_area *area);
71 s32 (*free)(struct tcm *tcm, struct tcm_area *area);
133 struct tcm_area *area) in tcm_reserve_2d() argument
137 (area == NULL || width == 0 || height == 0 || in tcm_reserve_2d()
143 area->is2d = true; in tcm_reserve_2d()
145 slot_bytes, area); in tcm_reserve_2d()
146 area->tcm = res ? NULL : tcm; in tcm_reserve_2d()
166 struct tcm_area *area) in tcm_reserve_1d() argument
170 (area == NULL || slots == 0) ? -EINVAL : in tcm_reserve_1d()
174 area->is2d = false; in tcm_reserve_1d()
175 res = tcm->reserve_1d(tcm, slots, area); in tcm_reserve_1d()
176 area->tcm = res ? NULL : tcm; in tcm_reserve_1d()
195 static inline s32 tcm_free(struct tcm_area *area) in tcm_free() argument
199 if (area && area->tcm) { in tcm_free()
200 res = area->tcm->free(area->tcm, area); in tcm_free()
202 area->tcm = NULL; in tcm_free()
243 static inline bool tcm_area_is_valid(struct tcm_area *area) in tcm_area_is_valid() argument
245 return area && area->tcm && in tcm_area_is_valid()
247 area->p1.x < area->tcm->width && in tcm_area_is_valid()
248 area->p1.y < area->tcm->height && in tcm_area_is_valid()
249 area->p0.y <= area->p1.y && in tcm_area_is_valid()
251 ((!area->is2d && in tcm_area_is_valid()
252 area->p0.x < area->tcm->width && in tcm_area_is_valid()
253 area->p0.x + area->p0.y * area->tcm->width <= in tcm_area_is_valid()
254 area->p1.x + area->p1.y * area->tcm->width) || in tcm_area_is_valid()
256 (area->is2d && in tcm_area_is_valid()
257 area->p0.x <= area->p1.x)); in tcm_area_is_valid()
276 static inline u16 __tcm_area_width(struct tcm_area *area) in __tcm_area_width() argument
278 return area->p1.x - area->p0.x + 1; in __tcm_area_width()
282 static inline u16 __tcm_area_height(struct tcm_area *area) in __tcm_area_height() argument
284 return area->p1.y - area->p0.y + 1; in __tcm_area_height()
288 static inline u16 __tcm_sizeof(struct tcm_area *area) in __tcm_sizeof() argument
290 return area->is2d ? in __tcm_sizeof()
291 __tcm_area_width(area) * __tcm_area_height(area) : in __tcm_sizeof()
292 (area->p1.x - area->p0.x + 1) + (area->p1.y - area->p0.y) * in __tcm_sizeof()
293 area->tcm->width; in __tcm_sizeof()
295 #define tcm_sizeof(area) __tcm_sizeof(&(area)) argument
296 #define tcm_awidth(area) __tcm_area_width(&(area)) argument
297 #define tcm_aheight(area) __tcm_area_height(&(area)) argument
298 #define tcm_is_in(pt, area) __tcm_is_in(&(pt), &(area)) argument
325 #define tcm_for_each_slice(var, area, safe) \ argument
326 for (safe = area, \