public inbox for intel-gfx@lists.freedesktop.org
 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
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 05/12] drm/i915/crt: Populate connector->ddc
Date: Wed, 30 Aug 2023 15:06:18 +0300	[thread overview]
Message-ID: <87msy8zqdh.fsf@intel.com> (raw)
In-Reply-To: <20230829113920.13713-6-ville.syrjala@linux.intel.com>

On Tue, 29 Aug 2023, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Populate connector->ddc, and thus create the "ddc" symlink
> in sysfs for analog VGA connectors.
>
> As a bonus we can replace a bunch of intel_gmbus_get_adapter()
> lookups with just the connector->ddc pointer. Sadly one extra
> lookup still remains due to the g4x DVI-I shenanigans. We could
> perhaps consider borrowing the ddc proxy idea from SDVO to deal
> with that in a perhaps nicer way, but can't really be bothered
> right now at least. Also not sure exposing such a dual ddc bus
> to userspace would be quite wise.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_crt.c | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_crt.c b/drivers/gpu/drm/i915/display/intel_crt.c
> index 8145511bd5c3..ea3908fd2505 100644
> --- a/drivers/gpu/drm/i915/display/intel_crt.c
> +++ b/drivers/gpu/drm/i915/display/intel_crt.c
> @@ -650,11 +650,9 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector)
>  	struct intel_crt *crt = intel_attached_crt(to_intel_connector(connector));
>  	struct drm_i915_private *dev_priv = to_i915(crt->base.base.dev);
>  	const struct drm_edid *drm_edid;
> -	struct i2c_adapter *ddc;
>  	bool ret = false;
>  
> -	ddc = intel_gmbus_get_adapter(dev_priv, dev_priv->display.vbt.crt_ddc_pin);
> -	drm_edid = intel_crt_get_edid(connector, ddc);
> +	drm_edid = intel_crt_get_edid(connector, connector->ddc);
>  
>  	if (drm_edid) {
>  		const struct edid *edid = drm_edid_raw(drm_edid);
> @@ -923,8 +921,7 @@ static int intel_crt_get_modes(struct drm_connector *connector)
>  	wakeref = intel_display_power_get(dev_priv,
>  					  intel_encoder->power_domain);
>  
> -	ddc = intel_gmbus_get_adapter(dev_priv, dev_priv->display.vbt.crt_ddc_pin);
> -	ret = intel_crt_ddc_get_modes(connector, ddc);
> +	ret = intel_crt_ddc_get_modes(connector, connector->ddc);
>  	if (ret || !IS_G4X(dev_priv))
>  		goto out;
>  
> @@ -988,6 +985,7 @@ void intel_crt_init(struct drm_i915_private *dev_priv)
>  	struct intel_crt *crt;
>  	struct intel_connector *intel_connector;
>  	i915_reg_t adpa_reg;
> +	u8 ddc_pin;
>  	u32 adpa;
>  
>  	if (HAS_PCH_SPLIT(dev_priv))
> @@ -1024,10 +1022,14 @@ void intel_crt_init(struct drm_i915_private *dev_priv)
>  		return;
>  	}
>  
> +	ddc_pin = dev_priv->display.vbt.crt_ddc_pin;
> +
>  	connector = &intel_connector->base;
>  	crt->connector = intel_connector;
> -	drm_connector_init(&dev_priv->drm, &intel_connector->base,
> -			   &intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA);
> +	drm_connector_init_with_ddc(&dev_priv->drm, connector,
> +				    &intel_crt_connector_funcs,
> +				    DRM_MODE_CONNECTOR_VGA,
> +				    intel_gmbus_get_adapter(dev_priv, ddc_pin));
>  
>  	drm_encoder_init(&dev_priv->drm, &crt->base.base, &intel_crt_enc_funcs,
>  			 DRM_MODE_ENCODER_DAC, "CRT");

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2023-08-30 12:06 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-29 11:39 [Intel-gfx] [PATCH 00/12] drm/i915: Populate connector->ddc always Ville Syrjala
2023-08-29 11:39 ` [Intel-gfx] [PATCH 01/12] drm: Reorder drm_sysfs_connector_remove() vs. drm_debugfs_connector_remove() Ville Syrjala
2023-08-30 11:52   ` Jani Nikula
2023-08-29 11:39 ` [Intel-gfx] [PATCH 02/12] drm/sysfs: Register "ddc" symlink later Ville Syrjala
2023-08-30 11:59   ` Jani Nikula
2023-08-29 11:39 ` [Intel-gfx] [PATCH 03/12] drm/i915: Call the DDC bus i2c adapter "ddc" Ville Syrjala
2023-08-30 11:19   ` Jani Nikula
2023-08-30 12:04     ` Jani Nikula
2023-08-31 10:43   ` [Intel-gfx] [PATCH v2 " Ville Syrjala
2023-08-29 11:39 ` [Intel-gfx] [PATCH 04/12] drm/i915/lvds: Populate connector->ddc Ville Syrjala
2023-08-30 12:05   ` Jani Nikula
2023-08-29 11:39 ` [Intel-gfx] [PATCH 05/12] drm/i915/crt: " Ville Syrjala
2023-08-30 12:06   ` Jani Nikula [this message]
2023-08-29 11:39 ` [Intel-gfx] [PATCH 06/12] drm/i915/dvo: " Ville Syrjala
2023-08-30 12:06   ` Jani Nikula
2023-08-29 11:39 ` [Intel-gfx] [PATCH 07/12] drm/i915/dp: " Ville Syrjala
2023-08-30 12:06   ` Jani Nikula
2023-08-29 11:39 ` [Intel-gfx] [PATCH 08/12] drm/i915/mst: " Ville Syrjala
2023-08-30 12:08   ` Jani Nikula
2023-08-29 11:39 ` [Intel-gfx] [PATCH 09/12] drm/i915/hdmi: Use connector->ddc everwhere Ville Syrjala
2023-08-30 12:08   ` Jani Nikula
2023-08-29 11:39 ` [Intel-gfx] [PATCH 10/12] drm/i915/hdmi: Nuke hdmi->ddc_bus Ville Syrjala
2023-08-31 10:34   ` Jani Nikula
2023-08-29 11:39 ` [Intel-gfx] [PATCH 11/12] drm/i915/hdmi: Remove old i2c symlink Ville Syrjala
2023-08-31 10:40   ` Jani Nikula
2023-08-29 11:39 ` [Intel-gfx] [PATCH 12/12] drm/i915/sdvo: Constify mapping structs Ville Syrjala
2023-08-30 12:09   ` Jani Nikula
2023-08-29 13:40 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Populate connector->ddc always Patchwork
2023-08-29 13:40 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-08-29 13:50 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-08-29 20:40 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-08-31 13:54 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Populate connector->ddc always (rev2) Patchwork
2023-08-31 13:54 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-08-31 14:13 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-09-01 20:55 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Populate connector->ddc always (rev3) Patchwork
2023-09-01 20:55 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-09-01 21:14 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-09-02  5:47 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-09-13 12:28 ` [Intel-gfx] [PATCH 00/12] drm/i915: Populate connector->ddc always Ville Syrjälä

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=87msy8zqdh.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --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