drm/i915/bios: add intel_bios_max_tmds_encoder()
Don't access i915->vbt.ddi_port_info[] directly. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/c52c39df43374b51f56439daf8047079afae7749.1579270868.git.jani.nikula@intel.com
This commit is contained in:
parent
7865559872
commit
d9ee21111b
|
@ -2562,3 +2562,10 @@ enum aux_ch intel_bios_port_aux_ch(struct drm_i915_private *dev_priv,
|
|||
|
||||
return aux_ch;
|
||||
}
|
||||
|
||||
int intel_bios_max_tmds_clock(struct intel_encoder *encoder)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
|
||||
return i915->vbt.ddi_port_info[encoder->port].max_tmds_clock;
|
||||
}
|
||||
|
|
|
@ -247,5 +247,6 @@ enum aux_ch intel_bios_port_aux_ch(struct drm_i915_private *dev_priv, enum port
|
|||
bool intel_bios_get_dsc_params(struct intel_encoder *encoder,
|
||||
struct intel_crtc_state *crtc_state,
|
||||
int dsc_max_bpc);
|
||||
int intel_bios_max_tmds_clock(struct intel_encoder *encoder);
|
||||
|
||||
#endif /* _INTEL_BIOS_H_ */
|
||||
|
|
|
@ -2090,9 +2090,7 @@ static void pch_post_disable_hdmi(struct intel_encoder *encoder,
|
|||
static int intel_hdmi_source_max_tmds_clock(struct intel_encoder *encoder)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
const struct ddi_vbt_port_info *info =
|
||||
&dev_priv->vbt.ddi_port_info[encoder->port];
|
||||
int max_tmds_clock;
|
||||
int max_tmds_clock, vbt_max_tmds_clock;
|
||||
|
||||
if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
|
||||
max_tmds_clock = 594000;
|
||||
|
@ -2103,8 +2101,9 @@ static int intel_hdmi_source_max_tmds_clock(struct intel_encoder *encoder)
|
|||
else
|
||||
max_tmds_clock = 165000;
|
||||
|
||||
if (info->max_tmds_clock)
|
||||
max_tmds_clock = min(max_tmds_clock, info->max_tmds_clock);
|
||||
vbt_max_tmds_clock = intel_bios_max_tmds_clock(encoder);
|
||||
if (vbt_max_tmds_clock)
|
||||
max_tmds_clock = min(max_tmds_clock, vbt_max_tmds_clock);
|
||||
|
||||
return max_tmds_clock;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue