dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: Nuke drm_calc_{h,v}scale_relaxed()
@ 2019-02-06 18:32 Ville Syrjala
  2019-02-06 18:35 ` Alex Deucher
  2019-02-07 12:07 ` Maarten Lankhorst
  0 siblings, 2 replies; 3+ messages in thread
From: Ville Syrjala @ 2019-02-06 18:32 UTC (permalink / raw)
  To: dri-devel; +Cc: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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>
---
 drivers/gpu/drm/drm_rect.c | 108 -------------------------------------
 include/drm/drm_rect.h     |   6 ---
 2 files changed, 114 deletions(-)

diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
index 8c057829b804..66c41b12719c 100644
--- a/drivers/gpu/drm/drm_rect.c
+++ b/drivers/gpu/drm/drm_rect.c
@@ -207,114 +207,6 @@ int drm_rect_calc_vscale(const struct drm_rect *src,
 }
 EXPORT_SYMBOL(drm_rect_calc_vscale);
 
-/**
- * drm_calc_hscale_relaxed - calculate the horizontal scaling factor
- * @src: source window rectangle
- * @dst: destination window rectangle
- * @min_hscale: minimum allowed horizontal scaling factor
- * @max_hscale: maximum allowed horizontal scaling factor
- *
- * Calculate the horizontal scaling factor as
- * (@src width) / (@dst width).
- *
- * If the calculated scaling factor is below @min_vscale,
- * decrease the height of rectangle @dst to compensate.
- *
- * If the calculated scaling factor is above @max_vscale,
- * decrease the height of rectangle @src to compensate.
- *
- * If the scale is below 1 << 16, round down. If the scale is above
- * 1 << 16, round up. This will calculate the scale with the most
- * pessimistic limit calculation.
- *
- * RETURNS:
- * The horizontal scaling factor.
- */
-int drm_rect_calc_hscale_relaxed(struct drm_rect *src,
-				 struct drm_rect *dst,
-				 int min_hscale, int max_hscale)
-{
-	int src_w = drm_rect_width(src);
-	int dst_w = drm_rect_width(dst);
-	int hscale = drm_calc_scale(src_w, dst_w);
-
-	if (hscale < 0 || dst_w == 0)
-		return hscale;
-
-	if (hscale < min_hscale) {
-		int max_dst_w = src_w / min_hscale;
-
-		drm_rect_adjust_size(dst, max_dst_w - dst_w, 0);
-
-		return min_hscale;
-	}
-
-	if (hscale > max_hscale) {
-		int max_src_w = dst_w * max_hscale;
-
-		drm_rect_adjust_size(src, max_src_w - src_w, 0);
-
-		return max_hscale;
-	}
-
-	return hscale;
-}
-EXPORT_SYMBOL(drm_rect_calc_hscale_relaxed);
-
-/**
- * drm_rect_calc_vscale_relaxed - calculate the vertical scaling factor
- * @src: source window rectangle
- * @dst: destination window rectangle
- * @min_vscale: minimum allowed vertical scaling factor
- * @max_vscale: maximum allowed vertical scaling factor
- *
- * Calculate the vertical scaling factor as
- * (@src height) / (@dst height).
- *
- * If the calculated scaling factor is below @min_vscale,
- * decrease the height of rectangle @dst to compensate.
- *
- * If the calculated scaling factor is above @max_vscale,
- * decrease the height of rectangle @src to compensate.
- *
- * If the scale is below 1 << 16, round down. If the scale is above
- * 1 << 16, round up. This will calculate the scale with the most
- * pessimistic limit calculation.
- *
- * RETURNS:
- * The vertical scaling factor.
- */
-int drm_rect_calc_vscale_relaxed(struct drm_rect *src,
-				 struct drm_rect *dst,
-				 int min_vscale, int max_vscale)
-{
-	int src_h = drm_rect_height(src);
-	int dst_h = drm_rect_height(dst);
-	int vscale = drm_calc_scale(src_h, dst_h);
-
-	if (vscale < 0 || dst_h == 0)
-		return vscale;
-
-	if (vscale < min_vscale) {
-		int max_dst_h = src_h / min_vscale;
-
-		drm_rect_adjust_size(dst, 0, max_dst_h - dst_h);
-
-		return min_vscale;
-	}
-
-	if (vscale > max_vscale) {
-		int max_src_h = dst_h * max_vscale;
-
-		drm_rect_adjust_size(src, 0, max_src_h - src_h);
-
-		return max_vscale;
-	}
-
-	return vscale;
-}
-EXPORT_SYMBOL(drm_rect_calc_vscale_relaxed);
-
 /**
  * drm_rect_debug_print - print the rectangle information
  * @prefix: prefix string
diff --git a/include/drm/drm_rect.h b/include/drm/drm_rect.h
index 6c54544a4be7..6195820aa5c5 100644
--- a/include/drm/drm_rect.h
+++ b/include/drm/drm_rect.h
@@ -182,12 +182,6 @@ int drm_rect_calc_hscale(const struct drm_rect *src,
 int drm_rect_calc_vscale(const struct drm_rect *src,
 			 const struct drm_rect *dst,
 			 int min_vscale, int max_vscale);
-int drm_rect_calc_hscale_relaxed(struct drm_rect *src,
-				 struct drm_rect *dst,
-				 int min_hscale, int max_hscale);
-int drm_rect_calc_vscale_relaxed(struct drm_rect *src,
-				 struct drm_rect *dst,
-				 int min_vscale, int max_vscale);
 void drm_rect_debug_print(const char *prefix,
 			  const struct drm_rect *r, bool fixed_point);
 void drm_rect_rotate(struct drm_rect *r,
-- 
2.19.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm: Nuke drm_calc_{h,v}scale_relaxed()
  2019-02-06 18:32 [PATCH] drm: Nuke drm_calc_{h,v}scale_relaxed() Ville Syrjala
@ 2019-02-06 18:35 ` Alex Deucher
  2019-02-07 12:07 ` Maarten Lankhorst
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2019-02-06 18:35 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: Intel Graphics Development, Maling list - DRI developers

On Wed, Feb 6, 2019 at 1:32 PM Ville Syrjala
<ville.syrjala@linux.intel.com> wrote:
>
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> 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>

Acked-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/drm_rect.c | 108 -------------------------------------
>  include/drm/drm_rect.h     |   6 ---
>  2 files changed, 114 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
> index 8c057829b804..66c41b12719c 100644
> --- a/drivers/gpu/drm/drm_rect.c
> +++ b/drivers/gpu/drm/drm_rect.c
> @@ -207,114 +207,6 @@ int drm_rect_calc_vscale(const struct drm_rect *src,
>  }
>  EXPORT_SYMBOL(drm_rect_calc_vscale);
>
> -/**
> - * drm_calc_hscale_relaxed - calculate the horizontal scaling factor
> - * @src: source window rectangle
> - * @dst: destination window rectangle
> - * @min_hscale: minimum allowed horizontal scaling factor
> - * @max_hscale: maximum allowed horizontal scaling factor
> - *
> - * Calculate the horizontal scaling factor as
> - * (@src width) / (@dst width).
> - *
> - * If the calculated scaling factor is below @min_vscale,
> - * decrease the height of rectangle @dst to compensate.
> - *
> - * If the calculated scaling factor is above @max_vscale,
> - * decrease the height of rectangle @src to compensate.
> - *
> - * If the scale is below 1 << 16, round down. If the scale is above
> - * 1 << 16, round up. This will calculate the scale with the most
> - * pessimistic limit calculation.
> - *
> - * RETURNS:
> - * The horizontal scaling factor.
> - */
> -int drm_rect_calc_hscale_relaxed(struct drm_rect *src,
> -                                struct drm_rect *dst,
> -                                int min_hscale, int max_hscale)
> -{
> -       int src_w = drm_rect_width(src);
> -       int dst_w = drm_rect_width(dst);
> -       int hscale = drm_calc_scale(src_w, dst_w);
> -
> -       if (hscale < 0 || dst_w == 0)
> -               return hscale;
> -
> -       if (hscale < min_hscale) {
> -               int max_dst_w = src_w / min_hscale;
> -
> -               drm_rect_adjust_size(dst, max_dst_w - dst_w, 0);
> -
> -               return min_hscale;
> -       }
> -
> -       if (hscale > max_hscale) {
> -               int max_src_w = dst_w * max_hscale;
> -
> -               drm_rect_adjust_size(src, max_src_w - src_w, 0);
> -
> -               return max_hscale;
> -       }
> -
> -       return hscale;
> -}
> -EXPORT_SYMBOL(drm_rect_calc_hscale_relaxed);
> -
> -/**
> - * drm_rect_calc_vscale_relaxed - calculate the vertical scaling factor
> - * @src: source window rectangle
> - * @dst: destination window rectangle
> - * @min_vscale: minimum allowed vertical scaling factor
> - * @max_vscale: maximum allowed vertical scaling factor
> - *
> - * Calculate the vertical scaling factor as
> - * (@src height) / (@dst height).
> - *
> - * If the calculated scaling factor is below @min_vscale,
> - * decrease the height of rectangle @dst to compensate.
> - *
> - * If the calculated scaling factor is above @max_vscale,
> - * decrease the height of rectangle @src to compensate.
> - *
> - * If the scale is below 1 << 16, round down. If the scale is above
> - * 1 << 16, round up. This will calculate the scale with the most
> - * pessimistic limit calculation.
> - *
> - * RETURNS:
> - * The vertical scaling factor.
> - */
> -int drm_rect_calc_vscale_relaxed(struct drm_rect *src,
> -                                struct drm_rect *dst,
> -                                int min_vscale, int max_vscale)
> -{
> -       int src_h = drm_rect_height(src);
> -       int dst_h = drm_rect_height(dst);
> -       int vscale = drm_calc_scale(src_h, dst_h);
> -
> -       if (vscale < 0 || dst_h == 0)
> -               return vscale;
> -
> -       if (vscale < min_vscale) {
> -               int max_dst_h = src_h / min_vscale;
> -
> -               drm_rect_adjust_size(dst, 0, max_dst_h - dst_h);
> -
> -               return min_vscale;
> -       }
> -
> -       if (vscale > max_vscale) {
> -               int max_src_h = dst_h * max_vscale;
> -
> -               drm_rect_adjust_size(src, 0, max_src_h - src_h);
> -
> -               return max_vscale;
> -       }
> -
> -       return vscale;
> -}
> -EXPORT_SYMBOL(drm_rect_calc_vscale_relaxed);
> -
>  /**
>   * drm_rect_debug_print - print the rectangle information
>   * @prefix: prefix string
> diff --git a/include/drm/drm_rect.h b/include/drm/drm_rect.h
> index 6c54544a4be7..6195820aa5c5 100644
> --- a/include/drm/drm_rect.h
> +++ b/include/drm/drm_rect.h
> @@ -182,12 +182,6 @@ int drm_rect_calc_hscale(const struct drm_rect *src,
>  int drm_rect_calc_vscale(const struct drm_rect *src,
>                          const struct drm_rect *dst,
>                          int min_vscale, int max_vscale);
> -int drm_rect_calc_hscale_relaxed(struct drm_rect *src,
> -                                struct drm_rect *dst,
> -                                int min_hscale, int max_hscale);
> -int drm_rect_calc_vscale_relaxed(struct drm_rect *src,
> -                                struct drm_rect *dst,
> -                                int min_vscale, int max_vscale);
>  void drm_rect_debug_print(const char *prefix,
>                           const struct drm_rect *r, bool fixed_point);
>  void drm_rect_rotate(struct drm_rect *r,
> --
> 2.19.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm: Nuke drm_calc_{h,v}scale_relaxed()
  2019-02-06 18:32 [PATCH] drm: Nuke drm_calc_{h,v}scale_relaxed() Ville Syrjala
  2019-02-06 18:35 ` Alex Deucher
@ 2019-02-07 12:07 ` Maarten Lankhorst
  1 sibling, 0 replies; 3+ messages in thread
From: Maarten Lankhorst @ 2019-02-07 12:07 UTC (permalink / raw)
  To: Ville Syrjala, dri-devel; +Cc: intel-gfx

Op 06-02-2019 om 19:32 schreef Ville Syrjala:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> 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>
> ---
>  drivers/gpu/drm/drm_rect.c | 108 -------------------------------------
>  include/drm/drm_rect.h     |   6 ---
>  2 files changed, 114 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
> index 8c057829b804..66c41b12719c 100644
> --- a/drivers/gpu/drm/drm_rect.c
> +++ b/drivers/gpu/drm/drm_rect.c
> @@ -207,114 +207,6 @@ int drm_rect_calc_vscale(const struct drm_rect *src,
>  }
>  EXPORT_SYMBOL(drm_rect_calc_vscale);
>  
> -/**
> - * drm_calc_hscale_relaxed - calculate the horizontal scaling factor
> - * @src: source window rectangle
> - * @dst: destination window rectangle
> - * @min_hscale: minimum allowed horizontal scaling factor
> - * @max_hscale: maximum allowed horizontal scaling factor
> - *
> - * Calculate the horizontal scaling factor as
> - * (@src width) / (@dst width).
> - *
> - * If the calculated scaling factor is below @min_vscale,
> - * decrease the height of rectangle @dst to compensate.
> - *
> - * If the calculated scaling factor is above @max_vscale,
> - * decrease the height of rectangle @src to compensate.
> - *
> - * If the scale is below 1 << 16, round down. If the scale is above
> - * 1 << 16, round up. This will calculate the scale with the most
> - * pessimistic limit calculation.
> - *
> - * RETURNS:
> - * The horizontal scaling factor.
> - */
> -int drm_rect_calc_hscale_relaxed(struct drm_rect *src,
> -				 struct drm_rect *dst,
> -				 int min_hscale, int max_hscale)
> -{
> -	int src_w = drm_rect_width(src);
> -	int dst_w = drm_rect_width(dst);
> -	int hscale = drm_calc_scale(src_w, dst_w);
> -
> -	if (hscale < 0 || dst_w == 0)
> -		return hscale;
> -
> -	if (hscale < min_hscale) {
> -		int max_dst_w = src_w / min_hscale;
> -
> -		drm_rect_adjust_size(dst, max_dst_w - dst_w, 0);
> -
> -		return min_hscale;
> -	}
> -
> -	if (hscale > max_hscale) {
> -		int max_src_w = dst_w * max_hscale;
> -
> -		drm_rect_adjust_size(src, max_src_w - src_w, 0);
> -
> -		return max_hscale;
> -	}
> -
> -	return hscale;
> -}
> -EXPORT_SYMBOL(drm_rect_calc_hscale_relaxed);
> -
> -/**
> - * drm_rect_calc_vscale_relaxed - calculate the vertical scaling factor
> - * @src: source window rectangle
> - * @dst: destination window rectangle
> - * @min_vscale: minimum allowed vertical scaling factor
> - * @max_vscale: maximum allowed vertical scaling factor
> - *
> - * Calculate the vertical scaling factor as
> - * (@src height) / (@dst height).
> - *
> - * If the calculated scaling factor is below @min_vscale,
> - * decrease the height of rectangle @dst to compensate.
> - *
> - * If the calculated scaling factor is above @max_vscale,
> - * decrease the height of rectangle @src to compensate.
> - *
> - * If the scale is below 1 << 16, round down. If the scale is above
> - * 1 << 16, round up. This will calculate the scale with the most
> - * pessimistic limit calculation.
> - *
> - * RETURNS:
> - * The vertical scaling factor.
> - */
> -int drm_rect_calc_vscale_relaxed(struct drm_rect *src,
> -				 struct drm_rect *dst,
> -				 int min_vscale, int max_vscale)
> -{
> -	int src_h = drm_rect_height(src);
> -	int dst_h = drm_rect_height(dst);
> -	int vscale = drm_calc_scale(src_h, dst_h);
> -
> -	if (vscale < 0 || dst_h == 0)
> -		return vscale;
> -
> -	if (vscale < min_vscale) {
> -		int max_dst_h = src_h / min_vscale;
> -
> -		drm_rect_adjust_size(dst, 0, max_dst_h - dst_h);
> -
> -		return min_vscale;
> -	}
> -
> -	if (vscale > max_vscale) {
> -		int max_src_h = dst_h * max_vscale;
> -
> -		drm_rect_adjust_size(src, 0, max_src_h - src_h);
> -
> -		return max_vscale;
> -	}
> -
> -	return vscale;
> -}
> -EXPORT_SYMBOL(drm_rect_calc_vscale_relaxed);
> -
>  /**
>   * drm_rect_debug_print - print the rectangle information
>   * @prefix: prefix string
> diff --git a/include/drm/drm_rect.h b/include/drm/drm_rect.h
> index 6c54544a4be7..6195820aa5c5 100644
> --- a/include/drm/drm_rect.h
> +++ b/include/drm/drm_rect.h
> @@ -182,12 +182,6 @@ int drm_rect_calc_hscale(const struct drm_rect *src,
>  int drm_rect_calc_vscale(const struct drm_rect *src,
>  			 const struct drm_rect *dst,
>  			 int min_vscale, int max_vscale);
> -int drm_rect_calc_hscale_relaxed(struct drm_rect *src,
> -				 struct drm_rect *dst,
> -				 int min_hscale, int max_hscale);
> -int drm_rect_calc_vscale_relaxed(struct drm_rect *src,
> -				 struct drm_rect *dst,
> -				 int min_vscale, int max_vscale);
>  void drm_rect_debug_print(const char *prefix,
>  			  const struct drm_rect *r, bool fixed_point);
>  void drm_rect_rotate(struct drm_rect *r,

Good riddance.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-07 12:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-06 18:32 [PATCH] drm: Nuke drm_calc_{h,v}scale_relaxed() Ville Syrjala
2019-02-06 18:35 ` Alex Deucher
2019-02-07 12:07 ` Maarten Lankhorst

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox