Lines Matching +full:down +full:- +full:scaling
2 * Copyright (C) 2011-2013 Intel Corporation
31 * drm_rect_intersect - intersect two rectangles
44 r1->x1 = max(r1->x1, r2->x1); in drm_rect_intersect()
45 r1->y1 = max(r1->y1, r2->y1); in drm_rect_intersect()
46 r1->x2 = min(r1->x2, r2->x2); in drm_rect_intersect()
47 r1->y2 = min(r1->y2, r2->y2); in drm_rect_intersect()
60 tmp = mul_u32_u32(src, dst - clip); in clip_scaled()
73 * drm_rect_clip_scaled - perform a scaled clip operation
90 diff = clip->x1 - dst->x1; in drm_rect_clip_scaled()
95 src->x1 = clamp_t(int64_t, src->x2 - new_src_w, INT_MIN, INT_MAX); in drm_rect_clip_scaled()
96 dst->x1 = clip->x1; in drm_rect_clip_scaled()
98 diff = clip->y1 - dst->y1; in drm_rect_clip_scaled()
103 src->y1 = clamp_t(int64_t, src->y2 - new_src_h, INT_MIN, INT_MAX); in drm_rect_clip_scaled()
104 dst->y1 = clip->y1; in drm_rect_clip_scaled()
106 diff = dst->x2 - clip->x2; in drm_rect_clip_scaled()
111 src->x2 = clamp_t(int64_t, src->x1 + new_src_w, INT_MIN, INT_MAX); in drm_rect_clip_scaled()
112 dst->x2 = clip->x2; in drm_rect_clip_scaled()
114 diff = dst->y2 - clip->y2; in drm_rect_clip_scaled()
119 src->y2 = clamp_t(int64_t, src->y1 + new_src_h, INT_MIN, INT_MAX); in drm_rect_clip_scaled()
120 dst->y2 = clip->y2; in drm_rect_clip_scaled()
132 return -EINVAL; in drm_calc_scale()
146 * drm_rect_calc_hscale - calculate the horizontal scaling factor
149 * @min_hscale: minimum allowed horizontal scaling factor
150 * @max_hscale: maximum allowed horizontal scaling factor
152 * Calculate the horizontal scaling factor as
155 * If the scale is below 1 << 16, round down. If the scale is above
160 * The horizontal scaling factor, or errno of out of limits.
174 return -ERANGE; in drm_rect_calc_hscale()
181 * drm_rect_calc_vscale - calculate the vertical scaling factor
184 * @min_vscale: minimum allowed vertical scaling factor
185 * @max_vscale: maximum allowed vertical scaling factor
187 * Calculate the vertical scaling factor as
190 * If the scale is below 1 << 16, round down. If the scale is above
195 * The vertical scaling factor, or errno of out of limits.
209 return -ERANGE; in drm_rect_calc_vscale()
216 * drm_calc_hscale_relaxed - calculate the horizontal scaling factor
219 * @min_hscale: minimum allowed horizontal scaling factor
220 * @max_hscale: maximum allowed horizontal scaling factor
222 * Calculate the horizontal scaling factor as
225 * If the calculated scaling factor is below @min_vscale,
228 * If the calculated scaling factor is above @max_vscale,
231 * If the scale is below 1 << 16, round down. If the scale is above
236 * The horizontal scaling factor.
252 drm_rect_adjust_size(dst, max_dst_w - dst_w, 0); in drm_rect_calc_hscale_relaxed()
260 drm_rect_adjust_size(src, max_src_w - src_w, 0); in drm_rect_calc_hscale_relaxed()
270 * drm_rect_calc_vscale_relaxed - calculate the vertical scaling factor
273 * @min_vscale: minimum allowed vertical scaling factor
274 * @max_vscale: maximum allowed vertical scaling factor
276 * Calculate the vertical scaling factor as
279 * If the calculated scaling factor is below @min_vscale,
282 * If the calculated scaling factor is above @max_vscale,
285 * If the scale is below 1 << 16, round down. If the scale is above
290 * The vertical scaling factor.
306 drm_rect_adjust_size(dst, 0, max_dst_h - dst_h); in drm_rect_calc_vscale_relaxed()
314 drm_rect_adjust_size(src, 0, max_src_h - src_h); in drm_rect_calc_vscale_relaxed()
324 * drm_rect_debug_print - print the rectangle information
339 * drm_rect_rotate - Rotate the rectangle
364 r->x1 = width - tmp.x2; in drm_rect_rotate()
365 r->x2 = width - tmp.x1; in drm_rect_rotate()
369 r->y1 = height - tmp.y2; in drm_rect_rotate()
370 r->y2 = height - tmp.y1; in drm_rect_rotate()
379 r->x1 = tmp.y1; in drm_rect_rotate()
380 r->x2 = tmp.y2; in drm_rect_rotate()
381 r->y1 = width - tmp.x2; in drm_rect_rotate()
382 r->y2 = width - tmp.x1; in drm_rect_rotate()
386 r->x1 = width - tmp.x2; in drm_rect_rotate()
387 r->x2 = width - tmp.x1; in drm_rect_rotate()
388 r->y1 = height - tmp.y2; in drm_rect_rotate()
389 r->y2 = height - tmp.y1; in drm_rect_rotate()
393 r->x1 = height - tmp.y2; in drm_rect_rotate()
394 r->x2 = height - tmp.y1; in drm_rect_rotate()
395 r->y1 = tmp.x1; in drm_rect_rotate()
396 r->y2 = tmp.x2; in drm_rect_rotate()
405 * drm_rect_rotate_inv - Inverse rotate the rectangle
439 r->x1 = width - tmp.y2; in drm_rect_rotate_inv()
440 r->x2 = width - tmp.y1; in drm_rect_rotate_inv()
441 r->y1 = tmp.x1; in drm_rect_rotate_inv()
442 r->y2 = tmp.x2; in drm_rect_rotate_inv()
446 r->x1 = width - tmp.x2; in drm_rect_rotate_inv()
447 r->x2 = width - tmp.x1; in drm_rect_rotate_inv()
448 r->y1 = height - tmp.y2; in drm_rect_rotate_inv()
449 r->y2 = height - tmp.y1; in drm_rect_rotate_inv()
453 r->x1 = tmp.y1; in drm_rect_rotate_inv()
454 r->x2 = tmp.y2; in drm_rect_rotate_inv()
455 r->y1 = height - tmp.x2; in drm_rect_rotate_inv()
456 r->y2 = height - tmp.x1; in drm_rect_rotate_inv()
466 r->x1 = width - tmp.x2; in drm_rect_rotate_inv()
467 r->x2 = width - tmp.x1; in drm_rect_rotate_inv()
471 r->y1 = height - tmp.y2; in drm_rect_rotate_inv()
472 r->y2 = height - tmp.y1; in drm_rect_rotate_inv()