intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 07/10] drm/i915: Populate encoder->devdata for g4x+ DP/HDMI ports
Date: Mon, 13 Feb 2023 18:12:50 +0200	[thread overview]
Message-ID: <87edqtv919.fsf@intel.com> (raw)
In-Reply-To: <20230208015508.24824-8-ville.syrjala@linux.intel.com>

On Wed, 08 Feb 2023, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Let's make encoder->devdata (the VBT informaiton for the port)

*information

> 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: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/g4x_dp.c   | 10 ++++++++++
>  drivers/gpu/drm/i915/display/g4x_hdmi.c | 10 ++++++++++
>  2 files changed, 20 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/g4x_dp.c b/drivers/gpu/drm/i915/display/g4x_dp.c
> index fa754038d669..0cc1531a03a3 100644
> --- a/drivers/gpu/drm/i915/display/g4x_dp.c
> +++ b/drivers/gpu/drm/i915/display/g4x_dp.c
> @@ -1279,11 +1279,19 @@ static const struct drm_encoder_funcs intel_dp_enc_funcs = {
>  bool g4x_dp_init(struct drm_i915_private *dev_priv,
>  		 i915_reg_t output_reg, enum port port)
>  {
> +	const struct intel_bios_encoder_data *devdata;
>  	struct intel_digital_port *dig_port;
>  	struct intel_encoder *intel_encoder;
>  	struct drm_encoder *encoder;
>  	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);
>  	if (!dig_port)
>  		return false;
> @@ -1295,6 +1303,8 @@ bool g4x_dp_init(struct drm_i915_private *dev_priv,
>  	intel_encoder = &dig_port->base;
>  	encoder = &intel_encoder->base;
>  
> +	intel_encoder->devdata = devdata;
> +
>  	mutex_init(&dig_port->hdcp_mutex);
>  
>  	if (drm_encoder_init(&dev_priv->drm, &intel_encoder->base,
> diff --git a/drivers/gpu/drm/i915/display/g4x_hdmi.c b/drivers/gpu/drm/i915/display/g4x_hdmi.c
> index 64c3b3990702..e9ae4c67b8a4 100644
> --- a/drivers/gpu/drm/i915/display/g4x_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/g4x_hdmi.c
> @@ -548,10 +548,18 @@ intel_hdmi_hotplug(struct intel_encoder *encoder,
>  void g4x_hdmi_init(struct drm_i915_private *dev_priv,
>  		   i915_reg_t hdmi_reg, enum port port)
>  {
> +	const struct intel_bios_encoder_data *devdata;
>  	struct intel_digital_port *dig_port;
>  	struct intel_encoder *intel_encoder;
>  	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);
>  	if (!dig_port)
>  		return;
> @@ -564,6 +572,8 @@ void g4x_hdmi_init(struct drm_i915_private *dev_priv,
>  
>  	intel_encoder = &dig_port->base;
>  
> +	intel_encoder->devdata = devdata;
> +
>  	mutex_init(&dig_port->hdcp_mutex);
>  
>  	drm_encoder_init(&dev_priv->drm, &intel_encoder->base,

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2023-02-13 16:13 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-08  1:54 [Intel-gfx] [PATCH 00/10] drm/i915: Prep work for vbt.ports[] nukage Ville Syrjala
2023-02-08  1:54 ` [Intel-gfx] [PATCH 01/10] drm/i915: Pass the whole encoder to hotplug_enables() Ville Syrjala
2023-02-08  1:55 ` [Intel-gfx] [PATCH 02/10] drm/i915: Move variables to loop context Ville Syrjala
2023-02-08  1:55 ` [Intel-gfx] [PATCH 03/10] drm/i915: Replace intel_bios_is_lspcon_present() with intel_bios_encoder_is_lspcon() Ville Syrjala
2023-02-08  1:55 ` [Intel-gfx] [PATCH 04/10] drm/i915: Replace intel_bios_is_lane_reversal_needed() with intel_bios_encoder_lane_reversal() Ville Syrjala
2023-02-08  1:55 ` [Intel-gfx] [PATCH 05/10] drm/i915: Replace intel_bios_is_port_hpd_inverted() with intel_bios_encoder_hpd_invert() Ville Syrjala
2023-02-08  1:55 ` [Intel-gfx] [PATCH 06/10] drm/i915: Consult the registested encoders for the ICL combo PHY w/a Ville Syrjala
2023-02-13 16:12   ` Jani Nikula
2023-02-08  1:55 ` [Intel-gfx] [PATCH 07/10] drm/i915: Populate encoder->devdata for g4x+ DP/HDMI ports Ville Syrjala
2023-02-13 16:12   ` Jani Nikula [this message]
2023-02-08  1:55 ` [Intel-gfx] [PATCH 08/10] drm/i915: Pass devdata to intel_bios_port_aux_ch() Ville Syrjala
2023-02-08  1:55 ` [Intel-gfx] [PATCH 09/10] drm/i915: Iterate all child devs in intel_bios_is_port_present() Ville Syrjala
2023-02-13 16:08   ` Jani Nikula
2023-02-13 16:17     ` Ville Syrjälä
2023-02-13 16:41       ` Jani Nikula
2023-02-13 16:47         ` Ville Syrjälä
2023-02-14  7:38   ` [Intel-gfx] [PATCH v2 " Ville Syrjala
2023-02-14  8:11     ` Jani Nikula
2023-02-08  1:55 ` [Intel-gfx] [PATCH 10/10] drm/i915: Use encoder->devdata in eDP init Ville Syrjala
2023-02-13 16:13   ` Jani Nikula
2023-02-08  4:39 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Prep work for vbt.ports[] nukage Patchwork
2023-02-08  8:51 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-02-13 16:11 ` [Intel-gfx] [PATCH 00/10] " Jani Nikula
2023-02-14  8:20 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Prep work for vbt.ports[] nukage (rev2) Patchwork
2023-02-14  9:27 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87edqtv919.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).