summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/display/intel_ddi.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2023-06-16 17:08:17 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2023-06-20 19:07:45 +0300
commit679df6f19f1ebf575f440a704bcb9fe5b6c1f7ed (patch)
tree7c5947128d2be315eaedb01f01833a6e15d0d7bd /drivers/gpu/drm/i915/display/intel_ddi.c
parentce6ea7eeff2db080de4bfd651ae37818a46777cc (diff)
downloadlinux-679df6f19f1ebf575f440a704bcb9fe5b6c1f7ed.tar.gz
linux-679df6f19f1ebf575f440a704bcb9fe5b6c1f7ed.tar.bz2
linux-679df6f19f1ebf575f440a704bcb9fe5b6c1f7ed.zip
drm/i915: Assert that the port being initialized is valid
Sprinkle some asserts to catch any mishaps in the port_mask vs. output init. For DDI/DP/HDMI/SDVO I decided that we want to bail out for an invalid port since those are the encoder types where we might want consider driving the whole thing from the VBT child device list, and bogus VBTs could be a real issue (if for no other reason than the i915.vbt_firmware). For DVO and HSW/BDW CRT port I just threw the assert in there for good measure. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230616140820.11726-5-ville.syrjala@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_ddi.c')
-rw-r--r--drivers/gpu/drm/i915/display/intel_ddi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 090f242e610c..62bf6cc136ad 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -4661,6 +4661,9 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
bool init_hdmi, init_dp;
enum phy phy = intel_port_to_phy(dev_priv, port);
+ if (!assert_port_valid(dev_priv, port))
+ return;
+
/*
* On platforms with HTI (aka HDPORT), if it's enabled at boot it may
* have taken over some of the PHYs and made them unavailable to the