diff mbox series

drm/i915/dg2: fix snps buf trans for uhbr

Message ID 20211007115629.4531-1-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/dg2: fix snps buf trans for uhbr | expand

Commit Message

Jani Nikula Oct. 7, 2021, 11:56 a.m. UTC
The UHBR check was using > instead of >=. Use the helper instead to
avoid mistakes. Also always use the non-UHBR values for HDMI.

Fixes: 2817efaeb608 ("drm/i915/dg2: add SNPS PHY translations for UHBR link rates")
Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Ville Syrjälä Oct. 7, 2021, 12:08 p.m. UTC | #1
On Thu, Oct 07, 2021 at 02:56:29PM +0300, Jani Nikula wrote:
> The UHBR check was using > instead of >=. Use the helper instead to
> avoid mistakes. Also always use the non-UHBR values for HDMI.
> 
> Fixes: 2817efaeb608 ("drm/i915/dg2: add SNPS PHY translations for UHBR link rates")
> Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
> index a2d39131ea53..a87a688d8475 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
> @@ -8,6 +8,7 @@
>  #include "intel_ddi_buf_trans.h"
>  #include "intel_de.h"
>  #include "intel_display_types.h"
> +#include "intel_dp.h"
>  
>  /* HDMI/DVI modes ignore everything but the last 2 items. So we share
>   * them for both DP and FDI transports, allowing those ports to
> @@ -1611,10 +1612,11 @@ dg2_get_snps_buf_trans(struct intel_encoder *encoder,
>  		       const struct intel_crtc_state *crtc_state,
>  		       int *n_entries)
>  {
> -	if (crtc_state->port_clock > 1000000)
> -		return intel_get_buf_trans(&dg2_snps_trans_uhbr, n_entries);
> -	else
> +	if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI) ||
> +	    !intel_dp_is_uhbr(crtc_state))

Might be more clear flipped around to 'has_dp_encoder && is_uhbr'?

Either way
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  		return intel_get_buf_trans(&dg2_snps_trans, n_entries);
> +	else
> +		return intel_get_buf_trans(&dg2_snps_trans_uhbr, n_entries);
>  }
>  
>  void intel_ddi_buf_trans_init(struct intel_encoder *encoder)
> -- 
> 2.30.2
Jani Nikula Oct. 7, 2021, 12:43 p.m. UTC | #2
On Thu, 07 Oct 2021, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Thu, Oct 07, 2021 at 02:56:29PM +0300, Jani Nikula wrote:
>> The UHBR check was using > instead of >=. Use the helper instead to
>> avoid mistakes. Also always use the non-UHBR values for HDMI.
>> 
>> Fixes: 2817efaeb608 ("drm/i915/dg2: add SNPS PHY translations for UHBR link rates")
>> Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>  drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c | 8 +++++---
>>  1 file changed, 5 insertions(+), 3 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
>> index a2d39131ea53..a87a688d8475 100644
>> --- a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
>> +++ b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
>> @@ -8,6 +8,7 @@
>>  #include "intel_ddi_buf_trans.h"
>>  #include "intel_de.h"
>>  #include "intel_display_types.h"
>> +#include "intel_dp.h"
>>  
>>  /* HDMI/DVI modes ignore everything but the last 2 items. So we share
>>   * them for both DP and FDI transports, allowing those ports to
>> @@ -1611,10 +1612,11 @@ dg2_get_snps_buf_trans(struct intel_encoder *encoder,
>>  		       const struct intel_crtc_state *crtc_state,
>>  		       int *n_entries)
>>  {
>> -	if (crtc_state->port_clock > 1000000)
>> -		return intel_get_buf_trans(&dg2_snps_trans_uhbr, n_entries);
>> -	else
>> +	if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI) ||
>> +	    !intel_dp_is_uhbr(crtc_state))
>
> Might be more clear flipped around to 'has_dp_encoder && is_uhbr'?

Silly me, forgot about intel_crtc_has_dp_encoder() since it's not used
in this file. v2 sent.

> Either way
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Thanks,
Jani.

>
>>  		return intel_get_buf_trans(&dg2_snps_trans, n_entries);
>> +	else
>> +		return intel_get_buf_trans(&dg2_snps_trans_uhbr, n_entries);
>>  }
>>  
>>  void intel_ddi_buf_trans_init(struct intel_encoder *encoder)
>> -- 
>> 2.30.2
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
index a2d39131ea53..a87a688d8475 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
@@ -8,6 +8,7 @@ 
 #include "intel_ddi_buf_trans.h"
 #include "intel_de.h"
 #include "intel_display_types.h"
+#include "intel_dp.h"
 
 /* HDMI/DVI modes ignore everything but the last 2 items. So we share
  * them for both DP and FDI transports, allowing those ports to
@@ -1611,10 +1612,11 @@  dg2_get_snps_buf_trans(struct intel_encoder *encoder,
 		       const struct intel_crtc_state *crtc_state,
 		       int *n_entries)
 {
-	if (crtc_state->port_clock > 1000000)
-		return intel_get_buf_trans(&dg2_snps_trans_uhbr, n_entries);
-	else
+	if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI) ||
+	    !intel_dp_is_uhbr(crtc_state))
 		return intel_get_buf_trans(&dg2_snps_trans, n_entries);
+	else
+		return intel_get_buf_trans(&dg2_snps_trans_uhbr, n_entries);
 }
 
 void intel_ddi_buf_trans_init(struct intel_encoder *encoder)