diff mbox series

[10/15] drm/i915/tv: Make TV mode autoselection actually useable

Message ID 20181112170000.27531-12-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Fix TV encoder support | expand

Commit Message

Ville Syrjälä Nov. 12, 2018, 4:59 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The current code insists on picking a new TV mode when
switching between component and non-component cables.
That's super annoying. Let's just keep the current TV
mode unless the new cable type actually disagrees with it.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_tv.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

Comments

Imre Deak Jan. 22, 2019, 2:54 p.m. UTC | #1
On Mon, Nov 12, 2018 at 06:59:55PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> The current code insists on picking a new TV mode when
> switching between component and non-component cables.
> That's super annoying. Let's just keep the current TV
> mode unless the new cable type actually disagrees with it.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Imre Deak <imre.deak@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_tv.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
> index 433f538261c1..32a8786fe0da 100644
> --- a/drivers/gpu/drm/i915/intel_tv.c
> +++ b/drivers/gpu/drm/i915/intel_tv.c
> @@ -1253,16 +1253,18 @@ static void intel_tv_find_better_format(struct drm_connector *connector)
>  	const struct tv_mode *tv_mode = intel_tv_mode_find(connector->state);
>  	int i;
>  
> -	if ((intel_tv->type == DRM_MODE_CONNECTOR_Component) ==
> -		tv_mode->component_only)
> +	/* Component supports everything so we can keep the current mode */
> +	if (intel_tv->type == DRM_MODE_CONNECTOR_Component)
>  		return;
>  
> +	/* If the current mode is fine don't change it */
> +	if (!tv_mode->component_only)
> +		return;
>  
>  	for (i = 0; i < ARRAY_SIZE(tv_modes); i++) {
> -		tv_mode = tv_modes + i;
> +		tv_mode = &tv_modes[i];
>  
> -		if ((intel_tv->type == DRM_MODE_CONNECTOR_Component) ==
> -			tv_mode->component_only)
> +		if (!tv_mode->component_only)
>  			break;
>  	}
>  
> -- 
> 2.18.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index 433f538261c1..32a8786fe0da 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -1253,16 +1253,18 @@  static void intel_tv_find_better_format(struct drm_connector *connector)
 	const struct tv_mode *tv_mode = intel_tv_mode_find(connector->state);
 	int i;
 
-	if ((intel_tv->type == DRM_MODE_CONNECTOR_Component) ==
-		tv_mode->component_only)
+	/* Component supports everything so we can keep the current mode */
+	if (intel_tv->type == DRM_MODE_CONNECTOR_Component)
 		return;
 
+	/* If the current mode is fine don't change it */
+	if (!tv_mode->component_only)
+		return;
 
 	for (i = 0; i < ARRAY_SIZE(tv_modes); i++) {
-		tv_mode = tv_modes + i;
+		tv_mode = &tv_modes[i];
 
-		if ((intel_tv->type == DRM_MODE_CONNECTOR_Component) ==
-			tv_mode->component_only)
+		if (!tv_mode->component_only)
 			break;
 	}