Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [CI] drm/i915/dp_mst: Fix connector initialization in intel_dp_add_mst_connector()
@ 2024-11-18 13:10 Imre Deak
  2024-11-18 13:16 ` Jani Nikula
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Imre Deak @ 2024-11-18 13:10 UTC (permalink / raw)
  To: intel-gfx, intel-xe; +Cc: Jani Nikula, Rodrigo Vivi

The connector initialization in intel_dp_add_mst_connector() depends on
the device pointer in connector to be valid, at least by connector
debug printing. The device pointer is initialized by drm_connector_init(),
however that function also exposes the connector to in-kernel users,
which can't be done before the connector is fully initialized. For now
make sure the device pointer is valid before it's used, until a
follow-up change moving this to DRM core.

This issue was revealed by the commit in the Fixes: line below, before
which the above debug printing checked and handled a NULL device pointer
gracefully in DRM core.

Cc: Jani Nikula <jani.nikula@intel.com>
Fixes: 529798bd786a ("drm/i915/mst: convert to struct intel_display")
Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12799
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp_mst.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
index df7edcfe885b6..f058360a26413 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
@@ -1727,6 +1727,16 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
 
 	intel_dp_init_modeset_retry_work(intel_connector);
 
+	/*
+	 * TODO: The following drm_connector specific initialization belongs
+	 * to DRM core, however it happens atm too late in
+	 * drm_connector_init(). That function will also expose the connector
+	 * to in-kernel users, so it can't be called until the connector is
+	 * sufficiently initialized; init the device pointer used by the
+	 * following DSC setup, until a fix moving this to DRM core.
+	 */
+	intel_connector->base.dev = mgr->dev;
+
 	intel_connector->dp.dsc_decompression_aux = drm_dp_mst_dsc_aux_for_port(port);
 	intel_dp_mst_read_decompression_port_dsc_caps(intel_dp, intel_connector);
 	intel_connector->dp.dsc_hblank_expansion_quirk =
-- 
2.44.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-11-18 19:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-18 13:10 [CI] drm/i915/dp_mst: Fix connector initialization in intel_dp_add_mst_connector() Imre Deak
2024-11-18 13:16 ` Jani Nikula
2024-11-18 14:14 ` ✓ CI.Patch_applied: success for " Patchwork
2024-11-18 14:15 ` ✓ CI.checkpatch: " Patchwork
2024-11-18 14:16 ` ✓ CI.KUnit: " Patchwork
2024-11-18 14:34 ` ✓ CI.Build: " Patchwork
2024-11-18 14:34 ` ✗ CI.Hooks: failure " Patchwork
2024-11-18 14:35 ` ✗ CI.checksparse: warning " Patchwork
2024-11-18 14:54 ` ✓ CI.BAT: success " Patchwork
2024-11-18 19:19 ` ✗ CI.FULL: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox