diff mbox series

[6/6] drm/i915: Drop redundant has_hdmi_sink check

Message ID 20210511160532.21446-7-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Check HDMI sink deep color capabilities during .mode_valid() | expand

Commit Message

Ville Syrjälä May 11, 2021, 4:05 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

intel_hdmi_bpc_possible() will check has_hdmi_sink for us, so no
need to check it in intel_hdmi_mode_clock_valid() anymore.

Cc: Werner Sembach <wse@tuxedocomputers.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_hdmi.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

Comments

Souza, Jose May 14, 2021, 5:34 p.m. UTC | #1
On Tue, 2021-05-11 at 19:05 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> intel_hdmi_bpc_possible() will check has_hdmi_sink for us, so no
> need to check it in intel_hdmi_mode_clock_valid() anymore.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>

> 
> Cc: Werner Sembach <wse@tuxedocomputers.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_hdmi.c | 22 ++++++++++------------
>  1 file changed, 10 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> index 80e2ae652f6e..7e48897bbac0 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> @@ -1914,19 +1914,17 @@ intel_hdmi_mode_clock_valid(struct drm_connector *connector, int clock,
>  	status = hdmi_port_clock_valid(hdmi, intel_hdmi_port_clock(clock, 8),
>  				       true, has_hdmi_sink);
>  
> -	if (has_hdmi_sink) {
> -		/* if we can't do 8bpc we may still be able to do 12bpc */
> -		if (status != MODE_OK &&
> -		    intel_hdmi_bpc_possible(connector, 12, has_hdmi_sink, ycbcr420_output))
> -			status = hdmi_port_clock_valid(hdmi, intel_hdmi_port_clock(clock, 12),
> -						       true, has_hdmi_sink);
> +	/* if we can't do 8bpc we may still be able to do 12bpc */
> +	if (status != MODE_OK &&
> +	    intel_hdmi_bpc_possible(connector, 12, has_hdmi_sink, ycbcr420_output))
> +		status = hdmi_port_clock_valid(hdmi, intel_hdmi_port_clock(clock, 12),
> +					       true, has_hdmi_sink);
>  
> -		/* if we can't do 8,12bpc we may still be able to do 10bpc */
> -		if (status != MODE_OK &&
> -		    intel_hdmi_bpc_possible(connector, 10, has_hdmi_sink, ycbcr420_output))
> -			status = hdmi_port_clock_valid(hdmi, intel_hdmi_port_clock(clock, 10),
> -						       true, has_hdmi_sink);
> -	}
> +	/* if we can't do 8,12bpc we may still be able to do 10bpc */
> +	if (status != MODE_OK &&
> +	    intel_hdmi_bpc_possible(connector, 10, has_hdmi_sink, ycbcr420_output))
> +		status = hdmi_port_clock_valid(hdmi, intel_hdmi_port_clock(clock, 10),
> +					       true, has_hdmi_sink);
>  
>  	return status;
>  }
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index 80e2ae652f6e..7e48897bbac0 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -1914,19 +1914,17 @@  intel_hdmi_mode_clock_valid(struct drm_connector *connector, int clock,
 	status = hdmi_port_clock_valid(hdmi, intel_hdmi_port_clock(clock, 8),
 				       true, has_hdmi_sink);
 
-	if (has_hdmi_sink) {
-		/* if we can't do 8bpc we may still be able to do 12bpc */
-		if (status != MODE_OK &&
-		    intel_hdmi_bpc_possible(connector, 12, has_hdmi_sink, ycbcr420_output))
-			status = hdmi_port_clock_valid(hdmi, intel_hdmi_port_clock(clock, 12),
-						       true, has_hdmi_sink);
+	/* if we can't do 8bpc we may still be able to do 12bpc */
+	if (status != MODE_OK &&
+	    intel_hdmi_bpc_possible(connector, 12, has_hdmi_sink, ycbcr420_output))
+		status = hdmi_port_clock_valid(hdmi, intel_hdmi_port_clock(clock, 12),
+					       true, has_hdmi_sink);
 
-		/* if we can't do 8,12bpc we may still be able to do 10bpc */
-		if (status != MODE_OK &&
-		    intel_hdmi_bpc_possible(connector, 10, has_hdmi_sink, ycbcr420_output))
-			status = hdmi_port_clock_valid(hdmi, intel_hdmi_port_clock(clock, 10),
-						       true, has_hdmi_sink);
-	}
+	/* if we can't do 8,12bpc we may still be able to do 10bpc */
+	if (status != MODE_OK &&
+	    intel_hdmi_bpc_possible(connector, 10, has_hdmi_sink, ycbcr420_output))
+		status = hdmi_port_clock_valid(hdmi, intel_hdmi_port_clock(clock, 10),
+					       true, has_hdmi_sink);
 
 	return status;
 }