drm/i915: Introduce intel_hpd_enable_detection()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 17 Apr 2023 13:17:26 +0000 (16:17 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 18 Apr 2023 18:18:31 +0000 (21:18 +0300)
commitd28cdc43b43b77287d7839ef1b94fdaa24d2a444
treeed2e569fd2d910d6b88dbe986300f179e46039ee
parent40d06b0fae915ec8bbfbde69ee1cfb2d9a2b7a53
drm/i915: Introduce intel_hpd_enable_detection()

Add a mechanism by which we can enable the HPD sense for
individual encoders.

This will be used during eDP probing to figure out if
anything is actually connected. The normal intel_hpd_irq_setup()
thing doesn't work since we only do that after probing the
outputs, and we only enable HPD sense for encoders that were
successfully probed.

The other idea that crossed my minds was to just turn on
HPD sense for all pins before output probing and let hpd_irq_setup()
clean it up afterwards. But that doesn't work for BXT/GLK where
the HPD invert information comes from the VBT child device.
So looks like this really needs to be per-encoder.

v2: Give it a better name (Jani)
v3: Deal with mtl

Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com> #v2
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230417131728.7705-3-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/i915/i915_irq.h