Lines Matching refs:dst
55 static u32 clip_scaled(int src, int dst, int *clip)
59 if (dst == 0)
63 *clip = min(*clip, dst);
65 tmp = mul_u32_u32(src, dst - *clip);
71 if (src < (dst << 16))
72 return DIV_ROUND_UP_ULL(tmp, dst);
74 return DIV_ROUND_DOWN_ULL(tmp, dst);
80 * @dst: destination window rectangle
83 * Clip rectangle @dst by rectangle @clip. Clip rectangle @src by
85 * factors from @src to @dst.
89 * %true if rectangle @dst is still visible after being clipped,
92 bool drm_rect_clip_scaled(struct drm_rect *src, struct drm_rect *dst,
97 diff = clip->x1 - dst->x1;
100 drm_rect_width(dst), &diff);
103 dst->x1 += diff;
105 diff = clip->y1 - dst->y1;
108 drm_rect_height(dst), &diff);
111 dst->y1 += diff;
113 diff = dst->x2 - clip->x2;
116 drm_rect_width(dst), &diff);
119 dst->x2 -= diff;
121 diff = dst->y2 - clip->y2;
124 drm_rect_height(dst), &diff);
127 dst->y2 -= diff;
130 return drm_rect_visible(dst);
134 static int drm_calc_scale(int src, int dst)
138 if (WARN_ON(src < 0 || dst < 0))
141 if (dst == 0)
144 if (src > (dst << 16))
145 return DIV_ROUND_UP(src, dst);
147 scale = src / dst;
155 * @dst: destination window rectangle
160 * (@src width) / (@dst width).
170 const struct drm_rect *dst,
174 int dst_w = drm_rect_width(dst);
190 * @dst: destination window rectangle
195 * (@src height) / (@dst height).
205 const struct drm_rect *dst,
209 int dst_h = drm_rect_height(dst);