[Intel-gfx] [PATCH 11/12] drm/i915/bios: start using intel_bios_encoder_data for Type-C USB and TBT
Jani Nikula
jani.nikula at intel.com
Wed Feb 17 17:03:41 UTC 2021
Cc: Lucas De Marchi <lucas.demarchi at intel.com>
Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
drivers/gpu/drm/i915/display/intel_bios.c | 20 ++++++++------------
drivers/gpu/drm/i915/display/intel_bios.h | 2 ++
drivers/gpu/drm/i915/display/intel_ddi.c | 4 ++--
3 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index d26304ebc6b9..13a38cd01692 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -1818,7 +1818,7 @@ static void parse_ddi_port(struct drm_i915_private *i915,
{
const struct child_device_config *child = &devdata->child;
struct ddi_vbt_port_info *info;
- bool is_dvi, is_hdmi, is_dp, is_edp, is_crt;
+ bool is_dvi, is_hdmi, is_dp, is_edp, is_crt, supports_typec_usb, supports_tbt;
enum port port;
port = dvo_port_to_port(i915, child->dvo_port);
@@ -1845,17 +1845,14 @@ static void parse_ddi_port(struct drm_i915_private *i915,
info->supports_dp = is_dp;
info->supports_edp = is_edp;
- if (i915->vbt.version >= 195)
- info->supports_typec_usb = child->dp_usb_type_c;
-
- if (i915->vbt.version >= 209)
- info->supports_tbt = child->tbt;
+ supports_typec_usb = intel_bios_encoder_supports_typec_usb(devdata);
+ supports_tbt = intel_bios_encoder_supports_tbt(devdata);
drm_dbg_kms(&i915->drm,
"Port %c VBT info: CRT:%d DVI:%d HDMI:%d DP:%d eDP:%d LSPCON:%d USB-Type-C:%d TBT:%d DSC:%d\n",
port_name(port), is_crt, is_dvi, is_hdmi, is_dp, is_edp,
HAS_LSPCON(i915) && child->lspcon,
- info->supports_typec_usb, info->supports_tbt,
+ supports_typec_usb, supports_tbt,
devdata->dsc != NULL);
if (is_dvi) {
@@ -2903,15 +2900,14 @@ int intel_bios_alternate_ddc_pin(struct intel_encoder *encoder)
return i915->vbt.ddi_port_info[encoder->port].alternate_ddc_pin;
}
-bool intel_bios_port_supports_typec_usb(struct drm_i915_private *i915,
- enum port port)
+bool intel_bios_encoder_supports_typec_usb(const struct intel_bios_encoder_data *devdata)
{
- return i915->vbt.ddi_port_info[port].supports_typec_usb;
+ return devdata->i915->vbt.version >= 195 && devdata->child.dp_usb_type_c;
}
-bool intel_bios_port_supports_tbt(struct drm_i915_private *i915, enum port port)
+bool intel_bios_encoder_supports_tbt(const struct intel_bios_encoder_data *devdata)
{
- return i915->vbt.ddi_port_info[port].supports_tbt;
+ return devdata->i915->vbt.version >= 209 && devdata->child.tbt;
}
const struct intel_bios_encoder_data *
diff --git a/drivers/gpu/drm/i915/display/intel_bios.h b/drivers/gpu/drm/i915/display/intel_bios.h
index 18b5c2976bd4..f82cef29ab5a 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.h
+++ b/drivers/gpu/drm/i915/display/intel_bios.h
@@ -263,5 +263,7 @@ intel_bios_encoder_data_lookup(struct drm_i915_private *i915, enum port port);
bool intel_bios_encoder_supports_dvi(const struct intel_bios_encoder_data *devdata);
bool intel_bios_encoder_supports_hdmi(const struct intel_bios_encoder_data *devdata);
bool intel_bios_encoder_supports_dp(const struct intel_bios_encoder_data *devdata);
+bool intel_bios_encoder_supports_typec_usb(const struct intel_bios_encoder_data *devdata);
+bool intel_bios_encoder_supports_tbt(const struct intel_bios_encoder_data *devdata);
#endif /* _INTEL_BIOS_H_ */
diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 1a2f7725f8ec..0bf783f67a59 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -4150,8 +4150,8 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
if (intel_phy_is_tc(dev_priv, phy)) {
bool is_legacy =
- !intel_bios_port_supports_typec_usb(dev_priv, port) &&
- !intel_bios_port_supports_tbt(dev_priv, port);
+ !intel_bios_encoder_supports_typec_usb(devdata) &&
+ !intel_bios_encoder_supports_tbt(devdata);
intel_tc_port_init(dig_port, is_legacy);
--
2.20.1
More information about the Intel-gfx
mailing list