[Intel-gfx] [PATCH 2/3] drm/i915/dp: centralize max source rate conditions more
Manasi Navare
manasi.d.navare at intel.com
Tue Oct 10 18:35:28 UTC 2017
On Mon, Oct 09, 2017 at 12:29:58PM +0300, Jani Nikula wrote:
> Turn intel_dp_source_supports_hbr2() into a simple helper to query the
> pre-filled source rates array, and move the conditions about which
> platforms support which rates to the single point of truth in
> intel_dp_set_source_rates().
>
> This also reduces the code paths you have to think about in the source
> rates initialization in intel_dp_set_source_rates(), making it easier to
> grasp.
>
> Cc: Manasi Navare <manasi.d.navare at intel.com>
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
Reviewed-by: Manasi Navare <manasi.d.navare at intel.com>
Manasi
> ---
> drivers/gpu/drm/i915/intel_dp.c | 19 +++++++------------
> 1 file changed, 7 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index ca48bce23a6f..09d75df497c0 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -254,15 +254,15 @@ intel_dp_set_source_rates(struct intel_dp *intel_dp)
> } else if (IS_GEN9_BC(dev_priv)) {
> source_rates = skl_rates;
> size = ARRAY_SIZE(skl_rates);
> - } else {
> + } else if ((IS_HASWELL(dev_priv) && !IS_HSW_ULX(dev_priv)) ||
> + IS_BROADWELL(dev_priv)) {
> source_rates = default_rates;
> size = ARRAY_SIZE(default_rates);
> + } else {
> + source_rates = default_rates;
> + size = ARRAY_SIZE(default_rates) - 1;
> }
>
> - /* This depends on the fact that 5.4 is last value in the array */
> - if (!intel_dp_source_supports_hbr2(intel_dp))
> - size--;
> -
> intel_dp->source_rates = source_rates;
> intel_dp->num_source_rates = size;
> }
> @@ -1482,14 +1482,9 @@ intel_dp_aux_init(struct intel_dp *intel_dp)
>
> bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp)
> {
> - struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
> - struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
> + int max_rate = intel_dp->source_rates[intel_dp->num_source_rates - 1];
>
> - if ((IS_HASWELL(dev_priv) && !IS_HSW_ULX(dev_priv)) ||
> - IS_BROADWELL(dev_priv) || (INTEL_GEN(dev_priv) >= 9))
> - return true;
> - else
> - return false;
> + return max_rate >= 540000;
> }
>
> static void
> --
> 2.11.0
>
More information about the Intel-gfx
mailing list