Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Imre Deak" <imre.deak@intel.com>,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 12/13] drm/i915/ddi_mgr: Handle DDI pool system suspend and resume
Date: Thu, 26 Nov 2026 10:41:38 +0000	[thread overview]
Message-ID: <sashiko-outbox-235307@kernel.org> (raw)
In-Reply-To: <20261126100755.1252635-13-imre.deak@intel.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] drm/i915/ddi_mgr: stale TC max_lane_count in
  resume_ddi_resource()
- [Medium] drm/i915/ddi_mgr: intel_ddi_mgr_suspend() disables DDC on
  shutdown
--

commit bca24baba50bb2986501c95a0a336e4e761dcc14
Author: Imre Deak <imre.deak@intel.com>

drm/i915/ddi_mgr: Handle DDI pool system suspend and resume

This commit adds system suspend and resume handling for the DDI pool
manager, disabling pool DDC adapters on suspend and rebuilding legacy DDI
routes, HPD mappings, Type-C port state, and DP source capabilities on
resume.

> diff --git a/drivers/gpu/drm/i915/display/intel_ddi_mgr.c b/drivers/gpu/drm/i915/display/intel_ddi_mgr.c
> index 8f32e7c8dff27..a0157ff6afc04 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi_mgr.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi_mgr.c
> @@ -840,6 +840,83 @@ static void update_hpd_sources(struct intel_display *display)
>  	}
>  }
>  
> +void intel_ddi_mgr_suspend(struct intel_display *display)
> +{
> +	if (!intel_ddi_mgr_is_enabled(display->ddi_mgr))
> +		return;
> +
> +	intel_gmbus_ddi_pool_update(display, false);
> +}
> +
> +static void resume_ddi_resource(struct intel_display *display,
> +				struct intel_encoder *encoder,
> +				const struct intel_ddi_route *old_route)
> +{
> +	struct intel_ddi_mgr *mgr = display->ddi_mgr;
> +	struct intel_digital_port *dig_port;
> +	const struct intel_ddi_route *route;
> +
> +	if (!encoder)
> +		return;
> +
> +	route = &mgr->route[encoder->port - PORT_TC1];
> +	dig_port = enc_to_dig_port(encoder);
> +	encoder->devdata = intel_ddi_mgr_get_devdata_for_ddi(display, encoder->port);
> +	intel_tc_port_set_legacy(dig_port, mgr->enabled &&
> +				route->mode == INTEL_DDI_ROUTE_LEGACY);
> +	dig_port->lane_reversal = intel_ddi_mgr_encoder_has_lane_reversal(encoder);
> +
> +	if (mgr->enabled && old_route->mode == route->mode &&
> +	    old_route->phy == route->phy)
> +		return;
> +
> +	intel_dp_update_source_caps(&dig_port->dp);
> +}

[Severity: Medium]
Does intel_dp_update_source_caps() rebuild dig_port->dp.link.caps using a
stale tc->max_lane_count here?

intel_ddi_mgr_resume() runs before drm_mode_config_reset() calls
intel_ddi_encoder_reset() -> intel_tc_port_init_mode(dig_port), and
intel_tc_port_set_legacy() only updates tc->legacy_port while tc->mode is
TC_PORT_DISCONNECTED.  When intel_dp_update_source_caps() calls
intel_dp_set_common_link_params() -> intel_dp_get_max_common_lane_count(),
intel_tc_port_max_lane_count(dig_port) still returns the pre-suspend
route's tc->max_lane_count.

If a pool encoder's route changes across suspend/resume between a 2-lane
DP-alt sink and a 4-lane legacy PHY (or vice versa), link.caps is clamped
to 2 lanes on a 4-lane route or retains 4-lane configurations on a 2-lane
route during the resume modeset restore.

[ ... ]

> diff --git a/drivers/gpu/drm/i915/display/intel_display_driver.c b/drivers/gpu/drm/i915/display/intel_display_driver.c
> index b018608eae032..a9b03b4a1e76b 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_driver.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_driver.c
> @@ -780,6 +780,7 @@ static int __intel_display_driver_pm_suspend(struct intel_display *display, bool
>  	intel_display_driver_suspend_access(display);
>  
>  	intel_encoder_suspend_all(display);
> +	intel_ddi_mgr_suspend(display);
>  
>  	intel_dmc_suspend(display);
>  

[Severity: Medium]
When shutdown is true, does calling intel_ddi_mgr_suspend() here disable
the pool DDC adapters before intel_display_driver_shutdown() runs
intel_encoder_shutdown_all()?

In __intel_display_driver_pm_suspend(display, true),
drm_atomic_helper_shutdown() disables active outputs and turns off Type 2
DP dual-mode adaptor TMDS buffers over DDC.  intel_ddi_mgr_suspend() then
marks the pool GMBUS adapters disabled, so the subsequent
intel_encoder_shutdown_all() -> intel_hdmi_encoder_shutdown() ->
intel_dp_dual_mode_set_tmds_output(intel_hdmi, true) call fails in
gmbus_xfer() with -ENXIO instead of re-enabling the TMDS output buffer for
reboot.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261126100755.1252635-1-imre.deak@intel.com?part=12

  reply	other threads:[~2026-11-26 10:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 10:07 [PATCH 00/13] drm/i915/ddi_mgr: Add support for dynamic DDI allocation Imre Deak
2026-11-26 10:07 ` [PATCH 01/13] drm/i915/dp: Allow rebuilding the source rate list Imre Deak
2026-11-26 10:07 ` [PATCH 02/13] drm/i915/hotplug: Set detector enable bits without a clear mask Imre Deak
2026-11-26 10:07 ` [PATCH 03/13] drm/i915/nvl+: Add support for remapping logical HPD pins to HW pins Imre Deak
2026-11-26 10:07 ` [PATCH 04/13] drm/xe/display: Distinguish failed system suspend recovery Imre Deak
2026-11-26 13:22   ` Jani Nikula
2026-11-26 10:07 ` [PATCH 05/13] drm/i915/gmbus: Extract a helper for Type-C DDC pin mapping Imre Deak
2026-11-26 10:07 ` [PATCH 06/13] drm/i915/ddi_mgr: Add support for dynamic DDI allocation Imre Deak
2026-11-26 13:23   ` Jani Nikula
2026-11-26 10:07 ` [PATCH 07/13] drm/i915/gmbus: Extract adapter creation and destruction Imre Deak
2026-11-26 10:07 ` [PATCH 08/13] drm/i915/gmbus: Add stable DDC adapters for the DDI pool Imre Deak
2026-11-26 10:07 ` [PATCH 09/13] drm/i915/ddi_mgr: Register encoders with dynamic DDI support Imre Deak
2026-11-26 10:26   ` sashiko-bot
2026-11-26 10:07 ` [PATCH 10/13] drm/i915/ddi_mgr: Keep AUX access consistent with DDI pool routes Imre Deak
2026-11-26 10:07 ` [PATCH 11/13] drm/i915/ddi_mgr: Verify and restore DDI allocations after runtime resume Imre Deak
2026-11-26 13:25   ` Jani Nikula
2026-11-26 10:07 ` [PATCH 12/13] drm/i915/ddi_mgr: Handle DDI pool system suspend and resume Imre Deak
2026-11-26 10:41   ` sashiko-bot [this message]
2026-11-26 13:25   ` Jani Nikula
2026-11-26 10:07 ` [PATCH 13/13] drm/i915/ddi_mgr: Enable dynamic DDI allocation at load Imre Deak
2026-11-26 14:08 ` ✗ CI.checkpatch: warning for drm/i915/ddi_mgr: Add support for dynamic DDI allocation Patchwork
2026-11-26 14:10 ` ✓ CI.KUnit: success " Patchwork
2026-11-26 14:49 ` ✓ Xe.CI.BAT: " 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=sashiko-outbox-235307@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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