diff mbox

[3/3] drm: Remove drm_mode_validate_clocks

Message ID 1375230233-4256-3-git-send-email-marcheu@chromium.org (mailing list archive)
State New, archived
Headers show

Commit Message

Stéphane Marchesin July 31, 2013, 12:23 a.m. UTC
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
---
 drivers/gpu/drm/drm_modes.c | 37 -------------------------------------
 include/drm/drm_crtc.h      |  3 ---
 2 files changed, 40 deletions(-)

Comments

David Herrmann Aug. 2, 2013, 4:40 p.m. UTC | #1
Hi

On Wed, Jul 31, 2013 at 2:23 AM, Stéphane Marchesin
<marcheu@chromium.org> wrote:
> Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

Something like "unused" in the commit message makes "git log
[--oneline]" much more verbose without the need to read the patch.
Apart from that:
  Reviewed-by: David Herrmann <dh.herrmann@gmail.com>

I also did a short "grep MODE_CLOCK_RANGE" and radeon/i915 tv-helpers
are the last users. All others use MODE_BAD. But I guess
MODE_CLOCK_RANGE is more verbose so there is no need to remove it.

Regards
David

> ---
>  drivers/gpu/drm/drm_modes.c | 37 -------------------------------------
>  include/drm/drm_crtc.h      |  3 ---
>  2 files changed, 40 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index a6729bf..504a602 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -923,43 +923,6 @@ void drm_mode_validate_size(struct drm_device *dev,
>  EXPORT_SYMBOL(drm_mode_validate_size);
>
>  /**
> - * drm_mode_validate_clocks - validate modes against clock limits
> - * @dev: DRM device
> - * @mode_list: list of modes to check
> - * @min: minimum clock rate array
> - * @max: maximum clock rate array
> - * @n_ranges: number of clock ranges (size of arrays)
> - *
> - * LOCKING:
> - * Caller must hold a lock protecting @mode_list.
> - *
> - * Some code may need to check a mode list against the clock limits of the
> - * device in question.  This function walks the mode list, testing to make
> - * sure each mode falls within a given range (defined by @min and @max
> - * arrays) and sets @mode->status as needed.
> - */
> -void drm_mode_validate_clocks(struct drm_device *dev,
> -                             struct list_head *mode_list,
> -                             int *min, int *max, int n_ranges)
> -{
> -       struct drm_display_mode *mode;
> -       int i;
> -
> -       list_for_each_entry(mode, mode_list, head) {
> -               bool good = false;
> -               for (i = 0; i < n_ranges; i++) {
> -                       if (mode->clock >= min[i] && mode->clock <= max[i]) {
> -                               good = true;
> -                               break;
> -                       }
> -               }
> -               if (!good)
> -                       mode->status = MODE_CLOCK_RANGE;
> -       }
> -}
> -EXPORT_SYMBOL(drm_mode_validate_clocks);
> -
> -/**
>   * drm_mode_prune_invalid - remove invalid modes from mode list
>   * @dev: DRM device
>   * @mode_list: list of modes to check
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index fa12a2f..32e0820 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -930,9 +930,6 @@ extern void drm_mode_list_concat(struct list_head *head,
>  extern void drm_mode_validate_size(struct drm_device *dev,
>                                    struct list_head *mode_list,
>                                    int maxX, int maxY, int maxPitch);
> -extern void drm_mode_validate_clocks(struct drm_device *dev,
> -                                    struct list_head *mode_list,
> -                                    int *min, int *max, int n_ranges);
>  extern void drm_mode_prune_invalid(struct drm_device *dev,
>                                    struct list_head *mode_list, bool verbose);
>  extern void drm_mode_sort(struct list_head *mode_list);
> --
> 1.8.3
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
Daniel Vetter Aug. 5, 2013, 6:21 a.m. UTC | #2
On Tue, Jul 30, 2013 at 05:23:53PM -0700, Stéphane Marchesin wrote:
> Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>

Ben originally picked this up into his danvet-on-vactaion tree, but since
it's for core drm it needs to go in through Dave's tree.
-Daniel

> ---
>  drivers/gpu/drm/drm_modes.c | 37 -------------------------------------
>  include/drm/drm_crtc.h      |  3 ---
>  2 files changed, 40 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index a6729bf..504a602 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -923,43 +923,6 @@ void drm_mode_validate_size(struct drm_device *dev,
>  EXPORT_SYMBOL(drm_mode_validate_size);
>  
>  /**
> - * drm_mode_validate_clocks - validate modes against clock limits
> - * @dev: DRM device
> - * @mode_list: list of modes to check
> - * @min: minimum clock rate array
> - * @max: maximum clock rate array
> - * @n_ranges: number of clock ranges (size of arrays)
> - *
> - * LOCKING:
> - * Caller must hold a lock protecting @mode_list.
> - *
> - * Some code may need to check a mode list against the clock limits of the
> - * device in question.  This function walks the mode list, testing to make
> - * sure each mode falls within a given range (defined by @min and @max
> - * arrays) and sets @mode->status as needed.
> - */
> -void drm_mode_validate_clocks(struct drm_device *dev,
> -			      struct list_head *mode_list,
> -			      int *min, int *max, int n_ranges)
> -{
> -	struct drm_display_mode *mode;
> -	int i;
> -
> -	list_for_each_entry(mode, mode_list, head) {
> -		bool good = false;
> -		for (i = 0; i < n_ranges; i++) {
> -			if (mode->clock >= min[i] && mode->clock <= max[i]) {
> -				good = true;
> -				break;
> -			}
> -		}
> -		if (!good)
> -			mode->status = MODE_CLOCK_RANGE;
> -	}
> -}
> -EXPORT_SYMBOL(drm_mode_validate_clocks);
> -
> -/**
>   * drm_mode_prune_invalid - remove invalid modes from mode list
>   * @dev: DRM device
>   * @mode_list: list of modes to check
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index fa12a2f..32e0820 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -930,9 +930,6 @@ extern void drm_mode_list_concat(struct list_head *head,
>  extern void drm_mode_validate_size(struct drm_device *dev,
>  				   struct list_head *mode_list,
>  				   int maxX, int maxY, int maxPitch);
> -extern void drm_mode_validate_clocks(struct drm_device *dev,
> -				     struct list_head *mode_list,
> -				     int *min, int *max, int n_ranges);
>  extern void drm_mode_prune_invalid(struct drm_device *dev,
>  				   struct list_head *mode_list, bool verbose);
>  extern void drm_mode_sort(struct list_head *mode_list);
> -- 
> 1.8.3
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index a6729bf..504a602 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -923,43 +923,6 @@  void drm_mode_validate_size(struct drm_device *dev,
 EXPORT_SYMBOL(drm_mode_validate_size);
 
 /**
- * drm_mode_validate_clocks - validate modes against clock limits
- * @dev: DRM device
- * @mode_list: list of modes to check
- * @min: minimum clock rate array
- * @max: maximum clock rate array
- * @n_ranges: number of clock ranges (size of arrays)
- *
- * LOCKING:
- * Caller must hold a lock protecting @mode_list.
- *
- * Some code may need to check a mode list against the clock limits of the
- * device in question.  This function walks the mode list, testing to make
- * sure each mode falls within a given range (defined by @min and @max
- * arrays) and sets @mode->status as needed.
- */
-void drm_mode_validate_clocks(struct drm_device *dev,
-			      struct list_head *mode_list,
-			      int *min, int *max, int n_ranges)
-{
-	struct drm_display_mode *mode;
-	int i;
-
-	list_for_each_entry(mode, mode_list, head) {
-		bool good = false;
-		for (i = 0; i < n_ranges; i++) {
-			if (mode->clock >= min[i] && mode->clock <= max[i]) {
-				good = true;
-				break;
-			}
-		}
-		if (!good)
-			mode->status = MODE_CLOCK_RANGE;
-	}
-}
-EXPORT_SYMBOL(drm_mode_validate_clocks);
-
-/**
  * drm_mode_prune_invalid - remove invalid modes from mode list
  * @dev: DRM device
  * @mode_list: list of modes to check
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index fa12a2f..32e0820 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -930,9 +930,6 @@  extern void drm_mode_list_concat(struct list_head *head,
 extern void drm_mode_validate_size(struct drm_device *dev,
 				   struct list_head *mode_list,
 				   int maxX, int maxY, int maxPitch);
-extern void drm_mode_validate_clocks(struct drm_device *dev,
-				     struct list_head *mode_list,
-				     int *min, int *max, int n_ranges);
 extern void drm_mode_prune_invalid(struct drm_device *dev,
 				   struct list_head *mode_list, bool verbose);
 extern void drm_mode_sort(struct list_head *mode_list);