Lines Matching +full:down +full:- +full:scaling
2 * Copyright (C) 2011-2013 Intel Corporation
33 * drm_rect_intersect - intersect two rectangles
46 r1->x1 = max(r1->x1, r2->x1); in drm_rect_intersect()
47 r1->y1 = max(r1->y1, r2->y1); in drm_rect_intersect()
48 r1->x2 = min(r1->x2, r2->x2); in drm_rect_intersect()
49 r1->y2 = min(r1->y2, r2->y2); in drm_rect_intersect()
65 tmp = mul_u32_u32(src, dst - *clip); in clip_scaled()
78 * drm_rect_clip_scaled - perform a scaled clip operation
84 * the corresponding amounts, retaining the vertical and horizontal scaling
97 diff = clip->x1 - dst->x1; in drm_rect_clip_scaled()
102 src->x1 = src->x2 - new_src_w; in drm_rect_clip_scaled()
103 dst->x1 += diff; in drm_rect_clip_scaled()
105 diff = clip->y1 - dst->y1; in drm_rect_clip_scaled()
110 src->y1 = src->y2 - new_src_h; in drm_rect_clip_scaled()
111 dst->y1 += diff; in drm_rect_clip_scaled()
113 diff = dst->x2 - clip->x2; in drm_rect_clip_scaled()
118 src->x2 = src->x1 + new_src_w; in drm_rect_clip_scaled()
119 dst->x2 -= diff; in drm_rect_clip_scaled()
121 diff = dst->y2 - clip->y2; in drm_rect_clip_scaled()
126 src->y2 = src->y1 + new_src_h; in drm_rect_clip_scaled()
127 dst->y2 -= diff; in drm_rect_clip_scaled()
139 return -EINVAL; in drm_calc_scale()
153 * drm_rect_calc_hscale - calculate the horizontal scaling factor
156 * @min_hscale: minimum allowed horizontal scaling factor
157 * @max_hscale: maximum allowed horizontal scaling factor
159 * Calculate the horizontal scaling factor as
162 * If the scale is below 1 << 16, round down. If the scale is above
167 * The horizontal scaling factor, or errno of out of limits.
181 return -ERANGE; in drm_rect_calc_hscale()
188 * drm_rect_calc_vscale - calculate the vertical scaling factor
191 * @min_vscale: minimum allowed vertical scaling factor
192 * @max_vscale: maximum allowed vertical scaling factor
194 * Calculate the vertical scaling factor as
197 * If the scale is below 1 << 16, round down. If the scale is above
202 * The vertical scaling factor, or errno of out of limits.
216 return -ERANGE; in drm_rect_calc_vscale()
223 * drm_rect_debug_print - print the rectangle information
238 * drm_rect_rotate - Rotate the rectangle
263 r->x1 = width - tmp.x2; in drm_rect_rotate()
264 r->x2 = width - tmp.x1; in drm_rect_rotate()
268 r->y1 = height - tmp.y2; in drm_rect_rotate()
269 r->y2 = height - tmp.y1; in drm_rect_rotate()
278 r->x1 = tmp.y1; in drm_rect_rotate()
279 r->x2 = tmp.y2; in drm_rect_rotate()
280 r->y1 = width - tmp.x2; in drm_rect_rotate()
281 r->y2 = width - tmp.x1; in drm_rect_rotate()
285 r->x1 = width - tmp.x2; in drm_rect_rotate()
286 r->x2 = width - tmp.x1; in drm_rect_rotate()
287 r->y1 = height - tmp.y2; in drm_rect_rotate()
288 r->y2 = height - tmp.y1; in drm_rect_rotate()
292 r->x1 = height - tmp.y2; in drm_rect_rotate()
293 r->x2 = height - tmp.y1; in drm_rect_rotate()
294 r->y1 = tmp.x1; in drm_rect_rotate()
295 r->y2 = tmp.x2; in drm_rect_rotate()
304 * drm_rect_rotate_inv - Inverse rotate the rectangle
338 r->x1 = width - tmp.y2; in drm_rect_rotate_inv()
339 r->x2 = width - tmp.y1; in drm_rect_rotate_inv()
340 r->y1 = tmp.x1; in drm_rect_rotate_inv()
341 r->y2 = tmp.x2; in drm_rect_rotate_inv()
345 r->x1 = width - tmp.x2; in drm_rect_rotate_inv()
346 r->x2 = width - tmp.x1; in drm_rect_rotate_inv()
347 r->y1 = height - tmp.y2; in drm_rect_rotate_inv()
348 r->y2 = height - tmp.y1; in drm_rect_rotate_inv()
352 r->x1 = tmp.y1; in drm_rect_rotate_inv()
353 r->x2 = tmp.y2; in drm_rect_rotate_inv()
354 r->y1 = height - tmp.x2; in drm_rect_rotate_inv()
355 r->y2 = height - tmp.x1; in drm_rect_rotate_inv()
365 r->x1 = width - tmp.x2; in drm_rect_rotate_inv()
366 r->x2 = width - tmp.x1; in drm_rect_rotate_inv()
370 r->y1 = height - tmp.y2; in drm_rect_rotate_inv()
371 r->y2 = height - tmp.y1; in drm_rect_rotate_inv()