Commit 1b108bc7 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Populate encoder->devdata for g4x+ DP/HDMI ports

Let's make encoder->devdata (the VBT information for the port)
available on g4x+ platforms as well. Much easier when you can
just grab it there instead of trying to find it from some global
list array based on the port.

Note that (unlike DDI platforms) we don't currently require
that each DP/HDMI port is actually declared in VBT. Perhaps
in the future we may want to rethink that, but for now just
stick in a debug+FIXME as a reminder.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230208015508.24824-8-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent ee912572
...@@ -1279,11 +1279,19 @@ static const struct drm_encoder_funcs intel_dp_enc_funcs = { ...@@ -1279,11 +1279,19 @@ static const struct drm_encoder_funcs intel_dp_enc_funcs = {
bool g4x_dp_init(struct drm_i915_private *dev_priv, bool g4x_dp_init(struct drm_i915_private *dev_priv,
i915_reg_t output_reg, enum port port) i915_reg_t output_reg, enum port port)
{ {
const struct intel_bios_encoder_data *devdata;
struct intel_digital_port *dig_port; struct intel_digital_port *dig_port;
struct intel_encoder *intel_encoder; struct intel_encoder *intel_encoder;
struct drm_encoder *encoder; struct drm_encoder *encoder;
struct intel_connector *intel_connector; struct intel_connector *intel_connector;
devdata = intel_bios_encoder_data_lookup(dev_priv, port);
/* FIXME bail? */
if (!devdata)
drm_dbg_kms(&dev_priv->drm, "No VBT child device for DP-%c\n",
port_name(port));
dig_port = kzalloc(sizeof(*dig_port), GFP_KERNEL); dig_port = kzalloc(sizeof(*dig_port), GFP_KERNEL);
if (!dig_port) if (!dig_port)
return false; return false;
...@@ -1295,6 +1303,8 @@ bool g4x_dp_init(struct drm_i915_private *dev_priv, ...@@ -1295,6 +1303,8 @@ bool g4x_dp_init(struct drm_i915_private *dev_priv,
intel_encoder = &dig_port->base; intel_encoder = &dig_port->base;
encoder = &intel_encoder->base; encoder = &intel_encoder->base;
intel_encoder->devdata = devdata;
mutex_init(&dig_port->hdcp_mutex); mutex_init(&dig_port->hdcp_mutex);
if (drm_encoder_init(&dev_priv->drm, &intel_encoder->base, if (drm_encoder_init(&dev_priv->drm, &intel_encoder->base,
......
...@@ -548,10 +548,18 @@ intel_hdmi_hotplug(struct intel_encoder *encoder, ...@@ -548,10 +548,18 @@ intel_hdmi_hotplug(struct intel_encoder *encoder,
void g4x_hdmi_init(struct drm_i915_private *dev_priv, void g4x_hdmi_init(struct drm_i915_private *dev_priv,
i915_reg_t hdmi_reg, enum port port) i915_reg_t hdmi_reg, enum port port)
{ {
const struct intel_bios_encoder_data *devdata;
struct intel_digital_port *dig_port; struct intel_digital_port *dig_port;
struct intel_encoder *intel_encoder; struct intel_encoder *intel_encoder;
struct intel_connector *intel_connector; struct intel_connector *intel_connector;
devdata = intel_bios_encoder_data_lookup(dev_priv, port);
/* FIXME bail? */
if (!devdata)
drm_dbg_kms(&dev_priv->drm, "No VBT child device for HDMI-%c\n",
port_name(port));
dig_port = kzalloc(sizeof(*dig_port), GFP_KERNEL); dig_port = kzalloc(sizeof(*dig_port), GFP_KERNEL);
if (!dig_port) if (!dig_port)
return; return;
...@@ -564,6 +572,8 @@ void g4x_hdmi_init(struct drm_i915_private *dev_priv, ...@@ -564,6 +572,8 @@ void g4x_hdmi_init(struct drm_i915_private *dev_priv,
intel_encoder = &dig_port->base; intel_encoder = &dig_port->base;
intel_encoder->devdata = devdata;
mutex_init(&dig_port->hdcp_mutex); mutex_init(&dig_port->hdcp_mutex);
drm_encoder_init(&dev_priv->drm, &intel_encoder->base, drm_encoder_init(&dev_priv->drm, &intel_encoder->base,
......
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