diff mbox

[16/58] drm/i915: inline intel_best_encoder

Message ID 1345403595-9678-17-git-send-email-daniel.vetter@ffwll.ch (mailing list archive)
State Accepted
Headers show

Commit Message

Daniel Vetter Aug. 19, 2012, 7:12 p.m. UTC
Also kill the error-path, we have a fixed connector-encoder mapping.

Unfortunately we can't rip out all the ->best_encoder callbacks, these
are all still used by the fb_helper. Neat helper layering violation there.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_display.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

Comments

Jesse Barnes Sept. 4, 2012, 8:18 p.m. UTC | #1
On Sun, 19 Aug 2012 21:12:33 +0200
Daniel Vetter <daniel.vetter@ffwll.ch> wrote:

> Also kill the error-path, we have a fixed connector-encoder mapping.
> 
> Unfortunately we can't rip out all the ->best_encoder callbacks, these
> are all still used by the fb_helper. Neat helper layering violation there.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 18 +++---------------
>  1 file changed, 3 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 5dbe03a..9d5c575 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -6644,7 +6644,7 @@ static int intel_crtc_set_config(struct drm_mode_set *set)
>  	bool mode_changed = false; /* if true do a full mode set */
>  	bool fb_changed = false; /* if true and !mode_changed just do a flip */
>  	struct drm_connector *save_connectors, *connector;
> -	int count = 0, ro, fail = 0;
> +	int count = 0, ro;
>  	struct drm_mode_set save_set;
>  	int ret;
>  	int i;
> @@ -6660,7 +6660,6 @@ static int intel_crtc_set_config(struct drm_mode_set *set)
>  	if (!set->crtc->helper_private)
>  		return -EINVAL;
>  
> -
>  	if (!set->mode)
>  		set->fb = NULL;
>  
> @@ -6753,17 +6752,11 @@ static int intel_crtc_set_config(struct drm_mode_set *set)
>  	/* a) traverse passed in connector list and get encoders for them */
>  	count = 0;
>  	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
> -		struct drm_connector_helper_funcs *connector_funcs =
> -			connector->helper_private;
>  		new_encoder = connector->encoder;
>  		for (ro = 0; ro < set->num_connectors; ro++) {
>  			if (set->connectors[ro] == connector) {
> -				new_encoder = connector_funcs->best_encoder(connector);
> -				/* if we can't get an encoder for a connector
> -				   we are setting now - then fail */
> -				if (new_encoder == NULL)
> -					/* don't break so fail path works correct */
> -					fail = 1;
> +				new_encoder =
> +					&intel_attached_encoder(connector)->base;
>  				break;
>  			}
>  		}
> @@ -6780,11 +6773,6 @@ static int intel_crtc_set_config(struct drm_mode_set *set)
>  		}
>  	}
>  
> -	if (fail) {
> -		ret = -EINVAL;
> -		goto fail;
> -	}
> -
>  	count = 0;
>  	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
>  		if (!connector->encoder)

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5dbe03a..9d5c575 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6644,7 +6644,7 @@  static int intel_crtc_set_config(struct drm_mode_set *set)
 	bool mode_changed = false; /* if true do a full mode set */
 	bool fb_changed = false; /* if true and !mode_changed just do a flip */
 	struct drm_connector *save_connectors, *connector;
-	int count = 0, ro, fail = 0;
+	int count = 0, ro;
 	struct drm_mode_set save_set;
 	int ret;
 	int i;
@@ -6660,7 +6660,6 @@  static int intel_crtc_set_config(struct drm_mode_set *set)
 	if (!set->crtc->helper_private)
 		return -EINVAL;
 
-
 	if (!set->mode)
 		set->fb = NULL;
 
@@ -6753,17 +6752,11 @@  static int intel_crtc_set_config(struct drm_mode_set *set)
 	/* a) traverse passed in connector list and get encoders for them */
 	count = 0;
 	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
-		struct drm_connector_helper_funcs *connector_funcs =
-			connector->helper_private;
 		new_encoder = connector->encoder;
 		for (ro = 0; ro < set->num_connectors; ro++) {
 			if (set->connectors[ro] == connector) {
-				new_encoder = connector_funcs->best_encoder(connector);
-				/* if we can't get an encoder for a connector
-				   we are setting now - then fail */
-				if (new_encoder == NULL)
-					/* don't break so fail path works correct */
-					fail = 1;
+				new_encoder =
+					&intel_attached_encoder(connector)->base;
 				break;
 			}
 		}
@@ -6780,11 +6773,6 @@  static int intel_crtc_set_config(struct drm_mode_set *set)
 		}
 	}
 
-	if (fail) {
-		ret = -EINVAL;
-		goto fail;
-	}
-
 	count = 0;
 	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
 		if (!connector->encoder)