Lines Matching +full:offset +full:- +full:y

45 	u16 y;  member
60 unsigned int y_offset; /* offset to use for y coordinates */
68 s16 offset, u16 slot_bytes,
99 * @return 0 on success, non-0 error value on error. The call
101 * even on failure. Some error codes: -ENODEV: invalid
107 tcm->deinit(tcm); in tcm_deinit()
116 * @param align Alignment requirement for top-left corner of area. Not
120 * @param offset Offset requirement, in bytes. This is the offset
125 * @return 0 on success. Non-0 error code on failure. Also,
127 * failure. Some error codes: -ENODEV: invalid manager,
128 * -EINVAL: invalid area, -ENOMEM: not enough space for
132 u16 align, s16 offset, u16 slot_bytes, in tcm_reserve_2d() argument
136 s32 res = tcm == NULL ? -ENODEV : in tcm_reserve_2d()
139 (align & (align - 1))) ? -EINVAL : in tcm_reserve_2d()
140 (height > tcm->height || width > tcm->width) ? -ENOMEM : 0; in tcm_reserve_2d()
143 area->is2d = true; in tcm_reserve_2d()
144 res = tcm->reserve_2d(tcm, height, width, align, offset, in tcm_reserve_2d()
146 area->tcm = res ? NULL : tcm; in tcm_reserve_2d()
159 * @return 0 on success. Non-0 error code on failure. Also,
161 * failure. Some error codes: -ENODEV: invalid manager,
162 * -EINVAL: invalid area, -ENOMEM: not enough space for
169 s32 res = tcm == NULL ? -ENODEV : in tcm_reserve_1d()
170 (area == NULL || slots == 0) ? -EINVAL : in tcm_reserve_1d()
171 slots > (tcm->width * (u32) tcm->height) ? -ENOMEM : 0; 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()
190 * @return 0 on success. Non-0 error code on failure. Also, the tcm
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()
227 if (slice->tcm && !slice->is2d && in tcm_slice()
228 slice->p0.y != slice->p1.y && in tcm_slice()
229 (slice->p0.x || (slice->p1.x != slice->tcm->width - 1))) { in tcm_slice()
231 slice->p1.x = slice->tcm->width - 1; in tcm_slice()
232 slice->p1.y = (slice->p0.x) ? slice->p0.y : slice->p1.y - 1; in tcm_slice()
234 parent->p0.x = 0; in tcm_slice()
235 parent->p0.y = slice->p1.y + 1; in tcm_slice()
238 parent->tcm = NULL; in tcm_slice()
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()
265 if (a->is2d) { in __tcm_is_in()
266 return p->x >= a->p0.x && p->x <= a->p1.x && in __tcm_is_in()
267 p->y >= a->p0.y && p->y <= a->p1.y; in __tcm_is_in()
269 i = p->x + p->y * a->tcm->width; in __tcm_is_in()
270 return i >= a->p0.x + a->p0.y * a->tcm->width && in __tcm_is_in()
271 i <= a->p1.x + a->p1.y * a->tcm->width; in __tcm_is_in()
278 return area->p1.x - area->p0.x + 1; in __tcm_area_width()
284 return area->p1.y - area->p0.y + 1; in __tcm_area_height()
290 return area->is2d ? 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()
304 return -ENOMEM; in tcm_1d_limit()
306 return -EINVAL; in tcm_1d_limit()
308 a->p1.x = (a->p0.x + num_pg - 1) % a->tcm->width; in tcm_1d_limit()
309 a->p1.y = a->p0.y + ((a->p0.x + num_pg - 1) / a->tcm->width); in tcm_1d_limit()