Skip to content

Commit 2ebb242

Browse files
committed
drm: Nuke drm_calc_{h,v}scale_relaxed()
The fuzzy drm_calc_{h,v}scale_relaxed() helpers are no longer used. Throw them in the bin. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190206183204.21127-1-ville.syrjala@linux.intel.com Acked-by: Alex Deucher <alexander.deucher@amd.com>
1 parent badfa5b commit 2ebb242

File tree

2 files changed

+0
-114
lines changed

2 files changed

+0
-114
lines changed

drivers/gpu/drm/drm_rect.c

Lines changed: 0 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -207,114 +207,6 @@ int drm_rect_calc_vscale(const struct drm_rect *src,
207207
}
208208
EXPORT_SYMBOL(drm_rect_calc_vscale);
209209

210-
/**
211-
* drm_calc_hscale_relaxed - calculate the horizontal scaling factor
212-
* @src: source window rectangle
213-
* @dst: destination window rectangle
214-
* @min_hscale: minimum allowed horizontal scaling factor
215-
* @max_hscale: maximum allowed horizontal scaling factor
216-
*
217-
* Calculate the horizontal scaling factor as
218-
* (@src width) / (@dst width).
219-
*
220-
* If the calculated scaling factor is below @min_vscale,
221-
* decrease the height of rectangle @dst to compensate.
222-
*
223-
* If the calculated scaling factor is above @max_vscale,
224-
* decrease the height of rectangle @src to compensate.
225-
*
226-
* If the scale is below 1 << 16, round down. If the scale is above
227-
* 1 << 16, round up. This will calculate the scale with the most
228-
* pessimistic limit calculation.
229-
*
230-
* RETURNS:
231-
* The horizontal scaling factor.
232-
*/
233-
int drm_rect_calc_hscale_relaxed(struct drm_rect *src,
234-
struct drm_rect *dst,
235-
int min_hscale, int max_hscale)
236-
{
237-
int src_w = drm_rect_width(src);
238-
int dst_w = drm_rect_width(dst);
239-
int hscale = drm_calc_scale(src_w, dst_w);
240-
241-
if (hscale < 0 || dst_w == 0)
242-
return hscale;
243-
244-
if (hscale < min_hscale) {
245-
int max_dst_w = src_w / min_hscale;
246-
247-
drm_rect_adjust_size(dst, max_dst_w - dst_w, 0);
248-
249-
return min_hscale;
250-
}
251-
252-
if (hscale > max_hscale) {
253-
int max_src_w = dst_w * max_hscale;
254-
255-
drm_rect_adjust_size(src, max_src_w - src_w, 0);
256-
257-
return max_hscale;
258-
}
259-
260-
return hscale;
261-
}
262-
EXPORT_SYMBOL(drm_rect_calc_hscale_relaxed);
263-
264-
/**
265-
* drm_rect_calc_vscale_relaxed - calculate the vertical scaling factor
266-
* @src: source window rectangle
267-
* @dst: destination window rectangle
268-
* @min_vscale: minimum allowed vertical scaling factor
269-
* @max_vscale: maximum allowed vertical scaling factor
270-
*
271-
* Calculate the vertical scaling factor as
272-
* (@src height) / (@dst height).
273-
*
274-
* If the calculated scaling factor is below @min_vscale,
275-
* decrease the height of rectangle @dst to compensate.
276-
*
277-
* If the calculated scaling factor is above @max_vscale,
278-
* decrease the height of rectangle @src to compensate.
279-
*
280-
* If the scale is below 1 << 16, round down. If the scale is above
281-
* 1 << 16, round up. This will calculate the scale with the most
282-
* pessimistic limit calculation.
283-
*
284-
* RETURNS:
285-
* The vertical scaling factor.
286-
*/
287-
int drm_rect_calc_vscale_relaxed(struct drm_rect *src,
288-
struct drm_rect *dst,
289-
int min_vscale, int max_vscale)
290-
{
291-
int src_h = drm_rect_height(src);
292-
int dst_h = drm_rect_height(dst);
293-
int vscale = drm_calc_scale(src_h, dst_h);
294-
295-
if (vscale < 0 || dst_h == 0)
296-
return vscale;
297-
298-
if (vscale < min_vscale) {
299-
int max_dst_h = src_h / min_vscale;
300-
301-
drm_rect_adjust_size(dst, 0, max_dst_h - dst_h);
302-
303-
return min_vscale;
304-
}
305-
306-
if (vscale > max_vscale) {
307-
int max_src_h = dst_h * max_vscale;
308-
309-
drm_rect_adjust_size(src, 0, max_src_h - src_h);
310-
311-
return max_vscale;
312-
}
313-
314-
return vscale;
315-
}
316-
EXPORT_SYMBOL(drm_rect_calc_vscale_relaxed);
317-
318210
/**
319211
* drm_rect_debug_print - print the rectangle information
320212
* @prefix: prefix string

include/drm/drm_rect.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,6 @@ int drm_rect_calc_hscale(const struct drm_rect *src,
182182
int drm_rect_calc_vscale(const struct drm_rect *src,
183183
const struct drm_rect *dst,
184184
int min_vscale, int max_vscale);
185-
int drm_rect_calc_hscale_relaxed(struct drm_rect *src,
186-
struct drm_rect *dst,
187-
int min_hscale, int max_hscale);
188-
int drm_rect_calc_vscale_relaxed(struct drm_rect *src,
189-
struct drm_rect *dst,
190-
int min_vscale, int max_vscale);
191185
void drm_rect_debug_print(const char *prefix,
192186
const struct drm_rect *r, bool fixed_point);
193187
void drm_rect_rotate(struct drm_rect *r,

0 commit comments

Comments
 (0)