Commit 72337aac authored by Jani Nikula's avatar Jani Nikula

drm/i915/bios: use dp max link rate directly from child data

Avoid extra caching of the data.

Cc: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: default avatarAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/5593ce81f6670dc33cf18fa284f8237c875ef404.1630512523.git.jani.nikula@intel.com
parent 6ba69981
...@@ -1815,6 +1815,17 @@ static int parse_bdb_216_dp_max_link_rate(const int vbt_max_link_rate) ...@@ -1815,6 +1815,17 @@ static int parse_bdb_216_dp_max_link_rate(const int vbt_max_link_rate)
} }
} }
static int _intel_bios_dp_max_link_rate(const struct intel_bios_encoder_data *devdata)
{
if (!devdata || devdata->i915->vbt.version < 216)
return 0;
if (devdata->i915->vbt.version >= 230)
return parse_bdb_230_dp_max_link_rate(devdata->child.dp_max_link_rate);
else
return parse_bdb_216_dp_max_link_rate(devdata->child.dp_max_link_rate);
}
static void sanitize_device_type(struct intel_bios_encoder_data *devdata, static void sanitize_device_type(struct intel_bios_encoder_data *devdata,
enum port port) enum port port)
{ {
...@@ -1913,7 +1924,7 @@ static void parse_ddi_port(struct drm_i915_private *i915, ...@@ -1913,7 +1924,7 @@ static void parse_ddi_port(struct drm_i915_private *i915,
const struct child_device_config *child = &devdata->child; const struct child_device_config *child = &devdata->child;
struct ddi_vbt_port_info *info; struct ddi_vbt_port_info *info;
bool is_dvi, is_hdmi, is_dp, is_edp, is_crt, supports_typec_usb, supports_tbt; bool is_dvi, is_hdmi, is_dp, is_edp, is_crt, supports_typec_usb, supports_tbt;
int dp_boost_level, hdmi_boost_level, hdmi_level_shift, max_tmds_clock; int dp_boost_level, dp_max_link_rate, hdmi_boost_level, hdmi_level_shift, max_tmds_clock;
enum port port; enum port port;
port = dvo_port_to_port(i915, child->dvo_port); port = dvo_port_to_port(i915, child->dvo_port);
...@@ -2001,17 +2012,11 @@ static void parse_ddi_port(struct drm_i915_private *i915, ...@@ -2001,17 +2012,11 @@ static void parse_ddi_port(struct drm_i915_private *i915,
"Port %c VBT HDMI boost level: %d\n", "Port %c VBT HDMI boost level: %d\n",
port_name(port), hdmi_boost_level); port_name(port), hdmi_boost_level);
/* DP max link rate for GLK+ */ dp_max_link_rate = _intel_bios_dp_max_link_rate(devdata);
if (i915->vbt.version >= 216) { if (dp_max_link_rate)
if (i915->vbt.version >= 230)
info->dp_max_link_rate = parse_bdb_230_dp_max_link_rate(child->dp_max_link_rate);
else
info->dp_max_link_rate = parse_bdb_216_dp_max_link_rate(child->dp_max_link_rate);
drm_dbg_kms(&i915->drm, drm_dbg_kms(&i915->drm,
"Port %c VBT DP max link rate: %d\n", "Port %c VBT DP max link rate: %d\n",
port_name(port), info->dp_max_link_rate); port_name(port), dp_max_link_rate);
}
info->devdata = devdata; info->devdata = devdata;
} }
...@@ -2982,8 +2987,9 @@ int intel_bios_encoder_hdmi_boost_level(const struct intel_bios_encoder_data *de ...@@ -2982,8 +2987,9 @@ int intel_bios_encoder_hdmi_boost_level(const struct intel_bios_encoder_data *de
int intel_bios_dp_max_link_rate(struct intel_encoder *encoder) int intel_bios_dp_max_link_rate(struct intel_encoder *encoder)
{ {
struct drm_i915_private *i915 = to_i915(encoder->base.dev); struct drm_i915_private *i915 = to_i915(encoder->base.dev);
const struct intel_bios_encoder_data *devdata = i915->vbt.ddi_port_info[encoder->port].devdata;
return i915->vbt.ddi_port_info[encoder->port].dp_max_link_rate; return _intel_bios_dp_max_link_rate(devdata);
} }
int intel_bios_alternate_ddc_pin(struct intel_encoder *encoder) int intel_bios_alternate_ddc_pin(struct intel_encoder *encoder)
......
...@@ -641,8 +641,6 @@ struct ddi_vbt_port_info { ...@@ -641,8 +641,6 @@ struct ddi_vbt_port_info {
u8 alternate_aux_channel; u8 alternate_aux_channel;
u8 alternate_ddc_pin; u8 alternate_ddc_pin;
int dp_max_link_rate; /* 0 for not limited by VBT */
}; };
enum psr_lines_to_wait { enum psr_lines_to_wait {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment