diff mbox

[v3,3/3] drm/i915: Use drm_encoder_crtc_ok()

Message ID 1389622077-9324-4-git-send-email-treding@nvidia.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thierry Reding Jan. 13, 2014, 2:07 p.m. UTC
The intel_encoder_crtc_ok() is a duplicate of the drm_encoder_crtc_ok()
function that used to be only available in the DRM CRTC helpers. It has
recently been moved to the core, so the duplicate can now be dropped.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
Changes in v3:
- replace intel_encoder_crtc_ok() by drm_encoder_crtc_ok()

 drivers/gpu/drm/i915/intel_display.c | 26 ++------------------------
 1 file changed, 2 insertions(+), 24 deletions(-)

Comments

Jani Nikula Jan. 13, 2014, 2:19 p.m. UTC | #1
On Mon, 13 Jan 2014, Thierry Reding <thierry.reding@gmail.com> wrote:
> The intel_encoder_crtc_ok() is a duplicate of the drm_encoder_crtc_ok()
> function that used to be only available in the DRM CRTC helpers. It has
> recently been moved to the core, so the duplicate can now be dropped.
>
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>


> ---
> Changes in v3:
> - replace intel_encoder_crtc_ok() by drm_encoder_crtc_ok()
>
>  drivers/gpu/drm/i915/intel_display.c | 26 ++------------------------
>  1 file changed, 2 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index e77d4b8856a7..7c245185c71f 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -8720,28 +8720,6 @@ static struct drm_crtc_helper_funcs intel_helper_funcs = {
>  	.load_lut = intel_crtc_load_lut,
>  };
>  
> -static bool intel_encoder_crtc_ok(struct drm_encoder *encoder,
> -				  struct drm_crtc *crtc)
> -{
> -	struct drm_device *dev;
> -	struct drm_crtc *tmp;
> -	int crtc_mask = 1;
> -
> -	WARN(!crtc, "checking null crtc?\n");
> -
> -	dev = crtc->dev;
> -
> -	list_for_each_entry(tmp, &dev->mode_config.crtc_list, head) {
> -		if (tmp == crtc)
> -			break;
> -		crtc_mask <<= 1;
> -	}
> -
> -	if (encoder->possible_crtcs & crtc_mask)
> -		return true;
> -	return false;
> -}
> -
>  /**
>   * intel_modeset_update_staged_output_state
>   *
> @@ -9923,8 +9901,8 @@ intel_modeset_stage_output_state(struct drm_device *dev,
>  		}
>  
>  		/* Make sure the new CRTC will work with the encoder */
> -		if (!intel_encoder_crtc_ok(&connector->new_encoder->base,
> -					   new_crtc)) {
> +		if (!drm_encoder_crtc_ok(&connector->new_encoder->base,
> +					 new_crtc)) {
>  			return -EINVAL;
>  		}
>  		connector->encoder->new_crtc = to_intel_crtc(new_crtc);
> -- 
> 1.8.4.2
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e77d4b8856a7..7c245185c71f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8720,28 +8720,6 @@  static struct drm_crtc_helper_funcs intel_helper_funcs = {
 	.load_lut = intel_crtc_load_lut,
 };
 
-static bool intel_encoder_crtc_ok(struct drm_encoder *encoder,
-				  struct drm_crtc *crtc)
-{
-	struct drm_device *dev;
-	struct drm_crtc *tmp;
-	int crtc_mask = 1;
-
-	WARN(!crtc, "checking null crtc?\n");
-
-	dev = crtc->dev;
-
-	list_for_each_entry(tmp, &dev->mode_config.crtc_list, head) {
-		if (tmp == crtc)
-			break;
-		crtc_mask <<= 1;
-	}
-
-	if (encoder->possible_crtcs & crtc_mask)
-		return true;
-	return false;
-}
-
 /**
  * intel_modeset_update_staged_output_state
  *
@@ -9923,8 +9901,8 @@  intel_modeset_stage_output_state(struct drm_device *dev,
 		}
 
 		/* Make sure the new CRTC will work with the encoder */
-		if (!intel_encoder_crtc_ok(&connector->new_encoder->base,
-					   new_crtc)) {
+		if (!drm_encoder_crtc_ok(&connector->new_encoder->base,
+					 new_crtc)) {
 			return -EINVAL;
 		}
 		connector->encoder->new_crtc = to_intel_crtc(new_crtc);